From 9a9af5db5d705f88b621b16e45452c11f793a6d1 Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Wed, 19 Jun 2024 08:31:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B8=E5=BF=83=E4=BF=A1=E6=81=AF=E6=8F=90?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/njcn/bpm/pojo/vo/task/BpmTaskVO.java | 12 +- .../com/njcn/bpm/service/IBpmService.java | 11 +- .../BpmProcessInstanceController.java | 3 + .../bpm/controller/BpmTaskController.java | 6 +- .../com/njcn/bpm/utils/BpmTaskConvert.java | 26 +++- .../com/njcn/device/pq/enums/RunFlagEnum.java | 34 +++++ pqs-supervision/supervision-api/pom.xml | 6 + .../api/BusinessCommonFeignClient.java | 13 ++ ...inessCommonFeignClientFallbackFactory.java | 7 + .../supervision/enums/ProblemTypeEnum.java | 10 ++ .../pojo/po/leaflet/WarningLeaflet.java | 5 + .../pojo/vo/leaflet/WarningLeafletVO.java | 10 ++ .../controller/BusinessCommonController.java | 12 ++ .../plan/SupervisionPlanController.java | 2 + .../SupervisionTempLineRunTestMapper.xml | 1 + .../device/impl/CheckDeviceServiceImpl.java | 22 ++- .../impl/QuitRunningDeviceServiceImpl.java | 27 +++- ...SupervisionDevMainReportPOServiceImpl.java | 17 +++ ...SupervisionTempLineDebugPOServiceImpl.java | 20 ++- .../SupervisionTempLineReportServiceImpl.java | 19 +++ ...SupervisionTempLineRunTestServiceImpl.java | 19 +++ .../leaflet/IWarningLeafletService.java | 5 +- .../impl/WarningLeafletServiceImpl.java | 126 +++++++++++------- .../plan/SupervisionPlanPOService.java | 1 + .../impl/SupervisionPlanPOServiceImpl.java | 57 ++++---- ...SupervisionUserComplaintPOServiceImpl.java | 9 +- ...rvisionGeneralSurveyPlanPOServiceImpl.java | 63 +++++---- .../survey/impl/SurveyPlanServiceImpl.java | 43 ++++-- .../survey/impl/SurveyTestServiceImpl.java | 32 +++++ .../impl/UserReportNormalServiceImpl.java | 11 ++ .../user/impl/UserReportPOServiceImpl.java | 11 ++ 31 files changed, 507 insertions(+), 133 deletions(-) create mode 100644 pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/enums/RunFlagEnum.java diff --git a/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/pojo/vo/task/BpmTaskVO.java b/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/pojo/vo/task/BpmTaskVO.java index c9db955fe..d67c7ecd2 100644 --- a/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/pojo/vo/task/BpmTaskVO.java +++ b/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/pojo/vo/task/BpmTaskVO.java @@ -56,6 +56,17 @@ public class BpmTaskVO { */ private ProcessInstance processInstance; + /** + * 历史流程实例编号 + */ + private String historyInstanceId; + + /** + * 业务流程重要信息 + */ + private String instanceSign; + + @ApiModelProperty("父任务编号") private String parentTaskId; @@ -102,5 +113,4 @@ public class BpmTaskVO { private BpmProcessInstanceVO.User startUser; } - } diff --git a/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/service/IBpmService.java b/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/service/IBpmService.java index c6d1d6e57..63a962cda 100644 --- a/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/service/IBpmService.java +++ b/pqs-bpm/bpm-api/src/main/java/com/njcn/bpm/service/IBpmService.java @@ -19,10 +19,9 @@ public interface IBpmService extends IService { */ void updateProcessStatus(String businessId, Integer status); -// /** -// * 根据业务id获取历史审批id以及该任务的重要信息 -// * @param processKey 业务流程key -// * @param businessId 业务流程id -// */ -// BpmInstanceInfo getInstanceInfo(String processKey,String businessId); + /** + * 根据业务id获取历史审批id以及该任务的重要信息 + * @param businessId 业务流程id + */ + BpmInstanceInfo getInstanceInfo(String businessId); } diff --git a/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/controller/BpmProcessInstanceController.java b/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/controller/BpmProcessInstanceController.java index c38a210eb..f4fc399fc 100644 --- a/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/controller/BpmProcessInstanceController.java +++ b/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/controller/BpmProcessInstanceController.java @@ -22,6 +22,7 @@ import com.njcn.common.pojo.enums.common.LogEnum; import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.utils.HttpResultUtil; +import com.njcn.supervision.api.BusinessCommonFeignClient; import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.UserFeignClient; import com.njcn.user.pojo.po.Dept; @@ -60,6 +61,8 @@ public class BpmProcessInstanceController extends BaseController { @Resource private IBpmProcessInstanceService processInstanceService; @Resource + private BusinessCommonFeignClient businessCommonFeignClient; + @Resource private IBpmTaskService taskService; @Resource private IBpmProcessDefinitionService processDefinitionService; diff --git a/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/controller/BpmTaskController.java b/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/controller/BpmTaskController.java index 9b091f28c..e5abf18af 100644 --- a/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/controller/BpmTaskController.java +++ b/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/controller/BpmTaskController.java @@ -16,6 +16,7 @@ import com.njcn.common.pojo.enums.common.LogEnum; import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.utils.HttpResultUtil; +import com.njcn.supervision.api.BusinessCommonFeignClient; import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.UserFeignClient; import com.njcn.user.pojo.po.Dept; @@ -58,6 +59,9 @@ public class BpmTaskController extends BaseController { @Resource private IBpmTaskService taskService; + @Resource + private BusinessCommonFeignClient businessCommonFeignClient; + @Resource private IBpmProcessInstanceService processInstanceService; @@ -86,7 +90,7 @@ public class BpmTaskController extends BaseController { convertSet(pageResult.getList(), Task::getProcessInstanceId)); List userList = userFeignClient.getUserVOByIdList(convertList(processInstanceMap.values(), ProcessInstance::getStartUserId)).getData(); Map userMap = CollectionUtils.convertMap(userList, UserVO::getId); - PageResult bpmTaskVOPageResult = BpmTaskConvert.INSTANCE.buildTodoTaskPage(pageResult, processInstanceMap, userMap); + PageResult bpmTaskVOPageResult = BpmTaskConvert.INSTANCE.buildTodoTaskPage(pageResult, processInstanceMap, userMap,businessCommonFeignClient); //封装调整为当前系统的格式 Page page = new Page<>(); page.setRecords(bpmTaskVOPageResult.getList()); diff --git a/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/utils/BpmTaskConvert.java b/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/utils/BpmTaskConvert.java index 370a3e63e..ac3a07885 100644 --- a/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/utils/BpmTaskConvert.java +++ b/pqs-bpm/bpm-boot/src/main/java/com/njcn/bpm/utils/BpmTaskConvert.java @@ -2,10 +2,18 @@ package com.njcn.bpm.utils; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.extra.spring.SpringUtil; +import com.njcn.bpm.pojo.dto.BpmInstanceInfo; import com.njcn.bpm.pojo.dto.PageResult; import com.njcn.bpm.pojo.po.BpmForm; import com.njcn.bpm.pojo.vo.instance.BpmProcessInstanceVO; import com.njcn.bpm.pojo.vo.task.BpmTaskVO; +import com.njcn.bpm.service.IBpmService; +import com.njcn.common.pojo.exception.BusinessException; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.supervision.api.BusinessCommonFeignClient; +import com.njcn.supervision.enums.SupervisionKeyEnum; +import com.njcn.supervision.enums.SupervisionResponseEnum; import com.njcn.user.pojo.po.Dept; import com.njcn.user.pojo.vo.UserVO; import org.flowable.engine.history.HistoricProcessInstance; @@ -15,10 +23,13 @@ import org.flowable.task.api.history.HistoricTaskInstance; import org.flowable.task.service.impl.persistence.entity.TaskEntityImpl; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; +import org.springframework.validation.beanvalidation.SpringValidatorAdapter; +import javax.annotation.Resource; import java.util.Date; import java.util.List; import java.util.Map; +import java.util.Objects; import static com.njcn.bpm.utils.CollectionUtils.*; import static com.njcn.bpm.utils.MapUtils.findAndThen; @@ -34,9 +45,12 @@ public interface BpmTaskConvert { BpmTaskConvert INSTANCE = Mappers.getMapper(BpmTaskConvert.class); + + default PageResult buildTodoTaskPage(PageResult pageResult, Map processInstanceMap, - Map userMap) { + Map userMap, + BusinessCommonFeignClient businessCommonFeignClient) { return BeanUtils.toBean(pageResult, BpmTaskVO.class, taskVO -> { ProcessInstance processInstance = processInstanceMap.get(taskVO.getProcessInstanceId()); @@ -46,11 +60,21 @@ public interface BpmTaskConvert { taskVO.setProcessInstance(BeanUtils.toBean(processInstance, BpmTaskVO.ProcessInstance.class)); UserVO startUserVO = userMap.get(processInstance.getStartUserId()); taskVO.getProcessInstance().setStartUser(BeanUtils.toBean(startUserVO, BpmProcessInstanceVO.User.class)); + String processDefinitionId = taskVO.getProcessInstance().getProcessDefinitionId(); + String key = processDefinitionId.substring(0,processDefinitionId.lastIndexOf(":")); + key = key.substring(0,key.lastIndexOf(":")); + BpmInstanceInfo instanceInfo = businessCommonFeignClient.getInstanceInfo(key, processInstance.getBusinessKey()).getData(); + if(Objects.nonNull(instanceInfo)){ + taskVO.setHistoryInstanceId(instanceInfo.getHistoryInstanceId()); + taskVO.setInstanceSign(instanceInfo.getInstanceSign()); + } }); } + + default PageResult buildTaskPage(PageResult pageResult, Map processInstanceMap, Map userMap, diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/enums/RunFlagEnum.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/enums/RunFlagEnum.java new file mode 100644 index 000000000..e1c82e103 --- /dev/null +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/enums/RunFlagEnum.java @@ -0,0 +1,34 @@ +package com.njcn.device.pq.enums; + +import lombok.Getter; + +import java.util.Arrays; + +@Getter +public enum RunFlagEnum { + + /** + * 运行状态枚举 + */ + RUNNING(0, "运行"), + OVERHAUL(1, "检修"), + OFF_LINE(2, "停运"), + DEBUG(3, "调试"), + QUIT(4, "退运"); + + private final Integer status; + private final String remark; + + RunFlagEnum(Integer status, String remark) { + this.status = status; + this.remark = remark; + } + + public static String getRunFlagRemarkByStatus(Integer status) { + RunFlagEnum runFlagEnum = Arrays.stream(RunFlagEnum.values()) + .filter(runFlagEnum1 -> runFlagEnum1.getStatus().equals(status)) + .findAny() + .orElse(RUNNING); + return runFlagEnum.getRemark(); + } +} diff --git a/pqs-supervision/supervision-api/pom.xml b/pqs-supervision/supervision-api/pom.xml index 32d4514e4..b0ff48d30 100644 --- a/pqs-supervision/supervision-api/pom.xml +++ b/pqs-supervision/supervision-api/pom.xml @@ -38,6 +38,12 @@ common-poi ${project.version} + + com.njcn + bpm-api + 1.0.0 + compile + \ No newline at end of file diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/api/BusinessCommonFeignClient.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/api/BusinessCommonFeignClient.java index b3b369f1e..ddae4978f 100644 --- a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/api/BusinessCommonFeignClient.java +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/api/BusinessCommonFeignClient.java @@ -1,11 +1,16 @@ package com.njcn.supervision.api; +import com.njcn.bpm.pojo.dto.BpmInstanceInfo; +import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.constant.ServerInfo; +import com.njcn.common.pojo.enums.common.LogEnum; import com.njcn.common.pojo.response.HttpResult; import com.njcn.supervision.api.fallback.BusinessCommonFeignClientFallbackFactory; +import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; +import springfox.documentation.annotations.ApiIgnore; /** @@ -25,4 +30,12 @@ public interface BusinessCommonFeignClient { @GetMapping("/updateProcessStatus") HttpResult updateProcessStatus(@RequestParam("processKey") String processKey,@RequestParam("businessId") String businessId, @RequestParam("status")Integer status); + + /** + * 根据流程key,业务id去实时更新流程状态 + * @param processKey 流程定义key + * @param businessId 业务id + */ + @GetMapping("/getInstanceInfo") + HttpResult getInstanceInfo(@RequestParam("processKey") String processKey, @RequestParam("businessId")String businessId); } diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/api/fallback/BusinessCommonFeignClientFallbackFactory.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/api/fallback/BusinessCommonFeignClientFallbackFactory.java index 6be6d8217..d9a7bb4f8 100644 --- a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/api/fallback/BusinessCommonFeignClientFallbackFactory.java +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/api/fallback/BusinessCommonFeignClientFallbackFactory.java @@ -1,5 +1,6 @@ package com.njcn.supervision.api.fallback; +import com.njcn.bpm.pojo.dto.BpmInstanceInfo; import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.response.HttpResult; @@ -28,6 +29,12 @@ public class BusinessCommonFeignClientFallbackFactory implements FallbackFactory log.error("{}异常,降级处理,异常为:{}", "更新流程状态", throwable.toString()); throw new BusinessException(finalExceptionEnum); } + + @Override + public HttpResult getInstanceInfo(String processKey, String businessId) { + log.error("{}异常,降级处理,异常为:{}", "获取流程额外信息", throwable.toString()); + throw new BusinessException(finalExceptionEnum); + } }; } } diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/ProblemTypeEnum.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/ProblemTypeEnum.java index 55ccc8e11..9c4adbe98 100644 --- a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/ProblemTypeEnum.java +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/enums/ProblemTypeEnum.java @@ -2,6 +2,8 @@ package com.njcn.supervision.enums; import lombok.Getter; +import java.util.Arrays; + @Getter public enum ProblemTypeEnum { @@ -18,4 +20,12 @@ public enum ProblemTypeEnum { this.code = code; this.name = name; } + + public static String getNameByCode(Integer code) { + ProblemTypeEnum problemTypeEnumTemp = Arrays.stream(ProblemTypeEnum.values()) + .filter(problemTypeEnum -> problemTypeEnum.getCode().equals(code)) + .findAny() + .orElse(PLAN); + return problemTypeEnumTemp.getName(); + } } diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/leaflet/WarningLeaflet.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/leaflet/WarningLeaflet.java index a2f462f46..bdd2be140 100644 --- a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/leaflet/WarningLeaflet.java +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/po/leaflet/WarningLeaflet.java @@ -38,6 +38,11 @@ public class WarningLeaflet extends BaseEntity implements Serializable{ */ private String leafletNo; + /** + * 负责单位id + */ + private String deptId; + /** * 1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标 */ diff --git a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/leaflet/WarningLeafletVO.java b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/leaflet/WarningLeafletVO.java index 13903343a..96ea4311b 100644 --- a/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/leaflet/WarningLeafletVO.java +++ b/pqs-supervision/supervision-api/src/main/java/com/njcn/supervision/pojo/vo/leaflet/WarningLeafletVO.java @@ -33,6 +33,16 @@ public class WarningLeafletVO extends BaseEntity implements Serializable{ */ private String leafletNo; + /** + * 负责单位id + */ + private String deptId; + + /** + * 负责单位 + */ + private String deptName; + /** * 1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标 */ diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/BusinessCommonController.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/BusinessCommonController.java index 2a58265e9..f0f93f8a2 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/BusinessCommonController.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/BusinessCommonController.java @@ -1,6 +1,7 @@ package com.njcn.supervision.controller; import cn.hutool.extra.spring.SpringUtil; +import com.njcn.bpm.pojo.dto.BpmInstanceInfo; import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.enums.common.LogEnum; import com.njcn.common.pojo.enums.response.CommonResponseEnum; @@ -40,6 +41,17 @@ public class BusinessCommonController extends BaseController { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } + @ApiIgnore + @GetMapping("/getInstanceInfo") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("获取业务数据") + public HttpResult getInstanceInfo(String processKey,String businessId) { + String methodDescribe = getMethodDescribe("getInstanceInfo"); + IBpmService iBpmService = getBpmServiceByBusinessKey(processKey); + BpmInstanceInfo instanceInfo = iBpmService.getInstanceInfo(businessId); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, instanceInfo, methodDescribe); + } + /** * 根据业务流key获取实现类对象 * @param processKey 业务流key diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/plan/SupervisionPlanController.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/plan/SupervisionPlanController.java index 4a8899a8f..65a8ae001 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/plan/SupervisionPlanController.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/controller/plan/SupervisionPlanController.java @@ -95,6 +95,8 @@ public class SupervisionPlanController extends BaseController { supervisionPlanPOService.updateProcessStatus(businessKey,status); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } + + @Deprecated @OperateInfo(info = LogEnum.BUSINESS_COMMON) @GetMapping("/initiateWarningLeaflet") @ApiOperation("针对技术监督问题发起告警单") diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/device/mapping/SupervisionTempLineRunTestMapper.xml b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/device/mapping/SupervisionTempLineRunTestMapper.xml index 4bbe6a813..598042cc7 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/device/mapping/SupervisionTempLineRunTestMapper.xml +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/mapper/device/mapping/SupervisionTempLineRunTestMapper.xml @@ -13,6 +13,7 @@ supervision_temp_line_report.line_name lineName, supervision_temp_line_debug.reason reason, supervision_temp_line_run_test.process_instance_id process_instanceId, + supervision_temp_line_run_test.history_instance_id historyInstanceId, supervision_temp_line_run_test.`status` `Status`, IFNULL(supervision_temp_line_run_test.`test_run_state`,0) `testRunState`, supervision_temp_line_run_test.test_run_time, diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/CheckDeviceServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/CheckDeviceServiceImpl.java index 2d243418d..7c3f50353 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/CheckDeviceServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/device/impl/CheckDeviceServiceImpl.java @@ -1,6 +1,7 @@ package com.njcn.supervision.service.device.impl; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.text.StrPool; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -9,6 +10,7 @@ import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; import com.njcn.bpm.api.BpmProcessFeignClient; import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum; import com.njcn.bpm.enums.BpmTaskStatusEnum; +import com.njcn.bpm.pojo.dto.BpmInstanceInfo; import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO; import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; import com.njcn.db.constant.DbConstant; @@ -79,7 +81,7 @@ public class CheckDeviceServiceImpl extends MppServiceImpl { /** * 创建预告警单,此时还没有走流程,等待用户上传反馈单后,才正式进入工作流阶段 * name:预告警单名称,此处暂时用普测计划名称+变电站名称组成预告警单名 + * deptId:预告警单名称,负责单位id * code:预告警编号暂时随机by yxb * id:对应问题源id,用于查询详细数据 - * problemType:问题类型:1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标,此处是现场测试超标 + * problemType:问题类型:1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标,参考枚举:ProblemTypeEnum * leaflet:单子类型:1:预警单;2:告警单 * issueDetail:问题详细描述 */ - void createLeaflet(String name, String code, String id, Integer problemType, Integer leaflet,String issueDetail); + void createLeaflet(String name, String deptId, String code, String id, Integer problemType, Integer leaflet, String issueDetail); Page alarmPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam); diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/impl/WarningLeafletServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/impl/WarningLeafletServiceImpl.java index 7c94a2591..a67d3f836 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/impl/WarningLeafletServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/leaflet/impl/WarningLeafletServiceImpl.java @@ -6,6 +6,7 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.text.StrPool; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.IdWorker; @@ -14,6 +15,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.njcn.bpm.api.BpmProcessFeignClient; import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum; import com.njcn.bpm.enums.BpmTaskStatusEnum; +import com.njcn.bpm.pojo.dto.BpmInstanceInfo; import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO; import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; import com.njcn.common.pojo.enums.common.DataStateEnum; @@ -29,6 +31,7 @@ import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport; import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet; import com.njcn.supervision.pojo.po.survey.SupervisionGeneralSurveyPlanPO; import com.njcn.supervision.pojo.po.survey.SurveyTest; +import com.njcn.supervision.pojo.vo.device.CheckDeviceVo; import com.njcn.supervision.pojo.vo.leaflet.WarningLeafletVO; import com.njcn.supervision.service.leaflet.IWarningLeafletService; import com.njcn.supervision.service.survey.ISurveyTestService; @@ -66,11 +69,11 @@ import java.util.stream.Collectors; @Service public class WarningLeafletServiceImpl extends ServiceImpl implements IWarningLeafletService { @Resource - private UserFeignClient userFeignClient; + private UserFeignClient userFeignClient; @Resource - private DicDataFeignClient dicDataFeignClient; + private DicDataFeignClient dicDataFeignClient; @Resource - private BpmProcessFeignClient bpmProcessFeignClient; + private BpmProcessFeignClient bpmProcessFeignClient; @Resource private ISurveyTestService surveyTestService; @@ -79,20 +82,16 @@ public class WarningLeafletServiceImpl extends ServiceImpl colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData(); warningLeafletVOQueryWrapper.in("supervision_warning_leaflet.Create_By", colleaguesIds) - .eq("supervision_warning_leaflet.state",DataStateEnum.ENABLE.getCode()) + .eq("supervision_warning_leaflet.state", DataStateEnum.ENABLE.getCode()) .eq("supervision_warning_leaflet.leaflet_type", LeafletTypeEnum.WARNING.getCode()) .orderByDesc("supervision_warning_leaflet.Update_Time"); Page warningLeafletVOPage = this.baseMapper.warningPageData(new Page<>(PageFactory.getPageNum(warningLeafletQueryParam), PageFactory.getPageSize(warningLeafletQueryParam)), warningLeafletVOQueryWrapper); @@ -124,13 +123,13 @@ public class WarningLeafletServiceImpl extends ServiceImpl warningLeafletVOPage) { - if(CollUtil.isNotEmpty(warningLeafletVOPage.getRecords())){ + if (CollUtil.isNotEmpty(warningLeafletVOPage.getRecords())) { List deptIds = warningLeafletVOPage.getRecords().stream().distinct().map(WarningLeafletVO::getDutyOrgId).collect(Collectors.toList()); - if(CollUtil.isNotEmpty(deptIds)){ + if (CollUtil.isNotEmpty(deptIds)) { List data = deptFeignClient.getDeptInfoListByIds(deptIds).getData(); Map deptMap = data.stream().collect(Collectors.toMap(Dept::getId, Dept::getName)); warningLeafletVOPage.getRecords().stream().peek(x -> { - if(deptMap.containsKey(x.getDutyOrgId())){ + if (deptMap.containsKey(x.getDutyOrgId())) { x.setDutyOrgName(deptMap.get(x.getDutyOrgId())); } }); @@ -163,13 +162,13 @@ public class WarningLeafletServiceImpl extends ServiceImpl alarmPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam) { QueryWrapper warningLeafletVOQueryWrapper = new QueryWrapper<>(); @@ -221,27 +245,27 @@ public class WarningLeafletServiceImpl extends ServiceImpl colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData(); warningLeafletVOQueryWrapper.in("supervision_warning_leaflet.Create_By", colleaguesIds) - .eq("supervision_warning_leaflet.state",DataStateEnum.ENABLE.getCode()) + .eq("supervision_warning_leaflet.state", DataStateEnum.ENABLE.getCode()) .eq("supervision_warning_leaflet.leaflet_type", LeafletTypeEnum.ALARM.getCode()) - .eq(Objects.nonNull(warningLeafletQueryParam.getStatus()),"supervision_warning_leaflet.status",warningLeafletQueryParam.getStatus()) + .eq(Objects.nonNull(warningLeafletQueryParam.getStatus()), "supervision_warning_leaflet.status", warningLeafletQueryParam.getStatus()) .orderByDesc("supervision_warning_leaflet.Update_Time"); Page warningLeafletVOPage = this.baseMapper.alarmPageData(new Page<>(PageFactory.getPageNum(warningLeafletQueryParam), PageFactory.getPageSize(warningLeafletQueryParam)), warningLeafletVOQueryWrapper); //目前仅知道现场测试超标会有附件 List records = warningLeafletVOPage.getRecords(); - if(CollectionUtil.isNotEmpty(records)){ + if (CollectionUtil.isNotEmpty(records)) { List deptIds = records.stream().distinct().map(WarningLeafletVO::getDutyOrgId).collect(Collectors.toList()); Map deptMap = new HashMap<>(); - if(CollUtil.isNotEmpty(deptIds)){ + if (CollUtil.isNotEmpty(deptIds)) { List data = deptFeignClient.getDeptInfoListByIds(deptIds).getData(); deptMap.putAll(data.stream().collect(Collectors.toMap(Dept::getId, Dept::getName))); } for (WarningLeafletVO record : records) { - if(record.getProblemType().equals(ProblemTypeEnum.SITE_TEST.getCode()) && StrUtil.isNotBlank(record.getProblemId())){ + if (record.getProblemType().equals(ProblemTypeEnum.SITE_TEST.getCode()) && StrUtil.isNotBlank(record.getProblemId())) { //查询到现场测试超标附件地址 SurveyTest surveyTest = surveyTestService.getById(record.getProblemId()); record.setProblemPath(surveyTest.getTestReport()); } - if(deptMap.containsKey(record.getDutyOrgId())){ + if (deptMap.containsKey(record.getDutyOrgId())) { record.setDutyOrgName(deptMap.get(record.getDutyOrgId())); } } @@ -251,21 +275,21 @@ public class WarningLeafletServiceImpl extends ServiceImpl list = this.lambdaQuery().eq(WarningLeaflet::getIssueDetail, info).list(); - if(CollectionUtil.isNotEmpty(list)){ - throw new BusinessException("该预/告警单以发布"); - } - this.createLeaflet( - rMpPartHarmonicDetailDTO.getMeasurementPointName(), - IdWorker.get32UUID(), - rMpPartHarmonicDetailDTO.getMeasurementPointId(), - ProblemTypeEnum.ONLINE.getCode(), - Objects.equals(rMpPartHarmonicDetailDTO.getAlarmFlag(),1) ? LeafletTypeEnum.ALARM.getCode(): LeafletTypeEnum.WARNING.getCode(), - assembleOverLimitInfo(rMpPartHarmonicDetailDTO) - ); +// //组装预警告警信息 +// String info = assembleOverLimitInfo(rMpPartHarmonicDetailDTO); +// //检查是否存在该预警单 +// List list = this.lambdaQuery().eq(WarningLeaflet::getIssueDetail, info).list(); +// if(CollectionUtil.isNotEmpty(list)){ +// throw new BusinessException("该预/告警单已发布"); +// } +// this.createLeaflet( +// rMpPartHarmonicDetailDTO.getMeasurementPointName(), +// IdWorker.get32UUID(), +// rMpPartHarmonicDetailDTO.getMeasurementPointId(), +// ProblemTypeEnum.ONLINE.getCode(), +// Objects.equals(rMpPartHarmonicDetailDTO.getAlarmFlag(),1) ? LeafletTypeEnum.ALARM.getCode(): LeafletTypeEnum.WARNING.getCode(), +// assembleOverLimitInfo(rMpPartHarmonicDetailDTO) +// ); return null; } @@ -276,7 +300,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl steadyStatis = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INDICATOR_TYPE.getCode()).getData(); List harmonicTypes = steadyStatis.stream().filter(temp -> rMpPartHarmonicDetailDTO.getHarmonicTypes().contains(temp.getId())).map(DictData::getName).collect(Collectors.toList()); - info= "预警/告警单类型:"+ "监测点超标"+leafletType+" "+ - "预警/告警单生成时间:"+ LocalDateTimeUtil.format(LocalDate.now(), DatePattern.CHINESE_DATE_PATTERN)+"\n"+ - "超标电站名称:" +rMpPartHarmonicDetailDTO.getSustationName()+" "+"超标母线名称:" +rMpPartHarmonicDetailDTO.getBarName()+" "+"超标监测点名称:" +rMpPartHarmonicDetailDTO.getMeasurementPointName()+"\n"+ - "统计超标指标:" +String.join(",",harmonicTypes)+"\n"+ - "当月累计超标天数:" +rMpPartHarmonicDetailDTO.getOverLimitDay()+"天"+" "+ "当月累计连续天数:" +rMpPartHarmonicDetailDTO.getOverLimitContinuous()+"天"+"\n"+ - "超标天数详情:"+rMpPartHarmonicDetailDTO.getDateList(); + info = "预警/告警单类型:" + "监测点超标" + leafletType + " " + + "预警/告警单生成时间:" + LocalDateTimeUtil.format(LocalDate.now(), DatePattern.CHINESE_DATE_PATTERN) + "\n" + + "超标电站名称:" + rMpPartHarmonicDetailDTO.getSustationName() + " " + "超标母线名称:" + rMpPartHarmonicDetailDTO.getBarName() + " " + "超标监测点名称:" + rMpPartHarmonicDetailDTO.getMeasurementPointName() + "\n" + + "统计超标指标:" + String.join(",", harmonicTypes) + "\n" + + "当月累计超标天数:" + rMpPartHarmonicDetailDTO.getOverLimitDay() + "天" + " " + "当月累计连续天数:" + rMpPartHarmonicDetailDTO.getOverLimitContinuous() + "天" + "\n" + + "超标天数详情:" + rMpPartHarmonicDetailDTO.getDateList(); log.warn(info); return info; diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/plan/SupervisionPlanPOService.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/plan/SupervisionPlanPOService.java index 2bd7d6b49..43d57440b 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/plan/SupervisionPlanPOService.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/plan/SupervisionPlanPOService.java @@ -27,6 +27,7 @@ public interface SupervisionPlanPOService extends IBpmService SupervisionPlanVO getDetailPlan(String id); + @Deprecated void initiateWarningLeaflet(String id); String cancelSuperPlan(BpmProcessInstanceCancelParam cancelReqVO); diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/plan/impl/SupervisionPlanPOServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/plan/impl/SupervisionPlanPOServiceImpl.java index 47bdde5a2..5002f17c6 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/plan/impl/SupervisionPlanPOServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/plan/impl/SupervisionPlanPOServiceImpl.java @@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.njcn.bpm.api.BpmProcessFeignClient; import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum; import com.njcn.bpm.enums.BpmTaskStatusEnum; +import com.njcn.bpm.pojo.dto.BpmInstanceInfo; import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO; import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; import com.njcn.common.pojo.enums.common.DataStateEnum; @@ -377,33 +378,39 @@ public class SupervisionPlanPOServiceImpl extends ServiceImpl list = supervisionProblemPOService.lambdaQuery().eq(SupervisionProblemPO::getPlanId, id).list(); - - SupervisionPlanPO byId = this.getById(id); - if(byId.getStatus()!=2){ - throw new BusinessException("该计划未审核通过无法发送预告警单"); - } - /* - * 1、预告警单名称,此处暂时用计算监督计划名称 - * 2、预告警编号暂时随机by yxb - * 3、问题类型:1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标,此处是现场测试超标 - * 4、对应问题源id,用于查询详细数据 - * 5、单子类型:1:预警单;2:告警单 - * 6、问题详细描述 - * */ - warningLeafletService.createLeaflet( - byId.getWorkPlanName(), - IdWorker.get32UUID(), - id, - ProblemTypeEnum.PLAN.getCode(), - LeafletTypeEnum.ALARM.getCode(), - assembleIssueDetail(list,byId) - ); - //将当前的问题记录是否告警修改为已告警 - this.lambdaUpdate().eq(SupervisionPlanPO::getPlanId,id).set(SupervisionPlanPO::getIsUploadHead,1).update(); +// //获取数据源用于组装数据 +// List list = supervisionProblemPOService.lambdaQuery().eq(SupervisionProblemPO::getPlanId, id).list(); +// +// SupervisionPlanPO byId = this.getById(id); +// if(byId.getStatus()!=2){ +// throw new BusinessException("该计划未审核通过无法发送预告警单"); +// } +// /* +// * 1、预告警单名称,此处暂时用计算监督计划名称 +// * 2、预告警编号暂时随机by yxb +// * 3、问题类型:1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标,此处是现场测试超标 +// * 4、对应问题源id,用于查询详细数据 +// * 5、单子类型:1:预警单;2:告警单 +// * 6、问题详细描述 +// * */ +// warningLeafletService.createLeaflet( +// byId.getWorkPlanName(), +// IdWorker.get32UUID(), +// id, +// ProblemTypeEnum.PLAN.getCode(), +// LeafletTypeEnum.ALARM.getCode(), +// assembleIssueDetail(list,byId) +// ); +// //将当前的问题记录是否告警修改为已告警 +// this.lambdaUpdate().eq(SupervisionPlanPO::getPlanId,id).set(SupervisionPlanPO::getIsUploadHead,1).update(); } diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/problem/impl/SupervisionUserComplaintPOServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/problem/impl/SupervisionUserComplaintPOServiceImpl.java index a3a84d15a..effbfe7e2 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/problem/impl/SupervisionUserComplaintPOServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/problem/impl/SupervisionUserComplaintPOServiceImpl.java @@ -75,9 +75,9 @@ public class SupervisionUserComplaintPOServiceImpl extends ServiceImpl implements SupervisionGeneralSurveyPlanPOService { /** @@ -320,6 +322,11 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl detailPOLambdaQueryWrapper = new LambdaQueryWrapper<>(); - detailPOLambdaQueryWrapper.eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, id) - .eq(SupervisionGeneralSurveyPlanDetailPO::getSubId, subId); - SupervisionGeneralSurveyPlanDetailPO detailPlan = supervisionGeneralSurveyPlanDetailPOService.getOne(detailPOLambdaQueryWrapper); - SupervisionGeneralSurveyPlanPO generalSurveyPlan = this.getById(id); - /* - * 1、预告警单名称,此处暂时用普测计划名称+变电站名称组成预告警单名 - * 2、预告警编号暂时随机by yxb - * 3、问题类型:1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标,此处是现场测试超标 - * 4、对应问题源id,用于查询详细数据 - * 5、单子类型:1:预警单;2:告警单 - * 6、问题详细描述 - * */ - warningLeafletService.createLeaflet( - generalSurveyPlan.getPlanName().concat(StrPool.UNDERLINE).concat(detailPlan.getSubName()), - IdWorker.get32UUID(), - id, - ProblemTypeEnum.SITE_TEST.getCode(), - LeafletTypeEnum.ALARM.getCode(), - assembleIssueDetail(detailPlan,generalSurveyPlan) - ); - //将当前的问题记录是否告警修改为已告警 - LambdaUpdateWrapper detailPOLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); - detailPOLambdaUpdateWrapper.set(SupervisionGeneralSurveyPlanDetailPO::getInitiateWarningFlag, 1) - .eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, id) - .eq(SupervisionGeneralSurveyPlanDetailPO::getSubId, subId); - supervisionGeneralSurveyPlanDetailPOService.update(detailPOLambdaUpdateWrapper); +// //获取数据源用于组装数据 +// LambdaQueryWrapper detailPOLambdaQueryWrapper = new LambdaQueryWrapper<>(); +// detailPOLambdaQueryWrapper.eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, id) +// .eq(SupervisionGeneralSurveyPlanDetailPO::getSubId, subId); +// SupervisionGeneralSurveyPlanDetailPO detailPlan = supervisionGeneralSurveyPlanDetailPOService.getOne(detailPOLambdaQueryWrapper); +// SupervisionGeneralSurveyPlanPO generalSurveyPlan = this.getById(id); +// /* +// * 1、预告警单名称,此处暂时用普测计划名称+变电站名称组成预告警单名 +// * 2、预告警编号暂时随机by yxb +// * 3、问题类型:1:技术监督管理;2:在线监测超标问题;3:用户投诉;4:现场测试超标,此处是现场测试超标 +// * 4、对应问题源id,用于查询详细数据 +// * 5、单子类型:1:预警单;2:告警单 +// * 6、问题详细描述 +// * */ +// warningLeafletService.createLeaflet( +// generalSurveyPlan.getPlanName().concat(StrPool.UNDERLINE).concat(detailPlan.getSubName()), +// IdWorker.get32UUID(), +// id, +// ProblemTypeEnum.SITE_TEST.getCode(), +// LeafletTypeEnum.ALARM.getCode(), +// assembleIssueDetail(detailPlan,generalSurveyPlan) +// ); +// //将当前的问题记录是否告警修改为已告警 +// LambdaUpdateWrapper detailPOLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); +// detailPOLambdaUpdateWrapper.set(SupervisionGeneralSurveyPlanDetailPO::getInitiateWarningFlag, 1) +// .eq(SupervisionGeneralSurveyPlanDetailPO::getPlanNo, id) +// .eq(SupervisionGeneralSurveyPlanDetailPO::getSubId, subId); +// supervisionGeneralSurveyPlanDetailPOService.update(detailPOLambdaUpdateWrapper); } /** diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyPlanServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyPlanServiceImpl.java index ec18a0987..1c31d7d98 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyPlanServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/survey/impl/SurveyPlanServiceImpl.java @@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.njcn.bpm.api.BpmProcessFeignClient; import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum; import com.njcn.bpm.enums.BpmTaskStatusEnum; +import com.njcn.bpm.pojo.dto.BpmInstanceInfo; import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO; import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; import com.njcn.common.pojo.enums.common.DataStateEnum; @@ -23,11 +24,14 @@ import com.njcn.supervision.mapper.survey.SurveyPlanMapper; import com.njcn.supervision.pojo.param.survey.SurveyPlanParam; import com.njcn.supervision.pojo.po.survey.SurveyPlan; import com.njcn.supervision.pojo.po.survey.SurveyTest; +import com.njcn.supervision.pojo.vo.device.CheckDeviceVo; import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO; import com.njcn.supervision.pojo.vo.survey.SurveySubstation; import com.njcn.supervision.service.survey.ISurveyPlanService; import com.njcn.supervision.service.survey.ISurveyTestService; import com.njcn.supervision.utils.InstanceUtil; +import com.njcn.system.api.DicDataFeignClient; +import com.njcn.system.pojo.po.DictData; import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.UserFeignClient; import com.njcn.web.factory.PageFactory; @@ -52,19 +56,22 @@ import java.util.*; public class SurveyPlanServiceImpl extends ServiceImpl implements ISurveyPlanService { @Resource - private UserFeignClient userFeignClient; + private UserFeignClient userFeignClient; @Resource - private BpmProcessFeignClient bpmProcessFeignClient; + private BpmProcessFeignClient bpmProcessFeignClient; @Resource - private DeptFeignClient deptFeignClient; + private DeptFeignClient deptFeignClient; @Resource - private LineFeignClient lineFeignClient; + private LineFeignClient lineFeignClient; @Resource - private ISurveyTestService surveyTestService; + private ISurveyTestService surveyTestService; + + @Resource + private DicDataFeignClient dicDataFeignClient; @Override @@ -194,9 +201,9 @@ public class SurveyPlanServiceImpl extends ServiceImpl surveyTestPage(SurveyTestParam.SurveyTestQueryParam surveyTestQueryParam) { @@ -259,6 +265,31 @@ public class SurveyTestServiceImpl extends ServiceImpl().lambda().set(UserReportNormalPO::getStatus,status).eq(UserReportNormalPO::getId,businessKey)); } + @Override + public BpmInstanceInfo getInstanceInfo(String businessId) { + BpmInstanceInfo bpmInstanceInfo = new BpmInstanceInfo(); + UserReportVO.UserReportGoNetVO userReportGoNet = this.userReportGoNetById(businessId); + bpmInstanceInfo.setHistoryInstanceId(userReportGoNet.getHistoryInstanceId()); + bpmInstanceInfo.setInstanceSign(userReportGoNet.getProjectName()); + return bpmInstanceInfo; + } + @Override public String cancelUserReport(BpmProcessInstanceCancelParam cancelReqVO) { //准备取消该流程,需要远程调用接口 diff --git a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/impl/UserReportPOServiceImpl.java b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/impl/UserReportPOServiceImpl.java index 5db8bd49e..bd4f000e5 100644 --- a/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/impl/UserReportPOServiceImpl.java +++ b/pqs-supervision/supervision-boot/src/main/java/com/njcn/supervision/service/user/impl/UserReportPOServiceImpl.java @@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.njcn.bpm.api.BpmProcessFeignClient; import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum; import com.njcn.bpm.enums.BpmTaskStatusEnum; +import com.njcn.bpm.pojo.dto.BpmInstanceInfo; import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO; import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; import com.njcn.common.pojo.enums.common.DataStateEnum; @@ -36,6 +37,7 @@ import com.njcn.supervision.pojo.po.user.UserReportPO; import com.njcn.supervision.pojo.po.user.UserReportProjectPO; import com.njcn.supervision.pojo.po.user.UserReportSensitivePO; import com.njcn.supervision.pojo.po.user.UserReportSubstationPO; +import com.njcn.supervision.pojo.vo.survey.SurveyPlanVO; import com.njcn.supervision.pojo.vo.user.UserReportVO; import com.njcn.supervision.service.user.UserReportPOService; import com.njcn.supervision.service.user.UserReportProjectPOService; @@ -331,6 +333,15 @@ public class UserReportPOServiceImpl extends ServiceImpl getUserReportList() { String deptIndex = RequestUtil.getDeptIndex();