|
|
|
@ -545,7 +545,28 @@ public class RealTargetServiceImpl implements RealTargetService {
|
|
|
|
|
List<WaterLevelVo> list = new CopyOnWriteArrayList<>(); |
|
|
|
|
CountDownLatch countDownLatch = new CountDownLatch(modelList.size()); |
|
|
|
|
for(HzimsAnalyzeModelStationEntity item : modelList){ |
|
|
|
|
pool.submit(() -> { |
|
|
|
|
pool.execute(() -> { |
|
|
|
|
this.queryWaterLeve(list,item); |
|
|
|
|
countDownLatch.countDown(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
log.error("load_water_level :等待线程执行"); |
|
|
|
|
countDownLatch.await(); |
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
Thread.currentThread().interrupt(); |
|
|
|
|
} |
|
|
|
|
log.error("load_water_level :线程执行结束"); |
|
|
|
|
redisTemplate.opsForValue().set(loadwater_level_key,list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 水位数据查询 |
|
|
|
|
* @param list |
|
|
|
|
* @param item |
|
|
|
|
*/ |
|
|
|
|
private void queryWaterLeve(List<WaterLevelVo> list,HzimsAnalyzeModelStationEntity item) { |
|
|
|
|
try{ |
|
|
|
|
List<MultiAnalyzeCodePO> multiAnalyzeCodePOList=new ArrayList<>(); |
|
|
|
|
MultiAnalyzeCodePO multiAnalyzeCodePO=new MultiAnalyzeCodePO(); |
|
|
|
@ -573,23 +594,10 @@ public class RealTargetServiceImpl implements RealTargetService {
|
|
|
|
|
waterLevelVo.setRearCurveMap(rearCurveMap); |
|
|
|
|
list.add(waterLevelVo); |
|
|
|
|
} |
|
|
|
|
log.error("load_water_level : 线程执行完成 {}", item.getInstanceCode()); |
|
|
|
|
countDownLatch.countDown(); |
|
|
|
|
log.error("load_water_level : 小节线程执行完成 {}", item.getInstanceCode()); |
|
|
|
|
} catch (Exception exception) { |
|
|
|
|
log.error("load_water_level_error : 线程执行失败 {}", exception.getMessage()); |
|
|
|
|
countDownLatch.countDown(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
log.error("load_water_level :等待线程执行"); |
|
|
|
|
countDownLatch.await(); |
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
Thread.currentThread().interrupt(); |
|
|
|
|
} |
|
|
|
|
log.error("load_water_level :线程执行完成"); |
|
|
|
|
redisTemplate.opsForValue().set(loadwater_level_key,list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|