Commit 16eab8bb authored by pchxue's avatar pchxue

迁移问题处理

parent 7988a858
...@@ -161,11 +161,21 @@ public class Constants { ...@@ -161,11 +161,21 @@ public class Constants {
* 关闭 * 关闭
*/ */
public static final String CLOSE = "Close"; public static final String CLOSE = "Close";
/**
* 全部关闭
*/
public static final String CLOSE_ALL = "qbgb";
/** /**
* 已完成 * 已完成
*/ */
public static final String COMPLETED = "completed"; public static final String COMPLETED = "completed";
/**
* 已终止
*/
public static final String STATUS_END = "end";
/** /**
* 未完成 * 未完成
*/ */
......
package com.yonde.dcs.core.constants; package com.yonde.dcs.core.constants;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
...@@ -81,4 +82,42 @@ public final class SignConstants { ...@@ -81,4 +82,42 @@ public final class SignConstants {
* 定义流程路由常量 * 定义流程路由常量
*/ */
public final static List WfRoutingList = Arrays.asList("通过", "提交"); public final static List WfRoutingList = Arrays.asList("通过", "提交");
/**
* 流程 节点名称
*/
public static final HashMap<String, String> SignNodeMap = new HashMap(){{
put("编制", "BKBZ");
put("校对", "BKJD");
put("审定", "BKSD");
put("标检", "BKBJ");
put("数据审核", "BKSJ");
put("管理审核", "BKGL");
put("资料员审核", "BKZL");
put("标审", "BKBS");
put("会签", "BKHQ");
put("工艺室分发辅制会签", "BKFZ");
put("工艺主制会签", "BKZZ");
put("审核", "BKSH");
put("批准", "BKPZ");
put("待审阅", "BKDS");
put("设总签审", "BKSZ");
put("总体室签审", "BKZT");
put("总体室接口工程师签审设总综合检查人", "BKJK");
put("综合检查", "BKZH");
}};
/**
* 流程 节点名称
*/
public static final HashMap<String, String> InterfaceSignNodeMap = new HashMap(){
{
put("审核", "TKSK");
put("提资方设总签审", "TKSZ");
put("提资中", "TKTJ");
put("总体室接口工程师签审", "TKZT");
}};
} }
\ No newline at end of file
...@@ -7,6 +7,7 @@ import com.yonde.dcs.common.vo.ExtInterfaceVO; ...@@ -7,6 +7,7 @@ import com.yonde.dcs.common.vo.ExtInterfaceVO;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO; import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.feign.ExtAutoTaskServiceFeign; import com.yonde.dcs.feign.ExtAutoTaskServiceFeign;
import com.yonde.dcs.plan.common.vo.ExtPlanVO; import com.yonde.dcs.plan.common.vo.ExtPlanVO;
import com.yonde.dex.version.plugin.common.entity.DxIterationVOHolder;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import java.util.Map; import java.util.Map;
...@@ -135,8 +136,8 @@ public interface ExtAutoTaskService extends ExtAutoTaskServiceFeign { ...@@ -135,8 +136,8 @@ public interface ExtAutoTaskService extends ExtAutoTaskServiceFeign {
* @param iterationObject * @param iterationObject
*/ */
// TODO: 2024/7/31 DxIterationVO在4.1不存在 // TODO: xpc DxIterationVO不存在改为DxIterationVOHolder
// void endProcess(DxIterationVO iterationObject); void endProcess(DxIterationVOHolder iterationObject);
/** /**
* 生成过时文件通知单word * 生成过时文件通知单word
......
...@@ -5,20 +5,22 @@ import cn.hutool.core.convert.Convert; ...@@ -5,20 +5,22 @@ import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.extra.spring.SpringUtil; import cn.hutool.extra.spring.SpringUtil;
import cn.hutool.http.ContentType;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yonde.dcs.common.vo.*; import com.yonde.dcs.common.vo.*;
import com.yonde.dcs.core.constants.Constants;
import com.yonde.dcs.core.constants.SignConstants;
import com.yonde.dcs.core.events.DocBeforeCreateEvent;
import com.yonde.dcs.core.events.ProcessDataUtils;
import com.yonde.dcs.core.factory.NCRSCUtils; import com.yonde.dcs.core.factory.NCRSCUtils;
import com.yonde.dcs.core.factory.OutdatedDocNotifyUtils;
import com.yonde.dcs.core.factory.TechnicalFileUtils; import com.yonde.dcs.core.factory.TechnicalFileUtils;
import com.yonde.dcs.core.service.*; import com.yonde.dcs.core.service.*;
import com.yonde.dcs.core.util.ExtDocUtil; import com.yonde.dcs.core.util.*;
import com.yonde.dcs.core.util.ExtWfcUtil;
import com.yonde.dcs.core.util.SearchUtil;
import com.yonde.dcs.core.util.WorkFlowUtil;
import com.yonde.dcs.core.word.ImportWordService; import com.yonde.dcs.core.word.ImportWordService;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO; import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.document.core.service.DocumentService; import com.yonde.dcs.document.core.service.DocumentService;
import com.yonde.dcs.plan.common.constants.Constants;
import com.yonde.dcs.plan.common.utils.FileUtils;
import com.yonde.dcs.plan.common.vo.ExtPlanDocLinkVO; import com.yonde.dcs.plan.common.vo.ExtPlanDocLinkVO;
import com.yonde.dcs.plan.common.vo.ExtPlanVO; import com.yonde.dcs.plan.common.vo.ExtPlanVO;
import com.yonde.dcs.plan.feign.ExtDistributeRecordServiceFeign; import com.yonde.dcs.plan.feign.ExtDistributeRecordServiceFeign;
...@@ -27,8 +29,10 @@ import com.yonde.dcs.plan.feign.ExtPlanServiceFeign; ...@@ -27,8 +29,10 @@ import com.yonde.dcs.plan.feign.ExtPlanServiceFeign;
import com.yonde.dex.basedata.data.search.SearchItem; import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems; import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition; import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.api.CustomMultipartFile;
import com.yonde.dex.basedata.entity.data.DxPageImpl; import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.entity.data.OperatorType; import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.entity.jackson.JsonUtils;
import com.yonde.dex.basedata.exception.DxBusinessException; import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.basedata.utils.obj.DxEntityUtils; import com.yonde.dex.basedata.utils.obj.DxEntityUtils;
import com.yonde.dex.dao.service.util.DxPageUtils; import com.yonde.dex.dao.service.util.DxPageUtils;
...@@ -41,16 +45,20 @@ import com.yonde.dex.user.common.vo.DxUserInfoVO; ...@@ -41,16 +45,20 @@ import com.yonde.dex.user.common.vo.DxUserInfoVO;
import com.yonde.dex.user.feign.DxOrganizationFeign; import com.yonde.dex.user.feign.DxOrganizationFeign;
import com.yonde.dex.user.feign.DxUserInfoFeign; import com.yonde.dex.user.feign.DxUserInfoFeign;
import com.yonde.dex.user.feign.SwitchUserService; import com.yonde.dex.user.feign.SwitchUserService;
import com.yonde.dex.wfc.common.vo.DxWfParticipantInfoVO; import com.yonde.dex.utils.common.utils.DxFileUtils;
import com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO; import com.yonde.dex.version.plugin.common.entity.DxIterationVOHolder;
import com.yonde.dex.wfc.common.vo.DxWfTaskContext; import com.yonde.dex.wfc.common.enums.TaskStateEnum;
import com.yonde.dex.wfc.common.vo.*;
import com.yonde.dex.wfc.feign.api.WfcActivityFeign;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign; import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import com.yonde.dex.wfc.feign.api.WfcTaskFeign; import com.yonde.dex.wfc.feign.api.WfcTaskFeign;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.utils.CloneUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
...@@ -61,9 +69,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -61,9 +69,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.File; import java.io.*;
import java.io.FileInputStream;
import java.io.InputStream;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -94,6 +100,9 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -94,6 +100,9 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
private ExtDistributeRecordServiceFeign distributeRecordService; private ExtDistributeRecordServiceFeign distributeRecordService;
@Autowired @Autowired
private WfcProcessFeign wfInstanceService; private WfcProcessFeign wfInstanceService;
@Autowired
private WfcActivityFeign wfcActivityFeign;
@Autowired @Autowired
private ExtInterfaceReplaceLinkService interfaceReplaceLinkService; private ExtInterfaceReplaceLinkService interfaceReplaceLinkService;
@Autowired @Autowired
...@@ -112,15 +121,13 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -112,15 +121,13 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
private SwitchUserService switchUserService; private SwitchUserService switchUserService;
@Autowired @Autowired
private ExtInterfaceInfoLinkService interfaceInfoLinkService; private ExtInterfaceInfoLinkService interfaceInfoLinkService;
// @Autowired @Autowired
// private DocBeforeCreateEvent docBeforeCreateEvent; private DocBeforeCreateEvent docBeforeCreateEvent;
@Autowired @Autowired
private FileManagerFeignService fileManagerFeignService; private FileManagerFeignService fileManagerFeignService;
@Autowired @Autowired
private ObjFileLinkService objFileLinkService; private ObjFileLinkService objFileLinkService;
@Autowired
private WfcProcessFeign dexWorkFlowService;
@Autowired @Autowired
private ExtDocUtil extDocUtil; private ExtDocUtil extDocUtil;
@Autowired @Autowired
...@@ -132,16 +139,15 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -132,16 +139,15 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
private TechnicalFileUtils technicalFileUtils; private TechnicalFileUtils technicalFileUtils;
@Autowired @Autowired
private WorkFlowUtil workFlowUtil; private WorkFlowUtil workFlowUtil;
// @Autowired @Autowired
// private ProcessDataUtils processDataUtils; private ProcessDataUtils processDataUtils;
@Autowired @Autowired
ExtApplicantService extApplicantService; ExtApplicantService extApplicantService;
@Autowired @Autowired
ExtInterfaceService extInterfaceService; ExtInterfaceService extInterfaceService;
// @Autowired
// IOrganizationService organizationService; @Autowired
// @Autowired ExtAuditInterfLinkService extAuditInterfLinkService;
// private ChangeUserHelper changeUserHelper;
/** /**
* 客制化文档修改状态 * 客制化文档修改状态
...@@ -544,18 +550,17 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -544,18 +550,17 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
*/ */
@Override @Override
public void getProcessSelectionInfo(String taskId, DxDocumentVO documentVO) { public void getProcessSelectionInfo(String taskId, DxDocumentVO documentVO) {
// TODO: 2024/7/31 4.1 taskService.getTaskSelectionInfo(taskId)此方法不存在 // TODO: xpc taskService.getTaskSelectionInfo(taskId)此方法不存在
List<DxWfParticipantInfoVO> processTeamParticipantList = dexWorkFlowService.getProcessTeamParticipantList(taskId);
// WfTaskSelectionVo taskSelectionInfo = this.taskService.getTaskSelectionInfo(taskId); // WfTaskSelectionVo taskSelectionInfo = this.taskService.getTaskSelectionInfo(taskId);
// Map<String, Object> participantList = taskSelectionInfo.getParticipantList(); // Map<String, Object> participantList = taskSelectionInfo.getParticipantList();
// Long[] review = (Long[]) participantList.get("wf_act_TeamRole_review_userList"); // Long[] review = (Long[]) participantList.get("wf_act_TeamRole_review_userList");
// Long[] approver = (Long[]) participantList.get("wf_act_TeamRole_Approver_userList"); // Long[] approver = (Long[]) participantList.get("wf_act_TeamRole_Approver_userList");
// Long[] verifier = (Long[]) participantList.get("wf_act_TeamRole_approve_userList"); // Long[] verifier = (Long[]) participantList.get("wf_act_teamrole_approve_userlist");
// //更新pbo属性 // //更新pbo属性
// Map<String, Object> dynamicAttrs = documentVO.getDynamicAttrs(); // Map<String, Object> dynamicAttrs = documentVO.getDynamicAttrs();
// dynamicAttrs.put("review", review.toString()); // dynamicAttrs.put("review", review.toString());
// dynamicAttrs.put("approver", approver.toString()); // dynamicAttrs.put("approver", approver.toString());
// dynamicAttrs.put("verifier", verifier.toString()·); // dynamicAttrs.put("verifier", verifier.toString());
// documentVO.setOperator(OperatorType.MODIFY); // documentVO.setOperator(OperatorType.MODIFY);
// documentService.saveRecursion(documentVO); // documentService.saveRecursion(documentVO);
} }
...@@ -590,8 +595,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -590,8 +595,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
DxDocumentVO doc = new DxDocumentVO(); DxDocumentVO doc = new DxDocumentVO();
doc.setNumber(extPlanVO.getFileNumber()); doc.setNumber(extPlanVO.getFileNumber());
doc.setName(extPlanVO.getFileName()); doc.setName(extPlanVO.getFileName());
// TODO: 2024/7/31 4.1 setProjectCode此字段不存在 doc.getDxDocumentExpand().setProjectCode(extPlanVO.getProjectCode());
// doc.setProjectCode(extPlanVO.getProjectCode());
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("fileNumber", extPlanVO.getFileCode()); map.put("fileNumber", extPlanVO.getFileCode());
map.put("review", org.springframework.util.StringUtils.isEmpty(this.searchUserId(extPlanVO.getReview())) ? "" : this.searchUserId(extPlanVO.getReview())); map.put("review", org.springframework.util.StringUtils.isEmpty(this.searchUserId(extPlanVO.getReview())) ? "" : this.searchUserId(extPlanVO.getReview()));
...@@ -602,8 +606,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -602,8 +606,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
doc.setDynamicAttrs(map); doc.setDynamicAttrs(map);
doc.setState(extPlanVO.getPhaseState()); doc.setState(extPlanVO.getPhaseState());
//查询文档分类 //查询文档分类
// TODO: 2024/8/1 extPlanService.searchFileT这个方法不存在 this.extPlanService.searchFileType(extPlanVO.getFileType(), doc);
// this.extPlanService.searchFileType(extPlanVO.getFileType(), doc);
doc.markCreatorIdHold(); doc.markCreatorIdHold();
doc.markModifyIdHold(); doc.markModifyIdHold();
//设置文档创建者 //设置文档创建者
...@@ -613,14 +616,12 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -613,14 +616,12 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
//绑定计划和文档的link //绑定计划和文档的link
ExtPlanDocLinkVO planDocLinkVO = new ExtPlanDocLinkVO(); ExtPlanDocLinkVO planDocLinkVO = new ExtPlanDocLinkVO();
planDocLinkVO.setSource(extPlanVO); planDocLinkVO.setSource(extPlanVO);
// TODO: 2024/8/1 DxDocumentVO参数类型不匹对 planDocLinkVO.setTarget(dxDocumentVO);
// planDocLinkVO.setTarget(dxDocumentVO);
planDocLinkService.save(planDocLinkVO); planDocLinkService.save(planDocLinkVO);
} }
if ("计划反馈类".equals(extPlanVO.getFeedbackType())) { if ("计划反馈类".equals(extPlanVO.getFeedbackType())) {
//向计划执行人分发通知 //向计划执行人分发通知
// TODO: 2024/8/1 extPlanService.generatePlanDistributeRecord方法不存在 this.extPlanService.generatePlanDistributeRecord(extPlanVO);
// this.extPlanService.generatePlanDistributeRecord(extPlanVO);
} }
} }
...@@ -647,15 +648,12 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -647,15 +648,12 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
String filePath = Constants.JD_BEFORE_MERGER_PATH + documentVO.getSubTypeName() + "/" + documentVO.getNumber() + "/" + Constants.MERGER_SOURCE; String filePath = Constants.JD_BEFORE_MERGER_PATH + documentVO.getSubTypeName() + "/" + documentVO.getNumber() + "/" + Constants.MERGER_SOURCE;
String fileInputName = Constants.BEFORE_MERGER_PATH + documentVO.getSubTypeName() + "/" + documentVO.getNumber() + "/" + Constants.MERGER_TARGET + "/" + Constants.MERGER_FILE_NAME; String fileInputName = Constants.BEFORE_MERGER_PATH + documentVO.getSubTypeName() + "/" + documentVO.getNumber() + "/" + Constants.MERGER_TARGET + "/" + Constants.MERGER_FILE_NAME;
List<ExtInterfaceInfoLinkVO> interfaceInfoLinkVOS = this.recursionInterfaceInfoLinks(documentVO.getVersionId()); List<ExtInterfaceInfoLinkVO> interfaceInfoLinkVOS = this.recursionInterfaceInfoLinks(documentVO.getVersionId());
DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
// TODO: xpc dexWorkFlowService.getProcessInstDetailById方法不存在
// TODO: 2024/8/1 getWfProcessInst返回属性不匹对 // WfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
// WfProcessInstVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
// DxWfProcessVO wfProcessInfoVO = dexWorkFlowService.getProcessDetail(wfProcessInstVO.getId());
if (!CollectionUtils.isEmpty(interfaceInfoLinkVOS)) { if (!CollectionUtils.isEmpty(interfaceInfoLinkVOS)) {
//1、先根据提资记录生成多个文档 //1、先根据提资记录生成多个文档
interfaceInfoLinkVOS.stream().forEach(item -> { interfaceInfoLinkVOS.stream().forEach(item -> {
// TODO: 2024/8/1 generateAutoInterFaceWord入参不匹对
// docBeforeCreateEvent.generateAutoInterFaceWord(docObjFile, item, wfProcessInfoVO); // docBeforeCreateEvent.generateAutoInterFaceWord(docObjFile, item, wfProcessInfoVO);
}); });
try { try {
...@@ -827,24 +825,23 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -827,24 +825,23 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
*/ */
private List<DxWfProcessTaskVO> getTaskList(Map<String, Object> wfTaskContext) { private List<DxWfProcessTaskVO> getTaskList(Map<String, Object> wfTaskContext) {
DxWfTaskContext context = (DxWfTaskContext) wfTaskContext.get("context"); DxWfTaskContext context = (DxWfTaskContext) wfTaskContext.get("context");
String processId = context.getProcessId(); // TODO: xpc getProcessInstDetailById(processId)方法不存在,改为wfcActivityFeign.getActivities()
// TODO: 2024/7/31 4.1此方法不存在 getProcessInstDetailById(processId)
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(processId); // DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(processId);
// List<WfTaskDefinitionVO> activities = wfProcessInfoVO.getActivityInfo(); // List<DxWfActivityVO> activities = wfProcessInfoVO.getActivityInfo();
// List<DxWfProcessTaskVO> taskVOList = new ArrayList<>(); List<DxWfActivityVO> activities = wfcActivityFeign.getActivities(context.getProcessId(), context.getProcessDefId());
// for (WfTaskDefinitionVO wf : activities) { List<DxWfProcessTaskVO> taskVOList = new ArrayList<>();
// //判断节点上是否存在 for (DxWfActivityVO wf : activities) {
// if (SignConstants.NCRSignTaskList.contains(wf.getTaskName())) { //判断节点上是否存在
// List<WfProcessTaskVO> taskList = wf.getTaskList(); if (SignConstants.NCRSignTaskList.contains(wf.getTaskName())) {
// for (WfProcessTaskVO wfPro : taskList) { List<DxWfProcessTaskVO> taskList = wf.getTaskList();
// if ("通过".equals(wfPro.getResult())) { for (DxWfProcessTaskVO wfPro : taskList) {
// taskVOList.add(wfPro); if ("通过".equals(wfPro.getResult())) {
// } taskVOList.add(wfPro);
// } }
// } }
// } }
// return taskVOList; }
return null; return taskVOList;
} }
/** /**
...@@ -884,9 +881,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -884,9 +881,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
//深度查询展开ObjLink //深度查询展开ObjLink
DxDocumentVO documentVO = extDocUtil.findDocObjFileLinks(documentId); DxDocumentVO documentVO = extDocUtil.findDocObjFileLinks(documentId);
log.info("自动任务======生成word签名开始"); log.info("自动任务======生成word签名开始");
// TODO: 2024/7/31 4.1返回对象不匹对 WfProcessInstVO DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
// WfProcessInstVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO); // TODO: xpc 此方法不存在 getProcessInstDetailById(processId)
// TODO: 2024/7/31 4.1此方法不存在 getProcessInstDetailById(processId)
// WfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId()); // WfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
String subTypeName = documentVO.getSubTypeName(); String subTypeName = documentVO.getSubTypeName();
log.info("自动任务======生成word签名进行中,文档SubTypeName:{}", subTypeName); log.info("自动任务======生成word签名进行中,文档SubTypeName:{}", subTypeName);
...@@ -931,90 +927,90 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -931,90 +927,90 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
public void savedInterfaceWf(Long documentId, Map<String, Object> wfTaskContext) { public void savedInterfaceWf(Long documentId, Map<String, Object> wfTaskContext) {
DxDocumentVO documentVO = extDocUtil.findDocObjFileLinks(documentId); DxDocumentVO documentVO = extDocUtil.findDocObjFileLinks(documentId);
DxWfTaskContext context = (DxWfTaskContext) wfTaskContext.get("context"); DxWfTaskContext context = (DxWfTaskContext) wfTaskContext.get("context");
String processId = context.getProcessId(); // TODO: xpc 此方法不存在 getProcessInstDetailById(processId),改为wfcActivityFeign.getActivities()
// TODO: 2024/7/31 4.1此方法不存在 getProcessInstDetailById(processId)
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(processId); // DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(processId);
Map<String, Object> dynamicAttrs = documentVO.getDynamicAttrs();
// List<WfTaskDefinitionVO> activities = wfProcessInfoVO.getActivityInfo(); // List<WfTaskDefinitionVO> activities = wfProcessInfoVO.getActivityInfo();
// if (!org.springframework.util.CollectionUtils.isEmpty(activities)) { List<DxWfActivityVO> activities = wfcActivityFeign.getActivities(context.getProcessId(), context.getProcessDefId());
// //申请审核 Map<String, Object> dynamicAttrs = documentVO.getDynamicAttrs();
// dynamicAttrs.replace("appReviewer", this.getUserName(activities, SignConstants.SIGN_KEY_SQSH)); if (!org.springframework.util.CollectionUtils.isEmpty(activities)) {
// dynamicAttrs.replace("appReviewerDate", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_SQSH)); //申请审核
// //总体室签审 dynamicAttrs.replace("appReviewer", this.getUserName(activities, SignConstants.SIGN_KEY_SQSH));
// dynamicAttrs.replace("ztsSign", this.getUserName(activities, SignConstants.SIGN_KEY_ZTSQS)); dynamicAttrs.replace("appReviewerDate", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_SQSH));
// dynamicAttrs.replace("ztsSignDate", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_ZTSQS)); //总体室签审
// } dynamicAttrs.replace("ztsSign", this.getUserName(activities, SignConstants.SIGN_KEY_ZTSQS));
dynamicAttrs.replace("ztsSignDate", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_ZTSQS));
}
documentVO.setOperator(OperatorType.MODIFY); documentVO.setOperator(OperatorType.MODIFY);
DxDocumentVO dxDocumentVO = (DxDocumentVO) documentService.saveRecursion(documentVO); DxDocumentVO dxDocumentVO = (DxDocumentVO) documentService.saveRecursion(documentVO);
} }
// public String getUserName(List<WfTaskDefinitionVO> activities, String activityName) { // TODO: xpc WfTaskDefinitionVO改为DxWfActivityVO
// for (WfTaskDefinitionVO wf : activities) { public String getUserName(List<DxWfActivityVO> activities, String activityName) {
// if (wf.getTaskName().equals(activityName)) { for (DxWfActivityVO wf : activities) {
// return getActivityUserName(wf); if (wf.getTaskName().equals(activityName)) {
// } return getActivityUserName(wf);
// } }
// return ""; }
// } return "";
}
/** /**
* 获取用户名称及用户id * 获取用户名称及用户id
*/ */
// TODO: 2024/7/31 4.1 这个类不存在WfTaskDefinitionVO // TODO: xpc WfTaskDefinitionVO改为DxWfActivityVO
// public String getActivityUserName(WfTaskDefinitionVO activity) { public String getActivityUserName(DxWfActivityVO activity) {
// String str = ""; String str = "";
// List<DxWfProcessTaskVO> taskList = activity.getTaskList(); List<DxWfProcessTaskVO> taskList = activity.getTaskList();
// for (DxWfProcessTaskVO wf : taskList) { for (DxWfProcessTaskVO wf : taskList) {
// if (wf.getState().equals(TaskStateEnum.COMPLETE.name()) && (SignConstants.WfResultList.contains(wf.getResult()))) { if (wf.getState().equals(TaskStateEnum.COMPLETE.name()) && (SignConstants.WfResultList.contains(wf.getResult()))) {
// //获取用户名称和id //获取用户名称和id
// String userName = wf.getAssigneeName(); String userName = wf.getAssigneeName();
// String userId = wf.getAssignee(); String userId = wf.getAssignee();
// DxUserInfoVO userVO = userService.get(Long.parseLong(userId)); DxUserInfoVO userVO = (DxUserInfoVO) userService.get(Long.parseLong(userId));
// str = userVO.getUserAccount(); str = userVO.getUserAccount();
// } }
// } }
// return str; return str;
// } }
/** /**
* 生成内部接口签名word * 生成内部接口签名word
* *
* @param documentVO * @param documentVO
*/ */
// TODO: 2024/7/31 4.1 这个类不存在WfProcessInfoVO public void generateInterfaceSignWord(DxDocumentVO documentVO, DxWfProcessInfoVO wfProcessInfoVO) {
// public void generateInterfaceSignWord(DxDocumentVO documentVO, WfProcessInfoVO wfProcessInfoVO) { //合并后word存放路径
// //合并后word存放路径 String dirPath = Constants.MERGER_FILE_ABSOLUTE_PATH + documentVO.getSubTypeName() + "\\" + documentVO.getNumber() + "\\" + Constants.MERGER_SIGN + "\\";
// String dirPath = Constants.MERGER_FILE_ABSOLUTE_PATH + documentVO.getSubTypeName() + "\\" + documentVO.getNumber() + "\\" + Constants.MERGER_SIGN + "\\"; String filePath = Constants.JD_BEFORE_MERGER_PATH + documentVO.getSubTypeName() + "/" + documentVO.getNumber() + "/" + Constants.MERGER_SOURCE;
// String filePath = Constants.JD_BEFORE_MERGER_PATH + documentVO.getSubTypeName() + "/" + documentVO.getNumber() + "/" + Constants.MERGER_SOURCE; String fileInputName = dirPath + Constants.MERGER_PDF_FILE_NAME;
// String fileInputName = dirPath + Constants.MERGER_PDF_FILE_NAME; List<ExtInterfaceInfoLinkVO> interfaceInfoLinkVOS = this.recursionInterfaceInfoLinks(documentVO.getVersionId());
// List<ExtInterfaceInfoLinkVO> interfaceInfoLinkVOS = this.recursionInterfaceInfoLinks(documentVO.getVersionId()); if (!CollectionUtils.isEmpty(interfaceInfoLinkVOS)) {
// if (!CollectionUtils.isEmpty(interfaceInfoLinkVOS)) { //1、先根据提资记录生成多个文档(不需要上传到附件和主内容中)
// //1、先根据提资记录生成多个文档(不需要上传到附件和主内容中) interfaceInfoLinkVOS.stream().forEach(item -> {
// interfaceInfoLinkVOS.stream().forEach(item -> { docBeforeCreateEvent.generateAutoInterFaceWord(documentVO, item, wfProcessInfoVO);
// docBeforeCreateEvent.generateAutoInterFaceWord(documentVO, item, wfProcessInfoVO); });
// }); try {
// try { //2、合并生成好的文档
// //2、合并生成好的文档 //生成word的路径为:D:\InetService\resource\template\words\新文档的subTypeName\新文档的number\target\mergeDoc.doc
// //生成word的路径为:D:\InetService\resource\template\words\新文档的subTypeName\新文档的number\target\mergeDoc.doc FileUtil.mkdir(dirPath);
// FileUtil.mkdir(dirPath); FileUtils.mergeFile(filePath, dirPath + Constants.MERGER_FILE_NAME);
// FileUtils.mergeFile(filePath, dirPath + Constants.MERGER_FILE_NAME); Word2PdfJacobUtil.word2PDF(dirPath + Constants.MERGER_FILE_NAME, fileInputName);
// Word2PdfJacobUtil.word2PDF(dirPath + Constants.MERGER_FILE_NAME, fileInputName); FileInputStream inputStreamDoc = new FileInputStream(fileInputName);
// FileInputStream inputStreamDoc = new FileInputStream(fileInputName); //上传到附件中
// //上传到附件中 extDocService.extractedAttachFile(documentVO, inputStreamDoc, "", Constants.ATTACH_FILE);
// extDocService.extractedAttachFile(documentVO, inputStreamDoc, "", Constants.ATTACH_FILE); } catch (Exception e) {
// } catch (Exception e) { log.error("生成内部接口签名====生成文档错误:" + e.getMessage());
// log.error("生成内部接口签名====生成文档错误:" + e.getMessage()); } finally {
// } finally { //删除生成后的临时文件
// //删除生成后的临时文件 FileUtils.deleteDirectory(Constants.MERGER_FILE_ABSOLUTE_PATH + documentVO.getSubTypeName() + "\\" + documentVO.getNumber() + "\\");
// FileUtils.deleteDirectory(Constants.MERGER_FILE_ABSOLUTE_PATH + documentVO.getSubTypeName() + "\\" + documentVO.getNumber() + "\\"); }
// } } else {
// } else { //为空就生成单个的签名文件
// //为空就生成单个的签名文件 processDataUtils.generateInterFaceWord(documentVO, new ExtInterfaceInfoLinkVO(), wfProcessInfoVO);
// processDataUtils.generateInterFaceWord(documentVO, new ExtInterfaceInfoLinkVO(), wfProcessInfoVO); }
// } //生成过时文件通知单
// //生成过时文件通知单 this.generateOutNotify(documentVO, wfProcessInfoVO);
// this.generateOutNotify(documentVO, wfProcessInfoVO); }
// }
/** /**
* 自动任务-编制节点后生成word方法 * 自动任务-编制节点后生成word方法
...@@ -1058,9 +1054,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1058,9 +1054,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
public void generateQHTechDoc(Long documentId, Map<String, Object> wfTaskContext) { public void generateQHTechDoc(Long documentId, Map<String, Object> wfTaskContext) {
DxDocumentVO documentVO = extDocUtil.findDocObjFileLinks(documentId); DxDocumentVO documentVO = extDocUtil.findDocObjFileLinks(documentId);
if ((Constants.TECHNICAL_FILE.equals(documentVO.getDxDocumentExpand().getOneLevCategory()))) { if ((Constants.TECHNICAL_FILE.equals(documentVO.getDxDocumentExpand().getOneLevCategory()))) {
//TODO: 2024/7/31 4.1 不存在这个方法getWfProcessInst DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
// DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO); // TODO: xpc 不存在这个方法getProcessInstDetailById
// TODO: 2024/7/31 4.1 不存在这个方法getProcessInstDetailById
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId()); // DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
// //深度查询展开objFileLink // //深度查询展开objFileLink
// DxDocumentVO dxDocumentVO = extDocUtil.findDocObjFileLinks(documentVO.getId()); // DxDocumentVO dxDocumentVO = extDocUtil.findDocObjFileLinks(documentVO.getId());
...@@ -1084,67 +1079,67 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1084,67 +1079,67 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
* @param documentVO * @param documentVO
* @param wfProcessInfoVO * @param wfProcessInfoVO
*/ */
// TODO: 2024/7/31 4.1 这个类不存在WfProcessInfoVO private void generateOutNotify(DxDocumentVO documentVO, DxWfProcessInfoVO wfProcessInfoVO) {
// private void generateOutNotify(DxDocumentVO documentVO, WfProcessInfoVO wfProcessInfoVO) { List<ExtObsoleteDocLinkVO> obsoleteDocLinkVOS = extDocUtil.recursionObsoleteDocLinkBySourceId(documentVO.getVersionId());
// List<ExtObsoleteDocLinkVO> obsoleteDocLinkVOS = extDocUtil.recursionObsoleteDocLinkBySourceId(documentVO.getVersionId()); if (!CollectionUtils.isEmpty(obsoleteDocLinkVOS)) {
// if (!CollectionUtils.isEmpty(obsoleteDocLinkVOS)) { ExtObsoleteDocLinkVO obsoleteDocLinkVO = obsoleteDocLinkVOS.get(0);
// ExtObsoleteDocLinkVO obsoleteDocLinkVO = obsoleteDocLinkVOS.get(0); DxDocumentVO target = obsoleteDocLinkVO.getTarget();
// DxDocumentVO target = obsoleteDocLinkVO.getTarget(); if (!ObjectUtils.isEmpty(target)) {
// if (!ObjectUtils.isEmpty(target)) { extDocService.generateDocWordSign(target, OutdatedDocNotifyUtils.class, wfProcessInfoVO, "");
// extDocService.generateDocWordSign(target, OutdatedDocNotifyUtils.class, wfProcessInfoVO, ""); //保存
// //保存 documentService.saveRecursion(target);
// documentService.saveRecursion(target); } else {
// } else { log.error("生成过时文件通知单失败!");
// log.error("生成过时文件通知单失败!"); }
// } }
// } }
// }
/** /**
* 自动任务-生成QH技术文件签审页 * 自动任务-生成QH技术文件签审页
*/ */
// TODO: 2024/7/31 4.1 这个类不存在WfProcessInfoVO private void generateQHTechDocWord(DxDocumentVO documentVO, DxWfProcessInfoVO wfProcessInfoVO) {
// private void generateQHTechDocWord(DxDocumentVO documentVO, WfProcessInfoVO wfProcessInfoVO) { String dirPath = Constants.MERGER_FILE_ABSOLUTE_PATH + documentVO.getSubTypeName() + "\\" + documentVO.getNumber() + "\\" + Constants.MERGER_TARGET + "\\";
// String dirPath = Constants.MERGER_FILE_ABSOLUTE_PATH + documentVO.getSubTypeName() + "\\" + documentVO.getNumber() + "\\" + Constants.MERGER_TARGET + "\\"; String outWordFilePath = Constants.MERGER_FILE_ABSOLUTE_PATH + documentVO.getSubTypeName() + "\\" + documentVO.getNumber() + "\\" + Constants.MERGER_SOURCE + "\\";
// String outWordFilePath = Constants.MERGER_FILE_ABSOLUTE_PATH + documentVO.getSubTypeName() + "\\" + documentVO.getNumber() + "\\" + Constants.MERGER_SOURCE + "\\"; //生成特定的文档目录,保存生成的word文件
// //生成特定的文档目录,保存生成的word文件 FileUtil.mkdir(outWordFilePath);
// FileUtil.mkdir(outWordFilePath); try {
// try { //先生成封皮数据
// //先生成封皮数据 docBeforeCreateEvent.generalTechnicalWord(documentVO);
// docBeforeCreateEvent.generalTechnicalWord(documentVO); JSONObject jsonObject = technicalFileUtils.settingData(documentVO, wfProcessInfoVO);
// JSONObject jsonObject = technicalFileUtils.settingData(documentVO, wfProcessInfoVO); //生成校核、审核、审定的记录卡
// //生成校核、审核、审定的记录卡 importWordService.getWordAllTable(jsonObject, Constants.TEMPLATE_PATH + "TechnicalFile/QHTemplate.docx", outWordFilePath + "/QHAuditDoc.docx");
// importWordService.getWordAllTable(jsonObject, Constants.TEMPLATE_PATH + "TechnicalFile/QHTemplate.docx", outWordFilePath + "/QHAuditDoc.docx"); //生成接口会签
// //生成接口会签 technicalFileUtils.interfaceHQSetting(documentVO, wfProcessInfoVO);
// technicalFileUtils.interfaceHQSetting(documentVO, wfProcessInfoVO); //专项审查表
// //专项审查表 technicalFileUtils.specialSCSetting(documentVO, wfProcessInfoVO);
// technicalFileUtils.specialSCSetting(documentVO, wfProcessInfoVO); //合并生成好的文档
// //合并生成好的文档 FileUtils.mergePdfFile(outWordFilePath, dirPath + Constants.MERGER_PDF_FILE_NAME);
// FileUtils.mergePdfFile(outWordFilePath, dirPath + Constants.MERGER_PDF_FILE_NAME); log.info("生成QH技术文件签审页-合并pdf文件完成!");
// log.info("生成QH技术文件签审页-合并pdf文件完成!"); //将pdf上传到附件中(客制化)
// //将pdf上传到附件中(客制化) extDocService.extractedAttachFile(documentVO, new FileInputStream(dirPath + Constants.MERGER_PDF_FILE_NAME), "附件二", Constants.ATTACH_FILE);
// extDocService.extractedAttachFile(documentVO, new FileInputStream(dirPath + Constants.MERGER_PDF_FILE_NAME), "附件二", Constants.ATTACH_FILE); } catch (Exception exception) {
// } catch (Exception exception) { log.error("自动任务-生成QH技术文件签审页错误!" + exception.getMessage());
// log.error("自动任务-生成QH技术文件签审页错误!" + exception.getMessage()); } finally {
// } finally { //删除生成后的临时文件
// //删除生成后的临时文件 FileUtils.deleteDirectory(Constants.MERGER_FILE_ABSOLUTE_PATH + documentVO.getSubTypeName() + "\\" + documentVO.getNumber() + "\\");
// FileUtils.deleteDirectory(Constants.MERGER_FILE_ABSOLUTE_PATH + documentVO.getSubTypeName() + "\\" + documentVO.getNumber() + "\\"); }
// } }
// }
/** /**
* 结束流程实例 * 结束流程实例
* *
* @param iterationObject * @param iterationObject
*/ */
// TODO: 2024/7/31 4.1 这个类不存在DxIterationVO // TODO: xpc DxIterationVO不存在改为DxIterationVOHolder
// @Override @Override
// public void endProcess(DxIterationVO iterationObject) { public void endProcess(DxIterationVOHolder iterationObject) {
// WfProcessInstVO wfProcessInstVO = workFlowUtil.getWfProcessInst(iterationObject); DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(iterationObject);
// if (Objects.nonNull(wfProcessInstVO)) { if (Objects.nonNull(wfProcessInstVO)) {
// dexWorkFlowService.endProcessInst(wfProcessInstVO.getId()); // TODO: xpc endProcessInst()不存在,改为stopProcess()
// } wfInstanceService.stopProcess(wfProcessInstVO.getId());
// }
}
}
/** /**
* 生成过时文件通知单word * 生成过时文件通知单word
...@@ -1158,8 +1153,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1158,8 +1153,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
obsoleteDocLinkVOS.stream().forEach(item -> { obsoleteDocLinkVOS.stream().forEach(item -> {
DxDocumentVO source = item.getSource(); DxDocumentVO source = item.getSource();
if (!ObjectUtils.isEmpty(source)) { if (!ObjectUtils.isEmpty(source)) {
// TODO: 2024/7/31 4.1 这个类不存在WfProcessInstVO DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(source);
// WfProcessInstVO wfProcessInstVO = workFlowUtil.getWfProcessInst(source); // TODO: xpc 这个方法不存在getProcessInstDetailById
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId()); // DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
// extDocService.generateDocWordSign(documentVO, OutdatedDocNotifyUtils.class, wfProcessInfoVO, ""); // extDocService.generateDocWordSign(documentVO, OutdatedDocNotifyUtils.class, wfProcessInfoVO, "");
// } else { // } else {
...@@ -1180,7 +1175,6 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1180,7 +1175,6 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
public void changeOldDataState(DxDocumentVO documentVO) { public void changeOldDataState(DxDocumentVO documentVO) {
//获取上一大版本的最新小版本 //获取上一大版本的最新小版本
//List<DxDocumentVO> docVersions = documentService.getLastedIterationByVersions(documentVO.getId()); //List<DxDocumentVO> docVersions = documentService.getLastedIterationByVersions(documentVO.getId());
List<DxDocumentVO> allDocVersions = documentService.getAllIterationsByObjId(documentVO.getId()); List<DxDocumentVO> allDocVersions = documentService.getAllIterationsByObjId(documentVO.getId());
if (!CollectionUtils.isEmpty(allDocVersions)) { if (!CollectionUtils.isEmpty(allDocVersions)) {
allDocVersions.stream().forEach((doc) -> { allDocVersions.stream().forEach((doc) -> {
...@@ -1217,24 +1211,25 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1217,24 +1211,25 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
DxPageImpl<ExtApplicantVO> recursion = extApplicantService.findRecursion(queryCondition); DxPageImpl<ExtApplicantVO> recursion = extApplicantService.findRecursion(queryCondition);
ExtApplicantVO applicantVO = recursion.getContent().get(0); ExtApplicantVO applicantVO = recursion.getContent().get(0);
//TODO 获取任务参与者信息,key:占位符,value:人名 节点名称还需要补充 //TODO 获取任务参与者信息,key:占位符,value:人名 节点名称还需要补充
// Map<String, String> taskMap = getTaskParticipants(context); Map<String, String> taskMap = getTaskParticipants(context);
// //将签字后的pdf挂到接口单上面 //将签字后的pdf挂到接口单上面
// PapersVO papersVO = ObjFileLinkUtil.getAppointTypeFile(applicantVO, Constants.MASTER_FILE).get(0); RepoFileVO papersVO = ObjFileLinkUtil.getAppointTypeFile(applicantVO, Constants.MASTER_FILE).get(0);
// String temDir = DxFileUtils.createRandomTemp("interface"); String temDir = DxFileUtils.createRandomTemp("interface");
// String interFacePath = downPaperToLocal(papersVO, temDir); String interFacePath = downPaperToLocal(papersVO, temDir);
// String interSignPath = temDir + "签字_" + papersVO.getOriginalFileName(); String interSignPath = temDir + "签字_" + papersVO.getOriginalFileName();
// //pdf签字 //pdf签字
// PDFUtil.signWord(interFacePath, interSignPath, taskMap); PDFUtil.signWord(interFacePath, interSignPath, taskMap);
// FileUtil.rename(new File(interSignPath), papersVO.getOriginalFileName(), true); FileUtil.rename(new File(interSignPath), papersVO.getOriginalFileName(), true);
// //删除旧文件,增加新文件 //删除旧文件,增加新文件
// ObjFileLinkUtil.removeFile(applicantVO, Constants.MASTER_FILE); ObjFileLinkUtil.removeFile(applicantVO, Constants.MASTER_FILE);
// papersVO = savePDFToMinio(interFacePath);//上传到minio papersVO = savePDFToMinio(interFacePath);//上传到minio
// //TODO 附件上传待指定 //TODO 附件上传待指定
// ObjFileLinkUtil.addFile(applicantVO, papersVO, Constants.MASTER_FILE); ObjFileLinkUtil.addFile(applicantVO, papersVO, Constants.MASTER_FILE);
// extInterfaceService.saveRecursion(applicantVO); extInterfaceService.saveRecursion(applicantVO);
// FileUtils.deleteDirectory(temDir); FileUtils.deleteDirectory(temDir);
} }
/** /**
* 获取流程参与者 * 获取流程参与者
* *
...@@ -1251,21 +1246,23 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1251,21 +1246,23 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
@SneakyThrows @SneakyThrows
public Map<String, String> getTaskParticipants(String processId) { public Map<String, String> getTaskParticipants(String processId) {
Map<String, String> data = new HashMap<>(); Map<String, String> data = new HashMap<>();
//TODO //TODO xpc getProcessInstSimpleDetailById方法不存在,改为getHisTaskList()
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstSimpleDetailById(processId); // DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstSimpleDetailById(processId);
// List<DxWfProcessTaskVO> activities = wfProcessInfoVO.getHistoryInfo(); // List<DxWfProcessTaskVO> activities = wfProcessInfoVO.getHistoryInfo();
// String dateStr = ""; List<DxWfProcessTaskVO> activities = taskService.getHisTaskList(processId, null, 1, Integer.MAX_VALUE).getContent();
// HashMap<String, String> signMap = CloneUtils.cloneObject(SignConstants.SignNodeMap); String dateStr = "";
// for (Map.Entry<String, String> entry : signMap.entrySet()) { HashMap<String, String> signMap = CloneUtils.cloneObject(SignConstants.SignNodeMap);
// dateStr = new StringBuffer(entry.getValue()).reverse().toString(); for (Map.Entry<String, String> entry : signMap.entrySet()) {
// //节点参与人 dateStr = new StringBuffer(entry.getValue()).reverse().toString();
// data.put(entry.getValue(), getResolverName(activities, entry.getKey())); //节点参与人
// //节点时间 data.put(entry.getValue(), getResolverName(activities, entry.getKey()));
// data.put(dateStr, getResolverData(activities, entry.getKey())); //节点时间
// } data.put(dateStr, getResolverData(activities, entry.getKey()));
// data.entrySet().removeIf(o -> org.springframework.util.StringUtils.isEmpty(o.getValue())); }
data.entrySet().removeIf(o -> org.springframework.util.StringUtils.isEmpty(o.getValue()));
return data; return data;
} }
/** /**
* 下载文件到本地 * 下载文件到本地
* *
...@@ -1273,27 +1270,27 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1273,27 +1270,27 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
* @param dir * @param dir
* @return * @return
*/ */
// public String downPaperToLocal(PapersVO file, String dir) { public String downPaperToLocal(RepoFileVO file, String dir) {
// InputStream inputStream = null; InputStream inputStream = null;
// CustomMultipartFile multipartFile = null; CustomMultipartFile multipartFile = null;
// try { try {
// multipartFile = feignDownloadService.downloadio(file.getId()); multipartFile = fileManagerFeignService.feignDownloadIO(file.getId());
// } catch (IOException e) { } catch (IOException e) {
// log.info("[接口单] >>> 文件服务下载为文件:{}--失败!", file.getId()); log.info("[接口单] >>> 文件服务下载为文件:{}--失败!", file.getId());
// throw new DxBusinessException("500", "文件服务下载文件失败:" + file); throw new DxBusinessException("500", "文件服务下载文件失败:" + file);
// } }
// try { try {
// inputStream = new ByteArrayInputStream(multipartFile.getBytes()); inputStream = new ByteArrayInputStream(multipartFile.getBytes());
// } catch (IOException e) { } catch (IOException e) {
// log.info("[接口单] >>> 文件服务下载的文件:{}--转换为输入流失败!", file.getId()); log.info("[接口单] >>> 文件服务下载的文件:{}--转换为输入流失败!", file.getId());
// throw new DxBusinessException("500", "文件服务下载的文件转换为输入流失败:" + file); throw new DxBusinessException("500", "文件服务下载的文件转换为输入流失败:" + file);
// } }
// String filePath = dir + file.getOriginalFileName(); String filePath = dir + file.getOriginalFileName();
// //保存到本地目录 //保存到本地目录
// FileUtils.inputToFile(inputStream, filePath); FileUtils.inputToFile(inputStream, filePath);
// return filePath; return filePath;
//
// } }
/** /**
* 获取某个环节执行者 * 获取某个环节执行者
...@@ -1314,25 +1311,26 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1314,25 +1311,26 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
/** /**
* 保存pdf到文件服务 * 保存pdf到文件服务
*
* @param pdfPath * @param pdfPath
* @return * @return
*/ */
// @Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
// public PapersVO savePDFToMinio(String pdfPath) throws IOException { public RepoFileVO savePDFToMinio(String pdfPath) throws IOException {
// String pdfName = pdfPath.substring(pdfPath.lastIndexOf("/") + 1); String pdfName = pdfPath.substring(pdfPath.lastIndexOf("/") + 1);
// MultipartFile multipartFile = new MockMultipartFile("file", pdfName, MultipartFile multipartFile = new MockMultipartFile("file", pdfName,
// ContentType.MULTIPART.toString(), new FileInputStream(pdfPath)); ContentType.MULTIPART.toString(), new FileInputStream(pdfPath));
// Long field = fileManagerFeignService.upload(multipartFile, Constants.BUCKET_NAME); RepoFileVO field = fileManagerFeignService.uploadFile(multipartFile, Long.valueOf(Constants.BUCKET_NAME));
// if (field == null) { if (field == null) {
// log.error(">>> 接口单pdf >>> 文件上传失败!"); log.error(">>> 接口单pdf >>> 文件上传失败!");
// throw new DxBusinessException("500", "文件服务上传文件失败:" + pdfPath); throw new DxBusinessException("500", "文件服务上传文件失败:" + pdfPath);
// } else { } else {
// log.info(">>> 接口单pdf >>>文件上传成功:{}", field); log.info(">>> 接口单pdf >>>文件上传成功:{}", field);
// } }
// //根据docId查询文件对象 //根据docId查询文件对象
// PapersVO fileVO = fileManagerFeignService.findFileInfoById(field); RepoFileVO fileVO = fileManagerFeignService.findFileInfoById(field.getId());
// return fileVO; return fileVO;
// } }
/** /**
* 获取某个环节的结束时间 * 获取某个环节的结束时间
...@@ -1376,34 +1374,33 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1376,34 +1374,33 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
@SneakyThrows @SneakyThrows
@Override @Override
public void autoInterFaceSign(Long extInterfaceId, Map<String, Object> wfTaskContext) { public void autoInterFaceSign(Long extInterfaceId, Map<String, Object> wfTaskContext) {
//TODO DxWfTaskContext context = (DxWfTaskContext) wfTaskContext.get("context");
// DxWfTaskContext context = (DxWfTaskContext) wfTaskContext.get("context"); SearchQueryCondition queryCondition = SearchUtil.buildQueryWithOpenAttr("id", SearchItem.Operator.EQ, extInterfaceId, "objFileLinks.target");
// SearchQueryCondition queryCondition = SearchUtil.buildQueryWithOpenAttr("id", SearchItem.Operator.EQ, extInterfaceId, "objFileLinks.target"); DxPageImpl<ExtInterfaceVO> recursion = extInterfaceService.findRecursion(queryCondition);
// DxPageImpl<ExtInterfaceVO> recursion = extInterfaceService.findRecursion(queryCondition); ExtInterfaceVO extInterfaceVO = recursion.getContent().get(0);
// ExtInterfaceVO extInterfaceVO = recursion.getContent().get(0); //TODO 申请内容节点信息
// //TODO 申请内容节点信息 ExtApplicantVO applicantVO = (ExtApplicantVO) extApplicantService.get(extInterfaceVO.getExtApplicantId());
// ExtApplicantVO applicantVO = (ExtApplicantVO) extApplicantService.get(extInterfaceVO.getExtApplicantId()); Map<String, String> taskMap = ExtWfcUtil.getProcessTeam(ExtApplicantVO.class, applicantVO.getVersionId(), SignConstants.SignNodeMap);
// Map<String, String> taskMap = ExtWfcUtil.getProcessTeam(ExtApplicantVO.class, applicantVO.getVersionId(), SignConstants.SignNodeMap); //TODO 接口单接点信息
// //TODO 接口单接点信息 Map<String, String> interFaceMap = ExtWfcUtil.getProcessTeam(ExtInterfaceVO.class, extInterfaceVO.getVersionId(), SignConstants.InterfaceSignNodeMap);
// Map<String, String> interFaceMap = ExtWfcUtil.getProcessTeam(ExtInterfaceVO.class, extInterfaceVO.getVersionId(), SignConstants.InterfaceSignNodeMap); if (MapUtils.isNotEmpty(interFaceMap)) {
// if (MapUtils.isNotEmpty(interFaceMap)){ taskMap.putAll(interFaceMap);
// taskMap.putAll(interFaceMap); }
// } //TODO 将签字后的pdf挂到接口单上面
// TODO 将签字后的pdf挂到接口单上面 RepoFileVO papersVO = ObjFileLinkUtil.getAppointTypeFile(extInterfaceVO, Constants.MASTER_FILE).get(0);
// PapersVO papersVO = ObjFileLinkUtil.getAppointTypeFile(extInterfaceVO, Constants.MASTER_FILE).get(0); String temDir = DxFileUtils.createRandomTemp("interface");
// String temDir = DxFileUtils.createRandomTemp("interface"); String interFacePath = downPaperToLocal(papersVO, temDir);
// String interFacePath = downPaperToLocal(papersVO, temDir); String interSignPath = temDir + "签字_" + papersVO.getOriginalFileName();
// String interSignPath = temDir + "签字_" + papersVO.getOriginalFileName(); //pdf签字
// //pdf签字 PDFUtil.signWord(interFacePath, interSignPath, taskMap);
// PDFUtil.signWord(interFacePath, interSignPath, taskMap); FileUtil.rename(new File(interSignPath), papersVO.getOriginalFileName(), true);
// FileUtil.rename(new File(interSignPath), papersVO.getOriginalFileName(), true); //删除旧文件,增加新文件
// //删除旧文件,增加新文件 ObjFileLinkUtil.removeFile(extInterfaceVO, Constants.MASTER_FILE);
// ObjFileLinkUtil.removeFile(extInterfaceVO, Constants.MASTER_FILE); papersVO = savePDFToMinio(interFacePath);//上传到minio
// papersVO = savePDFToMinio(interFacePath);//上传到minio //TODO 附件上传待指定
// //TODO 附件上传待指定 ObjFileLinkUtil.addFile(extInterfaceVO, papersVO, Constants.MASTER_FILE);
// ObjFileLinkUtil.addFile(extInterfaceVO, papersVO, Constants.MASTER_FILE); extInterfaceService.saveRecursion(extInterfaceVO);
// extInterfaceService.saveRecursion(extInterfaceVO); FileUtils.deleteDirectory(temDir);
// FileUtils.deleteDirectory(temDir);
} }
/** /**
...@@ -1414,19 +1411,16 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1414,19 +1411,16 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void autoInterfaceEnd(ExtAuditObjectVO auditObjectVO) { public void autoInterfaceEnd(ExtAuditObjectVO auditObjectVO) {
//TODO SearchQueryCondition queryCondition = SearchUtil.buildQueryWithOpenAttr("sourceId", SearchItem.Operator.EQ, auditObjectVO.getId(), "target");
// SearchQueryCondition queryCondition = SearchUtil.buildQueryWithOpenAttr("sourceId", SearchItem.Operator.EQ, auditObjectVO.getId(), "target"); DxPageImpl<ExtAuditInterfLinkVO> recursion = extAuditInterfLinkService.findRecursion(queryCondition);
// DxPageImpl<ExtAuditInterfLinkVO> recursion = extAuditInterfLinkService.findRecursion(queryCondition); if (CollectionUtil.isNotEmpty(recursion.getContent())) {
// if (CollectionUtil.isNotEmpty(recursion.getContent())) { //TODO 设置接口单状态为终止
// //TODO 设置接口单状态为终止 List<ExtAuditInterfLinkVO> content = recursion.getContent();
// List<ExtAuditInterfLinkVO> content = recursion.getContent(); for (ExtAuditInterfLinkVO linkVO : content) {
// for (ExtAuditInterfLinkVO linkVO : content) { ExtInterfaceVO interfaceVO = linkVO.getTarget();
// ExtInterfaceVO interfaceVO = linkVO.getTarget(); extInterfaceService.changeStatus(interfaceVO.getId(), Constants.STATUS_END, true);
// extInterfaceService.changeStatus(interfaceVO, Constants.STATUS_END, true); }
// } }
//
// }
} }
/** /**
...@@ -1437,68 +1431,68 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1437,68 +1431,68 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void startInterFaceFlow(ExtApplicantVO applicantVO) { public void startInterFaceFlow(ExtApplicantVO applicantVO) {
//TODO applicantVO.setOperator(OperatorType.NO_CHANGE);
// applicantVO.setOperator(OperatorType.NO_CHANGE); //获取申请内容所关联的提资人
// //获取申请内容所关联的提资人 String providers = applicantVO.getProviders();
// String providers = applicantVO.getProviders(); //TODO 组织id 逗号隔开
// //TODO 组织id 逗号隔开 String[] split = providers.split(",");
// String[] split = providers.split(","); List<DxOrganizationVO> organizationVOList = new ArrayList<>();
// List<DxOrganizationVO> organizationVOList = new ArrayList<>(); for (String orgId : split) {
// for (String orgId : split) { DxOrganizationVO organizationVO = (DxOrganizationVO) dxOrganizationFeign.get(Long.valueOf(orgId));
// DxOrganizationVO organizationVO = organizationService.get(Long.valueOf(orgId)); organizationVOList.add(organizationVO);
// organizationVOList.add(organizationVO);
// }
// } Long creatorUserId = applicantVO.getCreator().getUserId();
// String userAccount = applicantVO.getCreator().getAccount(); try {
// try { switchUserService.switchUser(creatorUserId);
// changeUserHelper.switchServiceUser(userAccount); for (DxOrganizationVO organizationVO : organizationVOList) {
// for (DxOrganizationVO organizationVO : organizationVOList) { ExtInterfaceVO extInterfaceVO = new ExtInterfaceVO();
// ExtInterfaceVO extInterfaceVO = new ExtInterfaceVO(); //TODO 设置提资人ID 取组织下面 岗位为 主设人 的用户
// //TODO 设置提资人ID 取组织下面 岗位为 主设人 的用户 Long userId = getUserByOrg(organizationVO);
// Long userId = getUserByOrg(organizationVO); extInterfaceVO.setDxClassname(extInterfaceVO.getDxClassname());
// extInterfaceVO.setDxClassname(extInterfaceVO.getDxClassname()); //TODO xpc setDxContextId这个属性不存在,可能是因为没勾选上下文插件
// extInterfaceVO.setDxContextId(applicantVO.getDxContextId()); // extInterfaceVO.setDxContextId(applicantVO.getDxContextId());
// extInterfaceVO.setExtApplicant(applicantVO); extInterfaceVO.setExtApplicant(applicantVO);
// extInterfaceVO.setProviderId(userId); extInterfaceVO.setProviderId(userId);
// extInterfaceVO.setExtApplicantId(applicantVO.getId()); extInterfaceVO.setExtApplicantId(applicantVO.getId());
// extInterfaceVO.setExtApplicantIdType(applicantVO.getSubTypeName()); extInterfaceVO.setExtApplicantIdType(applicantVO.getSubTypeName());
// extInterfaceVO.setApplicatDate(applicantVO.getSubmitDate()); extInterfaceVO.setApplicatDate(applicantVO.getSubmitDate());
// extInterfaceVO.setOperator(OperatorType.ADD); extInterfaceVO.setOperator(OperatorType.ADD);
// organizationVO.setOperator(OperatorType.NO_CHANGE); organizationVO.setOperator(OperatorType.NO_CHANGE);
// extInterfaceVO.setProviderOrg(organizationVO); extInterfaceVO.setProviderOrg(organizationVO);
// extInterfaceVO.setApplicantOrg(organizationVO); extInterfaceVO.setApplicantOrg(organizationVO);
// extInterfaceVO.setApplicantOrgId(applicantVO.getApplicantOrgId()); extInterfaceVO.setApplicantOrgId(applicantVO.getApplicantOrgId());
// extInterfaceVO.setApplicantOrgIdType(applicantVO.getApplicantOrgIdType()); extInterfaceVO.setApplicantOrgIdType(applicantVO.getApplicantOrgIdType());
// extInterfaceVO = (ExtInterfaceVO) extInterfaceService.saveRecursion(extInterfaceVO); extInterfaceVO = (ExtInterfaceVO) extInterfaceService.saveRecursion(extInterfaceVO);
//
// //TODO 手动启动流程 //TODO 手动启动流程
// DxWfProcessStartVO startVO = new DxWfProcessStartVO(); DxWfProcessStartVO startVO = new DxWfProcessStartVO();
// startVO.setBusinessObject(extInterfaceVO); startVO.setBusinessObject(extInterfaceVO);
// startVO.setProcessDefKey("ExtInterface"); startVO.setProcessDefKey("ExtInterface");
// startVO.setBusinessService(extInterfaceVO.getDxClassname()); startVO.setBusinessService(extInterfaceVO.getDxClassname());
// startVO.setBusinessObjectId(String.valueOf(extInterfaceVO.getId())); startVO.setBusinessObjectId(String.valueOf(extInterfaceVO.getId()));
// startVO.setUserId(applicantVO.getCreator().getUserId().toString()); startVO.setUserId(applicantVO.getCreator().getUserId().toString());
//
// Map<String, Object> var = new HashMap<>(); Map<String, Object> var = new HashMap<>();
// DxWfTaskPerformerVO taskPerformerVO = new DxWfTaskPerformerVO(); DxWfTaskPerformerVO taskPerformerVO = new DxWfTaskPerformerVO();
// List<String> userIdList = new ArrayList<>(); List<String> userIdList = new ArrayList<>();
// // 此处放入任务接收人id // 此处放入任务接收人id
// userIdList.add(String.valueOf(userId)); userIdList.add(String.valueOf(userId));
// taskPerformerVO.setPerformers(userIdList); taskPerformerVO.setPerformers(userIdList);
//
// var.put("taskPerformer", JsonUtils.toJsonStr(taskPerformerVO)); var.put("taskPerformer", JsonUtils.toJsonStr(taskPerformerVO));
// startVO.setProcessVar(var); startVO.setProcessVar(var);
// //TODO 手动启动流程 //TODO 手动启动流程
// dexWorkFlowService.startProcessWithVar(startVO); wfInstanceService.startProcess(startVO);
// //废弃版 //废弃版
// //dexWorkFlowService.startProcessByKey("ExtInterface", extInterfaceVO); //dexWorkFlowService.startProcessByKey("ExtInterface", extInterfaceVO);
// } }
//
// } catch (Exception e) { } catch (Exception e) {
// throw new DxBusinessException("-1 切换用户失败", e.getMessage()); throw new DxBusinessException("-1 切换用户失败", e.getMessage());
// } finally { } finally {
// changeUserHelper.closeSwitchUser(); // changeUserHelper.closeSwitchUser();
// } }
} }
/** /**
...@@ -1509,61 +1503,61 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1509,61 +1503,61 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void startAddInterFaceFlow(ExtInterfaceVO extInterfaceVO) { public void startAddInterFaceFlow(ExtInterfaceVO extInterfaceVO) {
//TODO Long userAccount = extInterfaceVO.getCreator().getUserId();
// String userAccount = extInterfaceVO.getCreator().getAccount(); try {
// try { switchUserService.switchUser(userAccount);
// changeUserHelper.switchServiceUser(userAccount); //若申请方确认 属性值 不为 关闭,则需要重新启动流程
// //若申请方确认 属性值 不为 关闭,则需要重新启动流程 ExtInterfaceVO newInterFace = new ExtInterfaceVO();
// ExtInterfaceVO newInterFace = new ExtInterfaceVO(); //TODO 接口单编号规则 需要用到申请内容,需要把申请内容对象塞进去
// //TODO 接口单编号规则 需要用到申请内容,需要把申请内容对象塞进去 ExtApplicantVO applicantVO = (ExtApplicantVO) extApplicantService.get(extInterfaceVO.getExtApplicantId());
// ExtApplicantVO applicantVO = (ExtApplicantVO) extApplicantService.get(extInterfaceVO.getExtApplicantId()); applicantVO.setOperator(OperatorType.NO_CHANGE);
// applicantVO.setOperator(OperatorType.NO_CHANGE); newInterFace.setPreviousId(extInterfaceVO.getId());
// newInterFace.setPreviousId(extInterfaceVO.getId()); //TODO xpc setDxContextId这个属性不存在,可能是因为没勾选上下文插件
// newInterFace.setDxContextId(applicantVO.getDxContextId()); // newInterFace.setDxContextId(applicantVO.getDxContextId());
// newInterFace.setProviderId(extInterfaceVO.getProviderId()); newInterFace.setProviderId(extInterfaceVO.getProviderId());
// newInterFace.setProviderIdType(extInterfaceVO.getProviderIdType()); newInterFace.setProviderIdType(extInterfaceVO.getProviderIdType());
// newInterFace.setApplicatDate(extInterfaceVO.getApplicatDate()); newInterFace.setApplicatDate(extInterfaceVO.getApplicatDate());
// newInterFace.setProvideContent(extInterfaceVO.getProvideContent()); newInterFace.setProvideContent(extInterfaceVO.getProvideContent());
// newInterFace.setDynamicAttrs(extInterfaceVO.getDynamicAttrs()); newInterFace.setDynamicAttrs(extInterfaceVO.getDynamicAttrs());
// //TODO 初始化规则需要知道提资方 //TODO 初始化规则需要知道提资方
// OrganizationVO organizationVO = organizationService.get(extInterfaceVO.getProviderOrgId()); DxOrganizationVO organizationVO = (DxOrganizationVO) dxOrganizationFeign.get(extInterfaceVO.getProviderOrgId());
// organizationVO.setOperator(OperatorType.NO_CHANGE); organizationVO.setOperator(OperatorType.NO_CHANGE);
// newInterFace.setProviderOrg(organizationVO); newInterFace.setProviderOrg(organizationVO);
// newInterFace.setProviderOrgId(extInterfaceVO.getProviderOrgId()); newInterFace.setProviderOrgId(extInterfaceVO.getProviderOrgId());
// newInterFace.setProviderOrgIdType(extInterfaceVO.getProviderOrgIdType()); newInterFace.setProviderOrgIdType(extInterfaceVO.getProviderOrgIdType());
// newInterFace.setApplicantOrgId(extInterfaceVO.getApplicantOrgId()); newInterFace.setApplicantOrgId(extInterfaceVO.getApplicantOrgId());
// newInterFace.setApplicantOrgIdType(extInterfaceVO.getApplicantOrgIdType()); newInterFace.setApplicantOrgIdType(extInterfaceVO.getApplicantOrgIdType());
// //TODO 编号和名称待定 后续需要确认 是否能按初始化规则生成 //TODO 编号和名称待定 后续需要确认 是否能按初始化规则生成
// newInterFace.setExtApplicant(applicantVO); newInterFace.setExtApplicant(applicantVO);
// newInterFace.setOperator(OperatorType.ADD); newInterFace.setOperator(OperatorType.ADD);
// newInterFace = (ExtInterfaceVO) extInterfaceService.saveRecursion(newInterFace); newInterFace = (ExtInterfaceVO) extInterfaceService.saveRecursion(newInterFace);
//
// //TODO 手动启动流程 //TODO 手动启动流程
// DxWfProcessStartVO startVO = new DxWfProcessStartVO(); DxWfProcessStartVO startVO = new DxWfProcessStartVO();
// startVO.setBusinessObject(newInterFace); startVO.setBusinessObject(newInterFace);
// startVO.setProcessDefKey("ExtInterface"); startVO.setProcessDefKey("ExtInterface");
// startVO.setBusinessService(newInterFace.getDxClassname()); startVO.setBusinessService(newInterFace.getDxClassname());
// startVO.setBusinessObjectId(String.valueOf(newInterFace.getId())); startVO.setBusinessObjectId(String.valueOf(newInterFace.getId()));
// startVO.setUserId(extInterfaceVO.getCreator().getUserId().toString()); startVO.setUserId(extInterfaceVO.getCreator().getUserId().toString());
//
// Map<String, Object> var = new HashMap<>(); Map<String, Object> var = new HashMap<>();
// DxWfTaskPerformerVO taskPerformerVO = new DxWfTaskPerformerVO(); DxWfTaskPerformerVO taskPerformerVO = new DxWfTaskPerformerVO();
// List<String> userIdList = new ArrayList<>(); List<String> userIdList = new ArrayList<>();
// // 此处放入任务接收人id // 此处放入任务接收人id
//// Long userId = getUserByOrgId(extInterfaceVO.getProviderOrgId()); // Long userId = getUserByOrgId(extInterfaceVO.getProviderOrgId());
// Long userId = extInterfaceVO.getProviderId(); Long userId = extInterfaceVO.getProviderId();
// userIdList.add(String.valueOf(userId)); userIdList.add(String.valueOf(userId));
// taskPerformerVO.setPerformers(userIdList); taskPerformerVO.setPerformers(userIdList);
//
// var.put("taskPerformer", JsonUtils.toJsonStr(taskPerformerVO)); var.put("taskPerformer", JsonUtils.toJsonStr(taskPerformerVO));
// startVO.setProcessVar(var); startVO.setProcessVar(var);
// //TODO 手动启动流程 //TODO 手动启动流程
// dexWorkFlowService.startProcessWithVar(startVO); wfInstanceService.startProcess(startVO);
// } catch (Exception e) { } catch (Exception e) {
// throw new DxBusinessException("-1 切换用户失败", e.getMessage()); throw new DxBusinessException("-1 切换用户失败", e.getMessage());
// } finally { } finally {
// changeUserHelper.closeSwitchUser(); // changeUserHelper.closeSwitchUser();
// } }
} }
/** /**
...@@ -1585,7 +1579,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1585,7 +1579,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
if (!CollectionUtil.isEmpty(collect) && !CollectionUtil.isEmpty(extInterfaces)) { if (!CollectionUtil.isEmpty(collect) && !CollectionUtil.isEmpty(extInterfaces)) {
if (extInterfaces.size() == collect.size()) { if (extInterfaces.size() == collect.size()) {
//TODO 申请内容关联的多个内部接口单 状态全部为“已发布(关闭)”后,应该自动将申请内容状态置为“全部关闭” //TODO 申请内容关联的多个内部接口单 状态全部为“已发布(关闭)”后,应该自动将申请内容状态置为“全部关闭”
//TODO extApplicantService.changeStatus(first.get(),Constants.CLOSE_ALL,true); extApplicantService.changeStatus(first.get().getId(), Constants.CLOSE_ALL, true);
// extApplicantService.changeStatus(first.get(),Constants.OBSOLETE,true); // extApplicantService.changeStatus(first.get(),Constants.OBSOLETE,true);
} }
} }
...@@ -1606,4 +1600,23 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1606,4 +1600,23 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
interfaceVO.setProviderId(processTiZiId); interfaceVO.setProviderId(processTiZiId);
interfaceVO = (ExtInterfaceVO) extInterfaceService.update(interfaceVO); interfaceVO = (ExtInterfaceVO) extInterfaceService.update(interfaceVO);
} }
/**
* TODO 获取组织下面 岗位为主设人 的用户
*
* @param organizationVO
* @return
*/
public Long getUserByOrg(DxOrganizationVO organizationVO) {
//TODO xpc userGroupRefService.getUserRefByOrgId()不存在
// List<UserGroupRefVO> userRefByOrgId = this.userGroupRefService.getUserRefByOrgId(organizationVO.getId());
// if (CollectionUtil.isEmpty(userRefByOrgId)) {
// return null;
// }
// Optional<UserGroupRefVO> first = userRefByOrgId.stream().filter(o -> "主设人".equalsIgnoreCase(o.getPostName())).findFirst();
// return first.map(userGroupRefVO -> Long.valueOf(userGroupRefVO.getUserId())).orElse(null);
return null;
}
} }
...@@ -9,6 +9,7 @@ import com.yonde.dcs.core.constants.Constants; ...@@ -9,6 +9,7 @@ import com.yonde.dcs.core.constants.Constants;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO; import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dex.basedata.entity.data.OperatorType; import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.entity.vo.IdVO; import com.yonde.dex.basedata.entity.vo.IdVO;
import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.dfs.handler.ContentHolder; import com.yonde.dex.dfs.handler.ContentHolder;
import com.yonde.dex.dfs.vo.ObjFileLinkVO; import com.yonde.dex.dfs.vo.ObjFileLinkVO;
import lombok.SneakyThrows; import lombok.SneakyThrows;
...@@ -33,6 +34,28 @@ import java.util.stream.Collectors; ...@@ -33,6 +34,28 @@ import java.util.stream.Collectors;
*/ */
@Slf4j @Slf4j
public class FileUtils { public class FileUtils {
/**
* 保存到本地目录
* @param inputStream
* @param fileUrl 文件绝对路径
*/
public static void inputToFile(InputStream inputStream, String fileUrl){
OutputStream outputStream = null;
try {
try {
outputStream = new FileOutputStream(fileUrl);
} catch (FileNotFoundException e) {
log.info("保存到本地临时目录失败:{}!", fileUrl);
throw new DxBusinessException("500", "保存文件到本地临时目录失败:" + fileUrl);
}
IoUtil.copy(inputStream, outputStream);
} finally {
IoUtil.close(inputStream);
IoUtil.close(outputStream);
}
}
/** /**
* MultipartFile转fie * MultipartFile转fie
* *
......
...@@ -4,6 +4,7 @@ import com.yonde.dex.basedata.entity.data.OperatorType; ...@@ -4,6 +4,7 @@ import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.entity.vo.IdVO; import com.yonde.dex.basedata.entity.vo.IdVO;
import com.yonde.dex.dfs.handler.ContentHolder; import com.yonde.dex.dfs.handler.ContentHolder;
import com.yonde.dex.dfs.vo.ObjFileLinkVO; import com.yonde.dex.dfs.vo.ObjFileLinkVO;
import com.yonde.dex.dfs.vo.RepoFileVO;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -46,17 +47,17 @@ public class ObjFileLinkUtil { ...@@ -46,17 +47,17 @@ public class ObjFileLinkUtil {
// addFile(holder, fileVO, fileType); // addFile(holder, fileVO, fileType);
// } // }
// //
// public static <T extends IdVO & ContentHolder> void addFile(T holder, PapersVO fileVO, String fileType) { public static <T extends IdVO & ContentHolder> void addFile(T holder, RepoFileVO fileVO, String fileType) {
// if (CollectionUtils.isEmpty(((ContentHolder)holder).getObjFileLinks())) { if (CollectionUtils.isEmpty(((ContentHolder)holder).getObjFileLinks())) {
// ((ContentHolder)holder).setObjFileLinks(new ArrayList()); ((ContentHolder)holder).setObjFileLinks(new ArrayList());
// } }
//
// ObjFileLinkVO linkVo = new ObjFileLinkVO(); ObjFileLinkVO linkVo = new ObjFileLinkVO();
// linkVo.setTarget(fileVO); linkVo.setTarget(fileVO);
// linkVo.setOperator(OperatorType.ADD); linkVo.setOperator(OperatorType.ADD);
// linkVo.setContentType(fileType); linkVo.setContentType(fileType);
// ((ContentHolder)holder).getObjFileLinks().add(linkVo); ((ContentHolder)holder).getObjFileLinks().add(linkVo);
// } }
/** /**
...@@ -148,15 +149,16 @@ public class ObjFileLinkUtil { ...@@ -148,15 +149,16 @@ public class ObjFileLinkUtil {
* @param <T> * @param <T>
* @return * @return
*/ */
// public static <T extends IdVO & ContentHolder> List<PapersVO> getAppointTypeFile(T holder, String fileType) {
// if (!Objects.isNull(holder) && !CollectionUtils.isEmpty(((ContentHolder) holder).getObjFileLinks())) { public static <T extends IdVO & ContentHolder> List<RepoFileVO> getAppointTypeFile(T holder, String fileType) {
// List<ObjFileLinkVO> fileLinkVOList = holder.getObjFileLinks().stream().filter(o -> o.getContentType().equalsIgnoreCase(fileType)).collect(Collectors.toList()); if (!Objects.isNull(holder) && !CollectionUtils.isEmpty(((ContentHolder) holder).getObjFileLinks())) {
// if (!CollectionUtils.isEmpty(fileLinkVOList)) { List<ObjFileLinkVO> fileLinkVOList = holder.getObjFileLinks().stream().filter(o -> o.getContentType().equalsIgnoreCase(fileType)).collect(Collectors.toList());
// return fileLinkVOList.stream().map(ObjFileLinkVO::getTarget).collect(Collectors.toList()); if (!CollectionUtils.isEmpty(fileLinkVOList)) {
// } return fileLinkVOList.stream().map(ObjFileLinkVO::getTarget).collect(Collectors.toList());
// } }
// return null; }
// } return null;
}
/** /**
* 获取对象指定 类型的file * 获取对象指定 类型的file
......
...@@ -45,10 +45,7 @@ public class WorkFlowUtil { ...@@ -45,10 +45,7 @@ public class WorkFlowUtil {
* @param iterationVO * @param iterationVO
* @return * @return
*/ */
// TODO: 2024/8/1 DxIterationVO不存在 // TODO: xpc WfProcessInstVO不存在改为DxWfProcessVO,DxIterationVO不存在改为DxIterationVOHolder
// TODO: xpc WfProcessInstVO不存在改为DxWfProcessVO,IterationVO不存在改为DxIterationVOHolder
public DxWfProcessVO getWfProcessInst(DxIterationVOHolder iterationVO) { public DxWfProcessVO getWfProcessInst(DxIterationVOHolder iterationVO) {
// TODO: getProcessInstList方法不存在改为getProcessList // TODO: getProcessInstList方法不存在改为getProcessList
// DxWfProcessSearchVO wfProcessInstSearchVO = new DxWfProcessSearchVO(); // DxWfProcessSearchVO wfProcessInstSearchVO = new DxWfProcessSearchVO();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment