Commit 1cb95188 authored by pchxue's avatar pchxue

迁移问题处理

parent 52ecd47a
package com.yonde.dcs.core.controller;
import com.yonde.dcs.common.vo.ExtReviseVersionVO;
import com.yonde.dcs.core.service.ExtDocService;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.entity.po.ExtAtlasDrawingLink;
import com.yonde.dex.basedata.entity.api.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* @program: inet-pdm-service
* @description: 客制化文档接口
* @author: dang wei
* @create: 2021-09-18 13:38
*/
@Api(tags = {"客制化文档信息接口"})
@RestController
@RequestMapping({"/DxDocument/ext"})
//@BasePermission("DCS-DOC:Doc")
public class ExtDocController {
@Autowired
private ExtDocService extDocService;
/**
* 版本升级
*
* @param id
* @param reviseVersionVO
* @return
*/
@ApiOperation("版本升级")
@PostMapping({"/version/{id}/revise"})
// @SubPermission({"versionRevise"})
public ApiResult reviseDocVersion(@PathVariable Long id, @RequestBody ExtReviseVersionVO reviseVersionVO) {
DxDocumentVO dxDocumentVO = extDocService.reviseDocVersion(id, reviseVersionVO);
return ApiResult.ok(dxDocumentVO, "升版成功");
}
/**
* 内部接口提交审阅按钮业务
*
* @param id
* @return
*/
@ApiOperation("内部接口提交审阅按钮")
@PostMapping("/submitProcess/{id}")
public ApiResult submitReview(@PathVariable Long id) {
DxDocumentVO dxDocumentVO = extDocService.submitReview(id);
return ApiResult.ok(dxDocumentVO, "提交审阅成功!");
}
/**
* 批量下载图册
*
* @param response
* @param id
* @throws IOException
*/
@ApiOperation(value = "批量下载", notes = "批量下载", httpMethod = "GET")
@GetMapping(value = "/batchDownloadDoc")
public void batchDownloadDoc(HttpServletResponse response, @RequestParam("id") Long id) throws IOException {
extDocService.batchDownloadDoc(response, id);
}
/**
* 校验图册图纸
*
* @param drawingLinkList
*/
@ApiOperation(value = "校验图册图纸", notes = "校验图册图纸", httpMethod = "POST")
@PostMapping(value = "/checkAtlas")
public ApiResult checkAtlas(@RequestBody List<ExtAtlasDrawingLink> drawingLinkList) {
String message = extDocService.checkAtlas(drawingLinkList);
return ApiResult.ok(message);
}
/**
* 更新文件申请及相关单据
*
* @param documentVO
* @return
*/
@ApiOperation(value = "更新文件申请及相关单据", notes = "更新文件申请及相关单据", httpMethod = "POST")
@PostMapping(value = "/updateDocApplication")
public ApiResult updateDocApplication(@RequestBody DxDocumentVO documentVO) {
DxDocumentVO dxDocumentVO = extDocService.updateDocApplication(documentVO);
return ApiResult.ok(dxDocumentVO);
}
@ApiOperation(value = "获取升版的图册图纸", notes = "获取升版的图册图纸", httpMethod = "POST")
@PostMapping(value = "/upgradeAtlasDrawing")
public ApiResult getUpgradeAtlasDrawingList(@RequestBody DxDocumentVO documentVO) {
List<DxDocumentVO> atlasDrawingList = extDocService.getUpgradeAtlasDrawingList(documentVO);
return ApiResult.ok(atlasDrawingList);
}
}
......@@ -4,6 +4,7 @@ import com.yonde.dcs.common.vo.ExtAtlasDrawingLinkVO;
import com.yonde.dcs.common.vo.ExtReviseVersionVO;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.entity.po.ExtAtlasDrawingLink;
import com.yonde.dex.wfc.common.vo.DxWfActivityVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO;
import javax.servlet.http.HttpServletResponse;
......@@ -111,27 +112,28 @@ public interface ExtDocService {
* @param wfProcessInfoVO
* @param fileName
*/
// TODO: 2024/7/31 2.1有WfProcessInfoVO 4.1没有这个VO
// void generateDocWordSign(DxDocumentVO documentVo, Class classType, WfProcessInfoVO wfProcessInfoVO, String fileName);
// TODO: 2024/7/31 2.1有WfTaskDefinitionVO 4.1没有这个VO
// /**
// * 获取签名图片
// *
// * @param activities
// * @param activityName
// * @return
// */
// String getSignImage(List<WfTaskDefinitionVO> activities, String activityName);
//
// /**
// * 获取签名日期
// *
// * @param activities
// * @param activityName
// * @return
// */
// String getEndDate(List<WfTaskDefinitionVO> activities, String activityName);
void generateDocWordSign(DxDocumentVO documentVo, Class classType, DxWfProcessInfoVO wfProcessInfoVO, String fileName);
/**
* 获取签名图片
*
* @param activities
* @param activityName
* @return
*/
// TODO: xpc 将WfTaskDefinitionVO改为DxWfActivityVO
String getSignImage(List<DxWfActivityVO> activities, String activityName);
/**
* 获取签名日期
*
* @param activities
* @param activityName
* @return
*/
// TODO: xpc 将WfTaskDefinitionVO改为DxWfActivityVO
String getEndDate(List<DxWfActivityVO> activities, String activityName);
Boolean validate(DxDocumentVO documentVO);
......@@ -143,8 +145,6 @@ public interface ExtDocService {
*/
List<ExtAtlasDrawingLinkVO> recursionAtlasDoc(Long id);
void generateDocWordSign(DxDocumentVO documentVo, Class classType, DxWfProcessInfoVO wfProcessInfoVO, String fileName);
/**
* 获取升版的图册图纸
*
......
package com.yonde.dcs.core.util;
import com.yonde.dcs.core.constants.SignConstants;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dex.user.common.vo.DxUserInfoVO;
import com.yonde.dex.user.feign.DxUserInfoFeign;
import com.yonde.dex.version.plugin.common.entity.DxIterationVOHolder;
import com.yonde.dex.wfc.common.enums.TaskStateEnum;
import com.yonde.dex.wfc.common.vo.*;
import com.yonde.dex.wfc.common.vo.DxWfActivityVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessSearchVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessVO;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import com.yonde.dex.wfc.feign.api.WfcTaskFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Component;
......@@ -31,6 +35,8 @@ public class WorkFlowUtil {
@Autowired
private WfcProcessFeign instanceService;
@Autowired
private WfcTaskFeign wfcTaskFeign;
@Autowired
private DxUserInfoFeign userService;
/**
......@@ -39,17 +45,25 @@ public class WorkFlowUtil {
* @param iterationVO
* @return
*/
//TODO
// public DxWfProcessVO getWfProcessInst(DxIterationVO iterationVO) {
// TODO: 2024/8/1 DxIterationVO不存在
// TODO: xpc WfProcessInstVO不存在改为DxWfProcessVO,IterationVO不存在改为DxIterationVOHolder
public DxWfProcessVO getWfProcessInst(DxIterationVOHolder iterationVO) {
// TODO: getProcessInstList方法不存在改为getProcessList
// DxWfProcessSearchVO wfProcessInstSearchVO = new DxWfProcessSearchVO();
// wfProcessInstSearchVO.setPboClass(iterationVO.getClass().getName());
// wfProcessInstSearchVO.setPboId(iterationVO.getVersionId());
// Page<DxWfProcessVO> wfProcessInstVOPage = this.instanceService.getProcessList(wfProcessInstSearchVO, 1, 10);
// if (!CollectionUtils.isEmpty(wfProcessInstVOPage.getContent())) {
// return wfProcessInstVOPage.getContent().get(0);
// }
// return null;
// }
// Page<WfProcessInstVO> wfProcessInstVOPage = this.instanceService.getProcessList(wfProcessInstSearchVO, 1, 10);
DxWfProcessSearchVO dxWfProcessSearchVO = new DxWfProcessSearchVO();
dxWfProcessSearchVO.setPboClass(iterationVO.getClass().getName());
dxWfProcessSearchVO.setPboId(iterationVO.getVersionId());
Page<DxWfProcessVO> processList = instanceService.getProcessList(dxWfProcessSearchVO, 1, 10);
if (!CollectionUtils.isEmpty(processList.getContent())) {
return processList.getContent().get(0);
}
return null;
}
/**
* 获取流程实例
......@@ -57,37 +71,43 @@ public class WorkFlowUtil {
* @param doc
* @return
*/
//TODO
// public DxWfProcessVO getWfProcessInst(DxDocumentVO doc) {
// TODO: xpc WfProcessInstVO不存在改为DxWfProcessVO
public DxWfProcessVO getWfProcessInst(DxDocumentVO doc) {
// TODO: getProcessInstList方法不存在改为getProcessList
// WfProcessInstSearchVO wfProcessInstSearchVO = new WfProcessInstSearchVO();
// wfProcessInstSearchVO.setPboClass(DxDocumentVO.class.getName());
// wfProcessInstSearchVO.setPboId(doc.getVersionId());
// Page<DxWfProcessVO> wfProcessInstVOPage = this.instanceService.getProcessInstList(wfProcessInstSearchVO, 1, 10);
// if (!CollectionUtils.isEmpty(wfProcessInstVOPage.getContent())) {
// return wfProcessInstVOPage.getContent().get(0);
// }
// return null;
// }
// Page<WfProcessInstVO> wfProcessInstVOPage = this.instanceService.getProcessInstList(wfProcessInstSearchVO, 1, 10);
DxWfProcessSearchVO dxWfProcessSearchVO = new DxWfProcessSearchVO();
dxWfProcessSearchVO.setPboClass(DxDocumentVO.class.getName());
dxWfProcessSearchVO.setPboId(doc.getVersionId());
Page<DxWfProcessVO> processList = instanceService.getProcessList(dxWfProcessSearchVO, 1, 10);
if (!CollectionUtils.isEmpty(processList.getContent())) {
return processList.getContent().get(0);
}
return null;
}
/**
* 通过pbo获取流程实例签审详情信息
*
* @param doc
*/
//TODO
public Map<String, List<DxWfProcessTaskVO>> getWfInfo(DxDocumentVO doc) {
// DxWfProcessVO wfProcessInstVO = getWfProcessInst(doc);
// if (!ObjectUtils.isEmpty(wfProcessInstVO)) {
// DxWfProcessInfoVO wfProcessInfo = this.instanceService.getProcessInstSimpleDetailById(wfProcessInstVO.getId());
// TODO: WfProcessInstVO不存在改为DxWfProcessVO
DxWfProcessVO wfProcessInstVO = getWfProcessInst(doc);
if (!ObjectUtils.isEmpty(wfProcessInstVO)) {
// TODO: xpc getProcessInstList方法不存在,根据逻辑改为getHisTaskList
// WfProcessInfoVO wfProcessInfo = this.instanceService.getProcessInstSimpleDetailById(wfProcessInstVO.getId());
// List<DxWfProcessTaskVO> historyInfoList = wfProcessInfo.getHistoryInfo();
//
// List<String> checkResult = Arrays.asList("提交", "通过");
// Map<String, List<DxWfProcessTaskVO>> wfHistoryMap = historyInfoList.stream().filter(p -> TaskStateEnum.COMPLETE.name().equals(p.getState()) && checkResult.contains(p.getResult()))
// .sorted(Comparator.comparing(DxWfProcessTaskVO::getEndTime).reversed())
// .collect(Collectors.groupingBy(DxWfProcessTaskVO::getName));
//
// return wfHistoryMap;
// }
Page<DxWfProcessTaskVO> taskList = wfcTaskFeign.getHisTaskList(wfProcessInstVO.getId(), null, 1, Integer.MAX_VALUE);
List<String> checkResult = Arrays.asList("提交", "通过");
Map<String, List<DxWfProcessTaskVO>> wfHistoryMap = taskList.stream().filter(p -> TaskStateEnum.COMPLETE.name().equals(p.getState()) && checkResult.contains(p.getResult()))
.sorted(Comparator.comparing(DxWfProcessTaskVO::getEndTime).reversed())
.collect(Collectors.groupingBy(DxWfProcessTaskVO::getName));
return wfHistoryMap;
}
return null;
}
......@@ -130,6 +150,7 @@ public class WorkFlowUtil {
* @param activityName
* @return
*/
// TODO: xpc 将WfTaskDefinitionVO改为DxWfActivityVO
public String getSignImage(List<DxWfActivityVO> activities, List<String> activityName) {
for (DxWfActivityVO wf : activities) {
if (activityName.contains(wf.getTaskName())) {
......@@ -142,6 +163,7 @@ public class WorkFlowUtil {
/**
* 获取用户名称及用户id
*/
// TODO: xpc 将WfTaskDefinitionVO改为DxWfActivityVO
public String getActivityUserName(DxWfActivityVO activity) {
String str = " ";
List<DxWfProcessTaskVO> taskList = activity.getTaskList();
......@@ -164,6 +186,7 @@ public class WorkFlowUtil {
* @param activityName
* @return
*/
// TODO: xpc 将WfTaskDefinitionVO改为DxWfActivityVO
public String getEndDate(List<DxWfActivityVO> activities, List<String> activityName) {
for (DxWfActivityVO wf : activities) {
if (activityName.contains(wf.getTaskName())) {
......@@ -179,6 +202,7 @@ public class WorkFlowUtil {
* @param activity
* @return
*/
// TODO: xpc 将WfTaskDefinitionVO改为DxWfActivityVO
private String getActiveEndDate(DxWfActivityVO activity) {
List<DxWfProcessTaskVO> taskList = activity.getTaskList();
String 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