代码调整
This commit is contained in:
@@ -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.DeptGetBusBarDTO;
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenDTO;
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetSubStationDTO;
|
||||
@@ -276,4 +277,48 @@ public class ExecutionCenter extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("母线算法执行链(主网测点)")
|
||||
@PostMapping("/generaTrixExecutor")
|
||||
@Async("asyncExecutor")
|
||||
public void generaTrixExecutor(@RequestBody BaseParam baseParam) {
|
||||
String methodDescribe = getMethodDescribe("generaTrixExecutor");
|
||||
//手动判断参数是否合法,
|
||||
CalculatedParam calculatedParam = judgeExecuteParam(baseParam);
|
||||
//母线索引
|
||||
if (CollectionUtils.isEmpty(calculatedParam.getIdList())) {
|
||||
Dept dept = deptFeignClient.getRootDept().getData();
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(dept.getId());
|
||||
deptGetLineParam.setSystemType(0);
|
||||
List<DeptGetBusBarDTO> busBarList = commTerminalGeneralClient.deptBusBar(deptGetLineParam).getData();
|
||||
DeptGetBusBarDTO dto = busBarList.stream().filter(u -> Objects.equals(u.getUnitId(),dept.getCode())).findAny().orElse(null);
|
||||
if (Objects.nonNull(dto)){
|
||||
calculatedParam.setIdList(dto.getBusBarIds());
|
||||
}
|
||||
}
|
||||
LiteflowResponse liteflowResponse;
|
||||
if (baseParam.isRepair()) {
|
||||
//补招时,起始日期、截止日期必填
|
||||
DateTime startDate = DateUtil.parse(baseParam.getBeginTime(), DatePattern.NORM_DATE_FORMAT);
|
||||
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
||||
long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
||||
//递增日期执行算法链
|
||||
for (int i = 0; i < betweenDay; i++) {
|
||||
if (i != 0) {
|
||||
startDate = DateUtil.offsetDay(startDate, 1);
|
||||
}
|
||||
calculatedParam.setDataDate(DateUtil.format(startDate, DatePattern.NORM_DATE_PATTERN));
|
||||
liteflowResponse = flowExecutor.execute2Resp("genera_trix", calculatedParam);
|
||||
dealResponse(calculatedParam,liteflowResponse,methodDescribe);
|
||||
}
|
||||
} else {
|
||||
//非补招
|
||||
liteflowResponse = flowExecutor.execute2Resp("genera_trix", calculatedParam);
|
||||
dealResponse(calculatedParam, liteflowResponse, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user