Commit b946fe51 authored by hezhuozhi's avatar hezhuozhi

压力管道-公用、长输管道告知页面调整

parent 217f8e8b
...@@ -665,12 +665,17 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -665,12 +665,17 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// jgInstallationNotice.setNoticeReportUrl(url); // jgInstallationNotice.setNoticeReportUrl(url);
// this.updateById(jgInstallationNotice); // this.updateById(jgInstallationNotice);
map.put("equipBasicInfoList", maps); map.put("equipBasicInfoList", maps);
// WordTemplateUtils.templateToPdfDownload(tempFileName, "installation-notification-report.ftl", map, response); //将安装告知单和汇总表压缩到zip中 如果是压力/长输/公用管道的情况需要压缩包
byte[] templateToPdfData = WordTemplateUtils.getTemplateToPdfData(tempFileName, "installation-notification-report.ftl", map); String category = jgInstallationNotice.getEquCategoryCode();
//获取管道和气瓶的基本信息汇总表 if ("8300".equals(category) || "8200".equals(category) || "8100".equals(category)) {
List<CompletableFuture<byte[]>> exportSummaryBasicInfoData = jgUseRegistrationService.getExportSummaryBasicInfoData(Collections.singletonList(Long.valueOf(sequenceNbr)), jgInstallationNotice.getEquCategoryCode(),"安装告知"); //获取
//将安装告知单和汇总表压缩到zip中 byte[] templateToPdfData = WordTemplateUtils.getTemplateToPdfData(tempFileName, "installation-notification-report.ftl", map);
toZipFileByData(response, exportSummaryBasicInfoData, templateToPdfData, jgInstallationNotice.getApplyNo(),jgInstallationNotice.getEquCategoryCode()); //获取管道和气瓶的基本信息汇总表
List<CompletableFuture<byte[]>> exportSummaryBasicInfoData = jgUseRegistrationService.getExportSummaryBasicInfoData(Collections.singletonList(Long.valueOf(sequenceNbr)), jgInstallationNotice.getEquCategoryCode(),"安装告知");
toZipFileByData(response, exportSummaryBasicInfoData, templateToPdfData, jgInstallationNotice.getApplyNo());
}else {
WordTemplateUtils.templateToPdfDownload(tempFileName, "installation-notification-report.ftl", map, response);
}
} }
/** /**
...@@ -679,16 +684,10 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -679,16 +684,10 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
* @param exportSummaryBasicInfoData * @param exportSummaryBasicInfoData
* @param templateToPdfData * @param templateToPdfData
* @param applyNo * @param applyNo
* @param category
*/ */
private void toZipFileByData(HttpServletResponse response, List<CompletableFuture<byte[]>> exportSummaryBasicInfoData, byte[] templateToPdfData, String applyNo, String category) { private void toZipFileByData(HttpServletResponse response, List<CompletableFuture<byte[]>> exportSummaryBasicInfoData, byte[] templateToPdfData, String applyNo) {
String filePrefix ="汇总表"; String filePrefix ="压力管道基本信息汇总表_";
String customFileName="设备基本信息汇总表"; String customFileName="压力管道告知单_设备基本信息汇总表_" + applyNo + ".zip";
if ("8300".equals(category) || "8200".equals(category) || "8100".equals(category)) {
// 文件名前缀
filePrefix= "压力管道基本信息汇总表_";
customFileName="压力管道告知单_设备基本信息汇总表_" + applyNo + ".zip";
}
// 打包zip // 打包zip
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ZipOutputStream zip = new ZipOutputStream(outputStream)) { ZipOutputStream zip = new ZipOutputStream(outputStream)) {
......
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