Commit 21ec4376 authored by xuzhang's avatar xuzhang

[feat][DOC]定时任务Feign接口添加

parent 0c095bbb
...@@ -13,8 +13,10 @@ ...@@ -13,8 +13,10 @@
<module name="dcs-doc-expand-feign" /> <module name="dcs-doc-expand-feign" />
<module name="dcs-doc-expand-entity" /> <module name="dcs-doc-expand-entity" />
<module name="dcs-doc-expand-server" /> <module name="dcs-doc-expand-server" />
<module name="dcs-doc-autotask-interface" />
</profile> </profile>
</annotationProcessing> </annotationProcessing>
<bytecodeTargetLevel>
<module name="dcs-doc-autotask-interface" target="1.8" />
</bytecodeTargetLevel>
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.yonde.dcs</groupId> <groupId>com.yonde.dcs</groupId>
<artifactId>dcs-doc-expand-core</artifactId> <artifactId>dcs-doc-expand-feign</artifactId>
<version>4.1-RELEASE</version> <version>4.1-RELEASE</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
package com.yonde.dcs.task; //package com.yonde.dcs.task;
//
import cn.hutool.core.collection.CollectionUtil; //import cn.hutool.core.collection.CollectionUtil;
import com.yonde.dcs.core.constants.Constants; //import com.yonde.dcs.core.constants.Constants;
import com.yonde.dcs.core.service.ExtSendFormLinkService; //import com.yonde.dcs.core.service.ExtSendFormLinkService;
import com.yonde.dcs.core.util.ExtDocUtil; //import com.yonde.dcs.core.util.ExtDocUtil;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO; //import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dex.basedata.entity.api.ApiResult; //import com.yonde.dex.basedata.entity.api.ApiResult;
import com.yonde.dex.basedata.entity.vo.IdVO; //import com.yonde.dex.basedata.entity.vo.IdVO;
import com.yonde.dex.taskmonitor.api.interfaces.TaskMessagePusher; //import com.yonde.dex.taskmonitor.api.interfaces.TaskMessagePusher;
import com.yonde.dex.wfc.common.vo.DxWfProcessSearchVO; //import com.yonde.dex.wfc.common.vo.DxWfProcessSearchVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessVO; //import com.yonde.dex.wfc.common.vo.DxWfProcessVO;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign; //import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import io.swagger.annotations.Api; //import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; //import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; //import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*; //import org.springframework.web.bind.annotation.*;
//
/** ///**
* @program: service // * @program: service
* @description: 自动任务服务接口 // * @description: 自动任务服务接口
* @author: dang wei // * @author: dang wei
* @create: 2021-07-13 10:01 // * @create: 2021-07-13 10:01
*/ // */
@RestController //@RestController
@RequestMapping("/task") //@RequestMapping("/task")
@Api(tags = "自动任务服务接口") //@Api(tags = "自动任务服务接口")
public class ExtAutoTaskController { //public class ExtAutoTaskController {
//
@Autowired // @Autowired
WfcProcessFeign wfcProcessFeign; // WfcProcessFeign wfcProcessFeign;
//
@Autowired // @Autowired
TaskMessagePusher taskMessagePusher; // TaskMessagePusher taskMessagePusher;
@Autowired // @Autowired
private ExtAutoTaskService autoTaskService; // private ExtAutoTaskService autoTaskService;
@Autowired // @Autowired
private ExtDocUtil extDocUtil; // private ExtDocUtil extDocUtil;
//
@Autowired // @Autowired
private ExtSendFormLinkService sendFormLinkService; // private ExtSendFormLinkService sendFormLinkService;
//
@ApiOperation("电子签名") // @ApiOperation("电子签名")
@PostMapping({"/esign"}) // @PostMapping({"/esign"})
public ApiResult esign(@RequestBody IdVO entity) { // public ApiResult esign(@RequestBody IdVO entity) {
DxWfProcessSearchVO dxWfProcessSearchVO = new DxWfProcessSearchVO(); // DxWfProcessSearchVO dxWfProcessSearchVO = new DxWfProcessSearchVO();
dxWfProcessSearchVO.setPboClass(entity.getDxClassname()); // dxWfProcessSearchVO.setPboClass(entity.getDxClassname());
dxWfProcessSearchVO.setPboId(entity.getId()); // dxWfProcessSearchVO.setPboId(entity.getId());
Page<DxWfProcessVO> dxWfProcessVODxPage = this.wfcProcessFeign.getProcessList(dxWfProcessSearchVO, 1, 1); // Page<DxWfProcessVO> dxWfProcessVODxPage = this.wfcProcessFeign.getProcessList(dxWfProcessSearchVO, 1, 1);
if (CollectionUtil.isNotEmpty(dxWfProcessVODxPage.getContent())) { // if (CollectionUtil.isNotEmpty(dxWfProcessVODxPage.getContent())) {
DxWfProcessVO dxWfProcessVO = dxWfProcessVODxPage.getContent().get(0); // DxWfProcessVO dxWfProcessVO = dxWfProcessVODxPage.getContent().get(0);
//
String pboKey = ""; // String pboKey = "";
String signNode = ""; // String signNode = "";
//
if (DxDocumentVO.class.getName().equals(entity.getDxClassname())) { // if (DxDocumentVO.class.getName().equals(entity.getDxClassname())) {
pboKey = "doc"; // pboKey = "doc";
signNode = "Activity_0st1yf8"; // signNode = "Activity_0st1yf8";
} // }
// DxWfTaskContext dxWfTaskContext = new DxWfTaskContext(dxWfProcessVO.getBusinessKey(), dxWfProcessVO.getId(), dxWfProcessVO.getProcessDef().getId(), signNode, null, (Map) null); //// DxWfTaskContext dxWfTaskContext = new DxWfTaskContext(dxWfProcessVO.getBusinessKey(), dxWfProcessVO.getId(), dxWfProcessVO.getProcessDef().getId(), signNode, null, (Map) null);
//todo 在4.1中未找到WfcSignMessage 注释了71-74行 ////todo 在4.1中未找到WfcSignMessage 注释了71-74行
// WfcSignMessage wfcSignMessage = new WfcSignMessage(new HashMap()); // // WfcSignMessage wfcSignMessage = new WfcSignMessage(new HashMap());
// wfcSignMessage.setWfTaskContext(dxWfTaskContext); //// wfcSignMessage.setWfTaskContext(dxWfTaskContext);
// wfcSignMessage.setSignType(pboKey); //// wfcSignMessage.setSignType(pboKey);
// TaskMessage taskMessage = (new WfcSignMessageBuilder()).newTasks(wfcSignMessage); //// TaskMessage taskMessage = (new WfcSignMessageBuilder()).newTasks(wfcSignMessage);
// this.taskMessagePusher.sendMessage(taskMessage); //// this.taskMessagePusher.sendMessage(taskMessage);
this.taskMessagePusher.sendMessage(null); // this.taskMessagePusher.sendMessage(null);
return ApiResult.ok("重新发送电子签名请求成功!"); // return ApiResult.ok("重新发送电子签名请求成功!");
} else { // } else {
return ApiResult.ok("该对象未走签审流程!"); // return ApiResult.ok("该对象未走签审流程!");
} // }
} // }
@ApiOperation(value = "更新PDF", notes = "更新PDF", httpMethod = "GET") // @ApiOperation(value = "更新PDF", notes = "更新PDF", httpMethod = "GET")
@GetMapping(value = "/updatePdf/{id}") // @GetMapping(value = "/updatePdf/{id}")
public ApiResult updatePdf(@PathVariable Long id) { // public ApiResult updatePdf(@PathVariable Long id) {
DxDocumentVO documentVO = extDocUtil.findDocObjFileLinks(id); // DxDocumentVO documentVO = extDocUtil.findDocObjFileLinks(id);
//重新生成设计图册签名 // //重新生成设计图册签名
autoTaskService.generateQHTechDoc(documentVO, null); // autoTaskService.generateQHTechDoc(documentVO, null);
if (Constants.OUTDATED_NOTIFY.equals(documentVO.getSubTypeName())) { // if (Constants.OUTDATED_NOTIFY.equals(documentVO.getSubTypeName())) {
//特殊处理过时文件通知单 // //特殊处理过时文件通知单
autoTaskService.generateOutdatedDocNotify(documentVO); // autoTaskService.generateOutdatedDocNotify(documentVO);
} else { // } else {
//重新生成单据签名 // //重新生成单据签名
autoTaskService.generateDocWordSign(documentVO, null, "二"); // autoTaskService.generateDocWordSign(documentVO, null, "二");
} // }
return ApiResult.ok("更新成功!"); // return ApiResult.ok("更新成功!");
} // }
} //}
/*
package com.yonde.dcs.task; package com.yonde.dcs.task;
...@@ -8,141 +9,182 @@ import com.yonde.dcs.plan.common.vo.ExtPlanVO; ...@@ -8,141 +9,182 @@ import com.yonde.dcs.plan.common.vo.ExtPlanVO;
import java.util.Map; import java.util.Map;
*/
/** /**
* @program: inet-pdm-service * @program: inet-pdm-service
* @description: 自动任务服务接口 * @description: 自动任务服务接口
* @author: dang wei * @author: dang wei
* @create: 2021-09-27 09:41 * @create: 2021-09-27 09:41
*/ *//*
public interface ExtAutoTaskService { public interface ExtAutoTaskService {
/** */
/**
* 客户化文档修改状态 * 客户化文档修改状态
* *
* @param documentVO * @param documentVO
*/ *//*
void extChangeDocState(DxDocumentVO documentVO, String state); void extChangeDocState(DxDocumentVO documentVO, String state);
/** */
/**
* 给选择的提资方人员发放通知 * 给选择的提资方人员发放通知
* *
* @param documentVO * @param documentVO
* @param userId * @param userId
*/ *//*
void informativeUser(DxDocumentVO documentVO, String userId); void informativeUser(DxDocumentVO documentVO, String userId);
/** */
/**
* 设置提资审核 * 设置提资审核
* *
* @param taskParticipant * @param taskParticipant
* @param processInstId * @param processInstId
* @param key * @param key
* @param value * @param value
*/ *//*
void extSetProcessVariable(Map<String, Object> taskParticipant, String processInstId, String key, Object value); void extSetProcessVariable(Map<String, Object> taskParticipant, String processInstId, String key, Object value);
/** */
/**
* 设置提资人变量 * 设置提资人变量
* *
* @param processInstId * @param processInstId
* @param varKey * @param varKey
* @param informativeUser * @param informativeUser
*/ *//*
void setInformativeUser(String processInstId, String varKey, String informativeUser); void setInformativeUser(String processInstId, String varKey, String informativeUser);
/** */
/**
* 自动发送联系单 * 自动发送联系单
*/ *//*
void sendContractDoc(DxDocumentVO documentVO, String contractName); void sendContractDoc(DxDocumentVO documentVO, String contractName);
/** */
/**
* 创建过时文件通知单 * 创建过时文件通知单
* *
* @param documentVO * @param documentVO
*/ *//*
void createDocNotify(DxDocumentVO documentVO); void createDocNotify(DxDocumentVO documentVO);
/** */
/**
* 设置编制节点人员回显事件 * 设置编制节点人员回显事件
* *
* @param taskId * @param taskId
* @param documentVO * @param documentVO
*/ *//*
void setProcessSelectionInfo(String taskId, DxDocumentVO documentVO); void setProcessSelectionInfo(String taskId, DxDocumentVO documentVO);
/** */
/**
* 任务完成后更新pbo属性,驳回操作,设置编制节点人员回显 * 任务完成后更新pbo属性,驳回操作,设置编制节点人员回显
* *
* @param taskId * @param taskId
* @param documentVO * @param documentVO
*/ *//*
void getProcessSelectionInfo(String taskId, DxDocumentVO documentVO); void getProcessSelectionInfo(String taskId, DxDocumentVO documentVO);
/** */
/**
* 计划生命周期事件 * 计划生命周期事件
* *
* @param extPlanVO * @param extPlanVO
*/ *//*
void pressPlanInfo(ExtPlanVO extPlanVO) throws Exception; void pressPlanInfo(ExtPlanVO extPlanVO) throws Exception;
/** */
/**
* 内部接口-生成提资信息word * 内部接口-生成提资信息word
* *
* @param documentVO * @param documentVO
*/ *//*
void generateInformationWord(DxDocumentVO documentVO); void generateInformationWord(DxDocumentVO documentVO);
/** */
/**
* 生成NCR审查单word * 生成NCR审查单word
*/ *//*
void generateNcrReviewWord(DxDocumentVO documentVO, Map<String, Object> wfTaskContext); void generateNcrReviewWord(DxDocumentVO documentVO, Map<String, Object> wfTaskContext);
/** */
/**
* 生成word签字 * 生成word签字
* *
* @param documentVO * @param documentVO
* @param wfTaskContext * @param wfTaskContext
* @param fileName 同室审核完生成签名附件为(附件1),签审流程走完后生成签名附件为(附件2),没有是为""。 * @param fileName 同室审核完生成签名附件为(附件1),签审流程走完后生成签名附件为(附件2),没有是为""。
*/ *//*
void generateDocWordSign(DxDocumentVO documentVO, Map<String, Object> wfTaskContext, String fileName); void generateDocWordSign(DxDocumentVO documentVO, Map<String, Object> wfTaskContext, String fileName);
/** */
/**
* 内部接口-保存内部接口信息的总体室、审核签审信息值 * 内部接口-保存内部接口信息的总体室、审核签审信息值
*/ *//*
void savedInterfaceWf(DxDocumentVO documentVO, Map<String, Object> wfTaskContext); void savedInterfaceWf(DxDocumentVO documentVO, Map<String, Object> wfTaskContext);
/** */
/**
* 自动任务-编制节点后生成word方法(自动任务修改方法) * 自动任务-编制节点后生成word方法(自动任务修改方法)
*/ *//*
void generateWordByAutoMethod(DxDocumentVO documentVo); void generateWordByAutoMethod(DxDocumentVO documentVo);
/** */
/**
* 自动任务-校验图册下的图纸是否检入 * 自动任务-校验图册下的图纸是否检入
*/ *//*
void checkLockerUtil(DxDocumentVO documentVo); void checkLockerUtil(DxDocumentVO documentVo);
/** */
/**
* 自动任务-生成QH技术文件签审页 * 自动任务-生成QH技术文件签审页
*/ *//*
void generateQHTechDoc(DxDocumentVO documentVO, Map<String, Object> wfTaskContext); void generateQHTechDoc(DxDocumentVO documentVO, Map<String, Object> wfTaskContext);
/** */
/**
* 结束流程实例 * 结束流程实例
* *
* @param iterationObject * @param iterationObject
*/ *//*
// TODO: 2024/7/31 DxIterationVO在4.1不存在 // TODO: 2024/7/31 DxIterationVO在4.1不存在
// void endProcess(DxIterationVO iterationObject); // void endProcess(DxIterationVO iterationObject);
/** */
/**
* 生成过时文件通知单word * 生成过时文件通知单word
* *
* @param documentVO * @param documentVO
*/ *//*
void generateOutdatedDocNotify(DxDocumentVO documentVO); void generateOutdatedDocNotify(DxDocumentVO documentVO);
/** */
/**
* 已发布后修改状态已过时 * 已发布后修改状态已过时
*/ *//*
void changeOldDataState(DxDocumentVO documentVO); void changeOldDataState(DxDocumentVO documentVO);
} }
*/
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -138,6 +138,27 @@ ...@@ -138,6 +138,27 @@
<artifactId>ooxml-schemas</artifactId> <artifactId>ooxml-schemas</artifactId>
<version>1.4</version> <version>1.4</version>
</dependency> </dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.13.2</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>layout</artifactId>
<version>7.1.11</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>forms</artifactId>
<version>7.1.13</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-asian</artifactId>
<version>5.2.0</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
package com.yonde.dcs.core.service;
import com.yonde.dcs.common.vo.ExtApplicantVO;
import com.yonde.dcs.common.vo.ExtAuditObjectVO;
import com.yonde.dcs.common.vo.ExtInterfaceVO;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.feign.ExtAutoTaskServiceFeign;
import com.yonde.dcs.plan.common.vo.ExtPlanVO;
import lombok.SneakyThrows;
import java.util.Map;
/**
* @program: inet-pdm-service
* @description: 自动任务服务接口
* @author: dang wei
* @create: 2021-09-27 09:41
*/
public interface ExtAutoTaskService extends ExtAutoTaskServiceFeign {
/**
* 客户化文档修改状态
*
* @param documentVO
*/
void extChangeDocState(DxDocumentVO documentVO, String state);
/**
* 给选择的提资方人员发放通知
*
* @param documentVO
* @param userId
*/
void informativeUser(DxDocumentVO documentVO, String userId);
/**
* 设置提资审核
*
* @param taskParticipant
* @param processInstId
* @param key
* @param value
*/
void extSetProcessVariable(Map<String, Object> taskParticipant, String processInstId, String key, Object value);
/**
* 设置提资人变量
*
* @param processInstId
* @param varKey
* @param informativeUser
*/
void setInformativeUser(String processInstId, String varKey, String informativeUser);
/**
* 自动发送联系单
*/
void sendContractDoc(DxDocumentVO documentVO, String contractName);
/**
* 创建过时文件通知单
*
* @param documentVO
*/
void createDocNotify(DxDocumentVO documentVO);
/**
* 设置编制节点人员回显事件
*
* @param taskId
* @param documentVO
*/
void setProcessSelectionInfo(String taskId, DxDocumentVO documentVO);
/**
* 任务完成后更新pbo属性,驳回操作,设置编制节点人员回显
*
* @param taskId
* @param documentVO
*/
void getProcessSelectionInfo(String taskId, DxDocumentVO documentVO);
/**
* 计划生命周期事件
*
* @param extPlanVO
*/
void pressPlanInfo(ExtPlanVO extPlanVO) throws Exception;
/**
* 内部接口-生成提资信息word
*
* @param documentVO
*/
void generateInformationWord(DxDocumentVO documentVO);
/**
* 生成NCR审查单word
*/
void generateNcrReviewWord(DxDocumentVO documentVO, Map<String, Object> wfTaskContext);
/**
* 生成word签字
*
* @param documentVO
* @param wfTaskContext
* @param fileName 同室审核完生成签名附件为(附件1),签审流程走完后生成签名附件为(附件2),没有是为""。
*/
void generateDocWordSign(DxDocumentVO documentVO, Map<String, Object> wfTaskContext, String fileName);
/**
* 内部接口-保存内部接口信息的总体室、审核签审信息值
*/
void savedInterfaceWf(DxDocumentVO documentVO, Map<String, Object> wfTaskContext);
/**
* 自动任务-编制节点后生成word方法(自动任务修改方法)
*/
void generateWordByAutoMethod(DxDocumentVO documentVo);
/**
* 自动任务-校验图册下的图纸是否检入
*/
void checkLockerUtil(DxDocumentVO documentVo);
/**
* 自动任务-生成QH技术文件签审页
*/
void generateQHTechDoc(DxDocumentVO documentVO, Map<String, Object> wfTaskContext);
/**
* 结束流程实例
*
* @param iterationObject
*/
// TODO: 2024/7/31 DxIterationVO在4.1不存在
// void endProcess(DxIterationVO iterationObject);
/**
* 生成过时文件通知单word
*
* @param documentVO
*/
void generateOutdatedDocNotify(DxDocumentVO documentVO);
/**
* 已发布后修改状态已过时
*/
void changeOldDataState(DxDocumentVO documentVO);
/**
* 申请内容 签名
*
* @param applicantVO
* @param wfTaskContext
*/
@SneakyThrows
void autoApplicantSign(ExtApplicantVO applicantVO, Map<String, Object> wfTaskContext);
/**
* 接口单签名
*
* @param extInterfaceVO
* @param wfTaskContext
*/
void autoInterFaceSign(ExtInterfaceVO extInterfaceVO, Map<String, Object> wfTaskContext);
/**
* 签审对象 关联的接口单 状态置为已终止 (签审对象的终止流程)
* @param auditObjectVO
*/
@SneakyThrows
void autoInterfaceEnd(ExtAuditObjectVO auditObjectVO);
/**
* 申请内容走完流程后 自动启动 接口单的流程
* @param applicantVO 申请内容
*/
void startInterFaceFlow(ExtApplicantVO applicantVO);
/**
* 接口单 走完流程后 根据属性 applicantConfirm 申请方确认:待补充、不接受 重新创建启动流程
*
* @param extInterfaceVO
*/
void startAddInterFaceFlow(ExtInterfaceVO extInterfaceVO);
/**
* 签审对象 扫描所有提资单 并更新状态
* @param extInterfaceVO
*/
void stopAllExtApplicantFaceFlow(ExtInterfaceVO extInterfaceVO);
}
package com.yonde.dcs.core.util;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.map.MapUtil;
import com.yonde.dcs.core.constants.SignConstants;
import com.yonde.dex.dao.service.util.ApplicationContextUtil;
import com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.client.utils.CloneUtils;
import org.springframework.data.domain.Page;
import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @author wyy
* @date 2023-2-10 16:00
* @describe
*/
@Slf4j
public class ExtWfcUtil {
/**
* 根据 versionId + 类型 获取当前版本流程参与者的信息
*
* @param clsObj
* @param versionId
* @param signMap 签字节点需要搜索的签字节点,可为空
* @return
*/
public static Map<String, String> getProcessTeam(Class clsObj, Long versionId, HashMap<String, String> signMap) {
//TODO
// IInstanceService processService = ApplicationContextUtil.getBean(IInstanceService.class);
// WfProcessInstSearchVO searchVO = new WfProcessInstSearchVO();
// searchVO.setPboId(versionId);
// searchVO.setPboClass(clsObj.getCanonicalName());
// Page<WfProcessInstVO> processList = processService.getProcessInstList(searchVO, 1, 100);
// if (Objects.isNull(processList) || CollectionUtils.isEmpty(processList.getContent())) {
// log.error("[EXT流程]:根据pbo的versionId和cls类型未获取到团队成员:{}", versionId + clsObj.getCanonicalName());
// return new HashMap<>();
// }
// WfProcessInstVO dxWfProcessVO = processList.getContent().get(0);
// String instId = dxWfProcessVO.getId();
// return getTaskParticipants(instId, clsObj, signMap);
return null;
}
/**
* 获取 提资人
*
* @param clsObj
* @param versionId
* @return
*/
public static Long getProcessTiZiId(Class clsObj, Long versionId) {
//TODO
// IInstanceService processService = ApplicationContextUtil.getBean(IInstanceService.class);
// WfProcessInstSearchVO searchVO = new WfProcessInstSearchVO();
// searchVO.setPboId(versionId);
// searchVO.setPboClass(clsObj.getCanonicalName());
// Page<WfProcessInstVO> processList = processService.getProcessInstList(searchVO, 1, 100);
// if (Objects.isNull(processList) || CollectionUtils.isEmpty(processList.getContent())) {
// log.error("[EXT流程]:根据pbo的versionId和cls类型未获取到团队成员:{}", versionId + clsObj.getCanonicalName());
// return null;
// }
// WfProcessInstVO dxWfProcessVO = processList.getContent().get(0);
// String instId = dxWfProcessVO.getId();
// DexWorkFlowService dexWorkFlowService = ApplicationContextUtil.getBean(DexWorkFlowService.class);
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstSimpleDetailById(instId);
// List<DxWfProcessTaskVO> activities = wfProcessInfoVO.getHistoryInfo();
// DxWfProcessTaskVO resolver = activities.stream()
// .filter(wfProcessTaskVO -> wfProcessTaskVO.getName().equals("提资中") && ("通过".equals(wfProcessTaskVO.getResult()) || "提交审阅".equals(wfProcessTaskVO.getResult()) || "提交签审".equalsIgnoreCase(wfProcessTaskVO.getResult()))).findFirst().orElse(null);
// return Long.valueOf(resolver.getAssignee());
return null;
}
/**
* 获取流程参与者
*
* @param processId
* @param clsObj
* @return
*/
@SneakyThrows
public static Map<String, String> getTaskParticipants(String processId, Class clsObj, HashMap<String, String> signMap) {
//TODO
// Map<String, String> data = new HashMap<>();
// DexWorkFlowService dexWorkFlowService = ApplicationContextUtil.getBean(DexWorkFlowService.class);
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstSimpleDetailById(processId);
// List<DxWfProcessTaskVO> activities = wfProcessInfoVO.getHistoryInfo();
// String dateStr = "";
// if (MapUtil.isEmpty(signMap)) {
// signMap = CloneUtils.cloneObject(SignConstants.SignNodeMap);
// }
// 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(dateStr, getResolverData(activities, entry.getKey()));
// }
// data.entrySet().removeIf(o -> org.springframework.util.StringUtils.isEmpty(o.getValue()));
// return data;
return null;
}
/**
* 获取某个环节执行者
*
* @param activities
* @param activityName
* @return
*/
public static String getResolverName(List<DxWfProcessTaskVO> activities, String activityName) {
DxWfProcessTaskVO resolver = getResolver(activities, activityName);
if (Objects.isNull(resolver)) {
return null;
}
//获取用户的id resolver.getAssigneeName() 用户的名称
//Long userId = Long.valueOf(resolver.getAssignee());
return resolver.getAssigneeName();
}
/**
* 得到环节信息
*
* @param activities
* @param activityName
* @return
*/
public static DxWfProcessTaskVO getResolver(List<DxWfProcessTaskVO> activities, String activityName) {
DxWfProcessTaskVO resolver = activities.stream()
.filter(wfProcessTaskVO -> wfProcessTaskVO.getName().equals(activityName) && ("通过".equals(wfProcessTaskVO.getResult()) || "提交审阅".equals(wfProcessTaskVO.getResult()) || "提交签审".equalsIgnoreCase(wfProcessTaskVO.getResult()))).findFirst().orElse(null);
return resolver;
}
/**
* 获取某个环节的结束时间
*
* @param activities
* @param activityName
* @return
*/
public static String getResolverData(List<DxWfProcessTaskVO> activities, String activityName) {
DxWfProcessTaskVO resolver = getResolver(activities, activityName);
SimpleDateFormat dateFm = new SimpleDateFormat("yyyy-MM-dd");
if (Objects.isNull(resolver)) {
return null;
}
Date endTime = resolver.getEndTime();
if (Objects.isNull(endTime)) {
endTime = new DateTime();
}
return dateFm.format(endTime).replace("-", ".");
}
}
package com.yonde.dcs.core.util;
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 org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @author wyy
* @version 1.0
* @description:
* @date 2021/7/12 10:28
*/
public class ObjFileLinkUtil {
public static <T extends IdVO & ContentHolder> void removeAllFile(T holder) {
if (!CollectionUtils.isEmpty(((ContentHolder) holder).getObjFileLinks())) {
List<ObjFileLinkVO> fileLinkVos = (List) ((ContentHolder) holder).getObjFileLinks();
if (!CollectionUtils.isEmpty(fileLinkVos)) {
for (ObjFileLinkVO fileLinkVo : fileLinkVos) {
fileLinkVo.setOperator(OperatorType.REMOVE);
}
}
}
}
/**
* 移除pdf文件
*
* @param holder
* @param fileVO
* @param fileType
* @param <T>
*/
// public static <T extends IdVO & ContentHolder> void replaceFile(T holder, PapersVO fileVO, String fileType) {
// removeFile(holder, fileType);
// addFile(holder, fileVO, fileType);
// }
//
// public static <T extends IdVO & ContentHolder> void addFile(T holder, PapersVO fileVO, String fileType) {
// if (CollectionUtils.isEmpty(((ContentHolder)holder).getObjFileLinks())) {
// ((ContentHolder)holder).setObjFileLinks(new ArrayList());
// }
//
// ObjFileLinkVO linkVo = new ObjFileLinkVO();
// linkVo.setTarget(fileVO);
// linkVo.setOperator(OperatorType.ADD);
// linkVo.setContentType(fileType);
// ((ContentHolder)holder).getObjFileLinks().add(linkVo);
// }
/**
* 删除指定的文件
* @param holder
* @param fileName
* @param fileType
* @param <T>
*/
public static <T extends IdVO & ContentHolder> void deleteFileByName(T holder, String fileName, String fileType) {
if (!CollectionUtils.isEmpty(((ContentHolder)holder).getObjFileLinks())) {
List<ObjFileLinkVO> fileLinkVos = (List)((ContentHolder)holder).getObjFileLinks().stream().filter((m) -> {
return fileType.equalsIgnoreCase(m.getContentType());
}).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(fileLinkVos)) {
for (ObjFileLinkVO fileLinkVo : fileLinkVos) {
if (fileName.equals(fileLinkVo.getTarget().getOriginalFileName())){
fileLinkVo.setOperator(OperatorType.REMOVE);
}
}
}
}
}
/**
* 模糊 删除指定的文件
* @param holder
* @param fileName
* @param fileType
* @param <T>
*/
public static <T extends IdVO & ContentHolder> void deleteFileByLikeName(T holder, String fileName, String fileType) {
if (!CollectionUtils.isEmpty(((ContentHolder)holder).getObjFileLinks())) {
List<ObjFileLinkVO> fileLinkVos = (List)((ContentHolder)holder).getObjFileLinks().stream().filter((m) -> {
return fileType.equalsIgnoreCase(m.getContentType());
}).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(fileLinkVos)) {
for (ObjFileLinkVO fileLinkVo : fileLinkVos) {
if (!fileLinkVo.getTarget().getOriginalFileName().contains("签字_")){ //签字文件不删除
if (fileLinkVo.getTarget().getOriginalFileName().contains(fileName)){
fileLinkVo.setOperator(OperatorType.REMOVE);
}
}
}
}
}
}
public static <T extends IdVO & ContentHolder> void removeFile(T holder, String fileType) {
if (!CollectionUtils.isEmpty(((ContentHolder)holder).getObjFileLinks())) {
List<ObjFileLinkVO> fileLinkVos = (List)((ContentHolder)holder).getObjFileLinks().stream().filter((m) -> {
return fileType.equalsIgnoreCase(m.getContentType());
}).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(fileLinkVos)) {
Iterator var3 = fileLinkVos.iterator();
while (var3.hasNext()) {
ObjFileLinkVO linkVo = (ObjFileLinkVO) var3.next();
linkVo.setOperator(OperatorType.REMOVE);
}
}
}
}
public static <T extends IdVO & ContentHolder> void removeFileByFileName(T holder, String fileName) {
if (!CollectionUtils.isEmpty(((ContentHolder) holder).getObjFileLinks())) {
List<ObjFileLinkVO> fileLinkVos = (List) ((ContentHolder) holder).getObjFileLinks();
if (!CollectionUtils.isEmpty(fileLinkVos)) {
for (ObjFileLinkVO fileLinkVo : fileLinkVos) {
if (fileLinkVo.getTarget().getOriginalFileName().equals(fileName)) {
fileLinkVo.setOperator(OperatorType.REMOVE);
}
}
}
}
}
/**
* 获取对象指定 类型的file
*
* @param holder
* @param fileType
* @param <T>
* @return
*/
// public static <T extends IdVO & ContentHolder> List<PapersVO> getAppointTypeFile(T holder, String fileType) {
// if (!Objects.isNull(holder) && !CollectionUtils.isEmpty(((ContentHolder) holder).getObjFileLinks())) {
// List<ObjFileLinkVO> fileLinkVOList = holder.getObjFileLinks().stream().filter(o -> o.getContentType().equalsIgnoreCase(fileType)).collect(Collectors.toList());
// if (!CollectionUtils.isEmpty(fileLinkVOList)) {
// return fileLinkVOList.stream().map(ObjFileLinkVO::getTarget).collect(Collectors.toList());
// }
// }
// return null;
// }
/**
* 获取对象指定 类型的file
*
* @param holder
* @param fileType
* @param <T>
* @return
*/
// public static <T extends IdVO & ContentHolder> List<PapersVO> getAppointNameFile(T holder, String fileType, String fileLikeName) {
// if (!Objects.isNull(holder) && !CollectionUtils.isEmpty(((ContentHolder) holder).getObjFileLinks())) {
// List<ObjFileLinkVO> fileLinkVOList = holder.getObjFileLinks().stream().filter(o -> o.getContentType().equalsIgnoreCase(fileType)).collect(Collectors.toList());
// if (!CollectionUtils.isEmpty(fileLinkVOList)) {
// return fileLinkVOList.stream().map(ObjFileLinkVO::getTarget).filter(o -> o.getOriginalFileName().contains(fileLikeName)).collect(Collectors.toList());
// }
// }
// return null;
// }
}
package com.yonde.dcs.core.util;
import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchQueryBuilder;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
public class SearchUtil {
/**
* 构建查询条件
*
* @param key
* @param value
* @return
*/
public static SearchQueryCondition buildQuery(String key, SearchItem.Operator operator, Object value) {
return SearchQueryBuilder.openBuild()
.openFilterBuilder()
.setItem(key, operator, value)
.builder().build();
}
/**
* 构建带扩展属性的查询条件
*
* @param key
* @param value
* @param openAttr
* @return
*/
public static SearchQueryCondition buildQueryWithOpenAttr(String key, SearchItem.Operator operator, Object value, String openAttr) {
return SearchQueryBuilder.openBuild()
.setPropName(openAttr)
.openFilterBuilder()
.setItem(key, operator, value)
.builder().build();
}
}
package com.yonde.dcs.feign;
import com.yonde.dcs.common.vo.ExtApplicantVO;
import com.yonde.dcs.common.vo.ExtAuditObjectVO;
import com.yonde.dcs.common.vo.ExtInterfaceVO;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.plan.common.vo.ExtPlanVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Map;
/**
* @description: ExtApplicant-Feign
* @author: dexadmin
* @version: V
* @date: 2024-8-2 15:26:37
**/
@Api(tags = "ExtAutoTask-FEIGN")
@FeignClient(value = "${dcs.feign.DCS-DOC}", path = "/task")
public interface ExtAutoTaskServiceFeign {
@ApiOperation(value = "客户化文档修改状态", notes = "客户化文档修改状态", httpMethod = "PUT")
@PutMapping(value = "/extChangeDocState")
void extChangeDocState(@RequestBody DxDocumentVO documentVO, @RequestParam(name = "state") String state);
@ApiOperation(value = "给选择的提资方人员发放通知", notes = "给选择的提资方人员发放通知", httpMethod = "POST")
@PostMapping(value = "/informativeUser")
void informativeUser(@RequestBody DxDocumentVO documentVO, @RequestParam("userId") String userId);
@ApiOperation(value = "设置提资审核", notes = "设置提资审核", httpMethod = "POST")
@PostMapping(value = "/extSetProcessVariable")
void extSetProcessVariable(Map<String, Object> taskParticipant,
@RequestParam("processInstId") String processInstId,
@RequestParam("key") String key,
Object value);
@ApiOperation(value = "设置提资人变量", notes = "设置提资人变量", httpMethod = "POST")
@PostMapping(value = "/setInformativeUser")
void setInformativeUser(@RequestParam("processInstId") String processInstId,
@RequestParam("varKey") String varKey,
@RequestParam("informativeUser") String informativeUser);
@ApiOperation(value = "自动发送联系单", notes = "自动发送联系单", httpMethod = "POST")
@PostMapping(value = "/sendContractDoc")
void sendContractDoc(@RequestBody DxDocumentVO documentVO, @RequestParam("contractName") String contractName);
@ApiOperation(value = "创建过时文件通知单", notes = "创建过时文件通知单", httpMethod = "POST")
@PostMapping(value = "/createDocNotify")
void createDocNotify(@RequestBody DxDocumentVO documentVO);
@ApiOperation(value = "设置编制节点人员回显事件", notes = "设置编制节点人员回显事件", httpMethod = "POST")
@PostMapping(value = "/setProcessSelectionInfo")
void setProcessSelectionInfo(@RequestParam("taskId") String taskId, @RequestBody DxDocumentVO documentVO);
@ApiOperation(value = "任务完成后更新pbo属性,驳回操作,设置编制节点人员回显", notes = "任务完成后更新pbo属性,驳回操作,设置编制节点人员回显", httpMethod = "POST")
@PostMapping(value = "/getProcessSelectionInfo")
void getProcessSelectionInfo(@RequestParam("taskId") String taskId, @RequestBody DxDocumentVO documentVO);
@ApiOperation(value = "计划生命周期事件", notes = "计划生命周期事件", httpMethod = "POST")
@PostMapping(value = "/pressPlanInfo")
void pressPlanInfo(@RequestBody ExtPlanVO extPlanVO) throws Exception;
@ApiOperation(value = "内部接口-生成提资信息word", notes = "内部接口-生成提资信息word", httpMethod = "POST")
@PostMapping(value = "/generateInformationWord")
void generateInformationWord(@RequestBody DxDocumentVO documentVO);
@ApiOperation(value = "生成NCR审查单word", notes = "生成NCR审查单word", httpMethod = "POST")
@PostMapping(value = "/generateNcrReviewWord")
void generateNcrReviewWord(@RequestBody DxDocumentVO documentVO, Map<String, Object> wfTaskContext);
@ApiOperation(value = "生成word签字", notes = "生成word签字", httpMethod = "POST")
@PostMapping(value = "/generateDocWordSign")
void generateDocWordSign(@RequestBody DxDocumentVO documentVO, Map<String, Object> wfTaskContext, @RequestParam("fileName") String fileName);
@ApiOperation(value = "内部接口-保存内部接口信息的总体室、审核签审信息值", notes = "内部接口-保存内部接口信息的总体室、审核签审信息值", httpMethod = "POST")
@PostMapping(value = "/savedInterfaceWf")
void savedInterfaceWf(@RequestBody DxDocumentVO documentVO, Map<String, Object> wfTaskContext);
@ApiOperation(value = "自动任务-编制节点后生成word方法", notes = "自动任务-编制节点后生成word方法", httpMethod = "POST")
@PostMapping(value = "/generateWordByAutoMethod")
void generateWordByAutoMethod(@RequestBody DxDocumentVO documentVO);
@ApiOperation(value = "自动任务-校验图册下的图纸是否检入", notes = "自动任务-校验图册下的图纸是否检入", httpMethod = "POST")
@PostMapping(value = "/checkLockerUtil")
void checkLockerUtil(@RequestBody DxDocumentVO documentVO);
@ApiOperation(value = "自动任务-生成QH技术文件签审页", notes = "自动任务-生成QH技术文件签审页", httpMethod = "POST")
@PostMapping(value = "/generateQHTechDoc")
void generateQHTechDoc(@RequestBody DxDocumentVO documentVO, Map<String, Object> wfTaskContext);
//endProcess
@ApiOperation(value = "生成过时文件通知单word", notes = "生成过时文件通知单word", httpMethod = "POST")
@PostMapping(value = "/generateOutdatedDocNotify")
void generateOutdatedDocNotify(@RequestBody DxDocumentVO documentVO);
@ApiOperation(value = "已发布后修改状态已过时", notes = "已发布后修改状态已过时", httpMethod = "POST")
@PostMapping(value = "/changeOldDataState")
void changeOldDataState(@RequestBody DxDocumentVO documentVO);
@ApiOperation(value = "申请内容 签名", notes = "申请内容 签名", httpMethod = "POST")
@PostMapping(value = "/autoApplicantSign")
void autoApplicantSign(@RequestBody ExtApplicantVO applicantVO, Map<String, Object> wfTaskContext);
@ApiOperation(value = "接口单签名", notes = "接口单签名", httpMethod = "POST")
@PostMapping(value = "/autoInterFaceSign")
void autoInterFaceSign(@RequestBody ExtInterfaceVO extInterfaceVO, Map<String, Object> wfTaskContext);
@ApiOperation(value = "签审对象的终止流程", notes = "签审对象的终止流程", httpMethod = "POST")
@PostMapping(value = "/autoInterfaceEnd")
void autoInterfaceEnd(@RequestBody ExtAuditObjectVO auditObjectVO);
@ApiOperation(value = "申请内容走完流程后 自动启动 接口单的流程", notes = "申请内容走完流程后 自动启动 接口单的流程", httpMethod = "POST")
@PostMapping(value = "/startInterFaceFlow")
void startInterFaceFlow(@RequestBody ExtApplicantVO applicantVO);
@ApiOperation(value = "重新创建启动流程", notes = "重新创建启动流程", httpMethod = "POST")
@PostMapping(value = "/startAddInterFaceFlow")
void startAddInterFaceFlow(@RequestBody ExtInterfaceVO extInterfaceVO);
@ApiOperation(value = "签审对象 扫描所有提资单 并更新状态", notes = "签审对象 扫描所有提资单 并更新状态", httpMethod = "POST")
@PostMapping(value = "/stopAllExtApplicantFaceFlow")
void stopAllExtApplicantFaceFlow(@RequestBody ExtInterfaceVO extInterfaceVO);
}
...@@ -92,11 +92,11 @@ ...@@ -92,11 +92,11 @@
<groupId>com.yonde.dex</groupId> <groupId>com.yonde.dex</groupId>
<artifactId>dex-cache-rediscaffeine</artifactId> <artifactId>dex-cache-rediscaffeine</artifactId>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>com.yonde.dcs</groupId> <!-- <groupId>com.yonde.dcs</groupId>-->
<artifactId>dcs-doc-autotask-interface</artifactId> <!-- <artifactId>dcs-doc-autotask-interface</artifactId>-->
<version>4.1-RELEASE</version> <!-- <version>4.1-RELEASE</version>-->
</dependency> <!-- </dependency>-->
</dependencies> </dependencies>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<module>dcs-doc-expand-server</module> <module>dcs-doc-expand-server</module>
<module>dcs-doc-expand-build-lib</module> <module>dcs-doc-expand-build-lib</module>
<module>dcs-doc-expand-build-thirdLib</module> <module>dcs-doc-expand-build-thirdLib</module>
<module>dcs-doc-autotask-interface</module> <!-- <module>dcs-doc-autotask-interface</module>-->
</modules> </modules>
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
......
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