|
|
|
@ -2,6 +2,7 @@ package com.inspect.metadata.patrolpointmnt.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.inspect.base.core.constant.Color; |
|
|
|
import com.inspect.base.core.utils.StringUtils; |
|
|
|
import com.inspect.metadata.alg.domain.BasedataAlgSubtype; |
|
|
|
import com.inspect.metadata.alg.mapper.BasedataAlgSubtypeMapper; |
|
|
|
@ -75,25 +76,29 @@ public class BasedataPatrolPointServiceImpl implements IBasedataPatrolPointServi |
|
|
|
} |
|
|
|
|
|
|
|
public List<BasedataPatrolPoint> selectBasedataMonitorList(BasedataPatrolPoint basedataPatrolpoint) { |
|
|
|
List<BasedataPatrolPoint> pointList = this.basedataPatrolpointMapper.selectBasedataMonitorList(basedataPatrolpoint); |
|
|
|
List<BasedataPatrolPoint> pointList = basedataPatrolpointMapper.selectBasedataMonitorList(basedataPatrolpoint); |
|
|
|
logger.info("[META] pointList cnt: {}", pointList.size()); |
|
|
|
if (null != basedataPatrolpoint.getDeviceId()) { |
|
|
|
BasedataDevice basedataDevice = this.basedataDeviceMapper.selectBasedataDeviceByDeviceId(basedataPatrolpoint.getDeviceId()); |
|
|
|
basedataPatrolpoint.setDeviceTypeId(basedataDevice.getDeviceTypeId()); |
|
|
|
List<BasedataPatrolPoint> stdPointList = this.basedataPatrolpointMapper.selectBasedataMonitorUnionList(basedataPatrolpoint); |
|
|
|
logger.info("[META] stdPointList cnt: {}", stdPointList.size()); |
|
|
|
for (BasedataPatrolPoint stdPoint : stdPointList) { |
|
|
|
if (!pointList.isEmpty()) { |
|
|
|
if (pointList.stream().filter((item) -> stdPoint.getStdParolPointId().equals(item.getStdParolPointId())).count() == 0) { |
|
|
|
BasedataDevice basedataDevice = basedataDeviceMapper.selectBasedataDeviceByDeviceId(basedataPatrolpoint.getDeviceId()); |
|
|
|
if(basedataDevice != null) { |
|
|
|
basedataPatrolpoint.setDeviceTypeId(basedataDevice.getDeviceTypeId()); |
|
|
|
List<BasedataPatrolPoint> stdPointList = basedataPatrolpointMapper.selectBasedataMonitorUnionList(basedataPatrolpoint); |
|
|
|
logger.info("[META] stdPointList cnt: {}", stdPointList.size()); |
|
|
|
for (BasedataPatrolPoint stdPoint : stdPointList) { |
|
|
|
if (!pointList.isEmpty()) { |
|
|
|
if (pointList.stream().filter((item) -> stdPoint.getStdParolPointId().equals(item.getStdParolPointId())).count() == 0) { |
|
|
|
pointList.add(stdPoint); |
|
|
|
} |
|
|
|
} else { |
|
|
|
pointList.add(stdPoint); |
|
|
|
} |
|
|
|
} else { |
|
|
|
pointList.add(stdPoint); |
|
|
|
} |
|
|
|
} else { |
|
|
|
logger.warn(Color.RED + "[META] basedataDevice deviceId: {} not exist!" + Color.END, basedataPatrolpoint.getDeviceId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<BasedataAlgSubtype> basedataAlgSubtypes = this.basedataAlgSubtypeMapper.selectBasedataAlgSubtypeList(new BasedataAlgSubtype()); |
|
|
|
List<BasedataAlgSubtype> basedataAlgSubtypes = basedataAlgSubtypeMapper.selectBasedataAlgSubtypeList(new BasedataAlgSubtype()); |
|
|
|
logger.info("[META] basedataAlgSubtypes cnt: {}", basedataAlgSubtypes.size()); |
|
|
|
Map<String, String> algSubtypeMap = new HashMap<>(); |
|
|
|
basedataAlgSubtypes.forEach((item) -> { |
|
|
|
|