feat(algorithm): 添加监测点接线方式缓存优化数据处理逻辑
- 在ExecutionCenter中引入CsLineDTO和RedisUtil依赖 - 实现监测点、接线方式数据缓存到Redis功能,设置3小时过期时间 - 修改wlMeasurementPointExecutor方法使用缓存的线路ID列表 - 在数据处理服务中添加Gson和TypeToken用于JSON序列化 - 实现根据接线方式过滤电压类型数据的功能 - 添加线电压和相电压类型常量定义 - 优化数据查询逻辑,按监测点分组后根据接线方式过滤多余数据 - 实现线电压数据向相电压数据的特殊处理逻辑 - 统一返回经过接线方式过滤后的数据结果
This commit is contained in:
@@ -16,6 +16,7 @@ import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||
import com.njcn.csdevice.pojo.dto.CsLineDTO;
|
||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetDeviceDTO;
|
||||
@@ -23,6 +24,7 @@ import com.njcn.device.biz.pojo.dto.DeptGetSubStationDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.pq.api.DeptLineFeignClient;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -73,6 +75,8 @@ public class ExecutionCenter extends BaseController {
|
||||
private CsLineFeignClient csLineFeignClient;
|
||||
@Resource
|
||||
private FlowAsyncService flowService;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
/***
|
||||
* 1、校验非全链执行时,tagNames节点标签集合必须为非空,否则提示---无可执行节点
|
||||
@@ -143,9 +147,27 @@ public class ExecutionCenter extends BaseController {
|
||||
String methodDescribe = getMethodDescribe("wlMeasurementPointExecutor");
|
||||
//手动判断参数是否合法,
|
||||
CalculatedParam calculatedParam = judgeExecuteParam(baseParam);
|
||||
//缓存监测点、接线方式数据
|
||||
List<CsLineDTO> csLineDTOList = csLineFeignClient.getAllLineDetail().getData();
|
||||
List<String> lineIdList = new ArrayList<>();
|
||||
Map<String, Integer> lineConTypeMap = new HashMap<>();
|
||||
if (CollectionUtils.isNotEmpty(csLineDTOList)) {
|
||||
lineIdList = csLineDTOList.stream().map(CsLineDTO::getLineId).collect(Collectors.toList());
|
||||
//接线方式(0-星型 1-角型 2-V型)
|
||||
lineConTypeMap = csLineDTOList.stream()
|
||||
.filter(dto -> dto.getLineId() != null)
|
||||
.collect(Collectors.toMap(
|
||||
CsLineDTO::getLineId,
|
||||
dto -> dto.getConType() != null ? dto.getConType() : 0,
|
||||
(v1, v2) -> v1
|
||||
));
|
||||
redisUtil.saveByKeyWithExpire("wlLineDetail", lineConTypeMap, 3600L*3);
|
||||
}
|
||||
// 测点索引
|
||||
if (CollectionUtils.isEmpty(calculatedParam.getIdList())) {
|
||||
calculatedParam.setIdList(csLineFeignClient.getAllLine().getData());
|
||||
calculatedParam.setIdList(lineIdList);
|
||||
} else {
|
||||
calculatedParam.setIdList(calculatedParam.getIdList());
|
||||
}
|
||||
LiteflowResponse liteflowResponse;
|
||||
if (baseParam.isRepair()) {
|
||||
|
||||
Reference in New Issue
Block a user