fix:被驳回的报告重新发起流程
This commit is contained in:
@@ -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<List<BpmTaskRespDTO>> taskRet = bpmTaskApi.getTaskListByProcessInstanceId(flowInsId);
|
||||
List<BpmTaskRespDTO> 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<Boolean> 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)){
|
||||
//作废
|
||||
|
||||
@@ -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 {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user