Commit f1fd1dfb authored by pchxue's avatar pchxue

配置文件修改

parent 4036e65d
......@@ -26,7 +26,7 @@
<artifactId>dcs-doc-entity</artifactId>
<version>4.1-RELEASE</version>
</dependency>
<dependency>
<dependency>
<groupId>com.yonde.dex</groupId>
<artifactId>dex-datacenter-globalsearch-listener</artifactId>
</dependency>
......@@ -81,13 +81,40 @@
<dependency>
<groupId>com.yonde.dex</groupId>
<artifactId>dex-initialization-rule-runtime</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.2.12.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.jacob</groupId>
<artifactId>jacob</artifactId>
<version>1.19</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jacob.jar</systemPath>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.24</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
</dependency>
</dependencies>
</project>
......@@ -15,6 +15,7 @@ import com.yonde.dcs.document.common.vo.DxDocumentVO;
import com.yonde.dcs.document.core.constants.Constants;
import com.yonde.dcs.document.core.util.FileUtils;
import com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessVO;
import com.yonde.dex.wfc.common.vo.WfProcessInfoVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessInstVO;
import com.yonde.dex.wfc.feign.api.DexWorkFlowService;
......@@ -67,7 +68,7 @@ public class ProcessDataUtils {
*/
public void processData(DxDocumentVO documentVo) {
String subTypeName = documentVo.getSubTypeName();
WfProcessInstVO DxWfProcessInstVO = workFlowUtil.getWfProcessInst(documentVo);
DxWfProcessVO DxWfProcessInstVO = workFlowUtil.getWfProcessInst(documentVo);
DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(DxWfProcessInstVO.getId());
switch (subTypeName) {
case Constants.INTERNAL_INTERFACE:
......
......@@ -10,12 +10,15 @@ import com.yonde.dcs.document.common.vo.*;
import com.yonde.dcs.document.core.constants.Constants;
import com.yonde.dcs.document.core.events.DocBeforeCreateEvent;
import com.yonde.dcs.document.core.events.ProcessDataUtils;
import com.yonde.dcs.document.core.factory.NCRSCUtils;
import com.yonde.dcs.document.core.factory.TechnicalFileUtils;
import com.yonde.dcs.document.core.service.*;
import com.yonde.dcs.document.core.util.ExtDocUtil;
import com.yonde.dcs.document.core.util.FileUtils;
import com.yonde.dcs.document.core.util.WorkFlowUtil;
import com.yonde.dcs.document.core.word.ImportWordService;
import com.yonde.dcs.plan.common.vo.ExtPlanDocLinkVO;
import com.yonde.dcs.plan.common.vo.ExtPlanVO;
import com.yonde.dcs.plan.feign.ExtDistributeRecordServiceFeign;
import com.yonde.dcs.plan.feign.ExtPlanDocLinkServiceFeign;
import com.yonde.dcs.plan.feign.ExtPlanServiceFeign;
......@@ -221,7 +224,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
//得到souceId获取计划,更新计划状态
ExtPlanVO source = planDocLinkVO.getSource();
source.setTaskState(Constants.COMPLETED);
extPlanService.saveAndChangeState(source);
// TODO: 2024/8/1 extPlanService.saveOrUpdate这个方法不存在
// extPlanService.saveOrUpdate(source);
}
}
documentVO.setState(state);
......@@ -416,7 +420,9 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
*/
@Override
public List<DxOrganizationVO> searchOrgNameByUserId(Long userId, String code) {
return extPlanService.searchOrgNameByUserId(userId, code);
// TODO: 2024/8/1 searchOrgNameByUserId这个方法不存在
// return extPlanService.searchOrgNameByUserId(userId, code);
return null;
}
/**
......@@ -595,7 +601,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
doc.setDynamicAttrs(map);
doc.setState(extPlanVO.getPhaseState());
//查询文档分类
this.extPlanService.searchFileType(extPlanVO.getFileType(), doc);
// TODO: 2024/8/1 extPlanService.searchFileT这个方法不存在
// this.extPlanService.searchFileType(extPlanVO.getFileType(), doc);
doc.markCreatorIdHold();
doc.markModifyIdHold();
//设置文档创建者
......@@ -605,12 +612,14 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
//绑定计划和文档的link
ExtPlanDocLinkVO planDocLinkVO = new ExtPlanDocLinkVO();
planDocLinkVO.setSource(extPlanVO);
planDocLinkVO.setTarget(dxDocumentVO);
// TODO: 2024/8/1 DxDocumentVO参数类型不匹对
// planDocLinkVO.setTarget(dxDocumentVO);
planDocLinkService.save(planDocLinkVO);
}
if ("计划反馈类".equals(extPlanVO.getFeedbackType())) {
//向计划执行人分发通知
this.extPlanService.generatePlanDistributeRecord(extPlanVO);
// TODO: 2024/8/1 extPlanService.generatePlanDistributeRecord方法不存在
// this.extPlanService.generatePlanDistributeRecord(extPlanVO);
}
}
......@@ -637,12 +646,16 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
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;
List<ExtInterfaceInfoLinkVO> interfaceInfoLinkVOS = this.recursionInterfaceInfoLinks(documentVO.getVersionId());
DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
DxWfProcessVO wfProcessInfoVO = dexWorkFlowService.getProcessDetail(wfProcessInstVO.getId());
// TODO: 2024/8/1 getWfProcessInst返回属性不匹对
// WfProcessInstVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
// DxWfProcessVO wfProcessInfoVO = dexWorkFlowService.getProcessDetail(wfProcessInstVO.getId());
if (!CollectionUtils.isEmpty(interfaceInfoLinkVOS)) {
//1、先根据提资记录生成多个文档
interfaceInfoLinkVOS.stream().forEach(item -> {
docBeforeCreateEvent.generateAutoInterFaceWord(docObjFile, item, wfProcessInfoVO);
// TODO: 2024/8/1 generateAutoInterFaceWord入参不匹对
// docBeforeCreateEvent.generateAutoInterFaceWord(docObjFile, item, wfProcessInfoVO);
});
try {
//2、合并生成好的文档
......@@ -871,7 +884,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
//深度查询展开ObjLink
DxDocumentVO documentVO = extDocUtil.findDocObjFileLinks(documentVo.getId());
log.info("自动任务======生成word签名开始");
DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
// TODO: 2024/7/31 4.1返回对象不匹对 WfProcessInstVO
// WfProcessInstVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
// TODO: 2024/7/31 4.1此方法不存在 getProcessInstDetailById(processId)
// WfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
String subTypeName = documentVO.getSubTypeName();
......@@ -1042,7 +1056,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
@Override
public void generateQHTechDoc(DxDocumentVO documentVO, Map<String, Object> wfTaskContext) {
if ((Constants.TECHNICAL_FILE.equals(documentVO.getOneLevCategory()))) {
DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
//TODO: 2024/7/31 4.1 不存在这个方法getWfProcessInst
// DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
// TODO: 2024/7/31 4.1 不存在这个方法getProcessInstDetailById
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
// //深度查询展开objFileLink
......
package com.yonde.dcs.document.core.util;
import com.yonde.dex.bmodel.common.entity.vo.ModelDefinitionVO;
import com.yonde.dex.dao.service.util.ApplicationContextUtil;
import com.yonde.dex.dict.feign.DictDataFeignService;
import com.yonde.dex.dict.service.vo.DictDataVO;
import org.apache.logging.log4j.util.Strings;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class CommonUtil {
/**
* 获取字典中文密级
*
* @param key
* @return
*/
public static String getSecretCode(String key) {
if (Strings.isEmpty(key)) {
return "";
}
DictDataFeignService dictService = ApplicationContextUtil.getBean(DictDataFeignService.class);
String secretKey = "SecretCode";
List<DictDataVO> dictData = dictService.getDictDatas(secretKey);
Map<String, String> dictMap = new HashMap<>();
for (DictDataVO dict : dictData) {
dictMap.put(dict.getDictKey(), dict.getDictValue());
}
return dictMap.get(key);
}
/**
* 获取字典中文值
*
* @param key
* @return
*/
public static String getCode(String key,String dictCode) {
if (Strings.isEmpty(key)) {
return "";
}
DictDataFeignService dictService = ApplicationContextUtil.getBean(DictDataFeignService.class);
String secretKey = dictCode;
List<DictDataVO> dictData = dictService.getDictDatas(secretKey);
Map<String, String> dictMap = new HashMap<>();
for (DictDataVO dict : dictData) {
dictMap.put(dict.getDictKey(), dict.getDictValue());
}
return dictMap.get(key);
}
/**
* 根据value升序排序
*
* @param aMap
* @param <K>
* @param <V>
* @return
*/
public static <K extends Comparable, V extends Comparable> LinkedHashMap<K, V> sortMapByValues(Map<K, V> aMap) {
LinkedHashMap<K, V> finalOut = new LinkedHashMap<>();
aMap.entrySet()
.stream()
.sorted((p1, p2) -> p1.getValue().compareTo(p2.getValue()))
.collect(Collectors.toList()).forEach(ele -> finalOut.put(ele.getKey(), ele.getValue()));
return finalOut;
}
/**
* 根据key降序排序
*
* @param aMap
* @param <K>
* @param <V>
* @return
*/
public static <K extends Comparable, V extends Comparable> LinkedHashMap<K, V> sortMapByKeys(Map<K, V> aMap) {
LinkedHashMap<K, V> finalOut = new LinkedHashMap<>();
aMap.entrySet()
.stream()
.sorted((p1, p2) -> p2.getKey().compareTo(p1.getKey()))
.collect(Collectors.toList()).forEach(ele -> finalOut.put(ele.getKey(), ele.getValue()));
return finalOut;
}
}
......@@ -6,12 +6,14 @@ import com.yonde.dcs.document.common.vo.DxDocumentVO;
import com.yonde.dcs.document.common.vo.ExtObsoleteDocLinkVO;
import com.yonde.dcs.document.common.vo.ObsoleteDocLinkVO;
import com.yonde.dcs.document.core.constants.Constants;
import com.yonde.dcs.document.core.service.DxDocumentService;
import com.yonde.dcs.document.core.service.ExtObsoleteDocLinkService;
import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.dao.service.util.DxPageUtils;
import com.yonde.dex.dfs.feign.FileManagerFeignService;
import com.yonde.dex.dfs.vo.ObjFileLinkVO;
import com.yonde.dex.dfs.vo.RepoFileVO;
import com.yonde.dex.user.feign.DxUserInfoFeign;
......@@ -41,13 +43,15 @@ public class ExtDocUtil {
public static Map<String, RequestAttributes> requestAttributes = new HashMap<>();
@Autowired
DocCenterFeignService docCenterFeignService;
DxDocumentService docCenterFeignService;
@Autowired
private FileService fileService;
@Autowired
private MinioFileStoreService minioFileStoreService;
@Autowired
private SiteService siteService;
private FileManagerFeignService fileService;
// TODO: 2024/8/1 MinioFileStoreService这个类不存在了
// @Autowired
// private MinioFileStoreService minioFileStoreService;
// TODO: 2024/8/1 SiteService这个类不存在了
// @Autowired
// private SiteService siteService;
@Autowired
private DxUserInfoFeign userService;
@Autowired
......@@ -95,8 +99,8 @@ public class ExtDocUtil {
* @param objFileLinks
* @return
*/
public PapersVO obtainPrimaryFile(List<ObjFileLinkVO> objFileLinks) {
PapersVO fileVO = null;
public RepoFileVO obtainPrimaryFile(List<ObjFileLinkVO> objFileLinks) {
RepoFileVO fileVO = null;
if (!CollectionUtils.isEmpty(objFileLinks)) {
fileVO = objFileLinks.stream().filter(objFileLinkVO -> Constants.MASTER_FILE.equals(objFileLinkVO.getContentType())).map(ObjFileLinkVO::getTarget)
.findFirst().orElse(null);
......@@ -109,22 +113,23 @@ public class ExtDocUtil {
*
* @param fileVO
*/
public InputStream obtainPrimaryFileInputStream(PapersVO fileVO) {
InputStream inputStream = null;
if (!ObjectUtils.isEmpty(fileVO)) {
log.info("开始下载主内容======》" + fileVO.getId());
Papers fileEntity = this.fileService.findById(fileVO.getId());
Site siteEntity = this.siteService.findByIsDefault(true);
if (Objects.isNull(fileEntity)) {
log.error("下载主内容失败!====》" + DxValutErrorCodeData.FILE_NOT_EXISTS);
} else {
inputStream = this.minioFileStoreService.download(fileEntity.getBucketName(), fileEntity.getMinioFileName(), fileEntity.getSecretKey(), siteEntity);
}
} else {
log.error("下载主内容失败======》fileVO为空!");
}
return inputStream;
}
// TODO: 2024/8/1 minioFileStoreService不存在
// public InputStream obtainPrimaryFileInputStream(RepoFileVO fileVO) {
// InputStream inputStream = null;
// if (!ObjectUtils.isEmpty(fileVO)) {
// log.info("开始下载主内容======》" + fileVO.getId());
// RepoFileVO fileEntity = this.fileService.findFileInfoById(fileVO.getId());
// Site siteEntity = this.siteService.findByIsDefault(true);
// if (Objects.isNull(fileEntity)) {
// log.error("下载主内容失败!====》" + DxValutErrorCodeData.FILE_NOT_EXISTS);
// } else {
// inputStream = this.minioFileStoreService.download(fileEntity.getBucketName(), fileEntity.getMinioFileName(), fileEntity.getSecretKey(), siteEntity);
// }
// } else {
// log.error("下载主内容失败======》fileVO为空!");
// }
// return inputStream;
// }
/**
* 通过id查询文档附件
......
......@@ -3,14 +3,21 @@ package com.yonde.dcs.document.core.util;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
import com.yonde.dcs.document.common.vo.DxDocumentVO;
import com.yonde.dcs.document.core.constants.Constants;
import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.entity.vo.IdVO;
import com.yonde.dex.dfs.handler.ContentHolder;
import com.yonde.dex.dfs.vo.ObjFileLinkVO;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.pdfbox.io.MemoryUsageSetting;
import org.apache.pdfbox.multipdf.PDFMergerUtility;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
......
package com.yonde.dcs.document.core.util;
import freemarker.core.XMLOutputFormat;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
import sun.misc.BASE64Encoder;
import java.io.*;
import java.util.Map;
/**
......
package com.yonde.dcs.document.core.util;
import com.inet.pdm.word.DocumentDispatch;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.ComThread;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
import com.yonde.dcs.document.core.word.DocumentDispatch;
import lombok.extern.slf4j.Slf4j;
/**
......
......@@ -3,8 +3,12 @@ package com.yonde.dcs.document.core.util;
import com.yonde.dcs.document.common.vo.DxDocumentVO;
import com.yonde.dcs.document.core.constants.SignConstants;
import com.yonde.dex.user.common.vo.DxUserInfoVO;
import com.yonde.dex.user.feign.DxUserInfoFeign;
import com.yonde.dex.wfc.common.enums.TaskStateEnum;
import com.yonde.dex.wfc.common.vo.DxWfProcessSearchVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Component;
......@@ -25,7 +29,7 @@ import java.util.stream.Collectors;
public class WorkFlowUtil {
@Autowired
private IInstanceService instanceService;
private WfcProcessFeign instanceService;
@Autowired
private DxUserInfoFeign userService;
......@@ -35,16 +39,17 @@ public class WorkFlowUtil {
* @param iterationVO
* @return
*/
public WfProcessInstVO getWfProcessInst(DxIterationVO iterationVO) {
WfProcessInstSearchVO wfProcessInstSearchVO = new WfProcessInstSearchVO();
wfProcessInstSearchVO.setPboClass(iterationVO.getClass().getName());
wfProcessInstSearchVO.setPboId(iterationVO.getVersionId());
Page<WfProcessInstVO> wfProcessInstVOPage = this.instanceService.getProcessInstList(wfProcessInstSearchVO, 1, 10);
if (!CollectionUtils.isEmpty(wfProcessInstVOPage.getContent())) {
return wfProcessInstVOPage.getContent().get(0);
}
return null;
}
// TODO: 2024/8/1 DxIterationVO不存在
// public WfProcessInstVO getWfProcessInst(DxIterationVO iterationVO) {
// DxWfProcessSearchVO wfProcessInstSearchVO = new DxWfProcessSearchVO();
// wfProcessInstSearchVO.setPboClass(iterationVO.getClass().getName());
// wfProcessInstSearchVO.setPboId(iterationVO.getVersionId());
// Page<WfProcessInstVO> wfProcessInstVOPage = this.instanceService.getProcessList(wfProcessInstSearchVO, 1, 10);
// if (!CollectionUtils.isEmpty(wfProcessInstVOPage.getContent())) {
// return wfProcessInstVOPage.getContent().get(0);
// }
// return null;
// }
/**
* 获取流程实例
......@@ -52,37 +57,39 @@ public class WorkFlowUtil {
* @param doc
* @return
*/
public WfProcessInstVO getWfProcessInst(DxDocumentVO doc) {
WfProcessInstSearchVO wfProcessInstSearchVO = new WfProcessInstSearchVO();
wfProcessInstSearchVO.setPboClass(DxDocumentVO.class.getName());
wfProcessInstSearchVO.setPboId(doc.getVersionId());
Page<WfProcessInstVO> wfProcessInstVOPage = this.instanceService.getProcessInstList(wfProcessInstSearchVO, 1, 10);
if (!CollectionUtils.isEmpty(wfProcessInstVOPage.getContent())) {
return wfProcessInstVOPage.getContent().get(0);
}
return null;
}
// TODO: 2024/8/1 getProcessInstList方法不存在
// public WfProcessInstVO getWfProcessInst(DxDocumentVO doc) {
// WfProcessInstSearchVO wfProcessInstSearchVO = new WfProcessInstSearchVO();
// wfProcessInstSearchVO.setPboClass(DxDocumentVO.class.getName());
// wfProcessInstSearchVO.setPboId(doc.getVersionId());
// Page<WfProcessInstVO> wfProcessInstVOPage = this.instanceService.getProcessInstList(wfProcessInstSearchVO, 1, 10);
// if (!CollectionUtils.isEmpty(wfProcessInstVOPage.getContent())) {
// return wfProcessInstVOPage.getContent().get(0);
// }
// return null;
// }
/**
* 通过pbo获取流程实例签审详情信息
*
* @param doc
*/
public Map<String, List<WfProcessTaskVO>> getWfInfo(DxDocumentVO doc) {
WfProcessInstVO wfProcessInstVO = getWfProcessInst(doc);
if (!ObjectUtils.isEmpty(wfProcessInstVO)) {
WfProcessInfoVO wfProcessInfo = this.instanceService.getProcessInstSimpleDetailById(wfProcessInstVO.getId());
List<WfProcessTaskVO> historyInfoList = wfProcessInfo.getHistoryInfo();
List<String> checkResult = Arrays.asList("提交", "通过");
Map<String, List<WfProcessTaskVO>> wfHistoryMap = historyInfoList.stream().filter(p -> TaskStateEnum.COMPLETE.name().equals(p.getState()) && checkResult.contains(p.getResult()))
.sorted(Comparator.comparing(WfProcessTaskVO::getEndTime).reversed())
.collect(Collectors.groupingBy(WfProcessTaskVO::getName));
return wfHistoryMap;
}
return null;
}
// TODO: 2024/8/1 getProcessInstList方法不存在
// public Map<String, List<DxWfProcessTaskVO>> getWfInfo(DxDocumentVO doc) {
// WfProcessInstVO wfProcessInstVO = getWfProcessInst(doc);
// if (!ObjectUtils.isEmpty(wfProcessInstVO)) {
// WfProcessInfoVO wfProcessInfo = this.instanceService.getProcessInstSimpleDetailById(wfProcessInstVO.getId());
// List<WfProcessTaskVO> historyInfoList = wfProcessInfo.getHistoryInfo();
//
// List<String> checkResult = Arrays.asList("提交", "通过");
// Map<String, List<WfProcessTaskVO>> wfHistoryMap = historyInfoList.stream().filter(p -> TaskStateEnum.COMPLETE.name().equals(p.getState()) && checkResult.contains(p.getResult()))
// .sorted(Comparator.comparing(WfProcessTaskVO::getEndTime).reversed())
// .collect(Collectors.groupingBy(WfProcessTaskVO::getName));
//
// return wfHistoryMap;
// }
// return null;
// }
/**
* 根据任务名称获取处理人
......@@ -91,11 +98,11 @@ public class WorkFlowUtil {
* @param taskName
* @return
*/
public String getHandler(Map<String, List<WfProcessTaskVO>> wfHistoryMap, String taskName) {
public String getHandler(Map<String, List<DxWfProcessTaskVO>> wfHistoryMap, String taskName) {
String str = "";
if (wfHistoryMap.containsKey(taskName) && !ObjectUtils.isEmpty(wfHistoryMap.get(taskName).get(0))) {
String userId = wfHistoryMap.get(taskName).get(0).getAssignee();
UserVO userVO = userService.get(Long.parseLong(userId));
DxUserInfoVO userVO = (DxUserInfoVO) userService.get(Long.parseLong(userId));
str = userVO.getUserAccount() + ".png";
return str;
}
......@@ -109,7 +116,7 @@ public class WorkFlowUtil {
* @param taskName
* @return
*/
public String getHandlerUser(Map<String, List<WfProcessTaskVO>> wfHistoryMap, String taskName) {
public String getHandlerUser(Map<String, List<DxWfProcessTaskVO>> wfHistoryMap, String taskName) {
if (wfHistoryMap.containsKey(taskName) && !ObjectUtils.isEmpty(wfHistoryMap.get(taskName).get(0))) {
return wfHistoryMap.get(taskName).get(0).getAssigneeName();
}
......@@ -123,32 +130,34 @@ public class WorkFlowUtil {
* @param activityName
* @return
*/
public String getSignImage(List<WfTaskDefinitionVO> activities, List<String> activityName) {
for (WfTaskDefinitionVO wf : activities) {
if (activityName.contains(wf.getTaskName())) {
return getActivityUserName(wf);
}
}
return " ";
}
// TODO: 2024/8/1 WfTaskDefinitionVO类不存在
// public String getSignImage(List<WfTaskDefinitionVO> activities, List<String> activityName) {
// for (WfTaskDefinitionVO wf : activities) {
// if (activityName.contains(wf.getTaskName())) {
// return getActivityUserName(wf);
// }
// }
// return " ";
// }
/**
* 获取用户名称及用户id
*/
public String getActivityUserName(WfTaskDefinitionVO activity) {
String str = " ";
List<WfProcessTaskVO> taskList = activity.getTaskList();
for (WfProcessTaskVO wf : taskList) {
if (wf.getState().equals(TaskStateEnum.COMPLETE.name()) && (SignConstants.WfResultList.contains(wf.getResult()))) {
//获取用户名称和id
String userName = wf.getAssigneeName();
String userId = wf.getAssignee();
UserVO userVO = userService.get(Long.parseLong(userId));
str = userVO.getUserAccount() + ".png";
}
}
return str;
}
// TODO: 2024/8/1 WfTaskDefinitionVO类不存在
// public String getActivityUserName(WfTaskDefinitionVO activity) {
// String str = " ";
// List<WfProcessTaskVO> taskList = activity.getTaskList();
// for (WfProcessTaskVO wf : taskList) {
// if (wf.getState().equals(TaskStateEnum.COMPLETE.name()) && (SignConstants.WfResultList.contains(wf.getResult()))) {
// //获取用户名称和id
// String userName = wf.getAssigneeName();
// String userId = wf.getAssignee();
// UserVO userVO = userService.get(Long.parseLong(userId));
// str = userVO.getUserAccount() + ".png";
// }
// }
// return str;
// }
/**
* 获取某个环节结束时间
......@@ -157,14 +166,15 @@ public class WorkFlowUtil {
* @param activityName
* @return
*/
public String getEndDate(List<WfTaskDefinitionVO> activities, List<String> activityName) {
for (WfTaskDefinitionVO wf : activities) {
if (activityName.contains(wf.getTaskName())) {
return Optional.ofNullable(getActiveEndDate(wf)).orElse("");
}
}
return " ";
}
// TODO: 2024/8/1 WfTaskDefinitionVO类不存在
// public String getEndDate(List<WfTaskDefinitionVO> activities, List<String> activityName) {
// for (WfTaskDefinitionVO wf : activities) {
// if (activityName.contains(wf.getTaskName())) {
// return Optional.ofNullable(getActiveEndDate(wf)).orElse("");
// }
// }
// return " ";
// }
/**
* 修改后的处理获取日期
......@@ -172,17 +182,18 @@ public class WorkFlowUtil {
* @param activity
* @return
*/
private String getActiveEndDate(WfTaskDefinitionVO activity) {
List<WfProcessTaskVO> taskList = activity.getTaskList();
String date = "";
SimpleDateFormat dateFm = new SimpleDateFormat("yyyy-MM-dd");
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(taskList)) {
for (WfProcessTaskVO wf : taskList) {
if (wf.getState().equals(TaskStateEnum.COMPLETE.name()) && (SignConstants.WfResultList.contains(wf.getResult()))) {
return dateFm.format(wf.getEndTime()).replace(".", "-");
}
}
}
return date;
}
// TODO: 2024/8/1 WfTaskDefinitionVO类不存在
// private String getActiveEndDate(WfTaskDefinitionVO activity) {
// List<WfProcessTaskVO> taskList = activity.getTaskList();
// String date = "";
// SimpleDateFormat dateFm = new SimpleDateFormat("yyyy-MM-dd");
// if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(taskList)) {
// for (WfProcessTaskVO wf : taskList) {
// if (wf.getState().equals(TaskStateEnum.COMPLETE.name()) && (SignConstants.WfResultList.contains(wf.getResult()))) {
// return dateFm.format(wf.getEndTime()).replace(".", "-");
// }
// }
// }
// return date;
// }
}
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