| | |
| | | import com.ycl.common.enums.business.TaskStatusEnum; |
| | | import com.ycl.common.exception.CustomException; |
| | | import com.ycl.common.utils.SecurityUtils; |
| | | import com.ycl.constant.ProjectConstant; |
| | | import com.ycl.domain.dto.FlowCommentDto; |
| | | import com.ycl.domain.dto.FlowNextDto; |
| | | import com.ycl.domain.dto.FlowTaskDto; |
| | |
| | | import org.flowable.task.api.history.HistoricTaskInstance; |
| | | import org.flowable.task.api.history.HistoricTaskInstanceQuery; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.ApplicationEventPublisher; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private final ProcessLogService processLogService; |
| | | private final ApplicationEventPublisher publisher; |
| | | private final ProjectProcessMapper projectProcessMapper; |
| | | |
| | | @Value("${targetIp}") |
| | | private String targetIp; |
| | | |
| | | /** |
| | | * 完成审核任务 |
| | |
| | | taskName, |
| | | processDefId, |
| | | taskDefKey, |
| | | Boolean.TRUE, Boolean.TRUE); |
| | | Boolean.TRUE, Boolean.FALSE); |
| | | // 判断前置任务是不是和当前任务为同一个executeId |
| | | // 判断当前任务是否被挂起中 |
| | | String finalProcessInsId = processInsId; |
| | |
| | | // 处理每个表单的数据 |
| | | for (FormDetailVO formDetailVO : beforeNodes) { |
| | | if (formDetailVO.getCurrent() && !currentNeedData) { |
| | | // 当前节点的表单也要处理ip问题 |
| | | continue; // 跳过当前节点,因为当前节点在获取前置节点时已经设置过了(但表单数据没有给) |
| | | } |
| | | |
| | |
| | | |
| | | if(CollectionUtils.isNotEmpty(oldFields)) { |
| | | // 设置已填写的表单为禁用状态 |
| | | if (disableInput) { |
| | | for (JSONObject oldField : oldFields) { |
| | | JSONObject options = oldField.getJSONObject("options"); |
| | | for (JSONObject oldField : oldFields) { |
| | | JSONObject options = oldField.getJSONObject("options"); |
| | | if (disableInput) { |
| | | options.put("disabled", true); |
| | | } |
| | | // 处理文件上传ip问题 |
| | | if ("file-upload".equals(oldField.get("type"))) { |
| | | options.put("uploadURL", String.format("http://%s:10076/common/upload", this.targetIp)); |
| | | } |
| | | } |
| | | |
| | | formJson.put(ProcessConstants.WIDGET_LIST, oldFields); |
| | | newP.put(ProcessConstants.TASK_FORM_KEY, formJson); |
| | | newP.remove(formDetailVO.getBeforeNodeDefId() + "&" + ProcessConstants.TASK_FORM_KEY); |
| | | // 处理已经上传的文件的ip地址 |
| | | for (String s : newP.keySet()) { |
| | | if (ProcessConstants.TASK_FORM_KEY.equals(s)) { |
| | | continue; |
| | | } |
| | | if (s.startsWith("fileupload")) { |
| | | List files = (List) newP.get(s); |
| | | for (Object file : files) { |
| | | LinkedHashMap<String, String> fileMap = (LinkedHashMap<String, String>) file; |
| | | String url = fileMap.get("url"); |
| | | fileMap.put("url", url.replace("42.193.1.25", this.targetIp)); |
| | | } |
| | | } |
| | | } |
| | | formDetailVO.setFormJsonObj(newP); |
| | | } |
| | | // TODO 暂时只处理用户任务上的表单 |
| | | // if (StringUtils.isNotBlank(task.getFormKey())) { |
| | | // SysForm sysForm = sysFormService.selectSysFormById(Long.parseLong(task.getFormKey())); |
| | | // JSONObject data = JSONObject.parseObject(sysForm.getFormContent()); |
| | | // List<JSONObject> newFields = JSON.parseObject(JSON.toJSONString(data.get(ProcessConstants.WIDGET_LIST)), new TypeReference<List<JSONObject>>() { |
| | | // }); |
| | | // // 表单回显时 加入子表单信息到流程变量中 |
| | | // for (JSONObject newField : newFields) { |
| | | // String key = newField.getString("id"); |
| | | // // 处理图片上传组件回显问题 |
| | | // if ("picture-upload".equals(newField.getString("type"))) { |
| | | // parameters.put(key, new ArrayList<>()); |
| | | // } else { |
| | | // parameters.put(key, null); |
| | | // } |
| | | // } |
| | | // oldFields.addAll(newFields); |
| | | // } |
| | | |
| | | } |
| | | } |