技术监督计划导入
This commit is contained in:
@@ -4,8 +4,8 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description:
|
* @Description:
|
||||||
@@ -19,56 +19,48 @@ public class SupervisionPlanExcel {
|
|||||||
* 负责单位ID
|
* 负责单位ID
|
||||||
*/
|
*/
|
||||||
@Excel(name = "*计划负责单位", width = 30)
|
@Excel(name = "*计划负责单位", width = 30)
|
||||||
@NotBlank(message = "计划负责单位不能为空")
|
|
||||||
private String deptId;
|
private String deptId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 普测计划名称
|
* 计划名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "*普测计划名称", width = 30)
|
@Excel(name = "*计划名称", width = 30)
|
||||||
@NotBlank(message = "不能为空")
|
|
||||||
private String planName;
|
private String planName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监督类型
|
* 监督类型
|
||||||
*/
|
*/
|
||||||
@Excel(name = "*监督类型", width = 30)
|
@Excel(name = "*监督类型", width = 30)
|
||||||
@NotBlank(message = "监督类型不能为空")
|
|
||||||
private String supvType;
|
private String supvType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监督对象名称
|
* 监督对象名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "*监督对象名称", width = 30)
|
@Excel(name = "*监督对象名称", width = 30)
|
||||||
@NotBlank(message = "监督对象名称不能为空")
|
|
||||||
private String supvObjectName;
|
private String supvObjectName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划开始时间
|
* 计划开始时间
|
||||||
*/
|
*/
|
||||||
@Excel(name = "*计划开始时间(yyyy-MM-dd)", width = 30)
|
@Excel(name = "*计划开始时间(yyyy/MM/dd)", width = 30,exportFormat = "yyyy/MM/dd")
|
||||||
@NotBlank(message = "计划开始时间不能为空")
|
private Date planStartTime;
|
||||||
private String planStartTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划结束时间
|
* 计划结束时间
|
||||||
*/
|
*/
|
||||||
@Excel(name = "*计划结束时间(yyyy-MM-dd)", width = 30)
|
@Excel(name = "*计划结束时间(yyyy/MM/dd)", width = 30,exportFormat = "yyyy/MM/dd")
|
||||||
@NotBlank(message = "计划结束时间不能为空")
|
private Date planEndTime;
|
||||||
private String planEndTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0 关联系统内变电站;1 用户手动输入变电站
|
* 0 关联系统内变电站;1 用户手动输入变电站
|
||||||
*/
|
*/
|
||||||
@Excel(name = "*是否系统电站", width = 30, replace = {"是_1", "否_0",})
|
@Excel(name = "*是否系统电站", width = 30, replace = {"是_0", "否_1",})
|
||||||
@NotBlank(message = "是否系统电站不能为空")
|
|
||||||
private String customSubstationFlag ;
|
private String customSubstationFlag ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 变电站台账ID或者用户手动输入的变电站名称
|
* 变电站台账ID或者用户手动输入的变电站名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "*关联电站一", width = 30)
|
@Excel(name = "*关联电站一", width = 30)
|
||||||
@NotBlank(message = "关联电站一不能为空")
|
|
||||||
private String substation;
|
private String substation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -121,11 +121,11 @@ public class SurveyPlanController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping(value = "/importPlanData", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
@PostMapping(value = "/importPlanData")
|
||||||
@ApiOperation("批量导入技术监督计划")
|
@ApiOperation("批量导入技术监督计划")
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
public HttpResult<String> importPlanData(@ApiParam(value = "文件", required = true) @RequestPart("file") MultipartFile file, HttpServletResponse response) {
|
public HttpResult<String> importPlanData(@ApiParam(value = "文件", required = true) @RequestPart("file") MultipartFile file, HttpServletResponse response) {
|
||||||
String methodDescribe = getMethodDescribe("importDevData");
|
String methodDescribe = getMethodDescribe("importPlanData");
|
||||||
surveyPlanService.importPlanData(file, response);
|
surveyPlanService.importPlanData(file, response);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -357,33 +357,6 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
List<PullDown> pullDowns = new ArrayList<>();
|
List<PullDown> pullDowns = new ArrayList<>();
|
||||||
|
|
||||||
PullDown pullDown;
|
PullDown pullDown;
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(0);
|
|
||||||
pullDown.setLastCol(0);
|
|
||||||
pullDown.setIsText(true);
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(10);
|
|
||||||
pullDown.setLastCol(10);
|
|
||||||
pullDown.setIsText(true);
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(11);
|
|
||||||
pullDown.setLastCol(11);
|
|
||||||
pullDown.setIsText(true);
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(20);
|
|
||||||
pullDown.setLastCol(20);
|
|
||||||
pullDown.setIsText(true);
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(1);
|
pullDown.setFirstCol(1);
|
||||||
pullDown.setLastCol(1);
|
pullDown.setLastCol(1);
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.time.ZoneId;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@@ -144,12 +145,16 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
String[] subIds = substation.split(StrPool.COMMA);
|
String[] subIds = substation.split(StrPool.COMMA);
|
||||||
|
|
||||||
for (String subId : subIds) {
|
for (String subId : subIds) {
|
||||||
String name = lineFeignClient.getSubstationInfo(subId).getData().getName();
|
PollutionSubstationDTO data = lineFeignClient.getSubstationInfo(subId).getData();
|
||||||
subName = subName.concat(StrPool.COMMA).concat(name);
|
if (ObjectUtil.isNotNull(data)) {
|
||||||
|
String name = data.getName();
|
||||||
|
subName = subName.concat(StrPool.COMMA).concat(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StrUtil.isNotBlank(subName)){
|
||||||
|
subName = subName.substring(1);
|
||||||
}
|
}
|
||||||
subName = subName.substring(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
record.setSubstation(subName);
|
record.setSubstation(subName);
|
||||||
} else {
|
} else {
|
||||||
record.setSubstationName(record.getSubstation());
|
record.setSubstationName(record.getSubstation());
|
||||||
@@ -387,36 +392,12 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
pullDown.setStrings(depts.stream().map(DeptDTO::getName).distinct().collect(Collectors.toList()));
|
pullDown.setStrings(depts.stream().map(DeptDTO::getName).distinct().collect(Collectors.toList()));
|
||||||
pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(1);
|
|
||||||
pullDown.setLastCol(1);
|
|
||||||
pullDown.setIsText(true);
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(2);
|
pullDown.setFirstCol(2);
|
||||||
pullDown.setLastCol(2);
|
pullDown.setLastCol(2);
|
||||||
pullDown.setStrings(supType.stream().map(DictData::getName).distinct().collect(Collectors.toList()));
|
pullDown.setStrings(supType.stream().map(DictData::getName).distinct().collect(Collectors.toList()));
|
||||||
pullDowns.add(pullDown);
|
pullDowns.add(pullDown);
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(3);
|
|
||||||
pullDown.setLastCol(3);
|
|
||||||
pullDown.setIsText(true);
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(4);
|
|
||||||
pullDown.setLastCol(4);
|
|
||||||
pullDown.setIsText(true);
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
|
||||||
pullDown.setFirstCol(5);
|
|
||||||
pullDown.setLastCol(5);
|
|
||||||
pullDown.setIsText(true);
|
|
||||||
pullDowns.add(pullDown);
|
|
||||||
|
|
||||||
pullDown = new PullDown();
|
pullDown = new PullDown();
|
||||||
pullDown.setFirstCol(6);
|
pullDown.setFirstCol(6);
|
||||||
pullDown.setLastCol(6);
|
pullDown.setLastCol(6);
|
||||||
@@ -445,6 +426,7 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void importPlanData(MultipartFile file, HttpServletResponse response) {
|
public void importPlanData(MultipartFile file, HttpServletResponse response) {
|
||||||
|
List<SupervisionPlanExcel.ExcelMsg> planMsgList = new ArrayList<>();
|
||||||
ImportParams params = new ImportParams();
|
ImportParams params = new ImportParams();
|
||||||
//表头
|
//表头
|
||||||
params.setHeadRows(1);
|
params.setHeadRows(1);
|
||||||
@@ -455,19 +437,13 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
params.setSheetNum(1);
|
params.setSheetNum(1);
|
||||||
List<SupervisionPlanExcel> planExcels;
|
List<SupervisionPlanExcel> planExcels;
|
||||||
try {
|
try {
|
||||||
planExcels = ExcelImportUtil.importExcel(file.getInputStream(), SupervisionPlanExcel.class, params);
|
planExcels = ExcelImportUtil.importExcel(file.getInputStream(), SupervisionPlanExcel.class, params);
|
||||||
|
|
||||||
//如果存在非法数据,将不合格的数据导出
|
//如果存在非法数据,将不合格的数据导出
|
||||||
// if (CollectionUtil.isEmpty(objectExcelImportResult.getList())) {
|
if (CollUtil.isEmpty(planExcels)) {
|
||||||
// throw new BusinessException(SupervisionResponseEnum.IMPORT_PLAN_DATA_ERROR);
|
|
||||||
// }
|
|
||||||
if (planExcels.size() > 1) {
|
|
||||||
throw new BusinessException(SupervisionResponseEnum.IMPORT_PLAN_DATA_ERROR);
|
throw new BusinessException(SupervisionResponseEnum.IMPORT_PLAN_DATA_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<SupervisionPlanExcel.ExcelMsg> planMsgList = new ArrayList<>();
|
|
||||||
//各地市
|
//各地市
|
||||||
List<DeptDTO> deptS = deptFeignClient.getDepSonDetailByDeptId(RequestUtil.getDeptIndex()).getData();
|
List<DeptDTO> deptS = deptFeignClient.getDepSonDetailByDeptId("0d52f9f6e43ec0ee83013cd32da93f66").getData();
|
||||||
List<DictData> supType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPV_TYPE.getCode()).getData();
|
List<DictData> supType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPV_TYPE.getCode()).getData();
|
||||||
|
|
||||||
SubstationParam substationParam = new SubstationParam();
|
SubstationParam substationParam = new SubstationParam();
|
||||||
@@ -489,18 +465,12 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
po.setDeptId(DeptIds.get(0));
|
po.setDeptId(DeptIds.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<SubGetBase> subList = new ArrayList<>();
|
if (StrUtil.isEmpty(planExcel.getPlanName())) {
|
||||||
List<String> list = Arrays.asList(planExcel.getSubstation(), planExcel.getSubstation2(), planExcel.getSubstation3());
|
msg.append("计划名称不能为空!");
|
||||||
if (CollUtil.isEmpty(list)) {
|
|
||||||
msg.append("关联电站不能为空!");
|
|
||||||
} else {
|
} else {
|
||||||
if ("1".equals(planExcel.getCustomSubstationFlag())) {
|
po.setPlanName(planExcel.getPlanName());
|
||||||
subList.addAll(data.stream().filter(x -> list.contains(x.getName())).collect(Collectors.toList()));
|
|
||||||
if (CollUtil.isEmpty(subList)) {
|
|
||||||
msg.append("关联电站不存在!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrUtil.isEmpty(planExcel.getSupvType())) {
|
if (StrUtil.isEmpty(planExcel.getSupvType())) {
|
||||||
msg.append("监督类型不能为空!");
|
msg.append("监督类型不能为空!");
|
||||||
} else {
|
} else {
|
||||||
@@ -513,24 +483,38 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
}
|
}
|
||||||
if (StrUtil.isEmpty(planExcel.getSupvObjectName())) {
|
if (StrUtil.isEmpty(planExcel.getSupvObjectName())) {
|
||||||
msg.append("监督对象名称不能为空!");
|
msg.append("监督对象名称不能为空!");
|
||||||
|
} else {
|
||||||
|
po.setSupvObjectName(planExcel.getSupvObjectName());
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Date startTime = planExcel.getPlanStartTime();
|
||||||
|
Date endTime = planExcel.getPlanEndTime();
|
||||||
|
po.setPlanStartTime(startTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
|
||||||
|
po.setPlanEndTime(endTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
|
||||||
|
} catch (Exception e) {
|
||||||
|
msg.append("计划时间格式有误!");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
if (StrUtil.isEmpty(planExcel.getCustomSubstationFlag())) {
|
||||||
DateTime startTime = DateUtil.parseDate(planExcel.getPlanStartTime());
|
msg.append("是否系统电站不能为空!");
|
||||||
DateTime endTime = DateUtil.parseDate(planExcel.getPlanEndTime());
|
} else {
|
||||||
po.setSupvObjectName(planExcel.getSupvObjectName());
|
po.setCustomSubstationFlag(Integer.valueOf(planExcel.getCustomSubstationFlag()));
|
||||||
po.setPlanStartTime(startTime.toLocalDateTime().toLocalDate());
|
}
|
||||||
po.setPlanEndTime(endTime.toLocalDateTime().toLocalDate());
|
List<String> list = Arrays.asList(planExcel.getSubstation(), planExcel.getSubstation2(), planExcel.getSubstation3())
|
||||||
if ("1".equals(planExcel.getCustomSubstationFlag())) {
|
.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
||||||
List<String> subIds = subList.stream().map(SubGetBase::getId).collect(Collectors.toList());
|
if (CollUtil.isEmpty(list)) {
|
||||||
po.setSubstation(String.join(",", subIds));
|
msg.append("关联电站不能为空!");
|
||||||
|
} else {
|
||||||
|
if ("0".equals(planExcel.getCustomSubstationFlag())) {
|
||||||
|
List<String> subIds = data.stream().filter(x -> list.contains(x.getName())).map(SubGetBase::getId).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isEmpty(subIds)) {
|
||||||
|
msg.append("关联电站不存在!");
|
||||||
|
} else {
|
||||||
|
po.setSubstation(String.join(",", subIds));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
po.setSubstation(planExcel.getSubstation());
|
po.setSubstation(planExcel.getSubstation());
|
||||||
}
|
}
|
||||||
po.setCustomSubstationFlag(Integer.valueOf(planExcel.getCustomSubstationFlag()));
|
|
||||||
po.setSubstation(subList.get(0).getId());
|
|
||||||
} catch (Exception e) {
|
|
||||||
msg.append("计划时间格式有误!");
|
|
||||||
}
|
}
|
||||||
String string = msg.toString();
|
String string = msg.toString();
|
||||||
if (StrUtil.isNotBlank(string)) {
|
if (StrUtil.isNotBlank(string)) {
|
||||||
@@ -543,23 +527,27 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
|||||||
po.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
po.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
po.setState(DataStateEnum.ENABLE.getCode());
|
po.setState(DataStateEnum.ENABLE.getCode());
|
||||||
info.add(po);
|
info.add(po);
|
||||||
// this.saveOrUpdate(po);
|
}
|
||||||
// SurveyPlan surveyPlan = this.baseMapper.selectById(po.getId());
|
}
|
||||||
// Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
if (CollUtil.isNotEmpty(info)) {
|
||||||
// BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
for (SurveyPlan surveyPlan : info) {
|
||||||
// bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SURVEY_PLAN.getKey());
|
this.saveOrUpdate(surveyPlan);
|
||||||
// bpmProcessInstanceCreateReqDTO.setBusinessKey(surveyPlan.getId());
|
SurveyPlan plan = this.baseMapper.selectById(surveyPlan.getId());
|
||||||
// bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>(16));
|
Map<String, Object> processInstanceVariables = new HashMap<>(16);
|
||||||
// bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
// String processInstanceId = bpmProcessFeignClient.createProcessInstance(surveyPlan.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(SupervisionKeyEnum.SURVEY_PLAN.getKey());
|
||||||
// // 将工作流的编号,更新到流程单中
|
bpmProcessInstanceCreateReqDTO.setBusinessKey(plan.getId());
|
||||||
// surveyPlan.setProcessInstanceId(processInstanceId);
|
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(new HashMap<>(16));
|
||||||
// this.baseMapper.updateById(surveyPlan);
|
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||||
|
String processInstanceId = bpmProcessFeignClient.createProcessInstance(plan.getCreateBy(), bpmProcessInstanceCreateReqDTO).getData();
|
||||||
|
// 将工作流的编号,更新到流程单中
|
||||||
|
plan.setProcessInstanceId(processInstanceId);
|
||||||
|
this.baseMapper.updateById(plan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//判断有没有错误信息
|
//判断有没有错误信息
|
||||||
if (CollectionUtil.isNotEmpty(planMsgList)) {
|
if (CollectionUtil.isNotEmpty(planMsgList)) {
|
||||||
ExcelUtil.exportExcel("失败列表.xlsx", SupervisionDevMainReportExcel.ExcelMsg.class, planMsgList);
|
ExcelUtil.exportExcel("失败列表.xlsx", SupervisionPlanExcel.ExcelMsg.class, planMsgList);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException(SupervisionResponseEnum.IMPORT_PLAN_ERROR);
|
throw new BusinessException(SupervisionResponseEnum.IMPORT_PLAN_ERROR);
|
||||||
|
|||||||
@@ -91,11 +91,6 @@
|
|||||||
<artifactId>cs-device-api</artifactId>
|
<artifactId>cs-device-api</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.njcn.platform</groupId>
|
|
||||||
<artifactId>algorithm-api</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
package com.njcn.system.timer.tasks.algorithm;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DatePattern;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.njcn.algorithm.pojo.bo.BaseParam;
|
|
||||||
import com.njcn.algorithm.pojo.liteflow.LiteFlowAlgorithmFeignClient;
|
|
||||||
import com.njcn.system.timer.TimerTaskRunner;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类的介绍:装置算法执行链定时任务
|
|
||||||
*
|
|
||||||
* @author xuyang
|
|
||||||
* @version 1.0.0
|
|
||||||
* @createTime 2023/12/6 9:35
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DeviceAlgorithmTaskRunner implements TimerTaskRunner {
|
|
||||||
|
|
||||||
private final LiteFlowAlgorithmFeignClient liteFlowFeignClient;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void action(String date) {
|
|
||||||
BaseParam baseParam = new BaseParam();
|
|
||||||
baseParam.setFullChain(true);
|
|
||||||
baseParam.setRepair(false);
|
|
||||||
if(StrUtil.isBlank(date)){
|
|
||||||
baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
|
||||||
}else {
|
|
||||||
baseParam.setDataDate(date);
|
|
||||||
}
|
|
||||||
liteFlowFeignClient.deviceExecutor(baseParam);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package com.njcn.system.timer.tasks.algorithm;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DatePattern;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.njcn.algorithm.pojo.bo.BaseParam;
|
|
||||||
import com.njcn.algorithm.pojo.liteflow.LiteFlowAlgorithmFeignClient;
|
|
||||||
import com.njcn.system.timer.TimerTaskRunner;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类的介绍:监测点算法执行链定时任务
|
|
||||||
*
|
|
||||||
* @author xuyang
|
|
||||||
* @version 1.0.0
|
|
||||||
* @createTime 2023/12/6 9:35
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class MeasurementAlgorithmTaskRunner implements TimerTaskRunner {
|
|
||||||
|
|
||||||
private final LiteFlowAlgorithmFeignClient liteFlowFeignClient;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void action(String date) {
|
|
||||||
BaseParam baseParam = new BaseParam();
|
|
||||||
baseParam.setFullChain(true);
|
|
||||||
baseParam.setRepair(false);
|
|
||||||
if(StrUtil.isBlank(date)){
|
|
||||||
baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
|
||||||
}else {
|
|
||||||
baseParam.setDataDate(date);
|
|
||||||
}
|
|
||||||
liteFlowFeignClient.measurementPointExecutor(baseParam);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package com.njcn.system.timer.tasks.algorithm;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.njcn.algorithm.pojo.bo.BaseParam;
|
|
||||||
import com.njcn.algorithm.pojo.liteflow.LiteFlowAlgorithmFeignClient;
|
|
||||||
import com.njcn.system.timer.TimerTaskRunner;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类的介绍:监测点算法执行链定时任务
|
|
||||||
*
|
|
||||||
* @author xuyang
|
|
||||||
* @version 1.0.0
|
|
||||||
* @createTime 2023/12/6 9:35
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class MeasurementHourAlgorithmTaskRunner implements TimerTaskRunner {
|
|
||||||
|
|
||||||
private final LiteFlowAlgorithmFeignClient liteFlowFeignClient;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void action(String date) {
|
|
||||||
BaseParam baseParam = new BaseParam();
|
|
||||||
baseParam.setFullChain(true);
|
|
||||||
//由于是按小时跑的,前端其他算法都是按天跑的,因此修改参数
|
|
||||||
if(StrUtil.isBlank(date)){
|
|
||||||
baseParam.setRepair(false);
|
|
||||||
baseParam.setDataDate(DateUtil.now());
|
|
||||||
}else {
|
|
||||||
baseParam.setRepair(true);
|
|
||||||
baseParam.setBeginTime(date+ " 00:00:00");
|
|
||||||
baseParam.setEndTime(date+ " 24:00:00");
|
|
||||||
}
|
|
||||||
liteFlowFeignClient.measurementPointExecutorByHour(baseParam);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.njcn.system.timer.tasks.algorithm;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DatePattern;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.njcn.algorithm.pojo.bo.BaseParam;
|
|
||||||
import com.njcn.algorithm.pojo.liteflow.LiteFlowAlgorithmFeignClient;
|
|
||||||
import com.njcn.system.timer.TimerTaskRunner;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类的介绍:单位监测点算法执行链定时任务
|
|
||||||
*
|
|
||||||
* @author xuyang
|
|
||||||
* @version 1.0.0
|
|
||||||
* @createTime 2023/12/6 9:35
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class OrgAlgorithmTaskRunner implements TimerTaskRunner {
|
|
||||||
|
|
||||||
private final LiteFlowAlgorithmFeignClient liteFlowFeignClient;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void action(String date) {
|
|
||||||
BaseParam baseParam = new BaseParam();
|
|
||||||
baseParam.setFullChain(true);
|
|
||||||
baseParam.setRepair(false);
|
|
||||||
if(StrUtil.isBlank(date)){
|
|
||||||
baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
|
||||||
}else {
|
|
||||||
baseParam.setDataDate(date);
|
|
||||||
}
|
|
||||||
liteFlowFeignClient.orgPointExecutor(baseParam);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.njcn.system.timer.tasks.algorithm;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DatePattern;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.njcn.algorithm.pojo.bo.BaseParam;
|
|
||||||
import com.njcn.algorithm.pojo.liteflow.LiteFlowAlgorithmFeignClient;
|
|
||||||
import com.njcn.system.timer.TimerTaskRunner;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类的介绍:变电站算法执行链定时任务
|
|
||||||
*
|
|
||||||
* @author xuyang
|
|
||||||
* @version 1.0.0
|
|
||||||
* @createTime 2023/12/6 9:35
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class SubstationAlgorithmTaskRunner implements TimerTaskRunner {
|
|
||||||
|
|
||||||
private final LiteFlowAlgorithmFeignClient liteFlowFeignClient;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void action(String date) {
|
|
||||||
BaseParam baseParam = new BaseParam();
|
|
||||||
baseParam.setFullChain(true);
|
|
||||||
baseParam.setRepair(false);
|
|
||||||
if(StrUtil.isBlank(date)){
|
|
||||||
baseParam.setDataDate(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
|
||||||
}else {
|
|
||||||
baseParam.setDataDate(date);
|
|
||||||
}
|
|
||||||
liteFlowFeignClient.substationExecutor(baseParam);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user