调整数据中心算法
1.装置在线率算法-日表 2.终端异常通告算法-日表
This commit is contained in:
@@ -11,10 +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;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.prepare.harmonic.enums.PrepareResponseEnum;
|
||||
import com.njcn.prepare.harmonic.pojo.bo.BaseParam;
|
||||
@@ -142,9 +139,48 @@ public class ExecutionCenter extends BaseController {
|
||||
liteflowResponse = flowExecutor.execute2Resp("measurement_point", calculatedParam);
|
||||
dealResponse(calculatedParam,liteflowResponse,methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("装置算法执行链")
|
||||
@PostMapping("/deviceExecutor")
|
||||
@Async("asyncExecutor")
|
||||
public void deviceExecutor(@RequestBody BaseParam baseParam) {
|
||||
String methodDescribe = getMethodDescribe("deviceExecutor");
|
||||
//手动判断参数是否合法,
|
||||
CalculatedParam calculatedParam = judgeExecuteParam(baseParam);
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
// 设备索引
|
||||
if (CollectionUtils.isEmpty(calculatedParam.getIdList())) {
|
||||
Dept data = deptFeignClient.getRootDept().getData();
|
||||
deptGetLineParam.setDeptId(data.getId());
|
||||
List<DeptGetDeviceDTO> list = commTerminalGeneralClient.deptGetDevice(deptGetLineParam).getData();
|
||||
DeptGetDeviceDTO dto = list.stream().filter(po ->Objects.equals(po.getUnitId(),data.getId())).collect(Collectors.toList()).get(0);
|
||||
List<LineDevGetDTO> devList = dto.getDeviceList();
|
||||
calculatedParam.setIdList(devList.stream().map(LineDevGetDTO::getDevId).distinct().collect(Collectors.toList()));
|
||||
}
|
||||
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("device", calculatedParam);
|
||||
dealResponse(calculatedParam,liteflowResponse,methodDescribe);
|
||||
}
|
||||
} else {
|
||||
//非补招
|
||||
liteflowResponse = flowExecutor.execute2Resp("device", calculatedParam);
|
||||
dealResponse(calculatedParam,liteflowResponse,methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("单位监测点算法执行链")
|
||||
@PostMapping("/orgPointExecutor")
|
||||
|
||||
Reference in New Issue
Block a user