From 166cb7304fa6c7fa5d3a6d7b53c3892a31dd1edf Mon Sep 17 00:00:00 2001 From: FCL Date: Wed, 5 Nov 2025 17:05:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=A2=AB=E9=A9=B3=E5=9B=9E=E7=9A=84?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E9=87=8D=E6=96=B0=E5=8F=91=E8=B5=B7=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReportDocumentMainServiceImpl.java | 27 ++++++++++++++++++- .../rpc/config/RpcConfiguration.java | 3 ++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java index 627ef64..72be504 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java @@ -9,7 +9,10 @@ import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi; +import com.zt.plat.module.bpm.api.task.BpmTaskApi; import com.zt.plat.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; +import com.zt.plat.module.bpm.api.task.dto.BpmTaskApproveReqDTO; +import com.zt.plat.module.bpm.api.task.dto.BpmTaskRespDTO; import com.zt.plat.module.qms.api.task.BMPCallbackInterface; import com.zt.plat.module.qms.api.task.dto.QmsBpmDTO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataPageReqVO; @@ -57,6 +60,7 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, @Resource private BusinessAssayReportDataService businessAssayReportDataService; @Resource private ReportDocumentDataService reportDocumentDataService; @Resource private BpmProcessInstanceApi bpmProcessInstanceApi; + @Resource private BpmTaskApi bpmTaskApi; @Resource private ReportDocumentMainCorrelationService reportDocumentMainCorrelationService; @Resource private ConfigUserSignatureService configUserSignatureService; /*** @@ -270,6 +274,27 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, String nickName = SecurityFrameworkUtils.getLoginUserNickname(); Long id = param.getId(); ReportDocumentMainDO entity = getReportDocumentMain(id); + String flowInsId = entity.getFlowInstanceId(); + + if(!ObjectUtils.isEmpty(flowInsId)){ + CommonResult> taskRet = bpmTaskApi.getTaskListByProcessInstanceId(flowInsId); + List taskList = taskRet.getData(); + if(taskList.isEmpty()) + throw exception0(ERROR_CODE_MODULE_COMMON, "流程任务查询失败,请联系管理员处理"); + String taskId = taskList.get(taskList.size() - 1).getId(); + //驳回后重新提交 + BpmTaskApproveReqDTO reqVO = new BpmTaskApproveReqDTO(); + reqVO.setId(taskId); + CommonResult result = bpmProcessInstanceApi.approveTask(reqVO); + if(!result.isSuccess()){ + throw exception0(ERROR_CODE_MODULE_COMMON, result.getMsg()); + } + entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS); + reportDocumentMainMapper.updateById(entity); + ReportDocumentMainRespVO respVO = BeanUtils.toBean(entity, ReportDocumentMainRespVO.class); + return CommonResult.success(respVO); + } + JSONObject formData = new JSONObject(); if(entity.getFormData() != null) formData = JSONObject.parseObject(entity.getFormData()); @@ -336,7 +361,7 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, //"RETURN_FLAG_Activity_001": true 标识驳回到发起环节 if(variables.containsKey(returnFlagKey) && variables.getString(returnFlagKey).equals("true")){ //驳回。流程需要配置退回到发起节点 - entity.setFlowStatus(QmsCommonConstant.VOID); + entity.setFlowStatus(QmsCommonConstant.REJECTED); entity.setDocumentSignature(""); }else if("4".equals(PROCESS_STATUS)){ //作废 diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/rpc/config/RpcConfiguration.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/rpc/config/RpcConfiguration.java index 9b670c7..c0a1040 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/rpc/config/RpcConfiguration.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/framework/rpc/config/RpcConfiguration.java @@ -1,6 +1,7 @@ package com.zt.plat.module.qms.framework.rpc.config; import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi; +import com.zt.plat.module.bpm.api.task.BpmTaskApi; import com.zt.plat.module.infra.api.file.FileApi; import com.zt.plat.module.system.api.dept.DeptApi; import com.zt.plat.module.system.api.sequence.SequenceApi; @@ -10,6 +11,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Configuration; @Configuration(value = "qmsRpcConfiguration", proxyBeanMethods = false) -@EnableFeignClients(clients = {FileApi.class, SequenceApi.class, AdminUserApi.class, DeptApi.class, BpmProcessInstanceApi.class}) +@EnableFeignClients(clients = {FileApi.class, SequenceApi.class, AdminUserApi.class, DeptApi.class, BpmProcessInstanceApi.class, BpmTaskApi.class}) public class RpcConfiguration { }