From faac94c6e28302fba23ccd1dfbc8d137ed70b782 Mon Sep 17 00:00:00 2001 From: dd3s_206 Date: Thu, 17 Sep 2026 14:46:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=88=B1=E5=BF=83=E5=B8=AE=E6=89=B6-=E8=81=8C?= =?UTF-8?q?=E5=B7=A5=E6=85=B0=E9=97=AE-=E6=85=B0=E9=97=AE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E8=AE=BE=E7=BD=AE=EF=BC=9A=E6=96=B0=E5=A2=9E=E2=80=98?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=9C=89=E9=A2=86=E6=8D=AE=E2=80=99=E9=80=89?= =?UTF-8?q?=E9=A1=B9=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E9=A2=86?= =?UTF-8?q?=E6=8D=AE=EF=BC=8C=E6=85=B0=E9=97=AE=E9=98=85=E8=A7=88=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E9=99=84=E4=BB=B6=E6=97=B6=E5=B0=B1=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E4=B8=BA=E2=80=98=E5=B7=B2=E5=AF=BC=E5=87=BA=E2=80=99=EF=BC=9B?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=87=BA=E5=90=8E=E2=80=98=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=AF=BC=E5=87=BA=E5=AD=97=E6=AE=B5=E2=80=99=E4=B8=8D?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../condolence/CondolenceReadCon.java | 22 +++++++-- .../zgfw/model/condolence/CondolenceType.java | 5 +++ .../platform/zgfw/condolence/TypeMange.html | 20 +++++++++ .../views/platform/zgfw/condolence/read.html | 45 ++++++++++++++++--- 4 files changed, 82 insertions(+), 10 deletions(-) diff --git a/src/main/java/io/v/nutz/zgfw/controller/condolence/CondolenceReadCon.java b/src/main/java/io/v/nutz/zgfw/controller/condolence/CondolenceReadCon.java index 86b4e92..bd3512c 100644 --- a/src/main/java/io/v/nutz/zgfw/controller/condolence/CondolenceReadCon.java +++ b/src/main/java/io/v/nutz/zgfw/controller/condolence/CondolenceReadCon.java @@ -113,7 +113,8 @@ public class CondolenceReadCon { be.unionname be_unionname, state.state_name, state.state_color, - type.`code` + type.`code`, + type.hasReceipt AS has_receipt FROM condolence con LEFT JOIN `user` be ON con.be_user = be.id @@ -375,6 +376,7 @@ public class CondolenceReadCon { type.`name` AS type_name, type.money, type.`code` typeCode, + type.hasReceipt AS has_receipt, c.remark, c.deadImmediateFamily, c.inpatientSurgicalName, @@ -402,6 +404,10 @@ public class CondolenceReadCon { sql.setParam("id", id); NutMap nutMap = condolenceService.fetch(sql); + if (nutMap.get("has_receipt") != null && !nutMap.getBoolean("has_receipt")) { + return; + } + if (StrUtil.isNotBlank(nutMap.getString("lkrSignData"))) { try { nutMap.put("lkr", ViTool.poiBase64Image7030(nutMap.getString("lkrSignData"))); @@ -451,6 +457,8 @@ public class CondolenceReadCon { nutMap.put("detail", username + "其它慰问"); } else if (typeCode.equals("J")) { nutMap.put("detail", username + "取环慰问"); + } else { + nutMap.put("detail", username + nutMap.getString("type_name")); } double m = nutMap.getDouble("money"); String cm = Convert.digitToChinese(m); @@ -461,7 +469,8 @@ public class CondolenceReadCon { try { String fileName = nutMap.getString("unionname") + nutMap.getString("detail") + "领据"; response.addHeader("Content-Type", "application/octet-stream"); - response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\".docx"); + response.addHeader("Content-Disposition", "attachment;filename=" + + URLEncoder.encode(fileName + ".docx", StandardCharsets.UTF_8)); ServletOutputStream outputStream = response.getOutputStream(); Configure config = Configure.newBuilder().build(); XWPFTemplate.compile(officeTemplateUtil.getPath("condolenceDocument2"), config).render(nutMap).writeAndClose(response.getOutputStream()); @@ -574,6 +583,7 @@ public class CondolenceReadCon { bwwr.username AS bwwrname, bwwr.unionname, type.`name` AS type_name, + type.hasReceipt AS has_receipt, c.files FROM `condolence` c @@ -602,9 +612,13 @@ public class CondolenceReadCon { zipOutputStream.write(bytes, 0, bytes.length); zipOutputStream.closeEntry(); } - zipOutputStream.finish(); - response.flushBuffer(); } + + zipOutputStream.finish(); + if (condolence.get("has_receipt") != null && !condolence.getBoolean("has_receipt")) { + condolenceService.update(Chain.make("isExport", 1), Cnd.where("id", "=", id)); + } + response.flushBuffer(); } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/io/v/nutz/zgfw/model/condolence/CondolenceType.java b/src/main/java/io/v/nutz/zgfw/model/condolence/CondolenceType.java index a0df335..71758ef 100644 --- a/src/main/java/io/v/nutz/zgfw/model/condolence/CondolenceType.java +++ b/src/main/java/io/v/nutz/zgfw/model/condolence/CondolenceType.java @@ -57,6 +57,11 @@ public class CondolenceType { @ColDefine(type = ColType.BOOLEAN) private Boolean isUploadFile; + @Column + @Comment("是否有领据") + @ColDefine(type = ColType.BOOLEAN) + private Boolean hasReceipt; + @Column @Comment("上传附件说明") @ColDefine(type = ColType.VARCHAR,width = 200) diff --git a/src/main/resources/views/platform/zgfw/condolence/TypeMange.html b/src/main/resources/views/platform/zgfw/condolence/TypeMange.html index f12da87..4c210b4 100644 --- a/src/main/resources/views/platform/zgfw/condolence/TypeMange.html +++ b/src/main/resources/views/platform/zgfw/condolence/TypeMange.html @@ -66,6 +66,15 @@ layout("/layouts/platform.html"){ + + + +