From 7ffa0f92413da168a73394b02e06b760778da05c Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期一, 10 二月 2025 10:08:49 +0800 Subject: [PATCH] 办理期限 --- flowable/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java | 43 +++++++++++-------------------------------- 1 files changed, 11 insertions(+), 32 deletions(-) diff --git a/flowable/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java b/flowable/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java index ca23fe6..e0ff79b 100644 --- a/flowable/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java +++ b/flowable/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java @@ -29,7 +29,7 @@ import com.ycl.flow.FindNextNodeUtil; import com.ycl.flow.FlowableUtils; import com.ycl.mapper.ProcessCodingMapper; -import com.ycl.service.FlowLogService; +import com.ycl.service.ProcessLogService; import com.ycl.service.IFlowTaskService; import com.ycl.service.ISysDeployFormService; import com.ycl.service.ISysFormService; @@ -64,7 +64,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import javax.annotation.Resource; import java.io.InputStream; import java.lang.reflect.Field; import java.nio.charset.StandardCharsets; @@ -94,7 +93,7 @@ private final ISysFormService sysFormService; private final TaskCommonService taskCommonService; private final ProcessCodingMapper processCodingMapper; - private final FlowLogService flowLogService; + private final ProcessLogService processLogService; /** * 瀹屾垚瀹℃牳浠诲姟 @@ -151,15 +150,13 @@ //娣诲姞娴佺▼鍙橀噺 if(!processVariables.isEmpty()) taskService.setVariables(taskId,processVariables); taskService.addComment(taskId, task.getProcessInstanceId(), FlowComment.SUBMIT.getType(), "瀹屾垚鎻愪氦"); -// // 鍒ゆ柇褰撳墠浠诲姟鏄笉鏄浆鍔炶繃鐨� -// Boolean delegation = flowLogService.taskDelegation(task.getProcessInstanceId(), task.getId()); -// if (delegation) { -// taskService.resolveTask(taskId, newV); -// } - // 鍏堣褰撳墠鐢ㄦ埛璁ら杩欎釜浠诲姟 - taskService.claim(taskId, SecurityUtils.getUserId() + ""); - taskService.complete(taskId, newV); - + if (DelegationState.PENDING.equals(task.getDelegationState())) { + taskService.resolveTask(taskId, newV); + } else { + // 鍏堣褰撳墠鐢ㄦ埛璁ら杩欎釜浠诲姟 + taskService.claim(taskId, SecurityUtils.getUserId() + ""); + taskService.complete(taskId, newV); + } return AjaxResult.success("鎻愪氦鎴愬姛"); } @@ -803,7 +800,7 @@ * @return */ @Override - public AjaxResult flowRecord(String procInsId, String deployId) { + public AjaxResult flowRecord(String procInsId) { Map<String, Object> map = new HashMap<String, Object>(); if (StringUtils.isNotBlank(procInsId)) { List<HistoricActivityInstance> list = historyService @@ -1246,31 +1243,13 @@ * * @param parameters 鏍规嵁浠诲姟鏌ユ壘鍑烘潵鐨勫弬鏁� * @param formKey task鑷韩鍏宠仈鐨勮〃鍗昳d - * @param taskName task鑷韩鐨勪换鍔″悕 + * @param taskName 浠诲姟 * @param processDefId 娴佺▼瀹氫箟id * @param processDefKey 娴佺▼瀹炰緥id * @return */ private List<FormDetailVO> getBeforeNodeForm(Map<String, Object> parameters, String formKey, String taskName, String processDefId, String processDefKey, Boolean currentNeedData) { - if (!parameters.keySet().stream().anyMatch(key -> key.contains(ProcessConstants.TASK_FORM_KEY))) { - FormDetailVO formDetailVO = new FormDetailVO(); - formDetailVO.setBeforeNodeName(taskName); - formDetailVO.setCurrent(Boolean.TRUE); - // 濡傛灉鏄┖鐨勶紝浣跨敤formId鍘绘煡 - if (StringUtils.isNotBlank(formKey)) { - SysForm sysForm = sysFormService.selectSysFormById(Long.parseLong(formKey)); - if (Objects.isNull(sysForm)) { - throw new RuntimeException("璇ユ祦绋嬬粦瀹氱殑琛ㄥ崟涓嶅瓨鍦ㄦ垨宸茶鍒犻櫎"); - } - Map<String, Object> data = new HashMap<>(1); - data.put(ProcessConstants.TASK_FORM_KEY, JSONObject.parseObject(sysForm.getFormContent())); - formDetailVO.setFormJsonObj(data); - return Arrays.asList(formDetailVO); - } else { - return Arrays.asList(formDetailVO); - } - } // 杩欓噷鍙渶瑕佹煡鑷韩浠ュ強涓婁竴涓妭鐐�(濡傛灉骞惰鐨勬湁澶氫釜)鐨勮〃鍗曟暟鎹� List<FormDetailVO> beforeNodes = taskCommonService.getBeforeNodeDefInfo(processDefId, processDefKey, sysFormService, Boolean.TRUE); List<String> beforeNodeDefIds = beforeNodes.stream().filter(item -> !item.getCurrent() || currentNeedData).map(FormDetailVO::getBeforeNodeDefId).collect(Collectors.toList()); -- Gitblit v1.8.0