From e0e6c462b68b3f88d99aefe14862296059372c97 Mon Sep 17 00:00:00 2001 From: = <=> Date: Sat, 24 Jan 2026 09:30:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BC=9A=E6=8A=A5=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 + .../com/budwk/app/base/utils/MoneyUtil.java | 165 +++++ .../UnionReimburseApplyController.java | 148 +++- .../UnionReimburseCollectController.java | 93 ++- .../UnionReimburseDescController.java | 93 +++ .../UnionReimburseMineController.java | 302 +++++++- .../UnionReimburseReviewController.java | 100 ++- .../UnionReimburseStatisticsController.java | 153 ++++ .../UnionReimburseTypeController.java | 91 +++ .../unionReimburse/model/UnionReimburse.java | 278 ++++++-- .../model/UnionReimburseDesc.java | 61 ++ .../param/UnionReimbursePageForm.java | 24 + .../service/UnionReimburseDescService.java | 7 + .../service/UnionReimburseService.java | 4 + .../impl/UnionReimburseDescServiceImpl.java | 17 + .../impl/UnionReimburseServiceImpl.java | 47 ++ .../unionReimburse/apply/index.html | 668 ++++++++++++++---- .../unionReimburse/collect/index.html | 111 ++- .../unionReimburse/desc/basicForm.js | 67 ++ .../unionReimburse/desc/index.html | 146 ++++ .../zhgh/dayofficework/unionReimburse/info.js | 250 +++++-- .../unionReimburse/mine/index.html | 107 +-- .../unionReimburse/review/index.html | 112 +-- .../unionReimburse/statistics/index.html | 312 ++++++++ .../staffbenefit/condolence/type/basicForm.js | 12 +- .../staffbenefit/condolence/type/index.html | 2 +- 26 files changed, 2871 insertions(+), 505 deletions(-) create mode 100644 src/main/java/com/budwk/app/base/utils/MoneyUtil.java create mode 100644 src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseDescController.java create mode 100644 src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseStatisticsController.java create mode 100644 src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseTypeController.java create mode 100644 src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/model/UnionReimburseDesc.java create mode 100644 src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/param/UnionReimbursePageForm.java create mode 100644 src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/UnionReimburseDescService.java create mode 100644 src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/impl/UnionReimburseDescServiceImpl.java create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/desc/basicForm.js create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/desc/index.html create mode 100644 src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/statistics/index.html diff --git a/pom.xml b/pom.xml index 23953bc8..f7dc4108 100644 --- a/pom.xml +++ b/pom.xml @@ -89,6 +89,12 @@ aviator 5.3.3 + + com.google.zxing + javase + 3.3.0 + + io.minio diff --git a/src/main/java/com/budwk/app/base/utils/MoneyUtil.java b/src/main/java/com/budwk/app/base/utils/MoneyUtil.java new file mode 100644 index 00000000..ea6f7d94 --- /dev/null +++ b/src/main/java/com/budwk/app/base/utils/MoneyUtil.java @@ -0,0 +1,165 @@ +package com.budwk.app.base.utils; +import java.math.BigDecimal; +/** + * @author : hongqiwei + * @description : + * @createDate : 2026/1/20 15:41 + */ +public class MoneyUtil { + public MoneyUtil() { + } + + public static String toRMBUpper(String money) throws Exception { + boolean lessZero = false; + if (money.contains("E")) { + BigDecimal bg = new BigDecimal(Double.valueOf(money)); + money = bg.toPlainString(); + } + + if (money.startsWith("-")) { + money = money.substring(1); + lessZero = true; + } + + if (!money.matches("^[0-9]*$|^0+\\.[0-9]+$|^[1-9]+[0-9]*$|^[1-9]+[0-9]*.[0-9]+$")) { + throw new Exception("钱数格式错误!"); + } else { + String[] part = money.split("\\."); + String integerData = part[0]; + String decimalData = part.length > 1 ? part[1] : ""; + if (integerData.matches("^0+$")) { + integerData = "0"; + } else if (integerData.matches("^0+(\\d+)$")) { + integerData = integerData.replaceAll("^0+(\\d+)$", "$1"); + } + + StringBuffer integer = new StringBuffer(); + + for(int i = 0; i < integerData.length(); ++i) { + char perchar = integerData.charAt(i); + integer.append(upperNumber(perchar)); + integer.append(upperNumber(integerData.length() - i - 1)); + } + + StringBuffer decimal = new StringBuffer(); + if (part.length > 1 && !"00".equals(decimalData)) { + int length = decimalData.length() >= 2 ? 2 : decimalData.length(); + + for(int i = 0; i < length; ++i) { + char perchar = decimalData.charAt(i); + decimal.append(upperNumber(perchar)); + if (i == 0) { + decimal.append('角'); + } + + if (i == 1) { + decimal.append('分'); + } + } + } + + String var10000 = integer.toString(); + String result = var10000 + decimal.toString(); + result = dispose(result); + if (lessZero && !"零圆整".equals(result)) { + result = "负" + result; + } + + return result; + } + } + + private static char upperNumber(char number) { + switch (number) { + case '0' -> { + return '零'; + } + case '1' -> { + return '壹'; + } + case '2' -> { + return '贰'; + } + case '3' -> { + return '叁'; + } + case '4' -> { + return '肆'; + } + case '5' -> { + return '伍'; + } + case '6' -> { + return '陆'; + } + case '7' -> { + return '柒'; + } + case '8' -> { + return '捌'; + } + case '9' -> { + return '玖'; + } + default -> { + return '0'; + } + } + } + + private static char upperNumber(int index) { + int realIndex = index % 9; + if (index > 8) { + realIndex = (index - 9) % 8; + ++realIndex; + } + + switch (realIndex) { + case 0 -> { + return '圆'; + } + case 1 -> { + return '拾'; + } + case 2 -> { + return '佰'; + } + case 3 -> { + return '仟'; + } + case 4 -> { + return '万'; + } + case 5 -> { + return '拾'; + } + case 6 -> { + return '佰'; + } + case 7 -> { + return '仟'; + } + case 8 -> { + return '亿'; + } + default -> { + return '0'; + } + } + } + + private static String dispose(String result) { + result = result.replaceAll("0", ""); + result = result.replaceAll("零仟零佰零拾|零仟零佰|零佰零拾|零仟|零佰|零拾", "零"); + result = result.replaceAll("零+", "零").replace("零亿", "亿"); + result = result.matches("^.*亿零万[^零]仟.*$") ? result.replace("零万", "零") : result.replace("零万", "万"); + result = result.replace("亿万", "亿"); + result = result.replace("零角", "零").replace("零分", ""); + result = result.replaceAll("(^[零圆]*)(.+$)", "$2"); + result = result.replaceAll("(^.*)([零]+圆)(.+$)", "$1圆零$3"); + result = result.replaceAll("圆零角零分|圆零角$|圆$|^零$|圆零$|圆零零$|零圆$", "圆整"); + result = result.replaceAll("^圆整$", "零圆整"); + return result; + } +} + diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseApplyController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseApplyController.java index 67a9c777..b10116f4 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseApplyController.java @@ -16,6 +16,7 @@ import com.budwk.app.flow.entity.ProcessInstance; import com.budwk.app.flow.entity.ProcessTask; import com.budwk.app.flow.enums.ProcessSubmitTypeEnum; import com.budwk.app.flow.service.FlowCommonService; +import com.budwk.app.sys.models.Sys_unit; import com.budwk.app.sys.views.View_user; import com.budwk.app.web.commons.auth.utils.AuthUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil; @@ -84,7 +85,17 @@ public class UnionReimburseApplyController { @SaCheckPermission(value = {"unionReimburse.apply", "h5.unionReimburse.apply"}, mode = SaMode.OR) @SLog(type = "unionReimburse", tag = "工会报销-报销申请", msg = "保存报销申请") public Result save(@Param("data") UnionReimburse unionReimburse) { - if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(new Date()); + if (StrUtil.isBlank(unionReimburse.getId())) { + unionReimburse.setCreateTime(new Date()); + String documentNo = generateDocumentNo(); + unionReimburse.setDocumentNo(documentNo); + } + unionReimburse.setStateId(1);//待提交 + if (("UNION_REIMBURSE_PROJECT_1").equals(unionReimburse.getReimburseProject())){ + unionReimburse.setRealMoney(unionReimburse.getCondolenceMoney()); + }else { + unionReimburse.setRealMoney(unionReimburse.getMoney()); + } dao.insertOrUpdate(unionReimburse); return Result.success(); } @@ -94,52 +105,56 @@ public class UnionReimburseApplyController { @Aop(TransAop.READ_COMMITTED) @SaCheckPermission(value = {"unionReimburse.apply", "h5.unionReimburse.apply"}, mode = SaMode.OR) public Result submit(@Param("data") UnionReimburse unionReimburse) { - if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(new Date()); - - dao.insertOrUpdate(unionReimburse); - // 开启流程实例 - Dict args = Dict.create(); - args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode()); - args.set(FlowConst.FORM_DATA, unionReimburse); - args.set("userId", unionReimburse.getCertifierUserId()); - ProcessInstance instance = flowEngine.startProcessInstanceByKey("GHBX", unionReimburse.getId(), SecurityUtil.getUserId(), args); - - // 自动完成第一个申请任务 - List doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null); - for (ProcessTask task : doingTaskList) { - flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args); + if (StrUtil.isBlank(unionReimburse.getId())) { + unionReimburse.setCreateTime(new Date()); + String documentNo = generateDocumentNo(); + unionReimburse.setDocumentNo(documentNo); + } + unionReimburse.setStateId(2);//待审核 + if (("UNION_REIMBURSE_PROJECT_1").equals(unionReimburse.getReimburseProject())){ + unionReimburse.setRealMoney(unionReimburse.getCondolenceMoney()); + }else { + unionReimburse.setRealMoney(unionReimburse.getMoney()); } - return Result.success(); - } - - @At - @ApiOperation("重新提交申请") - @Aop(TransAop.READ_COMMITTED) - @SaCheckPermission(value = {"unionReimburse.apply", "h5.unionReimburse.apply"}, mode = SaMode.OR) - public Result submitAgain(@Param("data") UnionReimburse unionReimburse, @Param("taskId") Long taskId) { - if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(new Date()); - dao.insertOrUpdate(unionReimburse); - - Dict dict = Dict.create(); - dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId); - dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode()); - dict.set("userId", unionReimburse.getCertifierUserId()); - flowCommonService.executeTask(dict); +// // 开启流程实例 +// Dict args = Dict.create(); +// args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode()); +// args.set(FlowConst.FORM_DATA, unionReimburse); +// args.set("userId", unionReimburse.getCondolenceUserId()); +// ProcessInstance instance = flowEngine.startProcessInstanceByKey("GHBX", unionReimburse.getId(), SecurityUtil.getUserId(), args); +// +// // 自动完成第一个申请任务 +// List doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null); +// for (ProcessTask task : doingTaskList) { +// flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args); +// } return Result.success(); } +// @At +// @ApiOperation("重新提交申请") +// @Aop(TransAop.READ_COMMITTED) +// @SaCheckPermission(value = {"unionReimburse.apply", "h5.unionReimburse.apply"}, mode = SaMode.OR) +// public Result submitAgain(@Param("data") UnionReimburse unionReimburse, @Param("taskId") Long taskId) { +// if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(new Date()); +// +// dao.insertOrUpdate(unionReimburse); +// +// Dict dict = Dict.create(); +// dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId); +// dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode()); +// dict.set("userId", unionReimburse.getCondolenceUserId()); +// flowCommonService.executeTask(dict); +// return Result.success(); +// } + @At @SaCheckLogin @ApiOperation("获取当前登录人的申请信息") public Result info(@Param("id") String id) { UnionReimburse unionReimburse = dao.fetch(UnionReimburse.class, id); - CondolenceType type = unionReimburseService.dao().fetch(CondolenceType.class, - Cnd.where(CondolenceType::getId, "=", unionReimburse.getCondolenceType())); - NutMap nutMap = Lang.obj2nutmap(unionReimburse); - // 使用三元运算符处理 null 情况 - nutMap.put("typeName", type != null ? type.getName() : ""); - return Result.success(nutMap); + return Result.success(unionReimburse); } @@ -159,7 +174,10 @@ public class UnionReimburseApplyController { IFNULL(unitname, '暂无') as unitName, unitid as unitId, unionid as unionId, - unionname as unionName + unionname as unionName, + DATE(birthday) AS birthday, + idCard, + unionCode from vw_user $condition @@ -189,10 +207,29 @@ public class UnionReimburseApplyController { @ApiOperation("查询职工慰问类型") @SaCheckPermission(value = {"unionReimburse.apply", "h5.unionReimburse.apply"}, mode = SaMode.OR) public Result queryCondolenceType() { - List list = typeService.query(Cnd.NEW().desc(CondolenceType::getCode)); + List list = typeService.query(Cnd.NEW().asc(CondolenceType::getCode)); return Result.success(list); } + @At + @ApiOperation("查询厉害账号信息") + @SaCheckPermission(value = {"unionReimburse.apply", "h5.unionReimburse.apply"}, mode = SaMode.OR) + public Result findUserBankHistory(String payer) { + Sql sql = Sqls.create(""" + SELECT DISTINCT + bankCardNumber, + bankOfDeposit + FROM union_reimburse + $condition + """); + Cnd cnd = Cnd.NEW(); + cnd.andEX("payer", "=", payer); + sql.setCondition(cnd); + List result = unionReimburseService.listMap(sql); + return Result.success(result); + } + + @At @ApiOperation("查询校工会经费余额") @SaCheckPermission(value = {"unionReimburse.apply", "h5.unionReimburse.apply"}, mode = SaMode.OR) @@ -244,6 +281,39 @@ public class UnionReimburseApplyController { // 如果没有找到该社团的经费记录,返回0 return Result.success(0.0); } + @At + @ApiOperation("生成文件编号") + private String generateDocumentNo() { + int currentYear = DateUtil.thisYear(); + String yearPrefix = String.valueOf(currentYear); + + org.nutz.dao.Cnd cnd = org.nutz.dao.Cnd.where("documentNo", "LIKE", yearPrefix + "%"); + cnd.desc("documentNo"); + cnd.limit(1); + + List list = dao.query(UnionReimburse.class, cnd); + + int nextSeq = 1; // 默认从01开始 + if (!list.isEmpty()) { + String maxNo = list.get(0).getDocumentNo(); + if (maxNo != null && maxNo.startsWith(yearPrefix)) { + // 提取序号部分(去掉年份前缀) + String seqPart = maxNo.substring(yearPrefix.length()); + try { + int currentMaxSeq = Integer.parseInt(seqPart); + nextSeq = currentMaxSeq + 1; + } catch (NumberFormatException e) { + // 如果解析失败,使用默认值1 + nextSeq = 1; + } + } + } + + // 格式化序号为两位数 + String seqStr = String.format("%02d", nextSeq); + return yearPrefix + seqStr; + } + } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseCollectController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseCollectController.java index 11bb5e24..4896f3d3 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseCollectController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseCollectController.java @@ -3,10 +3,12 @@ package com.budwk.app.zhgh.dayofficework.unionReimburse.controller; import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.dev33.satoken.annotation.SaCheckLogin; import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaMode; import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.page.Pagination; import com.budwk.app.base.param.PageForm; import com.budwk.app.base.result.Result; @@ -14,12 +16,16 @@ import com.budwk.app.base.utils.CommonDownloadUtil; import com.budwk.app.flow.engine.FlowEngine; import com.budwk.app.sys.models.Sys_dict; import com.budwk.app.sys.services.SysDictService; +import com.budwk.app.web.commons.auth.utils.AuthUtil; +import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.zhgh.dayofficework.unionReimburse.model.UnionReimburse; import com.budwk.app.zhgh.dayofficework.unionReimburse.service.UnionReimburseService; import com.budwk.app.zhgh.dayofficework.unionReimburse.vo.UnionReimburseCollectExcelVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.usermodel.Workbook; +import org.nutz.dao.Chain; import org.nutz.dao.Cnd; import org.nutz.dao.Dao; import org.nutz.dao.Sqls; @@ -33,6 +39,7 @@ import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.List; @IocBean @@ -74,28 +81,9 @@ public class UnionReimburseCollectController { @Param(value = "reimburseProject") String reimburseProject) { Sql sql = Sqls.create(""" SELECT - info.*, - ins.id AS instanceId, - ins.businessNo, - ins.state instanceState, - ins.variable instanceVariable, - ins.processDefineId instanceProcessDefineId, - t.id taskId, - t.taskName AS taskKey, - t.displayName taskName, - t.taskType, - t.performType taskPerformType, - t.taskState, - t.finishTime, - t.taskParentId, - t.variable taskVariable, - IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke, - (select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask' AND taskState in (10,20)) AS startTaskId + info.* FROM union_reimburse info - LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id - LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10 - LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id $condition """); Cnd cnd = Cnd.NEW(); @@ -116,8 +104,7 @@ public class UnionReimburseCollectController { cnd.and(seg); } - // 只查询流程实例状态为20的数据(已完成状态) - cnd.and("ins.state", "=", 20); + cnd.and("info.stateId", "in", List.of(3, 2)); cnd.desc("info.createTime"); sql.setCondition(cnd); @@ -125,6 +112,68 @@ public class UnionReimburseCollectController { return Result.success(pagination); } + @At + @SaCheckPermission(value = {"unionReimburse.collect", "h5.unionReimburse.collect"}, mode = SaMode.OR) + public Result updateActuallyAmount(String id,Double realMoney) { + UnionReimburse unionReimburse = unionReimburseService.fetch(id); + unionReimburse.setRealMoney(realMoney); + unionReimburseService.updateIgnoreNull(unionReimburse); + return Result.success(); + } + + @At + @Ok("void") + @SaCheckPermission(value = {"unionReimburse.collect", "h5.unionReimburse.collect"}, mode = SaMode.OR) + public void exportSkr(Integer year, String unionId, String unitId, String reimburseProject,HttpServletResponse response) { + Sql sql = Sqls.create(""" + SELECT + CONCAT(u.username,'(',u.loginname,')') as skrxx, + rei.bankCardNumber, + rei.bankOfDeposit, + CASE + WHEN rei.reimburseProject = 'UNION_REIMBURSE_PROJECT_1' THEN '慰问' + WHEN rei.reimburseProject = 'UNION_REIMBURSE_PROJECT_2' THEN '文体活动' + WHEN rei.reimburseProject = 'UNION_REIMBURSE_PROJECT_3' THEN '日常活动' + WHEN rei.reimburseProject = 'UNION_REIMBURSE_PROJECT_4' THEN '专项活动' + ELSE rei.reimburseProject + END as reimbursementItemName, + u.mobile + FROM + `union_reimburse` rei + LEFT JOIN `vw_user` u ON u.id = rei.payer + $condition + """); + Cnd cnd = Cnd.NEW(); + cnd.andEX("rei.paymentWay","=","UNION_REIMBURSE_PAYMENT_WAY_2"); + cnd.andEX("rei.reimburseProject", "=", reimburseProject); + cnd.andEX("YEAR(rei.createTime)", "=", year); + cnd.andEX("u.unitid", "=", unitId); + cnd.andEX("u.unionid", "=", unionId); + if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) { + cnd.andEX("u.unionid", "=", SecurityUtil.getUnionId()); + } + cnd.desc("rei.createTime"); + sql.setCondition(cnd); + List list = unionReimburseService.listMap(sql); + + List excelExportEntities = new ArrayList<>(); + excelExportEntities.add(new ExcelExportEntity("收款人信息","skrxx",20)); + excelExportEntities.add(new ExcelExportEntity("收款人账号","bankCardNumber",20)); + excelExportEntities.add(new ExcelExportEntity("地区","area",20)); + excelExportEntities.add(new ExcelExportEntity("开户行信息","bankOfDeposit",20)); + excelExportEntities.add(new ExcelExportEntity("手机号码","mobile",20)); + excelExportEntities.add(new ExcelExportEntity("报销项目","reimbursementItemName",20)); + + try{ + response.setContentType("application/octet-stream"); + response.setHeader("Content-Disposition", "attachment;filename=" + new String(("收款人名册.xls").getBytes("utf-8"), "ISO8859-1")); + Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), excelExportEntities, list); + workbook.write(response.getOutputStream()); + }catch (Exception e){ + e.printStackTrace(); + } + } + @At @Ok("void") @SaCheckPermission(value = {"unionReimburse.collect", "h5.unionReimburse.collect"}, mode = SaMode.OR) diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseDescController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseDescController.java new file mode 100644 index 00000000..b2399497 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseDescController.java @@ -0,0 +1,93 @@ +package com.budwk.app.zhgh.dayofficework.unionReimburse.controller; + +import cn.dev33.satoken.annotation.SaCheckLogin; +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.annotation.SLog; +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.param.PageForm; +import com.budwk.app.base.result.Result; +import com.budwk.app.zhgh.dayofficework.unionReimburse.model.UnionReimburse; +import com.budwk.app.zhgh.dayofficework.unionReimburse.model.UnionReimburseDesc; +import com.budwk.app.zhgh.dayofficework.unionReimburse.service.UnionReimburseDescService; +import com.budwk.app.zhgh.staffbenefit.condolence.model.CondolenceType; +import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceTypeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; +import org.nutz.dao.util.cri.SqlExpressionGroup; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; + +import java.util.List; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2026/1/20 11:32 + */ +@Slf4j +@IocBean +@Ok("json:full") +@Api(tags = "职工慰问类型") +@At("/platform/unionReimburse/desc") +public class UnionReimburseDescController { + @Inject + private Dao dao; + @Inject + private UnionReimburseDescService unionReimburseDesc; + + @At("") + @SaCheckPermission("unionReimburse.desc") + @Ok("beetl:/platform/zhgh/dayofficework/unionReimburse/desc/index.html") + public void index() { + } + + @At + @ApiOperation("分页查询") + @SaCheckPermission("unionReimburse.desc") + public Result pageData(PageForm pageForm) { + Cnd cnd = Cnd.NEW(); + if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + SqlExpressionGroup seg = new SqlExpressionGroup(); + seg.or(UnionReimburseDesc::getName, "like", "%" + pageForm.getSearchKeyword() + "%"); + seg.or(UnionReimburseDesc::getCode, "like", "%" + pageForm.getSearchKeyword() + "%"); + cnd.and(seg); + } + cnd.asc("code"); + Pagination pagination = unionReimburseDesc.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd); + return Result.success(pagination); + } + + @At + @ApiOperation("新增/修改职工慰问类型") + @SaCheckPermission("unionReimburse.desc") + @SLog(tag = "职工慰问系统-慰问类型", msg = "新增/修改职工慰问类型") + public Object onSubmit(UnionReimburseDesc desc) { + unionReimburseDesc.insertOrUpdate(desc); + return Result.success(); + } + + @At + @ApiOperation("删除职工慰问类型") + @SaCheckPermission("unionReimburse.desc") + @SLog(tag = "职工慰问系统-慰问类型", msg = "删除职工慰问类型") + public Object onDelete(String id) { + unionReimburseDesc.delete(id); + return Result.success(); + } + + @At + @ApiOperation("查询附件说明") + @SaCheckPermission(value = {"unionReimburse.desc", "h5.unionReimburse.desc"}, mode = SaMode.OR) + public Result queryFileDesc() { + List list = unionReimburseDesc.query(Cnd.NEW().desc(UnionReimburseDesc::getCode)); + return Result.success(list); + } +} + diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseMineController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseMineController.java index 2a0a54e9..99658c4f 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseMineController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseMineController.java @@ -3,30 +3,58 @@ package com.budwk.app.zhgh.dayofficework.unionReimburse.controller; import cn.dev33.satoken.annotation.SaCheckLogin; import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaMode; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.IoUtil; import cn.hutool.core.util.StrUtil; import com.budwk.app.base.annotation.SLog; +import com.budwk.app.base.model.Audit; import com.budwk.app.base.page.Pagination; import com.budwk.app.base.param.PageForm; import com.budwk.app.base.result.Result; +import com.budwk.app.base.utils.CommonDownloadUtil; +import com.budwk.app.base.utils.MoneyUtil; +import com.budwk.app.base.utils.OfficePlusUtil; +import com.budwk.app.base.utils.SysOfficeTemplateUtil; import com.budwk.app.flow.engine.FlowEngine; import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.zhgh.dayofficework.unionReimburse.model.UnionReimburse; import com.budwk.app.zhgh.dayofficework.unionReimburse.service.UnionReimburseService; +import com.deepoove.poi.XWPFTemplate; +import com.deepoove.poi.config.Configure; +import com.deepoove.poi.data.PictureRenderData; +import com.google.zxing.BarcodeFormat; +import com.google.zxing.client.j2se.MatrixToImageWriter; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.qrcode.QRCodeWriter; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.IOUtils; import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; import org.nutz.dao.Sqls; +import org.nutz.dao.entity.Record; import org.nutz.dao.sql.Sql; 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.lang.Strings; +import org.nutz.lang.random.R; import org.nutz.lang.util.NutMap; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; +import javax.servlet.http.HttpServletResponse; +import java.awt.image.BufferedImage; +import java.io.*; +import java.nio.file.Files; +import java.nio.file.StandardOpenOption; +import java.util.HashMap; + /** * @ClassName UnionReimburseMineController * @Author hongqiwei @@ -41,10 +69,15 @@ import org.nutz.mvc.annotation.Param; @Slf4j public class UnionReimburseMineController { + + @Inject + private SysOfficeTemplateUtil sysOfficeTemplateUtil; @Inject private UnionReimburseService unionReimburseService; @Inject private FlowEngine flowEngine; + @Inject + private Dao dao; @At("/index") @@ -124,7 +157,274 @@ public class UnionReimburseMineController { @SLog( tag = "删除工会报销", msg = "删除工会报销") public Result delete(@Param("id") String id) { unionReimburseService.delete(id); - flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id); return Result.success(); } + + @At + @ApiOperation("撤回") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission(value = {"unionReimburse.mine", "h5.unionReimburse.mine"}, mode = SaMode.OR) + @SLog( tag = "撤回工会报销", msg = "撤回工会报销") + public Result revokeTask(@Param("id") String id) { + UnionReimburse unionReimburse = unionReimburseService.fetch(id); + unionReimburse.setStateId(1);//待审核 + dao.insertOrUpdate(unionReimburse); + return Result.success(); + } + + + @At + @Ok("void") + public void ActExport(String id, HttpServletResponse response, boolean Print) throws Exception { + UnionReimburse unionReimburse = unionReimburseService.fetch(id); + if (unionReimburse == null) { + throw new RuntimeException("报销记录不存在"); + } + HashMap docData = new HashMap<>(); + + QRCodeWriter qrCodeWriter = new QRCodeWriter(); + BitMatrix bitMatrix = qrCodeWriter.encode(unionReimburse.getDocumentNo(), BarcodeFormat.QR_CODE, 80, 80); + BufferedImage bufferedImage = MatrixToImageWriter.toBufferedImage(bitMatrix); + File tempFile = File.createTempFile("qrcode_", ".png"); + javax.imageio.ImageIO.write(bufferedImage, "PNG", tempFile); + PictureRenderData pictureRenderData = com.deepoove.poi.data.Pictures.of(tempFile.getAbsolutePath()) + .size(80, 80) + .create(); + docData.put("qrcode", pictureRenderData); + + tempFile.deleteOnExit(); + + docData.put("createTime", DateUtil.format(unionReimburse.getCreateTime(), "yyyy-MM-dd")); + docData.put("unitName", unionReimburse.getUnitName()); + docData.put("userName", unionReimburse.getUserName()); + docData.put("loginName", unionReimburse.getLoginName()); + docData.put("mobile", unionReimburse.getMobile()); + docData.put("paymentNotes", unionReimburse.getPaymentNotes()); + docData.put("invoiceNumber", unionReimburse.getInvoiceNumber()); + docData.put("notes", unionReimburse.getNotes()); + docData.put("realMoney", unionReimburse.getRealMoney()); + docData.put("reimburseProject", unionReimburse.getReimburseProject()); + docData.put("paymentWay", unionReimburse.getPaymentWay()); + //对私支付,付款人信息 + docData.put("payerLoginname", unionReimburse.getPayerLoginname()); + docData.put("payerName", unionReimburse.getPayerName()); + docData.put("bankOfDeposit", unionReimburse.getBankOfDeposit()); + docData.put("bankCardNumber", unionReimburse.getBankCardNumber()); + + // 金额转大写 + if (unionReimburse.getRealMoney() != null) { + docData.put("money_big", MoneyUtil.toRMBUpper(String.valueOf(unionReimburse.getRealMoney()))); + } else { + docData.put("money_big", ""); + } + + // 设置报销项目类型标记 + String wtAct = "□文体活动 □慰问 □日常活动 □专项活动"; + if ("UNION_REIMBURSE_PROJECT_2".equals(unionReimburse.getReimburseProject())) { + wtAct = wtAct.replace("□文体活动", "√文体活动"); + } else if ("UNION_REIMBURSE_PROJECT_3".equals(unionReimburse.getReimburseProject())) { + wtAct = wtAct.replace("□日常活动", "√日常活动"); + } else if ("UNION_REIMBURSE_PROJECT_4".equals(unionReimburse.getReimburseProject())) { + wtAct = wtAct.replace("□专项活动", "√专项活动"); + } else if ("UNION_REIMBURSE_PROJECT_1".equals(unionReimburse.getReimburseProject())) { + wtAct = wtAct.replace("□慰问", "√慰问"); + } + docData.put("bxxm", wtAct); + String templateName; + Double realMoney = unionReimburse.getRealMoney() != null ? unionReimburse.getRealMoney() : 0.0; + String paymentWay = unionReimburse.getPaymentWay(); + + if (("UNION_REIMBURSE_PAYMENT_WAY_2").equals(paymentWay)) { // 对私支付 + docData.put("paymentWay", "对私支付"); + if (realMoney < 5000) { + templateName = "unionReimburse_act_private_small"; + } else { + templateName = "unionReimburse_act_private_big"; + } + } else { // 对公支付 + docData.put("paymentWay", "对公支付"); + if (realMoney < 5000) { + templateName = "unionReimburse_act_public_small"; + } else { + templateName = "unionReimburse_act_public_big"; + } + } + + if (Print) { + exportAsPDF(templateName, docData, unionReimburse, response); + } else { + exportAsWord(templateName, docData, unionReimburse, response); + } + } + + @At + @Ok("void") + public void ConExport(String id, HttpServletResponse response, boolean Print) throws Exception { + UnionReimburse unionReimburse = unionReimburseService.fetch(id); + if (unionReimburse == null) { + throw new RuntimeException("报销记录不存在"); + } + HashMap docData = new HashMap<>(); + + QRCodeWriter qrCodeWriter = new QRCodeWriter(); + BitMatrix bitMatrix = qrCodeWriter.encode(unionReimburse.getDocumentNo(), BarcodeFormat.QR_CODE, 80, 80); + BufferedImage bufferedImage = MatrixToImageWriter.toBufferedImage(bitMatrix); + File tempFile = File.createTempFile("qrcode_", ".png"); + javax.imageio.ImageIO.write(bufferedImage, "PNG", tempFile); + PictureRenderData pictureRenderData = com.deepoove.poi.data.Pictures.of(tempFile.getAbsolutePath()) + .size(80, 80) + .create(); + docData.put("qrcode", pictureRenderData); + + docData.put("createTime", DateUtil.format(unionReimburse.getCreateTime(), "yyyy-MM-dd")); + docData.put("unitName", unionReimburse.getUnitName()); + docData.put("userName", unionReimburse.getUserName()); + docData.put("loginName", unionReimburse.getLoginName()); + docData.put("mobile", unionReimburse.getMobile()); + docData.put("paymentNotes", unionReimburse.getPaymentNotes()); + docData.put("invoiceNumber", unionReimburse.getInvoiceNumber()); + docData.put("notes", unionReimburse.getNotes()); + docData.put("realMoney", unionReimburse.getRealMoney()); + docData.put("reimburseProject", unionReimburse.getReimburseProject()); + docData.put("paymentWay", unionReimburse.getPaymentWay()); + //对私支付,付款人信息 + docData.put("payerLoginname", unionReimburse.getPayerLoginname()); + docData.put("payerName", unionReimburse.getPayerName()); + docData.put("bankOfDeposit", unionReimburse.getBankOfDeposit()); + docData.put("bankCardNumber", unionReimburse.getBankCardNumber()); + + //慰问 + docData.put("condolenceUserName", unionReimburse.getCondolenceUserName()); + docData.put("condolenceLoginName", unionReimburse.getCondolenceLoginName()); + docData.put("typeName", unionReimburse.getTypeName()); + docData.put("way", unionReimburse.getWay()); + docData.put("condolenceTime", DateUtil.format(unionReimburse.getCondolenceTime(), "yyyy-MM-dd")); + docData.put("participants", unionReimburse.getParticipants()); + //结婚 + docData.put("marryTime", DateUtil.format(unionReimburse.getMarryTime(), "yyyy-MM-dd")); + //生育 + docData.put("fertilityTime", DateUtil.format(unionReimburse.getFertilityTime(), "yyyy-MM-dd")); + //生病住院 + docData.put("hospitalCausation", unionReimburse.getHospitalCausation()); + docData.put("hospital", unionReimburse.getHospital()); + docData.put("hospitalCount", unionReimburse.getHospitalCount()); + String hospitalTime = DateUtil.format(unionReimburse.getHospitalizationStartTime(), "yyyy-MM-dd") + + " 至 " + + DateUtil.format(unionReimburse.getHospitalizationEndTime(), "yyyy-MM-dd"); + docData.put("hospitalTime", hospitalTime); + //去世 + docData.put("deathTime", DateUtil.format(unionReimburse.getDeathTime(), "yyyy-MM-dd")); + docData.put("condolenceRelationship", unionReimburse.getCondolenceRelationship()); + + + // 金额转大写 + if (unionReimburse.getRealMoney() != null) { + docData.put("money_big", MoneyUtil.toRMBUpper(String.valueOf(unionReimburse.getRealMoney()))); + } else { + docData.put("money_big", ""); + } + + // 设置报销项目类型标记 + String wtAct = "□文体活动 □慰问 □日常活动 □专项活动"; + if ("UNION_REIMBURSE_PROJECT_2".equals(unionReimburse.getReimburseProject())) { + wtAct = wtAct.replace("□文体活动", "√文体活动"); + } else if ("UNION_REIMBURSE_PROJECT_3".equals(unionReimburse.getReimburseProject())) { + wtAct = wtAct.replace("□日常活动", "√日常活动"); + } else if ("UNION_REIMBURSE_PROJECT_4".equals(unionReimburse.getReimburseProject())) { + wtAct = wtAct.replace("□专项活动", "√专项活动"); + } else if ("UNION_REIMBURSE_PROJECT_1".equals(unionReimburse.getReimburseProject())) { + wtAct = wtAct.replace("□慰问", "√慰问"); + } + docData.put("bxxm", wtAct); + String templateName; + Double realMoney = unionReimburse.getRealMoney() != null ? unionReimburse.getRealMoney() : 0.0; + String paymentWay = unionReimburse.getPaymentWay(); + + if (("UNION_REIMBURSE_PAYMENT_WAY_2").equals(paymentWay)) { // 对私支付 + docData.put("paymentWay", "对私支付"); + if (("生病住院").equals(unionReimburse.getTypeName())) { + templateName = "unionReimburse_con_private_hospital"; + } else if (("结婚").equals(unionReimburse.getTypeName())) { + templateName = "unionReimburse_con_private_mary"; + } else if (("生育").equals(unionReimburse.getTypeName())) { + templateName = "unionReimburse_con_private_birth"; + } else if (("会员去世").equals(unionReimburse.getTypeName()) || ("直系亲属去世").equals(unionReimburse.getTypeName())) { + if (realMoney < 5000) { + templateName = "unionReimburse_con_private_dead_small"; + } else { + templateName = "unionReimburse_con_private_dead_big"; + } + } else {//其他 + templateName = "unionReimburse_con_private_other"; + } + } else { // 对公支付 + docData.put("paymentWay", "对公支付"); + if (("生病住院").equals(unionReimburse.getTypeName())) { + templateName = "unionReimburse_con_public_hospital"; + } else if (("结婚").equals(unionReimburse.getTypeName())) { + templateName = "unionReimburse_con_public_mary"; + } else if (("生育").equals(unionReimburse.getTypeName())) { + templateName = "unionReimburse_con_public_birth"; + } else if (("会员去世").equals(unionReimburse.getTypeName()) || ("直系亲属去世").equals(unionReimburse.getTypeName())) { + if (realMoney < 5000) { + templateName = "unionReimburse_con_public_dead_small"; + } else { + templateName = "unionReimburse_con_public_dead_big"; + } + } else {//其他 + templateName = "unionReimburse_con_public_other"; + } + } + + if (Print) { + exportAsPDF(templateName, docData, unionReimburse, response); + } else { + exportAsWord(templateName, docData, unionReimburse, response); + } + } + + // 导出PDF + @At + private void exportAsPDF(String templateName, HashMap docData, + UnionReimburse unionReimburse, HttpServletResponse response) throws Exception { + String fileName = "中国地质大学(武汉)工会经费日常报销_" + unionReimburse.getUserName() + "_" + + DateUtil.format(unionReimburse.getCreateTime(), "yyyyMMdd") + ".pdf"; + + try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) { + XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate(templateName)) + .render(docData) + .writeAndClose(byteArrayOutputStream); + byte[] bytes = byteArrayOutputStream.toByteArray(); + File sourceFile = File.createTempFile("file_convert_origin", ".docx"); + Files.write(sourceFile.toPath(), bytes, StandardOpenOption.WRITE); + + File pdfFile = File.createTempFile("file_convert", ".pdf"); + OfficePlusUtil.convert(sourceFile.getPath(), pdfFile.getPath()); + CommonDownloadUtil.download(fileName, IoUtil.readBytes(FileUtil.getInputStream(pdfFile)), response); + // 删除临时文件 + FileUtil.del(sourceFile); + FileUtil.del(pdfFile.toPath()); + } catch (IOException e) { + log.error("工会报销单据导出PDF失败,id:{},错误信息:{}", unionReimburse.getId(), e.getMessage()); + } + } + + // 导出Word + @At + private void exportAsWord(String templateName, HashMap docData, + UnionReimburse unionReimburse, HttpServletResponse response) throws Exception { + String fileName = "中国地质大学(武汉)工会经费日常报销_" + unionReimburse.getUserName() + "_" + + DateUtil.format(unionReimburse.getCreateTime(), "yyyyMMdd") + ".docx"; + + try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) { + XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate(templateName)) + .render(docData) + .writeAndClose(byteArrayOutputStream); + CommonDownloadUtil.download(fileName, byteArrayOutputStream.toByteArray(), response); + } catch (IOException e) { + log.error("工会报销单据导出Word失败,id:{},错误信息:{}", unionReimburse.getId(), e.getMessage()); + } + } + + } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseReviewController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseReviewController.java index a75bb59b..0df7de86 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseReviewController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseReviewController.java @@ -5,28 +5,38 @@ import cn.dev33.satoken.annotation.SaCheckLogin; import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaMode; import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.annotation.SLog; import com.budwk.app.base.page.Pagination; import com.budwk.app.base.param.PageForm; import com.budwk.app.base.result.Result; import com.budwk.app.base.utils.PageUtil; import com.budwk.app.flow.enums.ProcessTaskStateEnum; import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.zhgh.dayofficework.unionReimburse.model.UnionReimburse; import com.budwk.app.zhgh.dayofficework.unionReimburse.service.UnionReimburseService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.nutz.aop.interceptor.ioc.TransAop; +import org.nutz.dao.Chain; import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; import org.nutz.dao.Sqls; import org.nutz.dao.sql.Sql; 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.lang.util.NutMap; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; +import org.nutz.mvc.annotation.Param; +import java.util.Date; import java.util.List; +import static org.openjdk.nashorn.internal.runtime.regexp.joni.Config.log; + @IocBean @At("/platform/unionReimburse/review") @Ok("json:full") @@ -34,6 +44,8 @@ import java.util.List; @Slf4j public class UnionReimburseReviewController { + @Inject + private Dao dao; @Inject private UnionReimburseService unionReimburseService; @@ -59,41 +71,20 @@ public class UnionReimburseReviewController { String unitId, String reimburseProject) { Sql sql = Sqls.create(""" - SELECT - info.*, - ins.id AS instanceId, - ins.businessNo, - ins.state instanceState, - ins.variable instanceVariable, - ins.processDefineId instanceProcessDefineId, - t.id taskId, - t.taskName AS taskKey, - t.displayName taskName, - t.taskType, - t.performType taskPerformType, - t.taskState, - t.finishTime, - t.taskParentId, - t.variable taskVariable, - IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName, - IF(rt.id IS NOT NULL, 1, 0) AS canRevoke - FROM - wf_process_task t - LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId - LEFT JOIN union_reimburse info ON info.id = ins.businessNo - LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id - LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10 - LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10 - $condition + SELECT + info.* + FROM + union_reimburse info + $condition """); Cnd cnd = Cnd.NEW(); - cnd.and("t.taskName", "=", "019925d2-6f33-449a-9fb0-34c470222e99"); - cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); if (approval) { - cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode())); + // 已审核:查询 stateId 为 3(报销成功)、4(拒绝)、5(退回)的记录 + cnd.and("info.stateId", "in", List.of(3, 4, 5)); } else { - cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode()); + // 未审核:只查询 stateId 为 2(待审核确认)的记录 + cnd.and("info.stateId", "=", 2); } // 年度查询条件 cnd.andEX("year(info.createTime)", "=", year); @@ -118,10 +109,55 @@ public class UnionReimburseReviewController { } else { cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); } - cnd.groupBy("t.id"); - cnd.desc("t.createdAt"); + cnd.desc("info.createdAt"); sql.setCondition(cnd); Pagination pagination = unionReimburseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); return Result.success(pagination); } + + @At + @ApiOperation("审核") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission(value = {"unionReimburse.review", "h5.unionReimburse.review"}, mode = SaMode.OR) + @SLog( tag = "审核工会报销", msg = "审核工会报销") + public Result reviewTask(@Param("data") UnionReimburse unionReimburse,String submitType) { + if (submitType == null || !List.of("3", "4", "5").contains(submitType)) { + return Result.error("无效的审核操作类型"); + } + + UnionReimburse dbRecord = dao.fetch(UnionReimburse.class, unionReimburse.getId()); + if (dbRecord == null) { + return Result.error("记录不存在"); + } + + dbRecord.setReviewTime(new Date()); + dbRecord.setStateId(Integer.parseInt(submitType)); + dbRecord.setReviewOpinion(unionReimburse.getReviewOpinion()); + + dao.update(dbRecord); + return Result.success(); + } + + @At + @ApiOperation("一键审核") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission(value = {"unionReimburse.review", "h5.unionReimburse.review"}, mode = SaMode.OR) + @SLog( tag = "一键审核", msg = "一键审核") + public Result allReview() { + try { + List reimbursements = unionReimburseService.query(Cnd.where("stateId", "=", 2)); + for (UnionReimburse reimbursement : reimbursements) { + reimbursement.setStateId(3); + reimbursement.setReviewTime(new Date()); + reimbursement.setReviewOpinion("通过"); + dao.update(reimbursement); + } + return Result.success("一键审核完成,共处理 " + reimbursements.size() + " 条记录"); + } catch (Exception e) { + log.error("一键审核失败"); + return Result.error("一键审核失败: " + e.getMessage()); + } + } + + } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseStatisticsController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseStatisticsController.java new file mode 100644 index 00000000..b4c0dd22 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseStatisticsController.java @@ -0,0 +1,153 @@ +package com.budwk.app.zhgh.dayofficework.unionReimburse.controller; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.result.Result; +import com.budwk.app.base.utils.CommonDownloadUtil; +import com.budwk.app.flow.engine.FlowEngine; +import com.budwk.app.sys.services.SysDictService; +import com.budwk.app.zhgh.dayofficework.unionReimburse.param.UnionReimbursePageForm; +import com.budwk.app.zhgh.dayofficework.unionReimburse.service.UnionReimburseService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.Workbook; +import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.lang.Strings; +import org.nutz.lang.util.NutMap; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; +import org.nutz.mvc.annotation.Param; + +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.List; + +@IocBean +@At("/platform/unionReimburse/statistics") +@Ok("json:full") +@Api("慰问统计") +@Slf4j +public class UnionReimburseStatisticsController { + + @Inject + private Dao dao; + @Inject + private FlowEngine flowEngine; + + @Inject + private SysDictService sysDictService; + + @Inject + private UnionReimburseService unionReimburseService; + + @At("") + @Ok("beetl:/platform/zhgh/dayofficework/unionReimburse/statistics/index.html") + @SaCheckPermission("unionReimburse.statistics") + public void index() { + } + @At("/h5") + @Ok("beetl:/platform/zhghh5/dayofficework/unionReimburse/statistics/index.html") + @SaCheckPermission("h5.unionReimburse.statistics") + public void h5Index() { + } + + @At + @ApiOperation("慰问类型统计图表数据") + @SaCheckPermission(value = {"unionReimburse.statistics", "h5.unionReimburse.statistics"}, mode = SaMode.OR) + public Result condolencesType(String year, String unionId, String condolenceTypeId, String way) { + Sql sql = Sqls.create(""" + SELECT + type.`name`, + type.`code`, + ( + SELECT + COUNT(*) + FROM + union_reimburse con + LEFT JOIN `vw_user` us ON us.id = con.condolenceUserId + WHERE + type.name = con.typeName + $yearCnd + $unionIdCnd + $typeCnd + $wayCnd + $stateId + AND con.stateId IN (2, 3) + ) `value` + FROM + condolence_type type $condition + """); + if (Strings.isNotBlank(year)) { + sql.setVar("yearCnd", String.format("AND YEAR ( con.createTime )= %s ", year)); + } + if (Strings.isNotBlank(unionId)) { + sql.setVar("unionIdCnd", String.format("AND us.unionId = '%s' ", unionId)); + } + if (Strings.isNotBlank(condolenceTypeId)) { + sql.setVar("typeCnd", String.format("AND con.condolenceTypeId = '%s' ", condolenceTypeId)); + } + if (Strings.isNotBlank(way)) { + sql.setVar("wayCnd", String.format("AND con.way = '%s' ", way)); + } + Cnd cnd = Cnd.NEW(); + cnd.asc("type.location"); + sql.setCondition(cnd); + List result = unionReimburseService.listMap(sql); + return Result.success(result); + + } + + @At + @ApiOperation("分页查询") + @SaCheckPermission(value = {"unionReimburse.statistics", "h5.unionReimburse.statistics"}, mode = SaMode.OR) + public Result pageData(UnionReimbursePageForm pageForm) { + Sql sql = unionReimburseService.getSql(pageForm); + Pagination pagination = unionReimburseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } + + + @At + @Ok("void") + @ApiOperation("导出慰问信息列表") + @SaCheckPermission(value = {"unionReimburse.statistics", "h5.unionReimburse.statistics"}, mode = SaMode.OR) + public void doExport(UnionReimbursePageForm pageForm, + HttpServletResponse response){ + Sql sql = unionReimburseService.getSql(pageForm); + List list = unionReimburseService.listMap(sql); + + List excelExportEntities = new ArrayList<>(); + excelExportEntities.add(new ExcelExportEntity("工号","condolenceLoginName",20)); + excelExportEntities.add(new ExcelExportEntity("姓名","condolenceUserName",20)); + excelExportEntities.add(new ExcelExportEntity("分工会代码","condolenceUnionCode",20)); + excelExportEntities.add(new ExcelExportEntity("分工会名称","condolenceUnionName",20)); + excelExportEntities.add(new ExcelExportEntity("慰问类型","typeName",20)); + excelExportEntities.add(new ExcelExportEntity("慰问方式","way",20)); + excelExportEntities.add(new ExcelExportEntity("慰问金额","realMoney",20)); + excelExportEntities.add(new ExcelExportEntity("慰问时间","newCreateTime",20)); + excelExportEntities.add(new ExcelExportEntity("录入时间","newCondolenceTime",20)); + + try { + ExportParams exportParams = new ExportParams(); + exportParams.setType(ExcelType.XSSF); + Workbook workbook = ExcelExportUtil.exportExcel(exportParams, excelExportEntities, list); + CommonDownloadUtil.download("慰问信息列表.xlsx", workbook, response); + } catch (Exception e) { + log.error("导出慰问信息列表失败", e); + } + + } + + +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseTypeController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseTypeController.java new file mode 100644 index 00000000..8d685591 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseTypeController.java @@ -0,0 +1,91 @@ +package com.budwk.app.zhgh.dayofficework.unionReimburse.controller; + +import cn.dev33.satoken.annotation.SaCheckLogin; +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.annotation.SLog; +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.param.PageForm; +import com.budwk.app.base.result.Result; +import com.budwk.app.zhgh.staffbenefit.condolence.model.CondolenceType; +import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceTypeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; +import org.nutz.dao.util.cri.SqlExpressionGroup; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; + +import java.util.List; + +/** + * @ClassName UnionReimburseTypeController + * @Author = + * @Date 2025/7/29 10:00 + * @Version 1.0 + * @Description TODO + */ +@Slf4j +@IocBean +@Ok("json:full") +@Api(tags = "职工慰问类型") +@At("/platform/unionReimburse/type") +public class UnionReimburseTypeController { + + @Inject + private Dao dao; + @Inject + private CondolenceTypeService typeService; + + @At("") + @SaCheckPermission("unionReimburse.type") + @Ok("beetl:/platform/zhgh/staffbenefit/condolence/type/index.html") + public void index() { + } + + @At + @ApiOperation("分页查询") + @SaCheckPermission("unionReimburse.type") + public Result pageData(PageForm pageForm) { + Cnd cnd = Cnd.NEW(); + if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + SqlExpressionGroup seg = new SqlExpressionGroup(); + seg.or(CondolenceType::getName, "like", "%" + pageForm.getSearchKeyword() + "%"); + seg.or(CondolenceType::getCode, "like", "%" + pageForm.getSearchKeyword() + "%"); + cnd.and(seg); + } + cnd.asc("code"); + Pagination pagination = typeService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd); + return Result.success(pagination); + } + + @At + @ApiOperation("新增/修改职工慰问类型") + @SaCheckPermission("unionReimburse.type") + @SLog(tag = "职工慰问系统-慰问类型", msg = "新增/修改职工慰问类型") + public Object onSubmit(CondolenceType type) { + typeService.insertOrUpdate(type); + return Result.success(); + } + + @At + @ApiOperation("删除职工慰问类型") + @SaCheckPermission("unionReimburse.type") + @SLog(tag = "职工慰问系统-慰问类型", msg = "删除职工慰问类型") + public Object onDelete(String id) { + typeService.delete(id); + return Result.success(); + } + + @At + @ApiOperation("查询职工慰问类型") + @SaCheckLogin + public Result queryCondolenceType() { + List list = typeService.query(Cnd.where(CondolenceType::getEnable, "=", true).asc(CondolenceType::getCode)); + return Result.success(list); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/model/UnionReimburse.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/model/UnionReimburse.java index 106403e7..c84b5c42 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/model/UnionReimburse.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/model/UnionReimburse.java @@ -1,5 +1,6 @@ package com.budwk.app.zhgh.dayofficework.unionReimburse.model; +import cn.afterturn.easypoi.excel.annotation.Excel; import cn.hutool.db.DaoTemplate; import cn.hutool.json.JSONObject; import com.budwk.app.base.model.BaseModel; @@ -70,41 +71,6 @@ public class UnionReimburse extends BaseModel { @ColDefine(type = ColType.VARCHAR, width = 100) private String unionName; - @Column - @Comment("证明人ID") - @ColDefine(type = ColType.VARCHAR, width = 32) - private String certifierUserId; - - @Column - @Comment("证明人姓名") - @ColDefine(type = ColType.VARCHAR, width = 100) - private String certifierUserName; - - @Column - @Comment("证明人工号") - @ColDefine(type = ColType.VARCHAR, width = 120) - private String certifierLoginName; - - @Column - @Comment("证明人分工会ID") - @ColDefine(type = ColType.VARCHAR, width = 32) - private String certifierUnionId; - - @Column - @Comment("证明人分工会") - @ColDefine(type = ColType.VARCHAR, width = 100) - private String certifierUnionName; - - @Column - @Comment("证明人单位ID") - @ColDefine(type = ColType.VARCHAR, width = 32) - private String certifierUnitId; - - @Column - @Comment("证明人单位") - @ColDefine(type = ColType.VARCHAR, width = 100) - private String certifierUnitName; - @Column @Comment("报销类别") @@ -117,6 +83,11 @@ public class UnionReimburse extends BaseModel { @ColDefine(type = ColType.VARCHAR, width = 30) private String reimburseProject; + @Column + @Comment("文件编号") + @ColDefine(type = ColType.VARCHAR, width = 30) + private String documentNo; + @Column @Comment("支付方式") @@ -139,6 +110,56 @@ public class UnionReimburse extends BaseModel { @ColDefine(type = ColType.VARCHAR, width = 100) private Double fundBalance; + + @Column + @Comment("发票张数") + @ColDefine(type = ColType.VARCHAR, width = 30) + private String invoiceNumber; + + @Column + @Comment("发票号码") + @ColDefine(type = ColType.VARCHAR, width = 30) + private String invoice; + + @Column + @Comment("报销事由") + @ColDefine(type = ColType.VARCHAR) + private String paymentNotes; + + @Column + @Comment("备注") + @ColDefine(type = ColType.VARCHAR) + private String notes; + + @Column + @Comment("附件") + @ColDefine(type = ColType.MYSQL_JSON) + private List files; + + @Comment("签字") + @ColDefine(type = ColType.VARCHAR, width = 255) + @Column(hump = true) + private String userSign; + + /** + * 对私支付 + */ + + @Column + @Comment("付款人") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String payer; + + @Column + @Comment("付款人工号") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String payerLoginname; + + @Column + @Comment("付款人姓名") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String payerName; + @Column @Comment("户名") @ColDefine(type = ColType.VARCHAR, width = 100) @@ -154,32 +175,6 @@ public class UnionReimburse extends BaseModel { @ColDefine(type = ColType.VARCHAR, width = 100) private String bankOfDeposit; - @Column - @Comment("发票张数") - @ColDefine(type = ColType.VARCHAR, width = 30) - private String invoiceNumber; - - @Column - @Comment("发票号码") - @ColDefine(type = ColType.VARCHAR, width = 30) - private String invoice; - - @Column - @Comment("支付内容") - @ColDefine(type = ColType.VARCHAR, width = 20) - private String paymentNotes; - - @Column - @Comment("附件") - @ColDefine(type = ColType.MYSQL_JSON) - private List files; - - @Comment("签字") - @ColDefine(type = ColType.VARCHAR, width = 255) - @Column(hump = true) - private String userSign; - - /** * 慰问 */ @@ -189,6 +184,66 @@ public class UnionReimburse extends BaseModel { @ColDefine(type = ColType.VARCHAR, width = 32) private String condolenceId; + @Column + @Comment("慰问人ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String condolenceUserId; + + @Column + @Comment("慰问人姓名") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String condolenceUserName; + + @Column + @Comment("慰问人工号") + @ColDefine(type = ColType.VARCHAR, width = 120) + private String condolenceLoginName; + + @Column + @Comment("慰问人性别") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String condolenceSex; + + @Column + @Comment("慰问人生日") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String condolenceBirthday; + + @Column + @Comment("慰问人身份证") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String condolenceIdCard; + + @Column + @Comment("证明人分工会ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String certifierUnionId; + + @Column + @Comment("慰问人分工会ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String condolenceUnionId; + + @Column + @Comment("慰问人分工会code") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String condolenceUnionCode; + + @Column + @Comment("慰问人分工会") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String condolenceUnionName; + + @Column + @Comment("慰问人单位ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String condolenceUnitId; + + @Column + @Comment("慰问人单位") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String condolenceUnitName; + @Column @Comment("慰问对象名称") @ColDefine(type = ColType.VARCHAR, width = 32) @@ -205,9 +260,34 @@ public class UnionReimburse extends BaseModel { private String condolenceType; @Column - @Comment("慰问金额/报销金额") + @Comment("慰问类型名称") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String typeName; + + @Column + @Comment("慰问上传附件说明") + @ColDefine(type = ColType.VARCHAR, width = 200) + private String condolenceFilesNotes; + + @Column + @Comment("慰问类型id") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String condolenceTypeId; + + @Column + @Comment("慰问类型方式") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String way; + + @Column + @Comment("慰问金额") @ColDefine(type = ColType.FLOAT, width = 10, precision = 2) - private Double money; + private Double condolenceMoney; + + @Column + @Comment("实际金额") + @ColDefine(type = ColType.FLOAT, width = 10, precision = 2) + private Double realMoney; @Column @@ -215,9 +295,59 @@ public class UnionReimburse extends BaseModel { @ColDefine(type = ColType.DATETIME) private Date condolenceTime; + @Column + @Comment("结婚时间") + @ColDefine(type = ColType.DATETIME) + private Date marryTime; + + @Column + @Comment("生育时间") + @ColDefine(type = ColType.DATETIME) + private Date fertilityTime; + + @Column + @Comment("住院开始时间") + @ColDefine(type = ColType.VARCHAR, width = 50) + private Date hospitalizationStartTime; + + @Column + @Comment("住院结束时间") + @ColDefine(type = ColType.VARCHAR, width = 50) + private Date hospitalizationEndTime; + + @Column + @Comment("入住医院") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String hospital; + + @Column + @Comment("住院病由") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String hospitalCausation; + + @Column + @Comment("当年次数") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String hospitalCount; + + @Column + @Comment("去逝时间") + @ColDefine(type = ColType.DATETIME) + private Date deathTime; + + @Column + @Comment("与被慰问人关系") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String condolenceRelationship; + + @Column + @Comment("参与随行人员") + @ColDefine(type = ColType.VARCHAR) + private String participants; + /** - * 活动/建家/日常 + * 活动 */ @Column @@ -246,6 +376,11 @@ public class UnionReimburse extends BaseModel { @ColDefine(type = ColType.VARCHAR, width = 50) private String activityPlace; + @Column + @Comment("报销金额") + @ColDefine(type = ColType.FLOAT, width = 10, precision = 2) + private Double money; + /* * 所属社团 */ @@ -265,4 +400,19 @@ public class UnionReimburse extends BaseModel { @ColDefine(type = ColType.DATETIME) private Date createTime; + @Column + @Comment("状态(1.待提交,2.待审核确认,3.报销成功,4.拒绝,5.退回)") + @ColDefine(type = ColType.VARCHAR, width = 32) + private int stateId; + + @Column + @Comment("审核意见") + @ColDefine(type = ColType.VARCHAR) + private String reviewOpinion; + + @Column + @Comment("审核时间") + @ColDefine(type = ColType.DATETIME) + private Date reviewTime; + } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/model/UnionReimburseDesc.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/model/UnionReimburseDesc.java new file mode 100644 index 00000000..86117039 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/model/UnionReimburseDesc.java @@ -0,0 +1,61 @@ +package com.budwk.app.zhgh.dayofficework.unionReimburse.model; + +import com.budwk.app.base.model.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.nutz.dao.DB; +import org.nutz.dao.entity.annotation.*; +import org.nutz.dao.interceptor.annotation.PrevInsert; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2026/1/20 11:22 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@Table("union_reimburse_desc") +@TableMeta("{'mysql-charset':'utf8mb4'}") +@Comment("工会报销-附件说明") +public class UnionReimburseDesc extends BaseModel { + @Column + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) + private String id; + + @Column + @Comment("编码") + @ColDefine(type = ColType.VARCHAR, width = 30) + private String code; + + @Column + @Comment("报销项目Id(1.慰问,2.文体活动,3.日常活动,4.专项活动)") + @ColDefine(type = ColType.INT, width = 2) + private String reimburseProject; + + @Column + @Comment("报销项目名称") + @ColDefine(type = ColType.VARCHAR, width = 10) + private String name; + + @Column + @Comment("附件说明") + @ColDefine(type = ColType.VARCHAR, width = 200) + private String fileDesc; + + @Column + @Comment("排序字段") + @Prev({ + @SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM Condolence_Type"), + @SQL(db = DB.ORACLE, value = "SELECT COALESCE(MAX(location),0)+1 FROM Condolence_Type") + }) + private Integer location; + + @Column + @Comment("排序") + @ColDefine(type = ColType.INT) + private int sortNum; +} + diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/param/UnionReimbursePageForm.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/param/UnionReimbursePageForm.java new file mode 100644 index 00000000..f8446564 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/param/UnionReimbursePageForm.java @@ -0,0 +1,24 @@ +package com.budwk.app.zhgh.dayofficework.unionReimburse.param; + +import com.budwk.app.base.param.PageForm; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import java.util.List; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2026/1/22 15:15 + */ +@Data +public class UnionReimbursePageForm extends PageForm { + private Integer year; + private String unionId; + private String condolenceTypeId; + private String way; + private String reimburseProject; + + private String unitId; +} + diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/UnionReimburseDescService.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/UnionReimburseDescService.java new file mode 100644 index 00000000..9d4d2681 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/UnionReimburseDescService.java @@ -0,0 +1,7 @@ +package com.budwk.app.zhgh.dayofficework.unionReimburse.service; + +import com.budwk.app.base.service.BaseService; +import com.budwk.app.zhgh.dayofficework.unionReimburse.model.UnionReimburseDesc; + +public interface UnionReimburseDescService extends BaseService { +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/UnionReimburseService.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/UnionReimburseService.java index 7d581d2a..cac64d45 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/UnionReimburseService.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/UnionReimburseService.java @@ -2,6 +2,10 @@ package com.budwk.app.zhgh.dayofficework.unionReimburse.service; import com.budwk.app.base.service.BaseService; import com.budwk.app.zhgh.dayofficework.unionReimburse.model.UnionReimburse; +import com.budwk.app.zhgh.dayofficework.unionReimburse.param.UnionReimbursePageForm; +import org.nutz.dao.sql.Sql; public interface UnionReimburseService extends BaseService { + + Sql getSql(UnionReimbursePageForm pageForm); } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/impl/UnionReimburseDescServiceImpl.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/impl/UnionReimburseDescServiceImpl.java new file mode 100644 index 00000000..c2da6a98 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/impl/UnionReimburseDescServiceImpl.java @@ -0,0 +1,17 @@ +package com.budwk.app.zhgh.dayofficework.unionReimburse.service.impl; + + +import com.budwk.app.base.service.impl.BaseServiceImpl; +import com.budwk.app.zhgh.dayofficework.unionReimburse.model.UnionReimburseDesc; +import com.budwk.app.zhgh.dayofficework.unionReimburse.service.UnionReimburseDescService; +import lombok.extern.slf4j.Slf4j; +import org.nutz.dao.Dao; +import org.nutz.ioc.loader.annotation.IocBean; + +@Slf4j +@IocBean(args = {"refer:dao"}) +public class UnionReimburseDescServiceImpl extends BaseServiceImpl implements UnionReimburseDescService { + public UnionReimburseDescServiceImpl(Dao dao) { + super(dao); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/impl/UnionReimburseServiceImpl.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/impl/UnionReimburseServiceImpl.java index dd44c8b0..55a91f56 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/impl/UnionReimburseServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/service/impl/UnionReimburseServiceImpl.java @@ -1,17 +1,64 @@ package com.budwk.app.zhgh.dayofficework.unionReimburse.service.impl; +import cn.hutool.core.util.StrUtil; import com.budwk.app.base.service.impl.BaseServiceImpl; import com.budwk.app.zhgh.dayofficework.unionReimburse.model.UnionReimburse; +import com.budwk.app.zhgh.dayofficework.unionReimburse.param.UnionReimbursePageForm; import com.budwk.app.zhgh.dayofficework.unionReimburse.service.UnionReimburseService; import lombok.extern.slf4j.Slf4j; +import org.nutz.dao.Cnd; import org.nutz.dao.Dao; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +import org.nutz.dao.util.cri.SqlExpressionGroup; import org.nutz.ioc.loader.annotation.IocBean; +import java.util.List; + @Slf4j @IocBean(args = {"refer:dao"}) public class UnionReimburseServiceImpl extends BaseServiceImpl implements UnionReimburseService { public UnionReimburseServiceImpl(Dao dao) { super(dao); } + + @Override + public Sql getSql(UnionReimbursePageForm pageForm) { + Sql sql = Sqls.create(""" + SELECT + info.*, + LEFT(info.createTime,10) newCreateTime, + LEFT(info.condolenceTime,10) newCondolenceTime + FROM + union_reimburse info + $condition + """); + Cnd cnd = Cnd.NEW(); + // 年度查询条件 + cnd.andEX("year(info.createTime)", "=", pageForm.getYear()); + + // 工会、单位名称查询条件 + cnd.andEX("info.condolenceUnionId", "=", pageForm.getUnionId()); + cnd.andEX("info.unitId", "=", pageForm.getUnitId()); + + cnd.andEX("info.condolenceTypeId", "=", pageForm.getCondolenceTypeId()); + cnd.andEX("info.way", "=", pageForm.getWay()); + + // 报销项目查询条件 + cnd.andEX("info.reimburseProject", "=", pageForm.getReimburseProject()); + // 姓名和工号查询条件 + if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + SqlExpressionGroup seg = new SqlExpressionGroup(); + seg.orLike("info.condolenceUserName",pageForm.getSearchKeyword()); + seg.orLike("info.condolenceLoginName",pageForm.getSearchKeyword()); + cnd.and(seg); + } + + cnd.and("info.stateId", "in", List.of(3, 2)); + + cnd.desc("info.createTime"); + sql.setCondition(cnd); + return sql; + } } diff --git a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/apply/index.html b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/apply/index.html index b0529499..f24b7ef4 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/apply/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/apply/index.html @@ -4,16 +4,30 @@ layout("/layouts/platform.html"){
- + {{formData.userName}} {{formData.loginName}} - - - - + + + + + + + + + + + + + {{item.name}} @@ -30,16 +44,6 @@ layout("/layouts/platform.html"){ - - - - - {{item.name}} - - - - - + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + - + - + + - - - - - - - - - - + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -157,19 +414,28 @@ layout("/layouts/platform.html"){ - - - - + +
+ {{ formData.condolenceFilesNotes || getFileDescByProject(formData.reimburseProject) || '需要提供购买的慰问品发票,慰问照片' }}
+
+ +
+ {{ getFileDescByProject(formData.reimburseProject) || '请上传活动照片、参加人员名单、付款凭证等相关材料' }} +
+ + + + +
@@ -191,52 +457,76 @@ layout("/layouts/platform.html"){ bizId: GetQueryString("bizId"), taskId: GetQueryString("taskId"), formData: { - reimburseType: "" + reimburseType: "", + hospitalizationTimeRange: [], + reimburseProject:'' }, + historyData: [], + condolenceWays: [ + {label: "慰问金(A)", value: "慰问金(A)"}, + {label: "提货券(B)", value: "提货券(B)"}, + {label: "慰问品(C)", value: "慰问品(C)"} + ], + relationships: [ + {label: "配偶", value: "配偶"}, + {label: "父亲", value: "父亲"}, + {label: "母亲", value: "母亲"}, + {label: "子女", value: "子女"}, + ], formRules: { - reimburseType: [{ required: true, message: "请选择报销类别", trigger: ["change", "blur"] }], - paymentWay: [{ required: true, message: "请选择支付方式", trigger: ["change", "blur"] }], - reimburseProject: [{ required: true, message: "请选择报销项目", trigger: ["change", "blur"] }], - reimburseFundSource: [{ required: true, message: "请选择经费来源", trigger: ["change", "blur"] }], - bankUserName: [{ required: true, message: "请填写户名", trigger: ["change", "blur"] }], + // reimburseType: [{ required: true, message: "请选择报销类别", trigger: ["change", "blur"] }], + paymentWay: [{required: true, message: "请选择支付方式", trigger: ["change", "blur"]}], + reimburseProject: [{required: true, message: "请选择报销项目", trigger: ["change", "blur"]}], + reimburseFundSource: [{required: true, message: "请选择经费来源", trigger: ["change", "blur"]}], + bankUserName: [{required: true, message: "请填写户名", trigger: ["change", "blur"]}], bankCardNumber: [{ required: true, message: "请填写银行账号", trigger: ["change", "blur"] - }, { pattern: /^([1-9]{1})(\d{15}|\d{18})$/, message: "请输入正确的银行卡号", trigger: "blur" }], - bankOfDeposit: [{ required: true, message: "请填写开户行", trigger: ["change", "blur"] }], - condolenceMobile: [{ pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号码", trigger: "blur" }], - condolenceTime: [{ required: true, message: "请选择慰问时间", trigger: ["change", "blur"] }], - invoiceNumber: [{ required: true, message: "请填写发票张数", trigger: ["change", "blur"] }], - invoice: [{ required: true, message: "请填写发票号码", trigger: ["change", "blur"] }], - paymentNotes: [{ required: true, message: "请填写支付内容", trigger: ["change", "blur"] }], - activityName: [{ required: true, message: "必填", trigger: ["change", "blur"] }], - money: [{ required: true, message: "必填", trigger: ["change", "blur"] }], - mobile: [{ required: true, message: "必填", trigger: ["change", "blur"] }], - files: [{ required: true, message: "必填", trigger: ["change", "blur"] }], - userSign: [{ required: true, message: "必填", trigger: ["change", "blur"] }], - certifierUserId: [{ required: true, message: "必填", trigger: ["change", "blur"] }] + }, {pattern: /^([1-9]{1})(\d{15}|\d{18})$/, message: "请输入正确的银行卡号", trigger: "blur"}], + bankOfDeposit: [{required: true, message: "请填写开户行", trigger: ["change", "blur"]}], + condolenceMobile: [{pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号码", trigger: "blur"}], + condolenceTime: [{required: true, message: "请选择慰问时间", trigger: ["change", "blur"]}], + // invoiceNumber: [{required: true, message: "请填写发票张数", trigger: ["change", "blur"]}], + // invoice: [{required: true, message: "请填写发票号码", trigger: ["change", "blur"]}], + paymentNotes: [{required: true, message: "请填写支付内容", trigger: ["change", "blur"]}], + activityName: [{required: true, message: "请填写活动名称", trigger: ["change", "blur"]}], + money: [{required: true, message: "请填写报销金额", trigger: ["change", "blur"]}], + mobile: [{required: true, message: "请填写联系方式", trigger: ["change", "blur"]}], + files: [{required: true, message: "请上传附件", trigger: ["change", "blur"]}], + userSign: [{required: true, message: "请签名", trigger: ["change", "blur"]}], + // certifierUserId: [{required: true, message: "请填写认证人", trigger: ["change", "blur"]}], + + condolenceUserId: [{required: true, message: "请选择慰问对象", trigger: ["change", "blur"]}], + condolenceTypeId: [{required: true, message: "请选择慰问类型", trigger: ["change", "blur"]}], + way: [{required: true, message: "请选择慰问方式", trigger: ["change", "blur"]}], + condolenceMoney: [{required: true, message: "请输入慰问金额", trigger: ["change", "blur"]}], + participants: [{required: true, message: "请填写参与随行人员", trigger: ["change", "blur"]}], + payer: [{required: true, message: "请选择付款人", trigger: ["change", "blur"]}], + activityType: [{required: true, message: "请选择活动类型", trigger: ["change", "blur"]}], + activityPlace: [{required: true, message: "请输入活动地点", trigger: ["change", "blur"]}], + activityTime: [{required: true, message: "请选择活动时间", trigger: ["change", "blur"]}], + activityNumber: [{required: true, message: "请输入活动人数", trigger: ["change", "blur"]}] }, chooseType: {}, userOptions: [], typeOptions: [], + descOptions: [], reimburseProjectList: [], reimburseProjects: [], clubOptions: [], - budgetTypeOption: [] + budgetTypeOption: [], + payerOptions: [] } }, - // 监听报销类别发生变化,报销项目联动改变 watch: { - "formData.reimburseType"(newVal) { - if (newVal === "UNION_REIMBURSE_TYPE_1") { - this.reimburseProjects = this.reimburseProjectList.filter((o) => { - return ["1", "UNION_REIMBURSE_TYPE_1"].includes(o.remark) - }) + "formData.hospitalizationTimeRange"(newVal) { + if (newVal && newVal.length === 2) { + this.$set(this.formData, "hospitalizationStartTime", newVal[0]); + this.$set(this.formData, "hospitalizationEndTime", newVal[1]); } else { - this.reimburseProjects = this.reimburseProjectList.filter((o) => { - return ["1", "UNION_REIMBURSE_TYPE_2"].includes(o.remark) - }) + this.$set(this.formData, "hospitalizationStartTime", null); + this.$set(this.formData, "hospitalizationEndTime", null); } }, // 添加对社团选择的监听 @@ -253,6 +543,17 @@ layout("/layouts/platform.html"){ } }, methods: { + createRemoteMethodForPayer(keyword) { + this.selectQueryUserForPayer(keyword, this.payerOptions) + }, + selectQueryUserForPayer(keyword, options) { + options.length = 0 + this.$axios.post("/platform/UnionReimburse/apply/listUser", {keyword: keyword}).then((res) => { + if (res.code === 0) { + options.push(...res.data) + } + }) + }, createRemoteMethod(options) { return (keyword) => { this.selectQueryUser(keyword, options) @@ -260,32 +561,90 @@ layout("/layouts/platform.html"){ }, selectQueryUser(keyword, options) { options.length = 0 - this.$axios.post("/platform/UnionReimburse/apply/listUser", { keyword: keyword }).then((res) => { + this.$axios.post("/platform/unionReimburse/apply/listUser", {keyword: keyword}).then((res) => { if (res.code === 0) { options.push(...res.data) } }) }, - userChange(val) { + // 获取用户历史银行卡信息 + getUserBankHistory() { + if (!this.formData.payer) { + this.historyData = []; + return; + } + + this.$axios.get("/platform/unionReimburse/apply/findUserBankHistory", { + params: { payer: this.formData.payer } + }).then((res) => { + if (res.code === 0) { + this.historyData = Array.isArray(res.data) ? res.data : []; + } else { + console.warn("获取历史银行卡信息失败:", res); + this.historyData = []; + } + }) + }, + + async payerUserChange(){ + if (this.formData.payer) { + await this.getUserBankHistory(); + } + const user = this.payerOptions.find(o => o.id === this.formData.payer) + if (user) { + const {userName, loginName,} = user + this.$set(this.formData, "payerName", userName); + this.$set(this.formData, "payerLoginname", loginName); + } + }, + async userChange(val) { const user = this.userOptions.find(o => o.id === val) if (user) { - const { userName, loginName, unitId, unitName, unionId, unionName } = user - this.$set(this.formData, "certifierUserName", userName) - this.$set(this.formData, "certifierLoginName", loginName) - this.$set(this.formData, "certifierUnitId", unitId) - this.$set(this.formData, "certifierUnitName", unitName) - this.$set(this.formData, "certifierUnionId", unionId) - this.$set(this.formData, "certifierUnionName", unionName) + const { + userName, + loginName, + unitId, + unitName, + unionId, + unionName, + unionCode, + sex, + birthday, + idCard, + mobile + } = user + this.$set(this.formData, "condolenceUserName", userName) + this.$set(this.formData, "condolenceLoginName", loginName) + this.$set(this.formData, "condolenceUnitId", unitId) + this.$set(this.formData, "condolenceUnitName", unitName) + this.$set(this.formData, "condolenceUnionId", unionId) + this.$set(this.formData, "condolenceUnionName", unionName) + this.$set(this.formData, "condolenceUnionCode", unionCode) + this.$set(this.formData, "condolenceSex", sex) + this.$set(this.formData, "condolenceBirthday", birthday) + this.$set(this.formData, "condolenceIdCard", idCard) + this.$set(this.formData, "condolenceMobile", mobile) + } + }, + typeChange(val) { + const type = this.typeOptions.find(o => o.id === val) + if (type) { + const {id, way, money, uploadFileDesc,name} = type + this.$set(this.formData, "condolenceTypeId", id) + this.$set(this.formData, "way", way) + this.$set(this.formData, "condolenceMoney", parseFloat(money).toFixed(2)) + this.$set(this.formData, "condolenceFilesNotes", uploadFileDesc) + this.$set(this.formData, "typeName", name) } }, // - typeChange(id) { - this.chooseType = this.typeOptions.find(o => o.id === id) - if (this.chooseType) { - this.$set(this.formData, "money", this.chooseType.money) - this.$set(this.formData, "way", this.chooseType.way) - } - }, + // typeChange(id) { + // this.chooseType = this.typeOptions.find(o => o.id === id) + // if (this.chooseType) { + // this.$set(this.formData, "money", this.chooseType.money) + // this.$set(this.formData, "way", this.chooseType.way) + // } + // }, // 保存 onSave() { this.$confirm("您确定保存吗?", "提示", { @@ -293,7 +652,7 @@ layout("/layouts/platform.html"){ cancelButtonText: "取消", type: "warning" }).then(() => { - this.$axios.post("/platform/unionReimburse/apply/save", { data: JSON.stringify(this.formData) }).then(res => { + this.$axios.post("/platform/unionReimburse/apply/save", {data: JSON.stringify(this.formData)}).then(res => { if (res.code === 0) { this.$message.success(res.msg) commonUtil.pjaxPush("/platform/unionReimburse/mine/index") @@ -308,7 +667,7 @@ layout("/layouts/platform.html"){ if (valid) { resolve(true) } else { - this.$message.error("请完善必填信息") + this.$message.warning("请完善必填信息") resolve(false) } }) @@ -316,7 +675,6 @@ layout("/layouts/platform.html"){ }, // 提交 async onSubmit() { - // 表单验证 const isValid = await this.validateBeforeSubmit() if (!isValid) return @@ -337,7 +695,6 @@ layout("/layouts/platform.html"){ }, // 再次提交 async onFinishTask() { - // 表单验证 const isValid = await this.validateBeforeSubmit() if (!isValid) return @@ -364,6 +721,21 @@ layout("/layouts/platform.html"){ this.typeOptions = resp.data }) }, + queryFileDesc() { + this.$axios.post("/platform/unionReimburse/desc/queryFileDesc") + .then((resp) => { + this.descOptions = resp.data + console.log(this.descOptions) + }) + }, + // 根据报销项目获取对应的附件说明 + getFileDescByProject(projectCode) { + if (!this.descOptions || !Array.isArray(this.descOptions)) { + return ''; + } + const project = this.descOptions.find(item => item.reimburseProject === projectCode); + return project ? project.fileDesc : ''; + }, //经费来源查询 reimburseFundSourceChange() { // 检查是否有选择经费来源 @@ -437,6 +809,12 @@ layout("/layouts/platform.html"){ if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) { } else { + if (this.formData.hospitalizationStartTime && this.formData.hospitalizationEndTime) { + this.$set(this.formData, "hospitalizationTimeRange", [ + this.formData.hospitalizationStartTime, + this.formData.hospitalizationEndTime + ]); + } if (this.$auth.hasRoleOr(["SCHOOL_OUTLAY_ADMIN", "SCHOOL_UNION_ADMIN"])) { this.budgetTypeOption.map(v => { if (["UNION_REIMBURSE_FUND_SOURCE_1"].includes(v.code)) { @@ -462,7 +840,7 @@ layout("/layouts/platform.html"){ } this.reimburseProjectList = await this.$businessTool.getDictOptions("UNION_REIMBURSE_PROJECT") if (this.bizId) { - this.$axios.post("/platform/unionReimburse/apply/info", { id: this.bizId }).then(async (res) => { + this.$axios.post("/platform/unionReimburse/apply/info", {id: this.bizId}).then(async (res) => { if (res.code === 0) { this.formData = res.data await this.selectQueryUser(this.formData.certifierLoginName, this.userOptions) @@ -470,7 +848,7 @@ layout("/layouts/platform.html"){ } }) } else { - const { username, loginname, id, unit, union, mobile } = this.$store.state.user + const {username, loginname, id, unit, union, mobile} = this.$store.state.user this.formData = { userName: username, loginName: loginname, @@ -478,17 +856,21 @@ layout("/layouts/platform.html"){ unitName: unit?.name, unionId: union?.id, unionName: union?.name, - reimburseType: "UNION_REIMBURSE_TYPE_1", + // reimburseType: "UNION_REIMBURSE_TYPE_1", + reimburseProject: 'UNION_REIMBURSE_PROJECT_1', + paymentWay: 'UNION_REIMBURSE_PAYMENT_WAY_2', mobile: mobile, - userId: id + userId: id, } } } }, created() { this.init() + this.queryFileDesc() + this.queryCondolenceType() //社团查询 - this.$businessTool.listClubByRole().then((res) => (this.clubOptions = res)) + this.$businessTool.listCLubByRole().then((res) => (this.clubOptions = res)) } }) diff --git a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/collect/index.html b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/collect/index.html index f6a9dd61..ce716434 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/collect/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/collect/index.html @@ -46,7 +46,8 @@ layout("/layouts/platform.html"){
- 导出 + 导出收款人名册 + @@ -54,37 +55,38 @@ layout("/layouts/platform.html"){ - - - - - - + - - - - + - + + + + @@ -96,6 +98,17 @@ layout("/layouts/platform.html"){ + + + + + + + +
@@ -117,6 +130,17 @@ layout("/layouts/platform.html"){ pageDataUrl: "/platform/unionReimburse/collect/pageData", unionOptions: [], unitOptions: [], + editDialogVisible: false, + editFormData: { + realMoney: '', + id: '' // 报销记录ID + }, + editFormRules: { + realMoney: [ + { required: true, message: '请输入实际报销金额', trigger: 'blur' }, + { pattern: /^([0-9]+)(\.[0-9]{1,2})?$/, message: '请输入正确的金额格式', trigger: 'blur' } + ] + } } } , @@ -141,6 +165,47 @@ layout("/layouts/platform.html"){ }) }) }, + openEdit(row) { + // 初始化编辑表单数据 + this.editFormData.id = row.id; + this.editFormData.realMoney = row.realMoney || ''; + this.editDialogVisible = true; + }, + + // 弹窗关闭时的处理 + handleDialogClose() { + this.$refs.editForm.resetFields(); + }, + + // 保存实际报销金额 + saveFinallyMoney() { + this.$refs.editForm.validate(async (valid) => { + if (valid) { + const resp = await this.$axios.post("/platform/unionReimburse/collect/updateActuallyAmount", { + id: this.editFormData.id, + realMoney: this.editFormData.realMoney + }).then((res) => { + if (res.code === 0) { + this.$message.success('保存成功'); + this.editDialogVisible = false; + this.$refs.editForm.resetFields(); + this.pageData(); + } + }) + } + }); + }, + exportSkr() { + const {year = '', unionId = '', unitId = '', reimburseProject = ''} = this.pageForm + window.open('/platform/unionReimburse/collect/exportSkr?year=' + year + "&unionId=" + unionId + '&unitId=' + unitId + "&reiItemId=" + reimburseProject) + }, + doPrint(row) { + if (row.reimburseProject != "UNION_REIMBURSE_PROJECT_1") { + window.location.href = "/platform/unionReimburse/mine/ActExport?id=" + (row.id || '') + "&Print=true" + } else { + window.location.href = "/platform/unionReimburse/mine/ConExport?id=" + (row.id || '') + "&Print=true" + } + }, onExport() { this.$downLoad('/platform/unionReimburse/collect/onExport', this.pageForm) }, diff --git a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/desc/basicForm.js b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/desc/basicForm.js new file mode 100644 index 00000000..6d7b9f46 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/desc/basicForm.js @@ -0,0 +1,67 @@ +const basicForm = { + template: /*language=HTML*/ ` +
+ + + + + + + + + + + + + + + 取消 + 提交 + +
+ `, + data() { + return { + formData: {}, + formRules: { + code: [{required: true, message: '必填', trigger: ['blur', 'change']}], + name: [{required: true, message: '必填', trigger: ['blur', 'change']}], + fileDesc: [{required: true, message: '必填', trigger: ['blur', 'change']}], + }, + } + }, + methods: { + onOpen(row) { + if(row && row.id) { + this.formData = clone(row) + } + }, + onSubmit() { + this.$refs.formRef.validate((valid) => { + if (valid) { + this.$confirm("您确定要提交吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(async () => { + const resp = await this.$axios.post("/platform/unionReimburse/desc/onSubmit", this.formData) + if (resp.code === 0) { + this.$message.success(resp.msg) + this.$emit('refresh') + } else { + this.$message.warning(resp.msg) + } + }) + } + }) + }, + }, + style: /*language=CSS*/ ` + .el-input-number .el-input__inner { + text-align: left; + } + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/desc/index.html b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/desc/index.html new file mode 100644 index 00000000..8ed1aa7a --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/desc/index.html @@ -0,0 +1,146 @@ + + + + +
+ + + + + + + +
+ + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/info.js b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/info.js index 21b1c92a..c479414b 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/info.js +++ b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/info.js @@ -10,37 +10,157 @@ const unionReimburseInfo = { {{viewData.loginName}} {{viewData.unitName}} {{viewData.unionName}} - - - + + + 慰问 + 文体活动 + 日常活动 + 专项活动 + {{ viewData.reimburseProject }} + - - - - + {{viewData.mobile}} - {{viewData.certifierUserName}}({{viewData.certifierLoginName}}) + + + {{ viewData.payerName }} - {{viewData.bankUserName}} - {{viewData.bankCardNumber}} - {{viewData.bankOfDeposit}} - {{viewData.activityName}} - {{viewData.activityPlace||'暂无'}} - {{viewData.money}} - - {{viewData.paymentNotes}} - - - 暂无附件 + + + {{ viewData.bankOfDeposit }} + + + {{ viewData.bankCardNumber }} + + + + + {{ viewData.condolenceUserName }}({{ viewData.condolenceLoginName }})({{ viewData.condolenceUnitName }}) + + + + {{ viewData.condolenceSex }} + + + + {{ viewData.condolenceBirthday && $moment(viewData.condolenceBirthday).isValid() ? $moment(viewData.condolenceBirthday).format('YYYY-MM-DD') : '' }} + + + + {{ viewData.condolenceIdCard }} + + + + {{ viewData.condolenceMobile }} + + + + {{ viewData.typeName }} + + + + {{ viewData.way }} + + + + {{ viewData.condolenceMoney }} + + + + {{ viewData.realMoney }} + + + + + {{ viewData.activityName }} + + + + {{ viewData.activityType }} + + + + {{ viewData.activityNumber }} + + + + {{ viewData.activityPlace }} + + + + {{ viewData.money }} + + + + {{ viewData.realMoney }} + + + + {{ viewData.activityTime | dateFormat }} + + + + {{ viewData.invoiceNumber }} + + + + {{ viewData.condolenceTime | dateFormat }} + + + + {{ viewData.marryTime | dateFormat }} + + + + {{ viewData.fertilityTime | dateFormat }} + + + + {{ viewData.hospitalCausation }} + + + + + {{ $moment(viewData.hospitalizationStartTime).format('YYYY-MM-DD') }} 至 {{ $moment(viewData.hospitalizationEndTime).format('YYYY-MM-DD') }} + + 暂无住院时间 + + + + {{ viewData.hospital }} + + + + {{ viewData.hospitalCount }} + + + + {{ viewData.deathTime | dateFormat }} + + + + {{ viewData.condolenceRelationship }} + + + + {{ viewData.participants }} + + + + {{ viewData.paymentNotes }} + + + + {{ viewData.notes }} + + @@ -48,39 +168,21 @@ const unionReimburseInfo = { -