a8f11427 张雷

危险作业人流程修改

1 个父辈 3021dd21
...@@ -10,6 +10,8 @@ import com.skua.core.util.ConvertUtils; ...@@ -10,6 +10,8 @@ import com.skua.core.util.ConvertUtils;
10 import com.skua.modules.emergency.entity.DangerousOperation; 10 import com.skua.modules.emergency.entity.DangerousOperation;
11 import com.skua.modules.emergency.service.IDangerousOperationService; 11 import com.skua.modules.emergency.service.IDangerousOperationService;
12 import com.skua.modules.flow.business.service.FlowBusinessService; 12 import com.skua.modules.flow.business.service.FlowBusinessService;
13 import com.skua.modules.flow.business.service.IFlowService;
14 import com.skua.modules.flow.core.constant.ProcessConstant;
13 import com.skua.modules.flow.core.entity.FlowAssemblyEntity; 15 import com.skua.modules.flow.core.entity.FlowAssemblyEntity;
14 import com.skua.modules.system.vo.UserCertificate; 16 import com.skua.modules.system.vo.UserCertificate;
15 import com.skua.tool.util.BeanExtUtils; 17 import com.skua.tool.util.BeanExtUtils;
...@@ -34,7 +36,8 @@ import java.util.stream.Collectors; ...@@ -34,7 +36,8 @@ import java.util.stream.Collectors;
34 public class DangerousOperationController { 36 public class DangerousOperationController {
35 @Autowired 37 @Autowired
36 private IDangerousOperationService dangerousOperationService; 38 private IDangerousOperationService dangerousOperationService;
37 39 @Autowired
40 private IFlowService flowService;
38 @Autowired 41 @Autowired
39 private FlowBusinessService flowBusinessService; 42 private FlowBusinessService flowBusinessService;
40 /** 43 /**
...@@ -222,24 +225,21 @@ public class DangerousOperationController { ...@@ -222,24 +225,21 @@ public class DangerousOperationController {
222 return Result.ok("删除成功!"); 225 return Result.ok("删除成功!");
223 } 226 }
224 227
228 //
225 @PostMapping(value = "/complete-task-choose-user-pass") 229 @PostMapping(value = "/complete-task-choose-user-pass")
226 public Result<?> completeTaskChooseUserPass(@RequestBody DangerousOperation dangerousOperation) throws Exception { 230 public Result<?> completeTaskChooseUserPass(@RequestBody DangerousOperation dangerousOperation) throws Exception {
227 Result<?> result = new Result(); 231 Result<?> result = new Result();
228 FlowAssemblyEntity flowAssemblyEntity = BeanExtUtils.bean2Bean(dangerousOperation, FlowAssemblyEntity.class); 232 //流程执行id
229 if (org.apache.commons.lang.StringUtils.isEmpty(flowAssemblyEntity.getAssemblyKey())) { 233 String executionId = dangerousOperation.getFlow().getExecutionId();
230 //AssemblyKey对应参数用户id
231 flowAssemblyEntity.setAssemblyKey("");
232 }
233 String activeResult = this.flowBusinessService.completeTaskChooseUserPass(flowAssemblyEntity);
234 if ("noChooseUser".equals(activeResult)) {
235 result.error500("未指定下一节点用户!");
236 } else if ("fail".equals(activeResult)) {
237 result.error500("程序异常,流程审批失败!");
238 } else {
239 DangerousOperation dangerOperation = BeanExtUtils.bean2Bean(dangerousOperation, DangerousOperation.class); 234 DangerousOperation dangerOperation = BeanExtUtils.bean2Bean(dangerousOperation, DangerousOperation.class);
240 dangerousOperationService.updateById(dangerOperation); 235 dangerousOperationService.updateById(dangerOperation);
236 //流程进入下一节点,并行网关设置判定条件
237 Map<String, Object> mapVariable = new HashMap<String,Object>();
238 mapVariable.put("dangerDeal", "taskUser_"+dangerousOperation.getOperationUser());
239 flowService.configureVariables(executionId, mapVariable);
240 //动态设置流程接修人
241 flowBusinessService.completeTask(ProcessConstant.PASS_KEY, dangerousOperation.getFlow());
241 result.success("成功"); 242 result.success("成功");
242 }
243 return result; 243 return result;
244 } 244 }
245 245
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!