From 7b8de896e269d2def4942207c0022134f6dfab29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=AD=A6=E6=88=90?= <1274337408@qq.com> Date: Thu, 15 Oct 2026 17:28:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E6=A1=88=E5=AF=BC=E5=87=BA=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=EF=BC=9A1.=E5=AF=BC=E5=87=BA=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E6=8F=90=E6=A1=88=E9=87=8C=E7=9A=84=E6=96=87=E4=BB=B6=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=BB=BA=E8=AE=AE=E8=90=BD=E5=AE=9E=E7=9A=84=E9=83=A8?= =?UTF-8?q?=E9=97=A8=EF=BC=9B2.=E5=AF=BC=E5=87=BA=E4=B8=8A=E4=BC=9A?= =?UTF-8?q?=E6=8F=90=E6=A1=88=E8=A1=A8=E6=B1=87=E6=80=BB=E8=A1=A8=E6=97=A0?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=8A=A0=E8=BD=BD=E5=92=8C=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../export/proposalExportNotCaseController.java | 15 ++++++++++----- .../services/impl/ProposalInfoServiceImpl.java | 11 +++++++++++ .../views/platform/proposal/export/notCase.html | 6 ++++-- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/v/nutz/proposal/controller/export/proposalExportNotCaseController.java b/src/main/java/io/v/nutz/proposal/controller/export/proposalExportNotCaseController.java index 0792a0e..ef931c9 100644 --- a/src/main/java/io/v/nutz/proposal/controller/export/proposalExportNotCaseController.java +++ b/src/main/java/io/v/nutz/proposal/controller/export/proposalExportNotCaseController.java @@ -13,6 +13,7 @@ import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.config.Configure; import com.deepoove.poi.policy.HackLoopTableRenderPolicy; import io.v.nutz.annontation.ViReturn; +import io.v.nutz.base.utils.Html2Text; import io.v.nutz.base.utils.Vi; import io.v.nutz.jdh.model.cb.Jdh_jdhxx; import io.v.nutz.modules.models.PageForm; @@ -350,9 +351,16 @@ public class proposalExportNotCaseController { for (NutMap info : infos) { String implementUnitId = info.getString("implementUnitId"); - List implementUnitIds = Json.fromJsonAsList(String.class, implementUnitId); - String implementUnitName = proposalUndertakeList.stream().filter(u -> implementUnitIds.contains(u.getId())).map(u -> u.getUnitName()).collect(Collectors.joining("、")); + String implementUnitName = ""; + if (StrUtil.isNotBlank(implementUnitId)) { + List implementUnitIds = Json.fromJsonAsList(String.class, implementUnitId); + if (implementUnitIds != null) { + implementUnitName = proposalUndertakeList.stream().filter(u -> implementUnitIds.contains(u.getId())).map(u -> u.getUnitName()).collect(Collectors.joining("、")); + } + } info.put("implementUnitName", implementUnitName); + info.put("brief", Html2Text.toPlainText(info.getString("brief"))); + info.put("measures", Html2Text.toPlainText(info.getString("measures"))); Sql secondedSql = Sqls.create(""" SELECT u.username s_username, @@ -371,12 +379,9 @@ public class proposalExportNotCaseController { info.put("schoolName", Globals.MyConfig.getString("GxName")); HackLoopTableRenderPolicy hackLoopTableRenderPolicy = new HackLoopTableRenderPolicy(); - HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy(); Configure config = Configure.newBuilder() .bind("secondedList", hackLoopTableRenderPolicy) - .bind("brief", htmlRenderPolicy) - .bind("measures", htmlRenderPolicy) .build(); diff --git a/src/main/java/io/v/nutz/proposal/services/impl/ProposalInfoServiceImpl.java b/src/main/java/io/v/nutz/proposal/services/impl/ProposalInfoServiceImpl.java index 4a0ce29..e6772b3 100644 --- a/src/main/java/io/v/nutz/proposal/services/impl/ProposalInfoServiceImpl.java +++ b/src/main/java/io/v/nutz/proposal/services/impl/ProposalInfoServiceImpl.java @@ -30,6 +30,7 @@ import org.nutz.dao.util.cri.SqlExpressionGroup; import org.nutz.ioc.aop.Aop; import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.json.Json; import org.nutz.lang.Strings; import org.nutz.lang.util.NutMap; @@ -229,6 +230,16 @@ public class ProposalInfoServiceImpl extends ViServiceImpl impleme NutMap nutMap = proposalInfoService.fetch(sql); + String implementUnitId = nutMap.getString("implementUnitId"); + String implementUnitName = ""; + if (StrUtil.isNotBlank(implementUnitId)) { + List implementUnitIds = Json.fromJsonAsList(String.class, implementUnitId); + if (implementUnitIds != null && !implementUnitIds.isEmpty()) { + List implementUnitList = proposalInfoService.dao().query(ProposalUndertake.class, Cnd.where("id", "in", implementUnitIds)); + implementUnitName = implementUnitList.stream().map(ProposalUndertake::getUnitName).collect(Collectors.joining("、")); + } + } + nutMap.setv("implementUnitName", implementUnitName); // nutMap.setv("brief", Html2Text.toPlainText(nutMap.getString("brief"))); nutMap.setv("measures", HtmlUtil.cleanHtmlTag(nutMap.getString("measures"))); diff --git a/src/main/resources/views/platform/proposal/export/notCase.html b/src/main/resources/views/platform/proposal/export/notCase.html index 55d83df..de6af6c 100644 --- a/src/main/resources/views/platform/proposal/export/notCase.html +++ b/src/main/resources/views/platform/proposal/export/notCase.html @@ -260,7 +260,9 @@ layout("/layouts/platform.html"){ window.URL.revokeObjectURL(url) loading.close(); }).catch((err) => { - }) + loading.close(); + this.$message.error('导出失败,请稍后重试'); + }) }, oneProposalExport(id) { window.location.href = "/platform/proposal/statistics/summary/oneProposalExport?isAll=0&proposalId=" + id @@ -354,4 +356,4 @@ layout("/layouts/platform.html"){ \ No newline at end of file +#-->