Commit b946fe51 authored by hezhuozhi's avatar hezhuozhi

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

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