From 12448bee0dce531ac740f3308141a63dc24ac3cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=8C=E5=85=88=E8=88=9C?= <2499071264@qq.com> Date: Sat, 31 Oct 2026 18:42:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=B0=E9=9A=BE=E5=B8=AE=E6=89=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=963?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DifficultHelpApprovalController.java | 12 +-- .../DifficultHelpReadingController.java | 79 ++++--------------- .../DifficultHelpThirdApprovalController.java | 1 + .../schoolunionapproval/form.html | 13 ++- .../schoolunionapproval/index.html | 12 +-- .../difficulthelp/common/info.css | 16 +--- .../schoolunionapproval/index.html | 6 +- 7 files changed, 45 insertions(+), 94 deletions(-) diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpApprovalController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpApprovalController.java index d72eba4..ab1ccd4 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpApprovalController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpApprovalController.java @@ -44,7 +44,7 @@ public class DifficultHelpApprovalController { ProcessTask task = dao.fetch(ProcessTask.class, args.getLong(FlowConst.PROCESS_TASK_ID_KEY)); if (task == null) throw new BaseException("审批任务不存在"); boolean actualAmountApproval = "e405f96c-5fc0-4f63-b323-e69dfe853253".equals(task.getTaskName()); - boolean amountApproval = "715ece82-4ae3-433c-ad18-ed875f45d1e3".equals(task.getTaskName()) || actualAmountApproval; + boolean amountApproval = "715ece82-4ae3-433c-ad18-ed875f45d1e3".equals(task.getTaskName()); if (!amountApproval && !"36ebafda-44c2-4bd3-bd7f-10839a575a0d".equals(task.getTaskName()) && !"e405f96c-5fc0-4f63-b323-e69dfe853253".equals(task.getTaskName())) { throw new BaseException("当前任务不是困难帮扶审批任务"); @@ -61,16 +61,16 @@ public class DifficultHelpApprovalController { Double money = amountApproval ? args.getDouble("money") : null; if (amountApproval) { if (money == null || !Double.isFinite(money) || money < 0) { - throw new BaseException(actualAmountApproval ? "请填写有效的实际审批金额" : "请填写有效的帮扶金额"); - } - if (actualAmountApproval && java.math.BigDecimal.valueOf(money).stripTrailingZeros().scale() > 2) { - throw new BaseException("实际审批金额最多保留两位小数"); + throw new BaseException("请填写有效的帮扶金额"); } args.put("tf_money", money); - if (actualAmountApproval) args.put("tf_actualMoney", money); } else { args.remove("money"); args.remove("tf_money"); + if (actualAmountApproval && info.getMoney() != null) { + args.put("tf_money", info.getMoney()); + args.put("tf_actualMoney", info.getMoney()); + } } // 参与者权限由流程引擎校验,业务入口不接受客户端指定管理员代办。 args.remove(FlowConst.EXT_ENABLE_OPERATOR); diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpReadingController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpReadingController.java index 8f268e0..c2fddd9 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpReadingController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpReadingController.java @@ -9,7 +9,6 @@ import cn.dev33.satoken.annotation.SaCheckPermission; import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.StrUtil; -import cn.hutool.json.JSONUtil; import com.alibaba.excel.EasyExcel; import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.page.Pagination; @@ -281,42 +280,14 @@ public class DifficultHelpReadingController { for (int i = 0; i < list.size(); i++) { NutMap record = list.get(i); - HashMap docData = new HashMap<>(); - docData.put("unionName", record.getString("unitName")); - docData.put("proxyUserName", record.getString("proxyUserName")); - docData.put("sex", record.getString("sex")); - docData.put("loginName", record.getString("loginName")); - docData.put("unitName", record.getString("unitName")); - docData.put("homeIncome", record.getDouble("homeIncome")); - docData.put("homeNumber", record.getInt("homeNumber")); - docData.put("position", record.getString("position")); - docData.put("officialCapacity", record.getString("officialCapacity")); - docData.put("mobile", record.getString("mobile")); - docData.put("userName", record.getString("userName")); - docData.put("homeAddress", record.getString("homeAddress")); - docData.put("bankOfDeposit", record.getString("bankOfDeposit")); - docData.put("bankCardNum", record.getString("bankCardNum")); - docData.put("reason", record.getString("reason")); - docData.put("applyTime", DateUtil.format(DateUtil.parse(record.getString("applyTime")), "yyyy年MM月dd日")); - docData.put("schoolname", "中国地质大学(武汉)"); - docData.put("year", DateUtil.format(DateUtil.parse(record.getString("applyTime")), "yyyy")); - - String familyListStr = record.getString("familyList"); - if (StrUtil.isNotBlank(familyListStr)) { - docData.put("familyList", JSONUtil.toList(familyListStr, Object.class)); - } else { - docData.put("familyList", new ArrayList<>()); + DifficultHelpInfo difficultHelp = difficultHelpCommonService.fetch(record.getString("id")); + if (difficultHelp == null) { + throw new IllegalStateException("待导出的申请记录不存在:" + record.getString("id")); } - - String fileName = (i + 1) + record.getString("userName") + "申请表.docx"; + byte[] bytes = renderApplyDocument(difficultHelp, false); + String fileName = (i + 1) + difficultHelp.getUserName() + "申请表.docx"; zipOutputStream.putNextEntry(new ZipEntry(fileName)); - - LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy(); - Configure config = Configure.builder().bind("familyList", policy).build(); - - try (InputStream input = sysOfficeTemplateUtil.getTemplate("difficulty_apply")) { - zipOutputStream.write(sysOfficeTemplateUtil.renderTemplate(input, docData, config, false, "difficulthelp:batch:" + record.getString("id"))); - } + zipOutputStream.write(bytes); zipOutputStream.closeEntry(); } zipOutputStream.flush(); @@ -353,6 +324,14 @@ public class DifficultHelpReadingController { throw new RuntimeException("该记录不在当前可查看的范围内,无法导出"); } } + boolean pdf = Boolean.TRUE.equals(print); + String fileName = FileUtil.mainName(sysOfficeTemplateUtil.getTemplateFileName("difficulty_apply")) + "_" + difficultHelp.getUserName() + "_" + + DateUtil.format(difficultHelp.getApplyTime(), "yyyyMMdd") + (pdf ? ".pdf" : ".docx"); + byte[] bytes = renderApplyDocument(difficultHelp, pdf); + CommonDownloadUtil.download(fileName, bytes, response); + } + + private byte[] renderApplyDocument(DifficultHelpInfo difficultHelp, boolean pdf) throws Exception { HashMap docData = new HashMap<>(); docData.put("unionName", difficultHelp.getUnitName()); @@ -385,10 +364,8 @@ public class DifficultHelpReadingController { docData.put("applyMoney", difficultHelp.getApplyMoney()); docData.put("money", difficultHelp.getMoney()); fillApplyApprovals(docData, difficultHelp.getId()); - if (print) { - exportAsPDF(templateName, docData, config, difficultHelp, response); - } else { - exportAsWord(templateName, docData, config, difficultHelp,response); + try (InputStream input = getApplyTemplate(templateName)) { + return sysOfficeTemplateUtil.renderTemplate(input, docData, config, pdf, "difficulthelp:" + difficultHelp.getId()); } } @@ -465,30 +442,6 @@ public class DifficultHelpReadingController { return new ByteArrayInputStream(templateBytes); } - @At - private void exportAsPDF(String templateName, HashMap docData,Configure config, - DifficultHelpInfo difficultHelp, HttpServletResponse response) throws Exception { - String fileName = FileUtil.mainName(sysOfficeTemplateUtil.getTemplateFileName(templateName)) + "_" + difficultHelp.getUserName() + "_" + - DateUtil.format(difficultHelp.getApplyTime(), "yyyyMMdd") + ".pdf"; - - try (InputStream input = getApplyTemplate(templateName)) { - byte[] bytes = sysOfficeTemplateUtil.renderTemplate(input, docData, config, true, "difficulthelp:" + difficultHelp.getId()); - CommonDownloadUtil.download(fileName, bytes, response); - } - } - - @At - private void exportAsWord(String templateName, HashMap docData,Configure config, - DifficultHelpInfo difficultHelp, HttpServletResponse response) throws Exception { - String fileName = FileUtil.mainName(sysOfficeTemplateUtil.getTemplateFileName(templateName)) + "_" + difficultHelp.getUserName() + "_" + - DateUtil.format(difficultHelp.getApplyTime(), "yyyyMMdd") + ".docx"; - - try (InputStream input = getApplyTemplate(templateName)) { - byte[] bytes = sysOfficeTemplateUtil.renderTemplate(input, docData, config, false, "difficulthelp:" + difficultHelp.getId()); - CommonDownloadUtil.download(fileName, bytes, response); - } - } - @At @Ok("void") @SaCheckPermission("difficultHelp.reading") diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpThirdApprovalController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpThirdApprovalController.java index c531da9..e2bd460 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpThirdApprovalController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpThirdApprovalController.java @@ -83,6 +83,7 @@ public class DifficultHelpThirdApprovalController { LEFT(info.applyTime, 10) AS applyTime, info.applyCount, info.applyMoney, + info.money, info.mobile, ins.id AS instanceId, ins.businessNo, diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/schoolunionapproval/form.html b/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/schoolunionapproval/form.html index 5e126f0..6e710ad 100644 --- a/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/schoolunionapproval/form.html +++ b/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/schoolunionapproval/form.html @@ -1,7 +1,7 @@
- - + + {{ formData.money != null ? formData.money : '--' }} @@ -18,13 +18,20 @@ el: "#difficult_help_school_union_approval_form", data() { return { - businessId: GetQueryString("businessId"), + businessId: GetQueryString("businessId") || GetQueryString("bizId"), formData: { money: undefined, tf_sign: "", tf_opinion: "", }, } }, + created() { + if (this.businessId) { + this.$axios.post("/platform/difficultHelp/mine/findOne", {id: this.businessId}).then(res => { + if (res.code === 0 && res.data) this.formData.money = res.data.money + }) + } + }, methods: { async handleTaskAction(val) { try { diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/schoolunionapproval/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/schoolunionapproval/index.html index 9f2a811..0ee2a12 100644 --- a/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/schoolunionapproval/index.html +++ b/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/schoolunionapproval/index.html @@ -83,8 +83,8 @@ layout("/layouts/platform.html"){ - - + + {{ formData.money != null ? formData.money : '--' }} @@ -106,8 +106,8 @@ layout("/layouts/platform.html"){ {{formData.taskName}}
- - + + {{ formData.money != null ? formData.money : '--' }} @@ -248,7 +248,7 @@ layout("/layouts/platform.html"){ async approveSingleItem(item) { const res = await this.$axios.post("/platform/difficultHelp/approval/executeTask", { - data: JSON.stringify({processTaskId: item.taskId, money: this.formData.money, tf_opinion: this.formData.tf_opinion, tf_sign: this.formData.tf_sign, submitType: 1}) + data: JSON.stringify({processTaskId: item.taskId, tf_opinion: this.formData.tf_opinion, tf_sign: this.formData.tf_sign, submitType: 1}) }) if (res.code !== 0) throw new Error(res.msg || '审批失败') }, @@ -256,7 +256,7 @@ layout("/layouts/platform.html"){ this.$refs.guava.edit(()=>{ this.showApprovalForm = true this.formData = { - money: undefined, + money: row.money, tf_sign: "", processTaskId: row.taskId, taskName: row.curTaskName, diff --git a/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/common/info.css b/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/common/info.css index 05966d8..9fb676c 100644 --- a/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/common/info.css +++ b/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/common/info.css @@ -167,11 +167,11 @@ } .difficult-help-info-card .van-cell__title { - width: 112px; + width: 102px; color: #596779; font-size: 12px; line-height: 24px; - flex: 0 0 112px; + flex: 0 0 102px; } .difficult-help-info-card .van-cell__value { @@ -184,16 +184,8 @@ } .difficult-help-info-long-cell { - display: block; -} - -.difficult-help-info-long-cell .van-cell__title { - width: auto; - max-width: 100%; -} - -.difficult-help-info-long-cell .van-cell__value { - margin-top: 7px; + display: flex; + align-items: flex-start; } .difficult-help-info-pre-line { diff --git a/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/schoolunionapproval/index.html b/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/schoolunionapproval/index.html index 6a8e212..e05a71f 100644 --- a/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/schoolunionapproval/index.html +++ b/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/schoolunionapproval/index.html @@ -111,9 +111,7 @@ layout("/layouts/platform_h5.html"){
- + {{ formData.money != null ? formData.money : '--' }}

@@ -238,7 +236,7 @@ layout("/layouts/platform_h5.html"){ onApproval(row) { this.$set(this, "showApprovalForm", true) this.$set(this, "formData", { - money: undefined, + money: row.money, processTaskId: row.taskId, taskName: row.curTaskName, id: row.id,