Commit 1e8b7f48 authored by wangyangyang's avatar wangyangyang

文档 图册:回写ied计划状态

parent b588106a
...@@ -260,31 +260,34 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -260,31 +260,34 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
catalogExcelVO.setPictureFrame(String.valueOf(doc.getDynamicAttrs().get("pictureFrame"))); catalogExcelVO.setPictureFrame(String.valueOf(doc.getDynamicAttrs().get("pictureFrame")));
excelVOS.add(catalogExcelVO); excelVOS.add(catalogExcelVO);
} }
//TODO 图册生成图纸信息 //已发布的时候才需要生成图册目录 以及修改IED计划状态
String dir = ResourceHelper.createTemDir().getPath(); if (Constants.DOC_RELEASE.equalsIgnoreCase(state)){
String filePath = dir + "\\图册.xlsx"; //TODO 图册生成图纸信息
EasyExcel.write(filePath, ExtCatalogExcelVO.class) String dir = ResourceHelper.createTemDir().getPath();
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) String filePath = dir + "\\图册.xlsx";
.sheet("图册").doWrite(excelVOS); EasyExcel.write(filePath, ExtCatalogExcelVO.class)
//转pdf .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
String pdfName = "图册.pdf"; .sheet("图册").doWrite(excelVOS);
String filePdfPath = dir + File.separator + pdfName; //转pdf
ExcelUtils.Ex2PDF(filePath, filePdfPath); String pdfName = "图册.pdf";
//上传文件到文件服务器 String filePdfPath = dir + File.separator + pdfName;
MultipartFile multipartFile = null; ExcelUtils.Ex2PDF(filePath, filePdfPath);
multipartFile = new MockMultipartFile("file", pdfName, com.yonde.dcs.plan.common.constants.Constants.CONTENT_TYPE_PDF, new FileInputStream(filePdfPath)); //上传文件到文件服务器
RepoFileVO fileVO = fileManagerFeignService.uploadFile(multipartFile, CommonUtil.getBucketIdByAppName(com.yonde.dcs.document.core.constants.Constants.APPLICATION_DOC_INNER_NAME)); MultipartFile multipartFile = null;
ObjFileLinkUtil.addFile(documentVO, fileVO, com.yonde.dcs.plan.common.constants.Constants.ATTACH_FILE); multipartFile = new MockMultipartFile("file", pdfName, com.yonde.dcs.plan.common.constants.Constants.CONTENT_TYPE_PDF, new FileInputStream(filePdfPath));
documentVO.setOperator(OperatorType.MODIFY); RepoFileVO fileVO = fileManagerFeignService.uploadFile(multipartFile, CommonUtil.getBucketIdByAppName(com.yonde.dcs.document.core.constants.Constants.APPLICATION_DOC_INNER_NAME));
documentVO = (DxDocumentVO) documentService.saveRecursion(documentVO); ObjFileLinkUtil.addFile(documentVO, fileVO, com.yonde.dcs.plan.common.constants.Constants.ATTACH_FILE);
FileUtil.del(dir); documentVO.setOperator(OperatorType.MODIFY);
documentVO = (DxDocumentVO) documentService.saveRecursion(documentVO);
FileUtil.del(dir);
// generateCatalog(documentVO.getId()); // generateCatalog(documentVO.getId());
//TODO 判断该文档关联IED计划下所有的文档状态是否为已完成,已完成则回写IED计划状态----一个IED计划对应一个图册,直接修改计划状态即可 //TODO 判断该文档关联IED计划下所有的文档状态是否为已完成,已完成则回写IED计划状态----一个IED计划对应一个图册,直接修改计划状态即可
SearchQueryCondition query = SearchUtil.buildQuery("targetId", SearchItem.Operator.EQ, documentVO.getId()); SearchQueryCondition query = SearchUtil.buildQuery("targetId", SearchItem.Operator.EQ, documentVO.getId());
DxPageImpl iedPage = extIEDPlanDocLinkServiceFeign.findRecursion(query); DxPageImpl iedPage = extIEDPlanDocLinkServiceFeign.findRecursion(query);
ExtIEDPlanDocLinkVO extIEDPlanDocLinkVO = (ExtIEDPlanDocLinkVO) iedPage.getContent().get(0); ExtIEDPlanDocLinkVO extIEDPlanDocLinkVO = (ExtIEDPlanDocLinkVO) iedPage.getContent().get(0);
Long iedPlanId = extIEDPlanDocLinkVO.getSourceId(); Long iedPlanId = extIEDPlanDocLinkVO.getSourceId();
extIEDPlanServiceFeign.changeStatus(iedPlanId, Constants.IED_Complete, true); extIEDPlanServiceFeign.changeStatus(iedPlanId, Constants.IED_Complete, true);
}
} }
//判断接口单为审阅中设置全局状态为已打开 //判断接口单为审阅中设置全局状态为已打开
if (Constants.INTERNAL_INTERFACE.equals(documentVO.getSubTypeName())) { if (Constants.INTERNAL_INTERFACE.equals(documentVO.getSubTypeName())) {
......
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