pms算法代码提交

This commit is contained in:
2023-11-22 10:47:00 +08:00
parent 7ac58df780
commit 0bb6fb9912
45 changed files with 1504 additions and 44 deletions

View File

@@ -11,6 +11,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.device.biz.commApi.CommTerminalGeneralClient;
import com.njcn.device.biz.pojo.dto.DeptGetChildrenDTO;
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
import com.njcn.device.biz.pojo.dto.DeptGetSubStationDTO;
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
@@ -236,28 +237,21 @@ public class ExecutionCenter extends BaseController {
* @date 2023/11/17
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@ApiOperation("变电站算法执行链")
@ApiOperation("pms变电站母线算法执行链")
@PostMapping("/pmsdimexecutor")
public void pmsDimExecutor(@RequestBody BaseParam baseParam) {
String methodDescribe = getMethodDescribe("pmsdimexecutor");
//手动判断参数是否合法,
CalculatedParam<String> calculatedParam = judgeExecuteParam(baseParam);
CalculatedParam<DeptGetChildrenDTO> calculatedParam = judgeExecuteParam(baseParam);
// 测点索引
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
if (CollectionUtils.isEmpty(calculatedParam.getIdList())) {
Dept data = deptFeignClient.getRootDept().getData();
deptGetLineParam.setDeptId(data.getId());
List<DeptGetSubStationDTO> data1 = commTerminalGeneralClient.deptSubStation(deptGetLineParam).getData();
List<String> stationIds = new ArrayList<>();
for (DeptGetSubStationDTO deptGetSubStationDTO : data1) {
Collection<String> union = CollectionUtils.union(Optional.ofNullable(deptGetSubStationDTO.getStationIds()).orElse(new ArrayList<String>()),
Optional.ofNullable(deptGetSubStationDTO.getStationIds()).orElse(new ArrayList<String>()));
List<String> collect = union.stream().distinct().collect(Collectors.toList());
stationIds.addAll(collect);
}
stationIds = stationIds.stream().distinct().collect(Collectors.toList());
calculatedParam.setIdList(stationIds);
deptGetLineParam.setSystemType(0);
List<DeptGetChildrenDTO> dept = commTerminalGeneralClient.deptGetLineList(deptGetLineParam).getData();
calculatedParam.setIdList(dept);
}
LiteflowResponse liteflowResponse;
if (baseParam.isRepair()) {
@@ -271,12 +265,12 @@ public class ExecutionCenter extends BaseController {
startDate = DateUtil.offsetDay(startDate, 1);
}
calculatedParam.setDataDate(DateUtil.format(startDate, DatePattern.NORM_DATE_PATTERN));
liteflowResponse = flowExecutor.execute2Resp("sub_station", calculatedParam);
liteflowResponse = flowExecutor.execute2Resp("dim_station_busbar", calculatedParam);
dealResponse(calculatedParam, liteflowResponse, methodDescribe);
}
} else {
//非补招
liteflowResponse = flowExecutor.execute2Resp("sub_station", calculatedParam);
liteflowResponse = flowExecutor.execute2Resp("dim_station_busbar", calculatedParam);
dealResponse(calculatedParam, liteflowResponse, methodDescribe);
}