|
|
@ -542,36 +542,50 @@ public class RealTargetServiceImpl implements RealTargetService { |
|
|
|
if(CollectionUtil.isEmpty(modelList)){ |
|
|
|
if(CollectionUtil.isEmpty(modelList)){ |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
List<WaterLevelVo> list = new ArrayList<>(); |
|
|
|
List<WaterLevelVo> list = new CopyOnWriteArrayList<>(); |
|
|
|
modelList.forEach(item -> { |
|
|
|
CountDownLatch countDownLatch = new CountDownLatch(modelList.size()); |
|
|
|
List<MultiAnalyzeCodePO> multiAnalyzeCodePOList = new ArrayList<>(); |
|
|
|
for(HzimsAnalyzeModelStationEntity item : modelList){ |
|
|
|
MultiAnalyzeCodePO multiAnalyzeCodePO = new MultiAnalyzeCodePO(); |
|
|
|
pool.submit(() -> { |
|
|
|
multiAnalyzeCodePO.setDeviceCode(item.getInstanceCode()); |
|
|
|
try{ |
|
|
|
multiAnalyzeCodePO.setSignages(Collections.singletonList(HomePageConstant.FRONT_WATER_LEVEL)); |
|
|
|
List<MultiAnalyzeCodePO> multiAnalyzeCodePOList=new ArrayList<>(); |
|
|
|
multiAnalyzeCodePOList.add(multiAnalyzeCodePO); |
|
|
|
MultiAnalyzeCodePO multiAnalyzeCodePO=new MultiAnalyzeCodePO(); |
|
|
|
R<List<AnalyzeCodeBySignagesVO>> result = analyseDataSearchClient.getAnalyzeCodeBySignages(multiAnalyzeCodePOList); |
|
|
|
multiAnalyzeCodePO.setDeviceCode(item.getInstanceCode()); |
|
|
|
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){ |
|
|
|
multiAnalyzeCodePO.setSignages(Collections.singletonList(HomePageConstant.FRONT_WATER_LEVEL)); |
|
|
|
return; |
|
|
|
multiAnalyzeCodePOList.add(multiAnalyzeCodePO); |
|
|
|
} |
|
|
|
R<List<AnalyzeCodeBySignagesVO>>result=analyseDataSearchClient.getAnalyzeCodeBySignages(multiAnalyzeCodePOList); |
|
|
|
WaterLevelVo waterLevelVo = new WaterLevelVo(); |
|
|
|
if(result.isSuccess() && CollectionUtil.isNotEmpty(result.getData())){ |
|
|
|
waterLevelVo.setStationCode(item.getStationId()); |
|
|
|
WaterLevelVo waterLevelVo=new WaterLevelVo(); |
|
|
|
// 前水位
|
|
|
|
waterLevelVo.setStationCode(item.getStationId()); |
|
|
|
double frontWaterLevel = this.getWaterLevel(item.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL); |
|
|
|
// 前水位
|
|
|
|
waterLevelVo.setFrontWaterLevel(frontWaterLevel); |
|
|
|
double frontWaterLevel=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL); |
|
|
|
// 后水位
|
|
|
|
waterLevelVo.setFrontWaterLevel(frontWaterLevel); |
|
|
|
double rearWaterLevel = this.getWaterLevel(item.getInstanceCode(),HomePageConstant.REAR_WATER_LEVEL); |
|
|
|
// 后水位
|
|
|
|
waterLevelVo.setRearWaterLevel(rearWaterLevel); |
|
|
|
double rearWaterLevel=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.REAR_WATER_LEVEL); |
|
|
|
// 下泄流量
|
|
|
|
waterLevelVo.setRearWaterLevel(rearWaterLevel); |
|
|
|
double dischargeFlow = this.getWaterLevel(item.getInstanceCode(),HomePageConstant.DISCHARGE_FLOW); |
|
|
|
// 下泄流量
|
|
|
|
waterLevelVo.setDischargeFlow(dischargeFlow); |
|
|
|
double dischargeFlow=this.getWaterLevel(item.getInstanceCode(),HomePageConstant.DISCHARGE_FLOW); |
|
|
|
// 前水位当日曲线
|
|
|
|
waterLevelVo.setDischargeFlow(dischargeFlow); |
|
|
|
Map<Integer,String> frontCurveMap = this.getWaterLevelMap(item.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL); |
|
|
|
// 前水位当日曲线
|
|
|
|
waterLevelVo.setFrontCurveMap(frontCurveMap); |
|
|
|
Map<Integer, String> frontCurveMap=this.getWaterLevelMap(item.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL); |
|
|
|
// 后水位当日曲线
|
|
|
|
waterLevelVo.setFrontCurveMap(frontCurveMap); |
|
|
|
Map<Integer,String> rearCurveMap = this.getWaterLevelMap(item.getInstanceCode(),HomePageConstant.REAR_WATER_LEVEL); |
|
|
|
// 后水位当日曲线
|
|
|
|
waterLevelVo.setRearCurveMap(rearCurveMap); |
|
|
|
Map<Integer, String> rearCurveMap=this.getWaterLevelMap(item.getInstanceCode(),HomePageConstant.REAR_WATER_LEVEL); |
|
|
|
list.add(waterLevelVo); |
|
|
|
waterLevelVo.setRearCurveMap(rearCurveMap); |
|
|
|
}); |
|
|
|
list.add(waterLevelVo); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
countDownLatch.countDown(); |
|
|
|
|
|
|
|
}catch (Exception exception){ |
|
|
|
|
|
|
|
log.error("load_water_level_error : {}",exception.getMessage()); |
|
|
|
|
|
|
|
countDownLatch.countDown(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
countDownLatch.await(); |
|
|
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
|
|
Thread.currentThread().interrupt(); |
|
|
|
|
|
|
|
} |
|
|
|
redisTemplate.opsForValue().set(loadwater_level_key,list); |
|
|
|
redisTemplate.opsForValue().set(loadwater_level_key,list); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|