|
|
@ -40,9 +40,11 @@ import com.inspect.base.core.utils.xml.GenXmlByBean; |
|
|
import java.io.ByteArrayInputStream; |
|
|
import java.io.ByteArrayInputStream; |
|
|
import java.io.InputStream; |
|
|
import java.io.InputStream; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.inspect.system.base.domain.SysDictData; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
@ -114,7 +116,18 @@ public class BasedataPatrolPointServiceImpl implements IBasedataPatrolPointServi |
|
|
algSubtypeMap.put(item.getAlgSubtypeId() + "", item.getAlgSubtypeName()); |
|
|
algSubtypeMap.put(item.getAlgSubtypeId() + "", item.getAlgSubtypeName()); |
|
|
}); |
|
|
}); |
|
|
logger.info("[META] algSubtypeMap: {}", algSubtypeMap); |
|
|
logger.info("[META] algSubtypeMap: {}", algSubtypeMap); |
|
|
pointList.forEach((item) -> item.loadAlgSubtypeName(algSubtypeMap)); |
|
|
|
|
|
|
|
|
// pointList.forEach((item) -> item.loadAlgSubtypeName(algSubtypeMap)); |
|
|
|
|
|
Map<String, String> deviceTypeDictMap = getDeviceTypeDictMap(); |
|
|
|
|
|
for (BasedataPatrolPoint basedataPatrolPoint : pointList) { |
|
|
|
|
|
basedataPatrolPoint.loadAlgSubtypeName(algSubtypeMap); |
|
|
|
|
|
String patrolPointCode = basedataPatrolPoint.getPatrolPointCode(); |
|
|
|
|
|
basedataPatrolPoint.setPointTypeName("摄像机"); |
|
|
|
|
|
if(StringUtils.isNotEmpty(patrolPointCode) && patrolPointCode.contains("|")) { |
|
|
|
|
|
patrolPointCode = patrolPointCode.substring(0, patrolPointCode.indexOf("|")); |
|
|
|
|
|
String pointTypeName = deviceTypeDictMap.getOrDefault(patrolPointCode, "未知设备类型"); |
|
|
|
|
|
basedataPatrolPoint.setPointTypeName(pointTypeName); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
logger.info("[META] pointList size: {},pointList: {}", pointList.size(), pointList); |
|
|
logger.info("[META] pointList size: {},pointList: {}", pointList.size(), pointList); |
|
|
return pointList; |
|
|
return pointList; |
|
|
} |
|
|
} |
|
|
@ -149,11 +162,40 @@ public class BasedataPatrolPointServiceImpl implements IBasedataPatrolPointServi |
|
|
algSubtypeMap.put(item.getAlgSubtypeId() + "", item.getAlgSubtypeName()); |
|
|
algSubtypeMap.put(item.getAlgSubtypeId() + "", item.getAlgSubtypeName()); |
|
|
}); |
|
|
}); |
|
|
logger.info("[META] algSubtypeMap: {}", algSubtypeMap); |
|
|
logger.info("[META] algSubtypeMap: {}", algSubtypeMap); |
|
|
pointList.forEach((item) -> item.loadAlgSubtypeName(algSubtypeMap)); |
|
|
|
|
|
|
|
|
// pointList.forEach((item) -> item.loadAlgSubtypeName(algSubtypeMap)); |
|
|
|
|
|
Map<String, String> deviceTypeDictMap = getDeviceTypeDictMap(); |
|
|
|
|
|
for (BasedataPatrolPoint basedataPatrolPoint : pointList) { |
|
|
|
|
|
basedataPatrolPoint.loadAlgSubtypeName(algSubtypeMap); |
|
|
|
|
|
String patrolPointCode = basedataPatrolPoint.getPatrolPointCode(); |
|
|
|
|
|
basedataPatrolPoint.setPointTypeName("摄像机"); |
|
|
|
|
|
if(StringUtils.isNotEmpty(patrolPointCode) && patrolPointCode.contains("|")) { |
|
|
|
|
|
patrolPointCode = patrolPointCode.substring(0, patrolPointCode.indexOf("|")); |
|
|
|
|
|
String pointTypeName = deviceTypeDictMap.getOrDefault(patrolPointCode, "未知设备类型"); |
|
|
|
|
|
basedataPatrolPoint.setPointTypeName(pointTypeName); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
logger.info("[META] pointList size: {},pointList: {}", pointList.size(), pointList); |
|
|
logger.info("[META] pointList size: {},pointList: {}", pointList.size(), pointList); |
|
|
return pointList; |
|
|
return pointList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 查询设备类型字典(point_device_type)并转换为 Map |
|
|
|
|
|
*/ |
|
|
|
|
|
private Map<String, String> getDeviceTypeDictMap() { |
|
|
|
|
|
Map<String, String> dictMap = new HashMap<>(); |
|
|
|
|
|
try { |
|
|
|
|
|
List<SysDictData> dictDatas = basedataPatrolpointMapper.selectDictDataByType("point_device_type"); |
|
|
|
|
|
if (dictDatas != null) { |
|
|
|
|
|
dictMap = dictDatas.stream() |
|
|
|
|
|
.collect(Collectors.toMap(SysDictData::getDictValue, SysDictData::getDictLabel)); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
logger.error("查询字典 point_device_type 失败", e); |
|
|
|
|
|
} |
|
|
|
|
|
return dictMap; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BasedataPatrolPoint insertBasedataPatrolPoint(BasedataPatrolPoint basedataPatrolpoint) { |
|
|
public BasedataPatrolPoint insertBasedataPatrolPoint(BasedataPatrolPoint basedataPatrolpoint) { |
|
|
basedataPatrolpoint.setCreateTime(DateUtils.getNowDate()); |
|
|
basedataPatrolpoint.setCreateTime(DateUtils.getNowDate()); |
|
|
int resId = basedataPatrolpointMapper.insertBasedataPatrolPoint(basedataPatrolpoint); |
|
|
int resId = basedataPatrolpointMapper.insertBasedataPatrolPoint(basedataPatrolpoint); |
|
|
|