增加新的静态文件放过

结构优化
648540858 2023-10-27 10:45:35 +08:00
parent 89fd69b5ab
commit a73508a24c
2 changed files with 33 additions and 18 deletions

View File

@ -75,6 +75,10 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
matchers.add("/js/**"); matchers.add("/js/**");
matchers.add("/api/device/query/snap/**"); matchers.add("/api/device/query/snap/**");
matchers.add("/record_proxy/*/**"); matchers.add("/record_proxy/*/**");
matchers.add("/_app.config.js");
matchers.add("/assets/**");
matchers.add("/resource/**");
matchers.add("/favicon.ico");
matchers.addAll(userSetting.getInterfaceAuthenticationExcludes()); matchers.addAll(userSetting.getInterfaceAuthenticationExcludes());
// 可以直接访问的静态数据 // 可以直接访问的静态数据
web.ignoring().antMatchers(matchers.toArray(new String[0])); web.ignoring().antMatchers(matchers.toArray(new String[0]));

View File

@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.service.impl; package com.genersoft.iot.vmp.service.impl;
import com.genersoft.iot.vmp.common.CivilCodePo;
import com.genersoft.iot.vmp.common.CommonGbChannel; import com.genersoft.iot.vmp.common.CommonGbChannel;
import com.genersoft.iot.vmp.conf.CivilCodeFileConf; import com.genersoft.iot.vmp.conf.CivilCodeFileConf;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
@ -119,18 +120,23 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
Gb28181CodeType channelIdType = SipUtils.getChannelIdType(deviceChannel.getChannelId()); Gb28181CodeType channelIdType = SipUtils.getChannelIdType(deviceChannel.getChannelId());
if (channelIdType != null) { if (channelIdType != null) {
if ( if (
( (
channelIdType == Gb28181CodeType.CIVIL_CODE_PROVINCE channelIdType == Gb28181CodeType.CIVIL_CODE_PROVINCE
|| channelIdType == Gb28181CodeType.CIVIL_CODE_CITY || channelIdType == Gb28181CodeType.CIVIL_CODE_CITY
|| channelIdType == Gb28181CodeType.CIVIL_CODE_COUNTY || channelIdType == Gb28181CodeType.CIVIL_CODE_COUNTY
|| channelIdType == Gb28181CodeType.CIVIL_CODE_GRASS_ROOTS || channelIdType == Gb28181CodeType.CIVIL_CODE_GRASS_ROOTS
) )
&& &&
!regionMap.containsKey(deviceChannel.getChannelId()) !regionMap.containsKey(deviceChannel.getChannelId())
) { ) {
CivilCodePo parentCivilCodePo = civilCodeFileConf.getParentCode(deviceChannel.getChannelId());
String civilCode = null;
if (parentCivilCodePo != null) {
civilCode = parentCivilCodePo.getCode();
}
// 行政区划条目 // 行政区划条目
Region region = Region.getInstance(deviceChannel.getChannelId(), deviceChannel.getName(), Region region = Region.getInstance(deviceChannel.getChannelId(), deviceChannel.getName(),
civilCodeFileConf.getParentCode(deviceChannel.getChannelId()).getCode()); civilCode);
regionMap.put(deviceChannel.getChannelId(), region); regionMap.put(deviceChannel.getChannelId(), region);
} }
if (channelIdType == Gb28181CodeType.BUSINESS_GROUP if (channelIdType == Gb28181CodeType.BUSINESS_GROUP
@ -386,18 +392,20 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
commonGbChannel.setCommonGbManufacturer(deviceChannel.getManufacture()); commonGbChannel.setCommonGbManufacturer(deviceChannel.getManufacture());
commonGbChannel.setCommonGbModel(deviceChannel.getModel()); commonGbChannel.setCommonGbModel(deviceChannel.getModel());
commonGbChannel.setCommonGbOwner(deviceChannel.getOwner()); commonGbChannel.setCommonGbOwner(deviceChannel.getOwner());
Gb28181CodeType channelIdType = SipUtils.getChannelIdType(deviceChannel.getCivilCode()); if (deviceChannel.getCivilCode() != null) {
if (channelIdType == Gb28181CodeType.CIVIL_CODE_PROVINCE Gb28181CodeType channelIdType = SipUtils.getChannelIdType(deviceChannel.getCivilCode());
if (channelIdType == Gb28181CodeType.CIVIL_CODE_PROVINCE
|| channelIdType == Gb28181CodeType.CIVIL_CODE_CITY || channelIdType == Gb28181CodeType.CIVIL_CODE_CITY
|| channelIdType == Gb28181CodeType.CIVIL_CODE_COUNTY || channelIdType == Gb28181CodeType.CIVIL_CODE_COUNTY
|| channelIdType == Gb28181CodeType.CIVIL_CODE_GRASS_ROOTS || channelIdType == Gb28181CodeType.CIVIL_CODE_GRASS_ROOTS
){ ){
commonGbChannel.setCommonGbCivilCode(deviceChannel.getCivilCode()); commonGbChannel.setCommonGbCivilCode(deviceChannel.getCivilCode());
}else { }else {
logger.warn("[不规范的CivilCode]deviceId: {}, channel: {}, civilCode: {}", logger.warn("[不规范的CivilCode]deviceId: {}, channel: {}, civilCode: {}",
deviceChannel.getDeviceId(), deviceChannel.getDeviceId(),
deviceChannel.getChannelId(), deviceChannel.getChannelId(),
deviceChannel.getCivilCode()); deviceChannel.getCivilCode());
}
} }
commonGbChannel.setCommonGbCivilCode(deviceChannel.getCivilCode()); commonGbChannel.setCommonGbCivilCode(deviceChannel.getCivilCode());
@ -443,6 +451,9 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
commonGbChannel.setCommonGbOwner(deviceChannel.getOwner()); commonGbChannel.setCommonGbOwner(deviceChannel.getOwner());
break; break;
case "commonGbCivilCode": case "commonGbCivilCode":
if (deviceChannel.getCivilCode() == null) {
break;
}
Gb28181CodeType channelIdType = SipUtils.getChannelIdType(deviceChannel.getCivilCode()); Gb28181CodeType channelIdType = SipUtils.getChannelIdType(deviceChannel.getCivilCode());
if (channelIdType == Gb28181CodeType.CIVIL_CODE_PROVINCE if (channelIdType == Gb28181CodeType.CIVIL_CODE_PROVINCE
|| channelIdType == Gb28181CodeType.CIVIL_CODE_CITY || channelIdType == Gb28181CodeType.CIVIL_CODE_CITY