From c35bea7cc702d806443898e2540fd613524f811f Mon Sep 17 00:00:00 2001 From: zhouhefeng Date: Wed, 17 Dec 2025 20:10:08 +0800 Subject: [PATCH] commit --- .../commons/ext/websocket/WkWebSocket.java | 2 +- ...mbursementDeputySchoolUnionController.java | 55 +++++- ...tyReimbursementSchoolUnionServiceImpl.java | 34 +++- .../ActivityBudgetSchoolAuditController.java | 2 +- .../welfare/model/WelfareUserSelection.java | 5 + .../service/impl/WelfareListServiceImpl.java | 6 +- .../WelfareSelectionSituationServiceImpl.java | 3 + .../impl/WelfareStatisticsServiceImpl.java | 13 +- .../views/layouts/v4/baseLayout.html | 2 +- .../declare/apply/index.html | 35 +++- .../reimbursement/apply/index.html | 5 +- .../reimbursement/branchunion/index.html | 4 + .../reimbursement/clubprincipal/index.html | 3 +- .../deputySchoolUnion/index.html | 11 +- .../reimbursement/schoolFinance/index.html | 5 +- .../reimbursement/schoolprincipal/index.html | 5 +- .../reimbursement/schoolunion/index.html | 5 +- .../zhgh/activity/statistics/index.html | 167 ------------------ .../outlay/activityBudget/info.js | 4 +- .../activityBudget/schoolAudit/index.html | 2 +- .../zhgh/welfare/select/optionSelect.js | 73 ++++++-- .../zhghh5/activity/sports/eventList.html | 16 +- .../platform/zhghh5/welfare/select/index.html | 72 +++++--- 23 files changed, 288 insertions(+), 241 deletions(-) delete mode 100644 src/main/resources/views/platform/zhgh/activity/statistics/index.html diff --git a/src/main/java/com/budwk/app/web/commons/ext/websocket/WkWebSocket.java b/src/main/java/com/budwk/app/web/commons/ext/websocket/WkWebSocket.java index 27b2549..cafd370 100644 --- a/src/main/java/com/budwk/app/web/commons/ext/websocket/WkWebSocket.java +++ b/src/main/java/com/budwk/app/web/commons/ext/websocket/WkWebSocket.java @@ -72,7 +72,7 @@ public class WkWebSocket extends AbstractWsEndpoint implements PubSub { ScanResult scan = null; do { scan = jedis.scan(scan == null ? ScanParams.SCAN_POINTER_START : scan.getStringCursor(), match); - for (String key : scan.getResult()) { + for (String key : scan.getResult()) { switch (jedis.type(key)) { case "none": break; diff --git a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementDeputySchoolUnionController.java b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementDeputySchoolUnionController.java index 01eab68..03ae5b7 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementDeputySchoolUnionController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/controller/ActivityReimbursementDeputySchoolUnionController.java @@ -1,24 +1,33 @@ package com.budwk.app.zhgh.activity.declarereimbursement.reimbursement.controller; import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.lang.Dict; import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.annotation.SLog; +import com.budwk.app.base.exception.BaseException; import com.budwk.app.base.page.Pagination; 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.flow.service.FlowCommonService; import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.zhgh.activity.declarereimbursement.reimbursement.models.ActivityReimbursementInfo; import com.budwk.app.zhgh.activity.declarereimbursement.reimbursement.service.ActivityReimbursementService; import com.budwk.app.zhgh.activity.declarereimbursement.vo.CommonPageParam; +import com.budwk.app.zhgh.dayofficework.outlay.activityBudget.models.ActivityBudget; import io.swagger.annotations.ApiOperation; import org.nutz.dao.Cnd; 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.json.Json; 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.math.BigDecimal; import java.util.List; /** @@ -36,6 +45,9 @@ public class ActivityReimbursementDeputySchoolUnionController { @Inject private ActivityReimbursementService activityReimbursementService; + @Inject + private FlowCommonService flowCommonService; + @At("") @SaCheckPermission("activityReimbursement.deputySchoolUnion") @Ok("beetl:/platform/zhgh/activity/declarereimbursement/reimbursement/deputySchoolUnion/index.html") @@ -96,8 +108,8 @@ public class ActivityReimbursementDeputySchoolUnionController { pageParam.buildSearch(cnd, "info."); cnd.and("t.taskName", "=", "f9b8379f-f348-4985-ba58-b6ba28deb9af"); - cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); - cnd.andEX("outlay.budgetReimburseType", "=" , pageParam.getBudgetReimburseType()); +// cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); + cnd.andEX("outlay.budgetReimburseType", "=", pageParam.getBudgetReimburseType()); cnd.andEX("info.outlayManageSource", "=", pageParam.getOutlayManageSource()); cnd.andEX("info.activityReimbursementMode", "=", pageParam.getActivityReimbursementMode()); @@ -119,5 +131,44 @@ public class ActivityReimbursementDeputySchoolUnionController { } + @At + @SLog(tag = "报销", msg = "校工会副主席审核了一条记录") + @SaCheckPermission("activityReimbursement.deputySchoolUnion") + public Result doReview(@Param("data") String param, String id) { + Dict args = Json.fromJson(Dict.class, param); + if (args.getInt("submitType") == 1) { + + ActivityReimbursementInfo info = activityReimbursementService.dao().fetch(ActivityReimbursementInfo.class, id); + if (info.getActualMoney().compareTo(BigDecimal.valueOf(10000)) < 0) { + ActivityBudget budget = activityReimbursementService.dao().fetch(ActivityBudget.class, info.getDeductionBudgetId()); + + Sql sql1 = Sqls.create(""" + SELECT + info.actualMoney + FROM + `activity_reimbursement_info` info + LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id + WHERE + ins.state = 20 + and info.deductionBudgetId=@deductionBudgetId + """).setParam("deductionBudgetId", info.getDeductionBudgetId()); + List infoList = activityReimbursementService.listMap(sql1); + + double usedBudgetMoney = infoList.stream().mapToDouble(v -> v.getDouble("actualMoney")).sum(); + + //全部已使用 + BigDecimal allUsedMoney = info.getActualMoney().add(BigDecimal.valueOf(usedBudgetMoney)); + if (allUsedMoney.compareTo(budget.getTotalBudgetMoney()) > 0) { + return Result.error("剩余配额不足!当前活动预算:" + budget.getTotalBudgetMoney() + + ",已使用:" + usedBudgetMoney + "元,剩余:" + + budget.getTotalBudgetMoney().subtract(BigDecimal.valueOf(usedBudgetMoney))); + } + + } + } + flowCommonService.executeTask(args); + return Result.success(); + } + } diff --git a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/service/impl/ActivityReimbursementSchoolUnionServiceImpl.java b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/service/impl/ActivityReimbursementSchoolUnionServiceImpl.java index cff9723..9be6ef5 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/service/impl/ActivityReimbursementSchoolUnionServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/activity/declarereimbursement/reimbursement/service/impl/ActivityReimbursementSchoolUnionServiceImpl.java @@ -18,11 +18,16 @@ import com.budwk.app.zhgh.dayofficework.outlay.outlayManage.union.model.OutlayMa 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.sql.Sql; import org.nutz.ioc.aop.Aop; import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.json.Json; +import org.nutz.lang.util.NutMap; +import java.math.BigDecimal; +import java.util.List; import java.util.Objects; /** @@ -45,7 +50,32 @@ public class ActivityReimbursementSchoolUnionServiceImpl extends BaseServiceImpl Dict args = Json.fromJson(Dict.class, param); if (args.getInt("submitType") == 1) { ActivityReimbursementInfo info = dao().fetch(ActivityReimbursementInfo.class, id); - OutlayUseDetail detail = new OutlayUseDetail(); + + ActivityBudget budget = dao().fetch(ActivityBudget.class, info.getDeductionBudgetId()); + Sql sql1 = Sqls.create(""" + SELECT + info.actualMoney + FROM + `activity_reimbursement_info` info + LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id + WHERE + ins.state = 20 + and info.deductionBudgetId=@deductionBudgetId + """).setParam("deductionBudgetId", id); + List infoList = listMap(sql1); + + double usedBudgetMoney = infoList.stream().mapToDouble(v -> v.getDouble("actualMoney")).sum(); + + //全部已使用 + BigDecimal allUsedMoney = info.getActualMoney().add(BigDecimal.valueOf(usedBudgetMoney)); + if (allUsedMoney.compareTo(budget.getTotalBudgetMoney()) > 0) { + throw new BaseException("剩余配额不足!当前活动预算:" + budget.getTotalBudgetMoney() + + ",已使用:" + usedBudgetMoney + "元,剩余:" + + budget.getTotalBudgetMoney().subtract(BigDecimal.valueOf(usedBudgetMoney))); + } + + + /* OutlayUseDetail detail = new OutlayUseDetail(); detail.setProjectName(info.getActivityName()); detail.setAdjustMoney(info.getActualMoney()); @@ -135,7 +165,7 @@ public class ActivityReimbursementSchoolUnionServiceImpl extends BaseServiceImpl //添加使用记录到经费管理表 detail.setOutlayManageId(manageClub.getId()); dao().insert(detail); - } + }*/ } flowCommonService.executeTask(args); diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/outlay/activityBudget/conteoller/ActivityBudgetSchoolAuditController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/outlay/activityBudget/conteoller/ActivityBudgetSchoolAuditController.java index b80dac6..f15003c 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/outlay/activityBudget/conteoller/ActivityBudgetSchoolAuditController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/outlay/activityBudget/conteoller/ActivityBudgetSchoolAuditController.java @@ -89,7 +89,7 @@ public class ActivityBudgetSchoolAuditController { """); Cnd cnd = Cnd.NEW(); cnd.and("t.taskName", "=", "b6f29037-972d-4b97-8677-c3b3672ef0dc"); - cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); +// cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); cnd.andEX("info.unionId", "=", unionId); cnd.andEX("info.outlayManageSource", "=", outlayManageSource); cnd.andEX("info.budgetReimburseType", "=", budgetReimburseType); diff --git a/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareUserSelection.java b/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareUserSelection.java index e258a36..0ae808c 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareUserSelection.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/model/WelfareUserSelection.java @@ -50,6 +50,11 @@ public class WelfareUserSelection extends BaseModel implements Serializable { @ColDefine(type = ColType.VARCHAR, width = 32) private String selectUserId; + @Column + @Comment("选择用户") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String userName; + @Column @Comment("选择时间") @ColDefine(type = ColType.DATETIME) diff --git a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java index d088751..4eb3737 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java @@ -16,6 +16,7 @@ import com.budwk.app.base.result.Result; import com.budwk.app.base.service.impl.BaseServiceImpl; import com.budwk.app.base.utils.CommonDownloadUtil; import com.budwk.app.base.utils.PageUtil; +import com.budwk.app.sys.models.Sys_union; 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; @@ -392,7 +393,7 @@ public class WelfareListServiceImpl extends BaseServiceImpl impleme t2.birthday FROM `welfare_list` t1 - LEFT JOIN sys_user t2 ON t2.id = t1.userId + LEFT JOIN `vw_user` t2 ON t2.id = t1.userId $condition """); Cnd cnd = Cnd.NEW(); @@ -408,6 +409,9 @@ public class WelfareListServiceImpl extends BaseServiceImpl impleme if (pageForm.getBirthMonths() != null && pageForm.getBirthMonths().length > 0) { cnd.andEX("MONTH(t2.birthday)", "in", pageForm.getBirthMonths()); } + if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name()) && AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) { + cnd.and("t2.unionId", "=", SecurityUtil.getUnionId()); + } cnd.andEX("t1.welfareUnitId", "in", pageForm.getUnitIds()); cnd.andEX("t1.welfareUnionId", "=", pageForm.getUnionId()); cnd.andEX("t1.personType", "in", pageForm.getPersonTypes()); diff --git a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareSelectionSituationServiceImpl.java b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareSelectionSituationServiceImpl.java index 21bca7e..71083fa 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareSelectionSituationServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareSelectionSituationServiceImpl.java @@ -219,6 +219,9 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl list = listMap(sql); diff --git a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareStatisticsServiceImpl.java b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareStatisticsServiceImpl.java index decf4e9..a5aa0a1 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareStatisticsServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareStatisticsServiceImpl.java @@ -7,11 +7,14 @@ import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.export.ExcelExportService; import cn.hutool.core.bean.BeanUtil; 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.service.impl.BaseServiceImpl; import com.budwk.app.base.utils.CommonDownloadUtil; import com.budwk.app.sys.models.Sys_union; +import com.budwk.app.web.commons.auth.utils.AuthUtil; +import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.zhgh.welfare.model.WelfareProject; import com.budwk.app.zhgh.welfare.model.WelfareProjectSubjectOption; import com.budwk.app.zhgh.welfare.service.WelfareStatisticsService; @@ -44,9 +47,15 @@ public class WelfareStatisticsServiceImpl extends BaseServiceImpl unions = dao().query(Sys_union.class, Cnd.NEW().andEX(Sys_union::getId, "=", unionId).asc(Sys_union::getUnionCode)); + List unions; + if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_ADMIN.name())) { + unions = dao().query(Sys_union.class, Cnd.NEW().andEX(Sys_union::getId, "=", SecurityUtil.getUnionId()).asc(Sys_union::getUnionCode)); + }else { + unions = dao().query(Sys_union.class, Cnd.NEW().andEX(Sys_union::getId, "=", unionId).asc(Sys_union::getUnionCode)); + } List mapUnions = BeanUtil.copyToList(unions, NutMap.class); + // 表格动态列数据 List dynamicTableColumns = new ArrayList<>() {{ add(NutMap.NEW().addv("label", "分工会").addv("prop", "name")); @@ -468,6 +477,7 @@ public class WelfareStatisticsServiceImpl extends BaseServiceImpl welfareSelectionList = listMap(sql); @@ -483,6 +493,7 @@ public class WelfareStatisticsServiceImpl extends BaseServiceImpl { if (res.code === 0) { window.sessionStorage.setItem("user", JSON.stringify(res.data)) diff --git a/src/main/resources/views/platform/zhgh/activity/declarereimbursement/declare/apply/index.html b/src/main/resources/views/platform/zhgh/activity/declarereimbursement/declare/apply/index.html index 3feceab..fd92510 100644 --- a/src/main/resources/views/platform/zhgh/activity/declarereimbursement/declare/apply/index.html +++ b/src/main/resources/views/platform/zhgh/activity/declarereimbursement/declare/apply/index.html @@ -122,7 +122,8 @@ layout("/layouts/platform.html"){ - + - + + + + + + + + + diff --git a/src/main/resources/views/platform/zhghh5/welfare/select/index.html b/src/main/resources/views/platform/zhghh5/welfare/select/index.html index 0f7b462..9df06b0 100644 --- a/src/main/resources/views/platform/zhghh5/welfare/select/index.html +++ b/src/main/resources/views/platform/zhghh5/welfare/select/index.html @@ -686,6 +686,27 @@ layout("/layouts/platform_h5.html"){
+ + + - -
@@ -813,10 +821,12 @@ layout("/layouts/platform_h5.html"){ showOptionDetailDialog: false, // 选项详情弹窗 selectedOption: null, // 当前选中的选项 mobileError: false, // 手机号错误标记 + userNameError: false, // 收货人错误标记 formData: { userSign: "", // 用户签名 mobile: "", // 手机号码 - address: "" // 收货地址 + address: "",// 收货地址 + userName: "",//收货人 }, addressOptions: [], @@ -941,14 +951,17 @@ layout("/layouts/platform_h5.html"){ // 如果有用户选择数据,从中获取手机号 if (this.userSelection && this.userSelection.length > 0 && this.userSelection[0].mobile) { this.formData.mobile = this.userSelection[0].mobile + this.formData.userName = this.userSelection[0].userName // 获取签名信息(如果有) if (this.userSelection[0].userSign) { this.formData.userSign = this.userSelection[0].userSign } - } else if (this.$store.user && this.$store.user.mobile) { + } else if (this.$store.state.user && this.$store.state.user.mobile) { // 如果没有选择过,使用store中的默认手机号 - this.formData.mobile = this.$store.user.mobile + this.formData.mobile = this.$store.state.user.mobile + }else if (this.$store.state.user && this.$store.state.user.username){ + this.formData.userName = this.$store.state.user.username } // 地址回显 @@ -995,6 +1008,11 @@ layout("/layouts/platform_h5.html"){ return } + // 验证收货人 + if (!this.validateUserName()) { + return; + } + // 验证手机号 if (!this.validateMobile()) { return @@ -1030,7 +1048,8 @@ layout("/layouts/platform_h5.html"){ { selectOptionId: this.selectedRadioId, selectNum: 1, - mobile: this.formData.mobile + mobile: this.formData.mobile, + userName: this.formData.userName } ] } @@ -1040,7 +1059,8 @@ layout("/layouts/platform_h5.html"){ selections = this.selectedOptions.map((option) => ({ selectOptionId: option.id, selectNum: option.selectNum, - mobile: this.formData.mobile + mobile: this.formData.mobile, + userName: this.formData.userName })) } @@ -1101,6 +1121,16 @@ layout("/layouts/platform_h5.html"){ return true }, + // 验证收货人 + validateUserName() { + if (!this.formData.userName) { + this.userNameError = true; + this.$toast.fail("请输入收货人姓名"); + return false; + } + return true; + }, + // 格式化时间范围 formatTimeRange(start, end) { if (!start || !end) return "未设置" @@ -1198,8 +1228,10 @@ layout("/layouts/platform_h5.html"){ // 选择收货地址 selectAddress(address) { - this.formData.receiveAddress = - "收货人:" + address.userName + ",联系电话:" + address.tel + ",收货地址:" + address.province + address.city + address.county + address.addressDetail + // "收货人:" + address.userName + ",联系电话:" + address.tel + ",收货地址:" + + this.formData.userName = address.userName + this.formData.mobile = address.tel + this.formData.receiveAddress = address.province + address.city + address.county + address.addressDetail this.showAddressSheet = false },