|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.hnac.hzims.scheduled.service.operation.home.impl; |
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.alibaba.fastjson.TypeReference; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
@ -39,6 +40,7 @@ import com.hnac.hzinfo.sdk.core.response.Result;
|
|
|
|
|
import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient; |
|
|
|
|
import com.hnac.hzinfo.sdk.v5.device.dto.ReductionDataDTO; |
|
|
|
|
import com.hnac.hzinfo.sdk.v5.device.vo.ReductionDataVO; |
|
|
|
|
import com.xxl.job.core.log.XxlJobLogger; |
|
|
|
|
import io.undertow.util.CopyOnWriteMap; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
@ -546,27 +548,6 @@ public class RealTargetServiceImpl implements RealTargetService {
|
|
|
|
|
CountDownLatch countDownLatch = new CountDownLatch(modelList.size()); |
|
|
|
|
for(HzimsAnalyzeModelStationEntity item : modelList){ |
|
|
|
|
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(); |
|
|
|
@ -594,11 +575,25 @@ public class RealTargetServiceImpl implements RealTargetService {
|
|
|
|
|
waterLevelVo.setRearCurveMap(rearCurveMap); |
|
|
|
|
list.add(waterLevelVo); |
|
|
|
|
} |
|
|
|
|
log.error("load_water_level : 小节线程执行完成 {}", item.getInstanceCode()); |
|
|
|
|
countDownLatch.countDown(); |
|
|
|
|
XxlJobLogger.log("load_water_level : 子线程执行完成 {}", item.getInstanceCode()); |
|
|
|
|
} catch (Exception exception) { |
|
|
|
|
log.error("load_water_level_error : 线程执行失败 {}", exception.getMessage()); |
|
|
|
|
countDownLatch.countDown(); |
|
|
|
|
XxlJobLogger.log("load_water_level_error : 子线程执行失败 {}", exception.getMessage()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
XxlJobLogger.log("load_water_level :等待线程执行"); |
|
|
|
|
countDownLatch.await(); |
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
Thread.currentThread().interrupt(); |
|
|
|
|
} |
|
|
|
|
XxlJobLogger.log("load_water_level :线程执行结束"); |
|
|
|
|
redisTemplate.opsForValue().set(loadwater_level_key,list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 光伏站-逆变器实时加载 |
|
|
|
|