Commit 1e8b7f48 authored by wangyangyang's avatar wangyangyang

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

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