| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | private final ISysFormService sysFormService; |
| | | private final TaskCommonService taskCommonService; |
| | | private final ProcessCodingMapper processCodingMapper; |
| | | private final FlowLogService flowLogService; |
| | | private final ProcessLogService processLogService; |
| | | |
| | | /** |
| | | * 完成审核任务 |
| | |
| | | * @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 |
| | |
| | | * |
| | | * @param parameters 根据任务查找出来的参数 |
| | | * @param formKey task自身关联的表单id |
| | | * @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()); |