diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpApplyController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpApplyController.java index 42add12..04b88b2 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpApplyController.java @@ -1,10 +1,10 @@ package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller; import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; import cn.hutool.core.lang.Dict; import cn.hutool.core.util.ObjectUtil; import com.budwk.app.base.annotation.SLog; -import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.page.Pagination; import com.budwk.app.base.result.Result; import com.budwk.app.flow.constant.FlowConst; @@ -177,12 +177,13 @@ public class DifficultHelpApplyController { @At @ApiOperation("获取受助人") - @SaCheckPermission("difficultHelp.apply") + @SaCheckPermission(value = {"difficultHelp.apply", "h5.difficultHelp.apply"}, mode = SaMode.OR) public Result queryRecipients(String key){ - if (!AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) { - return Result.error("只有分工会主席可以替他人申请"); + boolean schoolScope = AuthUtil.hasPermission("difficult_assistance_school"); + if (!schoolScope && !AuthUtil.hasPermission("difficult_assistance_union")) { + return Result.error("没有代申请权限"); } - if (Strings.isBlank(SecurityUtil.getUnionId())) { + if (!schoolScope && Strings.isBlank(SecurityUtil.getUnionId())) { return Result.error("当前用户未设置所属分工会"); } Sql sql = Sqls.create(""" @@ -193,6 +194,10 @@ public class DifficultHelpApplyController { birthday, mobile, sex, + idCard, + position, + professionalTitle AS officialCapacity, + (SELECT u.homeAddress FROM sys_user u WHERE u.id = vw_user.id) AS homeAddress, unitName, unionName, unionId, @@ -203,7 +208,9 @@ public class DifficultHelpApplyController { """); Cnd cnd = Cnd.NEW(); cnd.and("id", "<>", SecurityUtil.getUserId()); - cnd.and("unionid", "=", SecurityUtil.getUnionId()); + if (!schoolScope) { + cnd.and("unionid", "=", SecurityUtil.getUnionId()); + } if (Strings.isNotBlank(key)) { SqlExpressionGroup group = new SqlExpressionGroup(); 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 534d36d..d72eba4 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 @@ -43,7 +43,8 @@ public class DifficultHelpApprovalController { } ProcessTask task = dao.fetch(ProcessTask.class, args.getLong(FlowConst.PROCESS_TASK_ID_KEY)); if (task == null) throw new BaseException("审批任务不存在"); - boolean amountApproval = "715ece82-4ae3-433c-ad18-ed875f45d1e3".equals(task.getTaskName()); + boolean actualAmountApproval = "e405f96c-5fc0-4f63-b323-e69dfe853253".equals(task.getTaskName()); + boolean amountApproval = "715ece82-4ae3-433c-ad18-ed875f45d1e3".equals(task.getTaskName()) || actualAmountApproval; if (!amountApproval && !"36ebafda-44c2-4bd3-bd7f-10839a575a0d".equals(task.getTaskName()) && !"e405f96c-5fc0-4f63-b323-e69dfe853253".equals(task.getTaskName())) { throw new BaseException("当前任务不是困难帮扶审批任务"); @@ -56,12 +57,17 @@ public class DifficultHelpApprovalController { args.remove("level"); args.remove("tf_level"); + args.remove("tf_actualMoney"); Double money = amountApproval ? args.getDouble("money") : null; if (amountApproval) { if (money == null || !Double.isFinite(money) || money < 0) { - throw new BaseException("请填写有效的帮扶金额"); + throw new BaseException(actualAmountApproval ? "请填写有效的实际审批金额" : "请填写有效的帮扶金额"); + } + if (actualAmountApproval && java.math.BigDecimal.valueOf(money).stripTrailingZeros().scale() > 2) { + throw new BaseException("实际审批金额最多保留两位小数"); } args.put("tf_money", money); + if (actualAmountApproval) args.put("tf_actualMoney", money); } else { args.remove("money"); args.remove("tf_money"); diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpFirstApprovalController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpFirstApprovalController.java index d39d797..2c2f3e0 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpFirstApprovalController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpFirstApprovalController.java @@ -78,6 +78,7 @@ public class DifficultHelpFirstApprovalController { info.subsidyStandards, LEFT(info.applyTime, 10) AS applyTime, info.applyCount, + info.applyMoney, info.mobile, ins.id AS instanceId, ins.businessNo, diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpSecondApprovalController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpSecondApprovalController.java index 0cb1bf0..e7584fc 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpSecondApprovalController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/controller/DifficultHelpSecondApprovalController.java @@ -79,6 +79,7 @@ public class DifficultHelpSecondApprovalController { info.subsidyStandards, LEFT(info.applyTime, 10) AS applyTime, info.applyCount, + info.applyMoney, info.mobile, ins.id AS instanceId, ins.businessNo, 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 8839bdf..c531da9 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 @@ -82,6 +82,7 @@ public class DifficultHelpThirdApprovalController { info.subsidyStandards, LEFT(info.applyTime, 10) AS applyTime, info.applyCount, + info.applyMoney, info.mobile, ins.id AS instanceId, ins.businessNo, diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/service/impl/DifficultHelpCommonServiceImpl.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/service/impl/DifficultHelpCommonServiceImpl.java index c7c806a..d0b6440 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/service/impl/DifficultHelpCommonServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/difficulthelp/service/impl/DifficultHelpCommonServiceImpl.java @@ -4,7 +4,6 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import com.budwk.app.base.service.impl.BaseServiceImpl; -import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.exception.BaseException; import com.budwk.app.web.commons.auth.utils.AuthUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil; @@ -76,14 +75,23 @@ public class DifficultHelpCommonServiceImpl extends BaseServiceImpl - @@ -366,6 +366,11 @@ layout("/layouts/platform.html"){ subsidizedList: [] } }, + computed: { + canApplyForOthers() { + return this.$auth.hasPermissionOr(['difficult_assistance_school', 'difficult_assistance_union']) + } + }, methods: { textRules(label, max) { return [{required: true, whitespace: true, max, message: '请填写' + label + ',且不超过' + max + '个字符', trigger: ['blur', 'change']}] @@ -441,7 +446,7 @@ layout("/layouts/platform.html"){ // 查询受助人 queryRecipients(key) { - if (String(this.formData.mode) !== "2" || !this.$auth.hasRoleOr('BRANCH_UNION_CHAIRMAN')) { + if (String(this.formData.mode) !== "2" || !this.canApplyForOthers) { return } this.$axios.post("/platform/difficultHelp/apply/queryRecipients", { @@ -476,6 +481,9 @@ layout("/layouts/platform.html"){ this.$set(this.formData, 'birthday', user.birthday) this.$set(this.formData, 'mobile', user.mobile) this.$set(this.formData, 'idCard', user.idCard) + this.$set(this.formData, 'position', user.position || '') + this.$set(this.formData, 'officialCapacity', user.officialCapacity || '') + this.$set(this.formData, 'homeAddress', user.homeAddress || '') } else { this.$set(this.formData, 'userId', null) @@ -488,6 +496,10 @@ layout("/layouts/platform.html"){ this.$set(this.formData, 'unionName', null) this.$set(this.formData, 'birthday', null) this.$set(this.formData, 'mobile', null) + this.$set(this.formData, 'idCard', null) + this.$set(this.formData, 'position', '') + this.$set(this.formData, 'officialCapacity', '') + this.$set(this.formData, 'homeAddress', '') } }, // 申请模式 @@ -512,6 +524,8 @@ layout("/layouts/platform.html"){ this.$set(this.formData, 'idCard', user.idCard) this.$set(this.formData, 'mobile', user.mobile) this.$set(this.formData, 'homeAddress', user.homeAddress) + this.$set(this.formData, 'position', user.position || '') + this.$set(this.formData, 'officialCapacity', user.professionalTitle || '') this.$set(this.formData, 'subsidyStandards', null) this.$set(this.formData, 'reason', null) this.$set(this.formData, 'remarks', null) @@ -622,7 +636,7 @@ layout("/layouts/platform.html"){ return this.$axios.post('/platform/difficultHelp/apply/getIsCanPlay').then(res => { if (res.code === 0) { // 新增申请进入页面时,优先校验当前登录人本年度是否已经申请过,已申请则直接拦截新增。 - if (!this.bizId && res.data.hasCurrentYearApply && !this.$auth.hasRoleOr('BRANCH_UNION_CHAIRMAN')) { + if (!this.bizId && res.data.hasCurrentYearApply && !this.canApplyForOthers) { this.isShow = false this.$set(this, 'blockMessage', '抱歉,您本年度已申请困难帮扶,不能重复申请。') } else { diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/branchunionapproval/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/branchunionapproval/index.html index 00ae094..d501c79 100644 --- a/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/branchunionapproval/index.html +++ b/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/branchunionapproval/index.html @@ -42,7 +42,7 @@ layout("/layouts/platform.html"){ - 一键审核 + 已审核 未审核 @@ -145,7 +145,7 @@ layout("/layouts/platform.html"){ { prop: "mobile", label: "联系方式", sortable: true }, { prop: "subsidyStandards", label: "困难类型", sortable: true }, { prop: "applyTime", label: "申请时间", sortable: true }, - { prop: "applyCount", label: "申请次数", sortable: true }, + { prop: "applyMoney", label: "申请金额(元)", sortable: true }, { prop: "curTaskName", label: "当前节点" }, { prop: "instanceState", label: "流程状态" } ], diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/common/info.js b/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/common/info.js index 60b3d24..0ec47a1 100644 --- a/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/common/info.js +++ b/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/common/info.js @@ -8,6 +8,7 @@ const INFO = { {{ viewData.proxyUserName }} {{ viewData.applyMoney }} {{ viewData.sex }} + {{ viewData.idCard }} {{ viewData.proxyLoginName }} {{ viewData.unitName }} @@ -25,6 +26,12 @@ const INFO = { {{ 1 }} {{ viewData.homeAddress }} + + + + + + @@ -90,8 +97,9 @@ const INFO = { + {{ task.taskFormData.money }} @@ -110,7 +118,7 @@ const INFO = { `, store, - dicts: ["PROCESS_TASK_SUBMIT_TYPE"], + dicts: ["PROCESS_TASK_SUBMIT_TYPE", "DIFFICULT_SUBSIDY_TYPE", "DIFFICULT_TYPE"], data() { return { viewData: {}, 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 6dcf671..5e126f0 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,5 +1,8 @@
+ + + @@ -17,6 +20,7 @@ return { businessId: GetQueryString("businessId"), formData: { + money: undefined, tf_sign: "", tf_opinion: "", }, } 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 aa576e5..9f2a811 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 @@ -42,7 +42,7 @@ layout("/layouts/platform.html"){ - 一键审核 + 已审核 未审核 @@ -83,6 +83,9 @@ layout("/layouts/platform.html"){ + + + @@ -103,6 +106,9 @@ layout("/layouts/platform.html"){ {{formData.taskName}}
+ + + @@ -146,7 +152,7 @@ layout("/layouts/platform.html"){ { prop: "mobile", label: "联系方式", sortable: true }, { prop: "subsidyStandards", label: "困难类型", sortable: true }, { prop: "applyTime", label: "申请时间", sortable: true }, - { prop: "applyCount", label: "申请次数", sortable: true }, + { prop: "applyMoney", label: "申请金额(元)", sortable: true }, { prop: "curTaskName", label: "当前节点" }, { prop: "instanceState", label: "流程状态" } ], @@ -154,6 +160,7 @@ layout("/layouts/platform.html"){ units: [], formData: { + money: undefined, tf_sign: "", tf_opinion: "", }, showApprovalForm: false, @@ -178,6 +185,7 @@ layout("/layouts/platform.html"){ this.$message.warning('请至少选择一条记录进行审核!'); return; } + this.$set(this.formData, 'money', undefined) this.dialogVisible = true; }, submitAudit() { @@ -240,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, tf_opinion: this.formData.tf_opinion, tf_sign: this.formData.tf_sign, submitType: 1}) + data: JSON.stringify({processTaskId: item.taskId, money: this.formData.money, tf_opinion: this.formData.tf_opinion, tf_sign: this.formData.tf_sign, submitType: 1}) }) if (res.code !== 0) throw new Error(res.msg || '审批失败') }, @@ -248,6 +256,7 @@ layout("/layouts/platform.html"){ this.$refs.guava.edit(()=>{ this.showApprovalForm = true this.formData = { + money: undefined, tf_sign: "", processTaskId: row.taskId, taskName: row.curTaskName, diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/unionLeaderApproval/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/unionLeaderApproval/index.html index b38787f..5328a6d 100644 --- a/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/unionLeaderApproval/index.html +++ b/src/main/resources/views/platform/zhgh/staffbenefit/difficulthelp/unionLeaderApproval/index.html @@ -42,7 +42,7 @@ layout("/layouts/platform.html"){ - 一键审核 + 已审核 未审核 @@ -158,7 +158,7 @@ layout("/layouts/platform.html"){ { prop: "mobile", label: "联系方式", sortable: true }, { prop: "subsidyStandards", label: "困难类型", sortable: true }, { prop: "applyTime", label: "申请时间", sortable: true }, - { prop: "applyCount", label: "申请次数", sortable: true }, + { prop: "applyMoney", label: "申请金额(元)", sortable: true }, { prop: "curTaskName", label: "当前节点" }, { prop: "instanceState", label: "流程状态" } ], diff --git a/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/apply/index.html b/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/apply/index.html index c0f506f..4a8cd93 100644 --- a/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/apply/index.html +++ b/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/apply/index.html @@ -327,7 +327,7 @@ layout("/layouts/platform_h5.html"){ 本人申请 替他人申请 @@ -723,6 +723,9 @@ layout("/layouts/platform_h5.html"){ } }, computed: { + canApplyForOthers() { + return this.$auth.hasPermissionOr(['difficult_assistance_school', 'difficult_assistance_union']) + }, canImportFamilyInfo() { return false; } @@ -731,7 +734,7 @@ layout("/layouts/platform_h5.html"){ historyBack, // 替他人申请时由只读字段主动打开受助人选择,已有业务数据时保持原禁止更换规则。 openRecipientPopup() { - if (this.formData.mode !== "2" || this.formData.id) return + if (this.formData.mode !== "2" || this.formData.id || !this.canApplyForOthers) return this.$set(this, "recipientSearchKey", "") this.$set(this, "recipientHasSearched", false) this.$set(this, "subsidizedList", []) @@ -995,7 +998,7 @@ layout("/layouts/platform_h5.html"){ * recipientSearchKey 传搜索关键词;接口返回用户数组,列表仅展示姓名和单位。 */ queryRecipients() { - if (this.formData.mode !== "2") { + if (this.formData.mode !== "2" || !this.canApplyForOthers) { return } const key = (this.recipientSearchKey || "").trim() @@ -1044,6 +1047,7 @@ layout("/layouts/platform_h5.html"){ this.$set(this.formData, "userName", null) this.$set(this.formData, "loginName", null) this.$set(this.formData, "sex", null) + this.$set(this.formData, "birthday", null) this.$set(this.formData, "unitId", null) this.$set(this.formData, "unitName", null) this.$set(this.formData, "unionId", null) @@ -1108,6 +1112,8 @@ layout("/layouts/platform_h5.html"){ this.$set(this.formData, 'idCard', user.idCard) this.$set(this.formData, 'mobile', user.mobile) this.$set(this.formData, 'homeAddress', user.homeAddress) + this.$set(this.formData, 'position', user.position || '') + this.$set(this.formData, 'officialCapacity', user.professionalTitle || '') this.$set(this.formData, 'subsidyStandards', null) this.$set(this.formData, 'reason', null) this.$set(this.formData, 'remarks', null) diff --git a/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/branchunionapproval/index.html b/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/branchunionapproval/index.html index bfe8c1f..51545b2 100644 --- a/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/branchunionapproval/index.html +++ b/src/main/resources/views/platform/zhghh5/staffbenefit/difficulthelp/branchunionapproval/index.html @@ -80,6 +80,7 @@ layout("/layouts/platform_h5.html"){ {{row.unitName}} {{row.subsidyStandards}} {{row.applyTime}} + {{row.applyMoney}} {{row.curTaskName}}