From 6ccdd59d762953ab77f6917ce4873588764c6cbe Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Mon, 19 Aug 2024 16:07:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E8=A1=A5=E5=81=BF?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AlarmHandleFlowServiceImpl.java | 29 +++++++++++-- .../show/service/impl/AlarmHandleServiceImpl.java | 4 +- .../consumer/StandardWorkTicketConsumer.java | 2 +- .../processflow/feign/CompensateProcessClient.java | 4 +- .../strategy/abstracts/ProcessAbstractService.java | 16 +++---- .../strategy/service/ProcessService.java | 2 +- .../service/impl/AccessPlanV4ServiceImpl.java | 27 ++++++++++-- .../service/impl/AccessTaskV4ServiceImpl.java | 31 +++++++++++--- .../service/impl/DefectCheckServiceImpl.java | 9 ++-- .../operational/duty/feign/DutyRecClient.java | 14 +------ .../duty/service/IImsDutyRecService.java | 3 +- .../duty/service/impl/ImsDutyRecServiceImpl.java | 49 +++++++++++++++++++--- .../operational/src/main/resources/db/3.0.1.sql | 2 + .../risk/service/impl/HazardTaskServiceImpl.java | 34 +++++++++++---- 14 files changed, 167 insertions(+), 59 deletions(-) diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleFlowServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleFlowServiceImpl.java index 700ca5f..2d3090e 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleFlowServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleFlowServiceImpl.java @@ -2,6 +2,8 @@ package com.hnac.hzims.alarm.show.service.impl; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hnac.hzims.alarm.config.constants.AlarmHandleConstant; @@ -13,6 +15,7 @@ import com.hnac.hzims.alarm.show.service.AlarmHandleFlowService; import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.fdp.feign.IFdpDiagnoseClient; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; +import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.log.exception.ServiceException; @@ -63,6 +66,9 @@ public class AlarmHandleFlowServiceImpl extends ServiceImpl() {{ + eq(AlarmHandleFlowEntity::getId, split[1]); + }}); + alarmHandleFlowEntity.setIsNormal(false); + alarmHandleFlowEntity.setProcessInstanceId(processWorkFlowResponse.getTaskId()); + alarmHandleFlowEntity.setRemark(JSONObject.toJSONString(processWorkFlowResponse.getVariables())); + alarmHandleFlowEntity.setCurrentOperator(processWorkFlowResponse.getTaskName()); + alarmHandleFlowEntity.setCurrentLinkHandler(""); + this.baseMapper.updateById(alarmHandleFlowEntity); + log.info("补偿流程消息转换结束"+ processWorkFlowResponse); + return R.success("补偿流程消息保存成功"); + } private void sendMessage(ProcessWorkFlowResponse processWorkFlowResponse, AlarmHandleFlowEntity alarmHandleFlowEntity, Long taskId) { //推送消息 if (processWorkFlowResponse.getTaskId() != null) { diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java index 14f7b9f..769e53e 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java @@ -159,9 +159,9 @@ public class AlarmHandleServiceImpl extends ServiceImpl variables) { - return processService.startFlow(userId,dictValue,taskId,processName,variables); + return processService.startFlow(userId,dictValue,businessKey,processName,variables); } } \ No newline at end of file diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java index 5628704..b7014fb 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java @@ -44,11 +44,11 @@ public abstract class ProcessAbstractService implements ProcessService { private ProcessDictService processDictService; @Override - public R startFlow(String userId, String dictValue, String taskId, String processName, Map variables) { + public R startFlow(String userId, String dictValue, String businessKey, String processName, Map variables) { log.info("开启流程....."); R r = new R(); try { - R result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables); + R result = flowClient.startProcessInstanceContainNameByKey(dictValue, businessKey, processName, variables); r.setSuccess(result.isSuccess()); r.setCode(result.getCode()); r.setMsg(result.getMsg()); @@ -61,7 +61,7 @@ public abstract class ProcessAbstractService implements ProcessService { log.error("开启流程失败:{}",result); log.error("流程信息为{}",variables); r.setData(variables); - pushStartFailMessage(dictValue,taskId,userId,processName,result.getMsg()); + pushStartFailMessage(dictValue,businessKey,userId,processName,result.getMsg()); } return r; }catch (Exception e){ @@ -86,11 +86,11 @@ public abstract class ProcessAbstractService implements ProcessService { // return r; // } - public void pushStartFailMessage(String dictValue,String taskId, String userId, String content,String reason) { + public void pushStartFailMessage(String dictValue,String businessKey, String userId, String content,String reason) { ProcessDict processDict = processDictService.selectDictLabelByKey(dictValue); BusinessMessageFlowDTO message = new BusinessMessageFlowDTO(); // 计划Id - message.setTaskId(taskId); + message.setTaskId(businessKey); message.setBusinessClassify(MessageConstants.BusinessClassifyEnum.BUSINESS.getKey()); message.setBusinessKey(MessageConstants.BusinessClassifyEnum.BUSINESS.getKey()); // 主题 @@ -113,18 +113,18 @@ public abstract class ProcessAbstractService implements ProcessService { } @Override - public void pushFailMessage(String taskId, String proessKey, String content,String reason,String deptId) { + public void pushFailMessage(String businessKey, String proessKey, String content,String reason,String deptId) { ProcessDict processDict = processDictService.selectDictLabelByKey(proessKey); BusinessMessageFlowDTO message = new BusinessMessageFlowDTO(); // BusinessMessageDTO message = new BusinessMessageDTO(); // 计划Id - message.setTaskId(taskId); + message.setTaskId(businessKey); message.setBusinessClassify(MessageConstants.BusinessClassifyEnum.BUSINESS.getKey()); message.setBusinessKey(MessageConstants.BusinessClassifyEnum.BUSINESS.getKey()); // 主题 message.setSubject(MessageConstants.BusinessClassifyEnum.BUSINESS.getDescription()); // 内容 - String res= StringUtil.format("你有一个{}的{}流程流转失败,失败原因为:{}",content, + String res= StringUtil.format("你有一个流程环节为{}的{}流转失败,失败原因为:{}",content, processDict.getDictLabel(), reason); message.setContent(res); message.setTenantId("200000"); diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/service/ProcessService.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/service/ProcessService.java index 6475e19..68ab7f0 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/service/ProcessService.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/service/ProcessService.java @@ -14,7 +14,7 @@ import java.util.Map; */ public interface ProcessService { - R startFlow(String userId, String dictValue, String taskId, String processName, Map variables) ; + R startFlow(String userId, String dictValue, String businessKey, String processName, Map variables) ; void pushFailMessage(String taskId, String proessKey, String content,String reason,String deptId); /** diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java index cc715ff..e2cc2da 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java @@ -121,7 +121,6 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service, StartProces private final TransactionTemplate transactionTemplate; @Override public String saveEntity(String entity) { - transactionTemplate.setTransactionManager(transactionManager); String res = transactionTemplate.execute(status -> { AccessPlanV4DTO accessPlanV4DTO = JSONObject.parseObject(entity, AccessPlanV4DTO.class); @@ -289,8 +288,8 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service, StartProces entity.setNextStepOperator(processWorkFlowResponse.getNextStepOperator()); entity.setIsNormal(true); if(ObjectUtils.isNotEmpty(processWorkFlowResponse.getCode())&&700==processWorkFlowResponse.getCode()){ - entity.setIsNormal(false); - entity.setRemark(JSONObject.toJSONString(processWorkFlowResponse.getVariables())); + handException(processWorkFlowResponse); + return false; } if(ObjectUtil.isNotEmpty(variables.get("examine")) && (Boolean) variables.get("examine")){ entity.setTaskName("流程结束"); @@ -322,7 +321,27 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service, StartProces } return true; } - + private R handException(ProcessWorkFlowResponse processWorkFlowResponse) { + String[] split = processWorkFlowResponse.getBusinessKey().split(":"); + if (StringUtils.isBlank(split[1])){ + log.error("异常消息转换失败,未找到BusinessKey:"+ processWorkFlowResponse); + return R.fail("异常消息处理失败"); + } + OperAccessPlanEntity operAccessPlanEntity = planService.getOne(new LambdaQueryWrapper() {{ + eq(OperAccessPlanEntity::getId, split[1]); + }}); + operAccessPlanEntity.setIsNormal(false); + operAccessPlanEntity.setRemark(JSONObject.toJSONString(processWorkFlowResponse.getVariables())); + operAccessPlanEntity.setTaskName(processWorkFlowResponse.getTaskName()); + operAccessPlanEntity.setProcessInstanceId(processWorkFlowResponse.getTaskId()); + operAccessPlanEntity.setNextStepOperator(""); + boolean flag = planService.updateById(operAccessPlanEntity); + if (!flag){ + log.info("异常状态消息保存失败"+ processWorkFlowResponse); + return R.success("消息保存失败"); + } + return R.fail("消息保存成功"); + } /** * 开启检修任务 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java index 675064c..90ba737 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java @@ -131,7 +131,7 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service, StartProces String.valueOf(accessTaskV4DTO.getId())), accessTaskV4DTO.getName(),variables); log.error("开启检修任务流程失败{}" + result); // 更新任务流程Id - if (200==result.getCode()) { + if (200==result.getCode()&&ObjectUtil.isNotEmpty(result.getData())) { accessTaskV4DTO.setProcessInstanceId(result.getData().toString()); accessTaskV4DTO.setIsNormal(true); taskService.updateById(accessTaskV4DTO); @@ -237,8 +237,8 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service, StartProces AccessTaskV4DTO entity = JSONObject.parseObject(JSONObject.toJSONString(variables), new TypeReference(){}); entity.setIsNormal(true); if(ObjectUtils.isNotEmpty(processWorkFlowResponse.getCode())&&700==processWorkFlowResponse.getCode()){ - entity.setIsNormal(false); - entity.setRemark(JSONObject.toJSONString(processWorkFlowResponse.getVariables())); + handException(processWorkFlowResponse); + return false; } // 当前流程名称 entity.setTaskName(processWorkFlowResponse.getTaskName()); @@ -266,12 +266,31 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service, StartProces String content = "您有一条检修任务待处理/审核,检修任务名称:".concat(entity.getName()) .concat(",当前环节:") .concat(processWorkFlowResponse.getTaskName()); - if(ObjectUtils.isEmpty(processWorkFlowResponse.getCode())||700!=processWorkFlowResponse.getCode()){ - this.sendMessage(entity,processWorkFlowResponse.getUserId(),content); - } + this.sendMessage(entity,processWorkFlowResponse.getUserId(),content); return true; } + private R handException(ProcessWorkFlowResponse processWorkFlowResponse) { + String[] split = processWorkFlowResponse.getBusinessKey().split(":"); + if (StringUtils.isBlank(split[1])){ + log.error("异常消息转换失败,未找到BusinessKey:"+ processWorkFlowResponse); + return R.fail("异常消息处理失败"); + } + OperAccessTaskEntity operAccessTaskEntity = taskService.getOne(new LambdaQueryWrapper() {{ + eq(OperAccessTaskEntity::getId, split[1]); + }}); + operAccessTaskEntity.setIsNormal(false); + operAccessTaskEntity.setRemark(JSONObject.toJSONString(processWorkFlowResponse.getVariables())); + operAccessTaskEntity.setTaskName(processWorkFlowResponse.getTaskName()); + operAccessTaskEntity.setProcessInstanceId(processWorkFlowResponse.getTaskId()); + operAccessTaskEntity.setNextStepOperator(""); + boolean flag = taskService.updateById(operAccessTaskEntity); + if (!flag){ + log.info("异常状态消息保存失败"+ processWorkFlowResponse); + return R.success("消息保存失败"); + } + return R.fail("消息保存成功"); + } /** * 推送业务流程消息 diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java index 51f02c6..1247345 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java @@ -411,17 +411,18 @@ public class DefectCheckServiceImpl extends ServiceImpl() {{ - eq(OperPhenomenonEntity::getCheckProcessInstanceId, split[1]); + eq(OperPhenomenonEntity::getId, split[1]); }}); operPhenomenonEntity.setIsNormal(false); + operPhenomenonEntity.setCheckProcessInstanceId(processWorkFlowResponse.getTaskId()); operPhenomenonEntity.setRemark(JSONObject.toJSONString(processWorkFlowResponse.getVariables())); - operPhenomenonEntity.setCurrentOperator("流程异常"); + operPhenomenonEntity.setCurrentOperator(processWorkFlowResponse.getTaskName()); operPhenomenonEntity.setCurrentLinkHandler(""); this.baseMapper.update(operPhenomenonEntity, new LambdaUpdateWrapper() {{ eq(OperPhenomenonEntity::getDefectCode, operPhenomenonEntity.getDefectCode()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/feign/DutyRecClient.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/feign/DutyRecClient.java index eab7449..7df8870 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/feign/DutyRecClient.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/feign/DutyRecClient.java @@ -32,18 +32,6 @@ public class DutyRecClient implements IDutyRecClient { @Override public R dealDutyRecFlow(ProcessWorkFlowResponse processWorkFlowResponse) { - log.info("operational:duty:rec:dealDutyRecFlow","接受到消息:消息内容为:"+ JSON.toJSONString(processWorkFlowResponse)); - //ImsDutyRecDTO recDTO = BeanUtil.copy(processWorkFlowResponse.getVariables(),ImsDutyRecDTO.class); - ImsDutyRecDTO recDTO = JSONObject.parseObject(JSON.toJSONString(processWorkFlowResponse.getVariables()),ImsDutyRecDTO.class); - Assert.isTrue(ObjectUtil.isNotEmpty(recDTO),() -> { - throw new RuntimeException("未接收到交接班信息!"); - }); - recDTO.setDealChain(processWorkFlowResponse.getTaskName()); - recDTO.setIsNormal(true); - if(ObjectUtils.isNotEmpty(processWorkFlowResponse.getCode())&&700==processWorkFlowResponse.getCode()){ - recDTO.setIsNormal(false); - recDTO.setRemark(JSONObject.toJSONString(processWorkFlowResponse.getVariables())); - } - return R.status(service.dealDutyRecFlow(recDTO)); + return service.dealDutyRecFlow(processWorkFlowResponse); } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyRecService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyRecService.java index a217f4c..1d0461f 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyRecService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyRecService.java @@ -2,6 +2,7 @@ package com.hnac.hzims.operational.duty.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; +import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; import com.hnac.hzims.operational.duty.dto.ChangeShiftsReqDTO; import com.hnac.hzims.operational.duty.dto.ChangeShiftsRspDTO; import com.hnac.hzims.operational.duty.dto.ImsDutyRecDTO; @@ -130,7 +131,7 @@ public interface IImsDutyRecService extends IService { * @param recDTO 交接班信息 * @return */ - Boolean dealDutyRecFlow(ImsDutyRecDTO recDTO); + R dealDutyRecFlow(ProcessWorkFlowResponse processWorkFlowResponse); R getDutyLog(ImsDutyLogEntity imsDutyLogEntity); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java index c88e34e..89284c7 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java @@ -10,10 +10,13 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.common.collect.Lists; import com.hnac.hzims.common.flow.StartProcessService; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.middle.process.feign.ICompensateProcessClient; +import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; import com.hnac.hzims.monitor.utils.DateUtils; import com.hnac.hzims.operational.OperationalConstants; import com.hnac.hzims.operational.access.dto.AccessTaskV4DTO; +import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity; import com.hnac.hzims.operational.defect.constants.TreatMethodConstant; import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity; import com.hnac.hzims.operational.defect.entity.OperDefectStatisticsEntity; @@ -1321,8 +1324,19 @@ public class ImsDutyRecServiceImpl extends ServiceImpl { + throw new RuntimeException("未接收到交接班信息!"); + }); + recDTO.setDealChain(processWorkFlowResponse.getTaskName()); + recDTO.setIsNormal(true); + if(ObjectUtil.isNotEmpty(processWorkFlowResponse.getCode())&&700==processWorkFlowResponse.getCode()){ + handException(processWorkFlowResponse); + + } ImsDutyMainEntity headDutyMain = BeanUtil.copy(recDTO.getHeadDutyMainVo(), ImsDutyMainEntity.class); ImsDutyMainEntity carryDutyMain = BeanUtil.copy(recDTO.getCarryDutyMainVo(), ImsDutyMainEntity.class); if(StringUtil.isBlank(recDTO.getDealChain())) { @@ -1366,13 +1380,36 @@ public class ImsDutyRecServiceImpl extends ServiceImpl() {{ + eq(ImsDutyRecEntity::getId, split[1]); + }}); + imsDutyRecEntity.setIsNormal(false); + imsDutyRecEntity.setRemark(JSONObject.toJSONString(processWorkFlowResponse.getVariables())); + imsDutyRecEntity.setDealChain(processWorkFlowResponse.getTaskName()); + imsDutyRecEntity.setProcessInstanceId(processWorkFlowResponse.getTaskId()); + boolean flag = this.updateById(imsDutyRecEntity); + if (!flag){ + log.info("异常状态消息保存失败"+ processWorkFlowResponse); + return R.success("消息保存失败"); + } + return R.fail("消息保存成功"); + } /** * 计算交接班状态 * @param duty 值班信息 diff --git a/hzims-service/operational/src/main/resources/db/3.0.1.sql b/hzims-service/operational/src/main/resources/db/3.0.1.sql index 0dc314e..9ec9561 100644 --- a/hzims-service/operational/src/main/resources/db/3.0.1.sql +++ b/hzims-service/operational/src/main/resources/db/3.0.1.sql @@ -1,5 +1,7 @@ ALTER TABLE `hzims_oper_phenomenon` MODIFY COLUMN `REMARK` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '冗余字段' ; +ALTER TABLE `hzims_oper_phenomenon` + ADD COLUMN `is_normal` tinyint(2) NULL DEFAULT 1 ; ALTER TABLE `hz_ims_duty_rec` ADD COLUMN `is_normal` tinyint(2) NULL DEFAULT 1 ; ALTER TABLE `hzims_oper_access_task` diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardTaskServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardTaskServiceImpl.java index 7d05dfa..952f6cc 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardTaskServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardTaskServiceImpl.java @@ -3,6 +3,7 @@ package com.hnac.hzims.safeproduct.risk.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -159,7 +160,7 @@ public class HazardTaskServiceImpl extends ServiceImpl variables = (Map) processWorkFlowResponse.getVariables(); + //流程找不到下一个审批人处理 + if(ObjectUtils.isNotEmpty(processWorkFlowResponse.getCode())&&700==processWorkFlowResponse.getCode()){ + handException(processWorkFlowResponse); + log.info("风险排查流程补偿流程处理完毕"); + return false; + } // 对象转换 HazardRiskProcessDTO entity = JSONObject.parseObject(JSONObject.toJSONString(variables), new TypeReference(){}); try{ @@ -238,11 +245,7 @@ public class HazardTaskServiceImpl extends ServiceImpl() {{ + eq(HazardTask::getId, split[1]); + }}); + hazardTask.setIsNormal(false); + hazardTask.setProcessInstanceId(processWorkFlowResponse.getTaskId()); + hazardTask.setRemark(JSONObject.toJSONString(processWorkFlowResponse.getVariables())); + hazardTask.setProcessSteps(processWorkFlowResponse.getTaskName()); + hazardTask.setNextStepOperator(""); + this.baseMapper.updateById(hazardTask); + log.info("补偿流程消息转换结束"+ processWorkFlowResponse); + return R.success("补偿流程消息保存成功"); + } /** * 风险评估变量值流程穿插 * @param processWorkFlowResponse