From c5ec2137e2c600da0f08e8a858bfa06ef6ad4853 Mon Sep 17 00:00:00 2001 From: zhouhefeng Date: Mon, 19 Jan 2026 09:01:00 +0800 Subject: [PATCH] commit --- .../budwk/app/base/constant/RoleConstant.java | 2 + .../com/budwk/app/sys/models/Sys_user.java | 36 +- .../controller/AidFundApplyController.java | 207 ++++++++++++ .../AidFundApplyMineController.java | 145 ++++++++ .../AidFundFoundationAuditController.java | 166 +++++++++ .../controller/AidFundManageController.java | 97 ++++++ .../AidFundRetirementAuditController.java | 129 +++++++ .../AidFundUnionAuditController.java | 127 +++++++ .../aidFund/mode/AidFundMemberMode.java | 33 ++ .../model/AidFundMemberChangeRecord.java | 47 +++ .../aidFund/model/AidFundMemberPay.java | 67 ++++ .../aidFund/param/AidFundPageForm.java | 18 + .../AidFundMemberChangeRecordService.java | 18 + .../AidFundMemberChangeRecordServiceImpl.java | 121 +++++++ .../controller/WelfareListController.java | 5 +- src/main/resources/application-dev.yaml | 4 +- .../medicalMutualAid/aidFund/apply/index.html | 218 ++++++++++++ .../aidFund/applyMine/index.html | 151 +++++++++ .../aidFund/common/aidFundInfo.js | 6 + .../aidFund/common/applyInfo.js | 97 ++++++ .../aidFund/common/payRecord.js | 40 +++ .../aidFund/foundationAudit/index.html | 314 ++++++++++++++++++ .../aidFund/manage/index.html | 161 +++++++++ .../aidFund/retirementAudit/index.html | 204 ++++++++++++ .../aidFund/unionAudit/index.html | 204 ++++++++++++ .../welfare/selectionSituation/index.html | 4 +- src/test/java/com/budwk/app/Test.java | 11 - src/test/java/com/budwk/app/Testzhf.java | 42 +++ 28 files changed, 2651 insertions(+), 23 deletions(-) create mode 100644 src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundApplyController.java create mode 100644 src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundApplyMineController.java create mode 100644 src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundFoundationAuditController.java create mode 100644 src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundManageController.java create mode 100644 src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundRetirementAuditController.java create mode 100644 src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundUnionAuditController.java create mode 100644 src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/mode/AidFundMemberMode.java create mode 100644 src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/model/AidFundMemberChangeRecord.java create mode 100644 src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/model/AidFundMemberPay.java create mode 100644 src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/param/AidFundPageForm.java create mode 100644 src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/service/AidFundMemberChangeRecordService.java create mode 100644 src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/service/impl/AidFundMemberChangeRecordServiceImpl.java create mode 100644 src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/apply/index.html create mode 100644 src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/applyMine/index.html create mode 100644 src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/common/aidFundInfo.js create mode 100644 src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/common/applyInfo.js create mode 100644 src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/common/payRecord.js create mode 100644 src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/foundationAudit/index.html create mode 100644 src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/manage/index.html create mode 100644 src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/retirementAudit/index.html create mode 100644 src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/unionAudit/index.html delete mode 100644 src/test/java/com/budwk/app/Test.java create mode 100644 src/test/java/com/budwk/app/Testzhf.java diff --git a/src/main/java/com/budwk/app/base/constant/RoleConstant.java b/src/main/java/com/budwk/app/base/constant/RoleConstant.java index 0b5138a6..a2674d5a 100644 --- a/src/main/java/com/budwk/app/base/constant/RoleConstant.java +++ b/src/main/java/com/budwk/app/base/constant/RoleConstant.java @@ -91,6 +91,8 @@ RoleConstant { /*大病基金会员*/ AID_FUND_MEMBER("大病基金会员"), + RETIREMENT_WORKPLACE("离退休工作处"), + /*爱心扶助基金*/ LOVE_ASSIST_WORK_GROUP_LEADER("爱心扶助小组组长"), diff --git a/src/main/java/com/budwk/app/sys/models/Sys_user.java b/src/main/java/com/budwk/app/sys/models/Sys_user.java index 48f9de97..02c0d90e 100644 --- a/src/main/java/com/budwk/app/sys/models/Sys_user.java +++ b/src/main/java/com/budwk/app/sys/models/Sys_user.java @@ -297,12 +297,6 @@ public class Sys_user extends BaseModel implements Serializable { @Default(value = "0") private Boolean welfareMember; - @Column - @Comment("是否大病基金会员") - @ColDefine(type = ColType.BOOLEAN) - @Default(value = "0") - private Boolean aidFundMember; - @Column @Comment("家庭主要成员及其工作单位") @ColDefine(type = ColType.MYSQL_JSON) @@ -394,4 +388,34 @@ public class Sys_user extends BaseModel implements Serializable { @Comment("openId") @ColDefine(type = ColType.VARCHAR, width = 50) private String openId; + + + /** + * 基金会员 + */ + @Column + @Comment("是否大病基金会员") + @ColDefine(type = ColType.BOOLEAN) + @Default(value = "0") + private Boolean aidFundMember; + + @Column + @Comment("基金会员类型") + @ColDefine(type = ColType.VARCHAR,width = 10) + private String aidFundMemberUserType; + + @Column + @Comment("基金会员起扣时间") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String aidFundDeductTime; + + @Column + @Comment("指退休之前的工号") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String oldLoginName; + + @Column + @Comment("基金会员加入时间") + @ColDefine(type = ColType.DATETIME) + private Date aidFundMemberJoinTime; } diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundApplyController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundApplyController.java new file mode 100644 index 00000000..fe25e882 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundApplyController.java @@ -0,0 +1,207 @@ +package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.lang.Dict; +import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.annotation.SLog; +import com.budwk.app.base.result.Result; +import com.budwk.app.flow.constant.FlowConst; +import com.budwk.app.flow.engine.FlowEngine; +import com.budwk.app.flow.entity.ProcessInstance; +import com.budwk.app.flow.entity.ProcessTask; +import com.budwk.app.flow.enums.ProcessInstanceStateEnum; +import com.budwk.app.flow.enums.ProcessSubmitTypeEnum; +import com.budwk.app.flow.service.FlowCommonService; +import com.budwk.app.sys.models.Sys_user; +import com.budwk.app.sys.services.SysUserService; +import com.budwk.app.sys.views.View_user; +import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.web.commons.base.Globals; +import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.mode.AidFundMemberMode; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.model.AidFundMemberChangeRecord; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.model.AidFundMemberPay; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberChangeRecordService; +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.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.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; +import org.nutz.mvc.annotation.Param; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author zhf + * @date 2026/1/15 15:40 + * @description 基金会员申请 + */ +@IocBean +@At("/platform/medicalMutualAid/aidFund/apply") +@Api("基金会员申请") +@Ok("json:full") +@Slf4j +public class AidFundApplyController { + + @Inject + private SysUserService userService; + + @Inject + private AidFundMemberChangeRecordService changeRecordService; + + @Inject + private Dao dao; + @Inject + private FlowEngine flowEngine; + @Inject + private FlowCommonService flowCommonService; + + @At("") + @Ok("beetl:/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/apply/index.html") + @SaCheckPermission("medicalMutualAid.aidFund.apply") + public void index() { + } + + + @At + @ApiOperation("查询申请状态") + @SaCheckPermission("medicalMutualAid.aidFund.apply") + public Result canApply() { + String aidFundMemberApplyEndTime = Globals.MyConfig.getString("AidFundMemberApplyEndTime"); + if (StrUtil.isBlank(aidFundMemberApplyEndTime)) { + return Result.success(Map.of("disabled", true, "label", "请先配置基金会员申请截止时间!")); + } + + Date deadlineEnd = DateUtil.endOfDay(DateUtil.parse(aidFundMemberApplyEndTime, "yyyy-M-d")); + if (System.currentTimeMillis() > deadlineEnd.getTime()) { + return Result.success(Map.of("disabled", true, "label", "基金会员申请已截止!")); + } + + //当前是否有申请的 + Sys_user user = userService.fetch(SecurityUtil.getUserId()); + List userList = userService.query(Cnd.where("idCard", "=", user.getIdCard())); + + List recordList = changeRecordService.query(Cnd.where("userId", "in", userList.stream().map(Sys_user::getId).toList())); + List recordIds = recordList.stream().map(AidFundMemberChangeRecord::getId).toList(); + List instanceList = changeRecordService.dao().query(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "in", recordIds) + .and(ProcessInstance::getOperator, "=", SecurityUtil.getUserId()) + .and(ProcessInstance::getState, "=", ProcessInstanceStateEnum.DOING.getCode())); + if (!instanceList.isEmpty()) { + return Result.success(Map.of("disabled", true, "label", "您有正在申请的基金会员申请!")); + } + + + //判断是否是首次加入 + List userIds = new ArrayList<>(); + userIds.add(SecurityUtil.getUserId()); + + //判断是否是工号变更过的用户 + if (StrUtil.isNotBlank(user.getOldLoginName())) { + Sys_user oldUser = userService.fetch(Cnd.where(Sys_user::getLoginname, "=", user.getOldLoginName())); + if (null != oldUser) { + userIds.add(oldUser.getId()); + } + } + int payRecordCount = userService.dao().count(AidFundMemberPay.class, Cnd.where("userid", "in", userIds)); + + Boolean aidFundMember = Optional.ofNullable(user.getAidFundMember()) + .orElse(false); + if (aidFundMember == AidFundMemberMode.NONE.getCode()) { + if (payRecordCount == 0) { + return Result.success(Map.of("disabled", false, "label", "首次申请加入")); + } + //如果有两个工号并且有一个工号已经是会员就不让他申请了 + if (userList.size() >= 2) { + int size = userList.stream().filter(Sys_user::getAidFundMember).toList().size(); + if (size > 0) { + return Result.success(Map.of("disabled", true, "label", "请用新工号登陆办理申请业务!")); + } + } + return Result.success(Map.of("disabled", false, "label", "再次申请加入")); + } + return Result.success(Map.of("disabled", false, "label", "申请退出")); + } + + + @At + @ApiOperation("提交申请") + @SaCheckPermission(value = {"medicalMutualAid.aidFund.apply", "h5.medicalMutualAid.aidFund.apply"}, mode = SaMode.OR) + @SLog(tag = "基金会员-基金会员申请", msg = "提交申请") + @Aop(TransAop.READ_COMMITTED) + public Result submit(@Param("data") AidFundMemberChangeRecord aidFundMemberChangeRecord) { + aidFundMemberChangeRecord.setUserId(SecurityUtil.getUserId()); + Sys_user user = dao.fetch(Sys_user.class, SecurityUtil.getUserId()); + if (StrUtil.isBlank(aidFundMemberChangeRecord.getId())) aidFundMemberChangeRecord.setApplyTime(new Date()); + if (user.getAidFundMember() == AidFundMemberMode.NORMAL.getCode()) { + aidFundMemberChangeRecord.setChangeType("AIDFUND_MEMBER_CHANGE_TYPE_FOUR"); + } else { + aidFundMemberChangeRecord.setChangeType("AIDFUND_MEMBER_CHANGE_TYPE_ONE"); + } + dao.insertOrUpdate(aidFundMemberChangeRecord); + // 开启流程实例 + Dict args = Dict.create(); + args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode()); + args.set(FlowConst.FORM_DATA, aidFundMemberChangeRecord); + args.set("aidFundMemberUserType", user.getAidFundMemberUserType()); + ProcessInstance instance = flowEngine.startProcessInstanceByKey("JJHY", aidFundMemberChangeRecord.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("查询自己需要缴费多少") + @SaCheckPermission(value = {"medicalMutualAid.aidFund.apply", "h5.medicalMutualAid.aidFund.apply"}, mode = SaMode.OR) + public Result getPayMoney(String arrivalAtSchoolDate) { + return Result.success(changeRecordService.getPayMoney(arrivalAtSchoolDate, SecurityUtil.getUserId())); + } + + @At + @ApiOperation("查询自己的缴费记录") + @SaCheckPermission(value = {"medicalMutualAid.aidFund.apply", "h5.medicalMutualAid.aidFund.apply"}, mode = SaMode.OR) + public Result getUserPayRecordList(String userId) { + return Result.success(changeRecordService.getUserPayRecordList(userId)); + } + + @At + @ApiOperation("查询申请信息") + @SaCheckPermission(value = {"medicalMutualAid.aidFund.apply", "h5.medicalMutualAid.aidFund.apply"}, mode = SaMode.OR) + public Result info(String id) { + Sql sql = Sqls.create(""" + SELECT + us.username, + us.loginname, + us.mobile, + us.aidFundMemberUserType, + us.arrivalAtSchoolDate, + us.sex, + us.unitName, + us.unionName + FROM + `aid_fund_member_change_record` info + LEFT JOIN vw_user us ON us.id = info.userId + WHERE + info.id = '%s' + """.formatted(id)); + View_user user = changeRecordService.fetchVO(sql, View_user.class); + return Result.success(user); + } + + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundApplyMineController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundApplyMineController.java new file mode 100644 index 00000000..d4057b4d --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundApplyMineController.java @@ -0,0 +1,145 @@ +package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.hutool.core.lang.Dict; +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.service.BaseService; +import com.budwk.app.base.utils.PageUtil; +import com.budwk.app.flow.constant.FlowConst; +import com.budwk.app.flow.engine.FlowEngine; +import com.budwk.app.flow.enums.ProcessSubmitTypeEnum; +import com.budwk.app.flow.service.FlowCommonService; +import com.budwk.app.sys.services.SysUserService; +import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberChangeRecordService; +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.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; + +/** + * @author zhf + * @date 2026/1/16 14:08 + * @description 我的申请 + */ +@IocBean +@At("/platform/medicalMutualAid/aidFund/applyMine") +@Api("基金会员我的申请") +@Ok("json:full") +@Slf4j +public class AidFundApplyMineController { + + @Inject + private AidFundMemberChangeRecordService changeRecordService; + + @Inject + private Dao dao; + @Inject + private FlowEngine flowEngine; + @Inject + private FlowCommonService flowCommonService; + + @At("") + @Ok("beetl:/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/applyMine/index.html") + @SaCheckPermission("medicalMutualAid.aidFund.applyMine") + public void index() { + } + + @At + @ApiOperation("分页查询") + @SaCheckPermission(value = {"medicalMutualAid.aidFund.applyMine", "h5.medicalMutualAid.aidFund.applyMine"}, mode = SaMode.OR) + public Result pageData(PageForm pageForm, + @Param(value = "year") Integer year) { + Sql sql = Sqls.create(""" + SELECT + info.*, + us.arrivalAtSchoolDate, + us.mobile, + us.loginname loginName, + us.username userName, + us.unitName, + us.unionName, + us.aidFundMemberUserType, + us.sex, + 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') AS startTaskId + FROM + aid_fund_member_change_record info + LEFT JOIN vw_user us ON us.id = info.userId + 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(); + + cnd.andEX("year(info.applyTime)", "=", year); + cnd.and("info.userId", "=", SecurityUtil.getUserId()); + + if (StrUtil.isNotBlank(pageForm.getPageOrderName()) && StrUtil.isNotBlank(pageForm.getPageOrderBy())) { + cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); + } else { + cnd.desc("info.createdAt"); + } + sql.setCondition(cnd); + Pagination pagination = changeRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } + + + @At + @ApiOperation("删除") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission(value = {"medicalMutualAid.aidFund.applyMine", "h5.medicalMutualAid.aidFund.applyMine"}, mode = SaMode.OR) + @SLog(tag = "基金会员-我的申请", msg = "删除申请记录") + public Result delete(@Param("id") String id) { + changeRecordService.delete(id); + flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id); + return Result.success(); + } + + @At + @ApiOperation("重新提交申请") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission(value = {"medicalMutualAid.aidFund.applyMine", "h5.medicalMutualAid.aidFund.applyMine"}, mode = SaMode.OR) + public Result submitAgain(@Param("taskId") Long taskId) { + Dict dict = Dict.create(); + dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId); + dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode()); + flowCommonService.executeTask(dict); + return Result.success(); + } + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundFoundationAuditController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundFoundationAuditController.java new file mode 100644 index 00000000..d339e5c9 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundFoundationAuditController.java @@ -0,0 +1,166 @@ +package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.lang.Dict; +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.flow.service.FlowCommonService; +import com.budwk.app.sys.models.Sys_home_activity; +import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.zhgh.activity.culture.models.ActivityTissue; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberChangeRecordService; +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.Cnd; +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.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.util.List; + +/** + * @author zhf + * @date 2026/1/16 17:26 + * @description 互管会审核 + */ +@IocBean +@At("/platform/medicalMutualAid/aidFund/foundationAudit") +@Api("基金会员分工会审核") +@Ok("json:full") +@Slf4j +public class AidFundFoundationAuditController { + + @Inject + private AidFundMemberChangeRecordService changeRecordService; + + + + @At("") + @Ok("beetl:/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/foundationAudit/index.html") + @SaCheckPermission("medicalMutualAid.aidFund.foundationAudit") + public void index() { + } + + @At + @ApiOperation("分页查询") + @SaCheckPermission(value = {"medicalMutualAid.aidFund.foundationAudit", "h5.medicalMutualAid.aidFund.foundationAudit"}, mode = SaMode.OR) + public Result pageData(PageForm pageForm, + @Param(value = "year") Integer year, + @Param(value = "aidFundMemberUserType") String aidFundMemberUserType, + @Param(value = "unionId") String unionId, + @Param(value = "unitId") String unitId, + @Param(value = "changeType") String changeType, + @Param(value = "approval") Boolean approval) { + Sql sql = Sqls.create(""" + SELECT + info.*, + us.arrivalAtSchoolDate, + us.mobile, + us.loginname loginName, + us.username userName, + us.unitName, + us.unionName, + us.aidFundMemberUserType, + us.sex, + 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 aid_fund_member_change_record info ON info.id = ins.businessNo + LEFT JOIN vw_user us ON us.id = info.userId + 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 + """); + Cnd cnd = Cnd.NEW(); + if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + SqlExpressionGroup seg = new SqlExpressionGroup(); + seg.or("us.loginname", "like", "%" + pageForm.getSearchKeyword() + "%"); + seg.or("us.username", "like", "%" + pageForm.getSearchKeyword() + "%"); + cnd.and(seg); + } + cnd.andEX("YEAR(info.applyTime)", "=", year); + cnd.andEX("us.aidFundMemberUserType", "=", aidFundMemberUserType); + cnd.andEX("us.unionId", "=", unionId); + cnd.andEX("us.unitId", "=", unitId); + cnd.andEX("info.changeType", "=", changeType); + + cnd.and("t.taskName", "=", "85c7d148-44f5-4333-b854-ab225357fd3e"); +// cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); + + if (approval) { + cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode())); + } else { + cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode()); + } + + if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { + cnd.desc("info.applyTime"); + } else { + cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); + } + cnd.groupBy("t.id"); + sql.setCondition(cnd); + Pagination pageVO = changeRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + + List list = pageVO.getList(); + for (NutMap map : list) { + int money = changeRecordService.getPayMoney(map.getString("arrivalAtSchoolDate"), map.getString("userId")); + map.put("money", money); + } + return Result.success(pageVO); + } + + @At + @ApiOperation("查询需要缴费多少") + @SaCheckPermission(value = {"medicalMutualAid.aidFund.foundationAudit", "h5.medicalMutualAid.aidFund.foundationAudit"}, mode = SaMode.OR) + public Result getPayMoney(String arrivalAtSchoolDate,String userId) { + if (StrUtil.isBlank(userId)||StrUtil.isBlank(arrivalAtSchoolDate)){ + return Result.error("参数错误"); + } + return Result.success(changeRecordService.getPayMoney(arrivalAtSchoolDate, userId)); + } + + @At + @SLog(tag = "基金会员", msg = "互管会审核了一条记录") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission(value = {"medicalMutualAid.aidFund.foundationAudit", "h5.medicalMutualAid.aidFund.foundationAudit"}, mode = SaMode.OR) + public Result executeTask(@Param("data") String param, String id) { + changeRecordService.executeTask(param, id); + return Result.success(); + } + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundManageController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundManageController.java new file mode 100644 index 00000000..aeafe06e --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundManageController.java @@ -0,0 +1,97 @@ +package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.controller; + +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; +import com.budwk.app.base.utils.PageUtil; +import com.budwk.app.sys.models.Sys_user; +import com.budwk.app.sys.services.SysUserService; +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; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.mode.AidFundMemberMode; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.param.AidFundPageForm; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberChangeRecordService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.nutz.dao.Cnd; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +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 org.nutz.mvc.annotation.Param; + +/** + * @author zhf + * @date 2026/1/17 16:52 + * @description 基金会员台账 + */ + +@IocBean +@At("/platform/medicalMutualAid/aidFund/manage") +@Api("基金会员台账") +@Ok("json:full") +@Slf4j +public class AidFundManageController { + + @Inject + private SysUserService userService; + + + @Inject + private AidFundMemberChangeRecordService changeRecordService; + + @At("") + @Ok("beetl:/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/manage/index.html") + @SaCheckPermission("medicalMutualAid.aidFund.manage") + public void index() { + } + + @At + @ApiOperation("分页查询") + @SaCheckPermission(value = {"medicalMutualAid.aidFund.retirementAudit", "h5.medicalMutualAid.aidFund.retirementAudit"}, mode = SaMode.OR) + public Result pageData(AidFundPageForm pageForm) { + + Sql sql = Sqls.create(""" + select * from vw_user $condition + """); + Cnd cnd = Cnd.NEW(); + if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) { + if (AuthUtil.hasRole(RoleConstant.RETIREMENT_WORKPLACE.name())) { + cnd.and(Sys_user::getAidFundMemberUserType, "=", "离退休人员"); + } else { + cnd.and(View_user::getUnionId, "=", SecurityUtil.getUnionId()); + } + } + cnd.andEX(Sys_user::getAidFundMemberUserType, "=", pageForm.getAidFundMemberUserType()); + cnd.andEX(View_user::getUnionId, "=", pageForm.getUnionId()); + cnd.andEX(View_user::getUnitId, "=", pageForm.getUnitId()); + sql.setCondition(cnd); + cnd.and(Sys_user::getAidFundMember, "=", AidFundMemberMode.NORMAL.getCode()); + + if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + SqlExpressionGroup seg = new SqlExpressionGroup(); + seg.orLike("loginname", pageForm.getSearchKeyword()); + seg.orLike("username", pageForm.getSearchKeyword()); + cnd.and(seg); + } + if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { + cnd.desc("unitCode"); + } else { + cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); + } + sql.setCondition(cnd); + Pagination pagination = userService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } + + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundRetirementAuditController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundRetirementAuditController.java new file mode 100644 index 00000000..49656bbd --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundRetirementAuditController.java @@ -0,0 +1,129 @@ +package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.hutool.core.util.StrUtil; +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.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberChangeRecordService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.nutz.dao.Cnd; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +import org.nutz.dao.util.cri.SqlExpressionGroup; +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.List; + +/** + * @author zhf + * @date 2026/1/17 15:48 + * @description 离退休审核 + */ +@IocBean +@At("/platform/medicalMutualAid/aidFund/retirementAudit") +@Api("基金会员离退休审核") +@Ok("json:full") +@Slf4j +public class AidFundRetirementAuditController { + + @Inject + private AidFundMemberChangeRecordService changeRecordService; + + @At("") + @Ok("beetl:/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/retirementAudit/index.html") + @SaCheckPermission("medicalMutualAid.aidFund.retirementAudit") + public void index() { + } + + + @At + @ApiOperation("分页查询") + @SaCheckPermission(value = {"medicalMutualAid.aidFund.retirementAudit", "h5.medicalMutualAid.aidFund.retirementAudit"}, mode = SaMode.OR) + public Result pageData(PageForm pageForm, + @Param(value = "year") Integer year, + @Param(value = "aidFundMemberUserType") String aidFundMemberUserType, + @Param(value = "changeType") String changeType, + @Param(value = "approval") Boolean approval) { + Sql sql = Sqls.create(""" + SELECT + info.*, + us.arrivalAtSchoolDate, + us.mobile, + us.loginname loginName, + us.username userName, + us.unitName, + us.unionName, + us.aidFundMemberUserType, + us.sex, + 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 aid_fund_member_change_record info ON info.id = ins.businessNo + LEFT JOIN vw_user us ON us.id = info.userId + 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 + """); + Cnd cnd = Cnd.NEW(); + if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + SqlExpressionGroup seg = new SqlExpressionGroup(); + seg.or("us.loginname", "like", "%" + pageForm.getSearchKeyword() + "%"); + seg.or("us.username", "like", "%" + pageForm.getSearchKeyword() + "%"); + cnd.and(seg); + } + cnd.andEX("YEAR(info.applyTime)", "=", year); + cnd.andEX("us.aidFundMemberUserType", "=", aidFundMemberUserType); + cnd.andEX("info.changeType", "=", changeType); + + cnd.and("t.taskName", "=", "f756c818-6bb7-4f50-b8fa-24390fc7b0b8"); + cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); + + if (approval) { + cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode())); + } else { + cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode()); + } + + if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { + cnd.desc("info.applyTime"); + } else { + cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); + } + cnd.groupBy("t.id"); + sql.setCondition(cnd); + Pagination pageVO = changeRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pageVO); + } + + + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundUnionAuditController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundUnionAuditController.java new file mode 100644 index 00000000..204b4147 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/controller/AidFundUnionAuditController.java @@ -0,0 +1,127 @@ +package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.hutool.core.util.StrUtil; +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.staffbenefit.condolence.model.Condolence; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberChangeRecordService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.nutz.dao.Cnd; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +import org.nutz.dao.util.cri.SqlExpressionGroup; +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.List; + +/** + * @author zhf + * @date 2026/1/16 14:57 + * @description 基金会员分工会审核 + */ +@IocBean +@At("/platform/medicalMutualAid/aidFund/unionAudit") +@Api("基金会员分工会审核") +@Ok("json:full") +@Slf4j +public class AidFundUnionAuditController { + + @Inject + private AidFundMemberChangeRecordService changeRecordService; + + @At("") + @Ok("beetl:/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/unionAudit/index.html") + @SaCheckPermission("medicalMutualAid.aidFund.unionAudit") + public void index() { + } + + + @At + @ApiOperation("分页查询") + @SaCheckPermission(value = {"medicalMutualAid.aidFund.unionAudit", "h5.medicalMutualAid.aidFund.unionAudit"}, mode = SaMode.OR) + public Result pageData(PageForm pageForm, + @Param(value = "year") Integer year, + @Param(value = "aidFundMemberUserType") String aidFundMemberUserType, + @Param(value = "changeType") String changeType, + @Param(value = "approval") Boolean approval) { + Sql sql = Sqls.create(""" + SELECT + info.*, + us.arrivalAtSchoolDate, + us.mobile, + us.loginname loginName, + us.username userName, + us.unitName, + us.unionName, + us.aidFundMemberUserType, + us.sex, + 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 aid_fund_member_change_record info ON info.id = ins.businessNo + LEFT JOIN vw_user us ON us.id = info.userId + 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 + """); + Cnd cnd = Cnd.NEW(); + if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + SqlExpressionGroup seg = new SqlExpressionGroup(); + seg.or("us.loginname", "like", "%" + pageForm.getSearchKeyword() + "%"); + seg.or("us.username", "like", "%" + pageForm.getSearchKeyword() + "%"); + cnd.and(seg); + } + cnd.andEX("YEAR(info.applyTime)", "=", year); + cnd.andEX("us.aidFundMemberUserType", "=", aidFundMemberUserType); + cnd.andEX("info.changeType", "=", changeType); + + cnd.and("t.taskName", "=", "06ed1d6d-5f96-485f-9150-ed1ef4a082d6"); + cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); + + if (approval) { + cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode())); + } else { + cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode()); + } + + if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { + cnd.desc("info.applyTime"); + } else { + cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); + } + cnd.groupBy("t.id"); + sql.setCondition(cnd); + Pagination pageVO = changeRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pageVO); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/mode/AidFundMemberMode.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/mode/AidFundMemberMode.java new file mode 100644 index 00000000..292815f6 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/mode/AidFundMemberMode.java @@ -0,0 +1,33 @@ +package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.mode; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 基金会员mode + * + * @author 1V + * @date 2021/04/16 + * @since 1.0 + */ +@Getter +@AllArgsConstructor +public enum AidFundMemberMode { + /** + * 非会员 + */ + NONE(false, "非会员"), + /** + * 正式会员 + */ + NORMAL(true, "正式会员"); + + /** + * 编码 + */ + private final Boolean code; + /** + * 描述 + */ + private final String description; +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/model/AidFundMemberChangeRecord.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/model/AidFundMemberChangeRecord.java new file mode 100644 index 00000000..50fa6d65 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/model/AidFundMemberChangeRecord.java @@ -0,0 +1,47 @@ +package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.model; + +import com.budwk.app.base.model.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.nutz.dao.entity.annotation.*; +import org.nutz.dao.interceptor.annotation.PrevInsert; + +import java.util.Date; + +/** + * @author zhf + * @date 2026/1/16 10:44 + * @description 基金会员变更记录表 + */ +@Data +@Comment("基金会员变更记录表") +@Accessors(chain = true) +@Table("aid_fund_member_change_record") +@EqualsAndHashCode(callSuper = true) +public class AidFundMemberChangeRecord extends BaseModel { + + @Column + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) + private String id; + + @Column + @Comment("用户id") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String userId; + + @Column + @Comment("变更类型(dict)") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String changeType; + + @Column + @Comment("申请时间") + @ColDefine(type = ColType.DATETIME) + private Date applyTime; + + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/model/AidFundMemberPay.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/model/AidFundMemberPay.java new file mode 100644 index 00000000..1d5ce1e3 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/model/AidFundMemberPay.java @@ -0,0 +1,67 @@ +package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.model; + +import com.budwk.app.base.model.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.nutz.dao.entity.annotation.*; +import org.nutz.dao.interceptor.annotation.PrevInsert; + +/** + * 基金会员缴费记录 + * + * @author 1V + * @date 2021/04/19 + * @since 1.0 + */ +@Data +@Comment("基金会员缴费记录") +@Accessors(chain = true) +@Table("aid_fund_member_pay") +@EqualsAndHashCode(callSuper = true) +public class AidFundMemberPay extends BaseModel { + + @Column + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) + private String id; + + @Column + @Comment("用户id") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String userId; + + @Column + @Comment("年份") + @ColDefine(type = ColType.INT, width = 4) + private Integer year; + + @Column + @Comment("缴费金额") + @ColDefine(customType = "DECIMAL(10,2)") + private Double money; + + @Column + @Comment("是否已缴费") + @Default("0") + @ColDefine(type = ColType.BOOLEAN) + private Boolean isPayed; + + @Column + @Comment("基金会员人员类型") + @ColDefine(type = ColType.VARCHAR, width = 20) + private String aidFundMemberUserType; + + @Column + @Comment("人员类型") + @ColDefine(type = ColType.VARCHAR, width = 20) + private String personType; + + @Column + @Comment("在职状态") + @ColDefine(type = ColType.VARCHAR, width = 10) + private String userState; + +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/param/AidFundPageForm.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/param/AidFundPageForm.java new file mode 100644 index 00000000..4d42ce63 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/param/AidFundPageForm.java @@ -0,0 +1,18 @@ +package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.param; + +import com.budwk.app.base.param.PageForm; +import lombok.Data; + +/** + * @author zhf + * @date 2026/1/17 17:34 + * @description + */ +@Data +public class AidFundPageForm extends PageForm { + + //基金会员类型 + private String aidFundMemberUserType; + private String unionId; + private String unitId; +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/service/AidFundMemberChangeRecordService.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/service/AidFundMemberChangeRecordService.java new file mode 100644 index 00000000..c4a58e38 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/service/AidFundMemberChangeRecordService.java @@ -0,0 +1,18 @@ +package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service; + +import com.budwk.app.base.service.BaseService; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.model.AidFundMemberChangeRecord; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.model.AidFundMemberPay; +import org.nutz.lang.util.NutMap; + +import java.util.List; + +public interface AidFundMemberChangeRecordService extends BaseService { + + + void executeTask( String param, String id); + + + int getPayMoney(String arrivalAtSchoolDate,String userId); + List getUserPayRecordList(String userId); +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/service/impl/AidFundMemberChangeRecordServiceImpl.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/service/impl/AidFundMemberChangeRecordServiceImpl.java new file mode 100644 index 00000000..06c45f28 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/medicalMutualAid/aidFund/service/impl/AidFundMemberChangeRecordServiceImpl.java @@ -0,0 +1,121 @@ +package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.lang.Dict; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.service.impl.BaseServiceImpl; +import com.budwk.app.flow.service.FlowCommonService; +import com.budwk.app.sys.models.Sys_user; +import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.mode.AidFundMemberMode; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.model.AidFundMemberChangeRecord; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.model.AidFundMemberPay; +import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberChangeRecordService; +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.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.Lang; +import org.nutz.lang.util.NutMap; + +import java.util.*; + +/** + * @author zhf + * @date 2026/1/16 14:31 + * @description + */ +@IocBean(args = {"refer:dao"}) +public class AidFundMemberChangeRecordServiceImpl extends BaseServiceImpl implements AidFundMemberChangeRecordService { + public AidFundMemberChangeRecordServiceImpl(Dao dao) { + super(dao); + } + + + @Inject + private FlowCommonService flowCommonService; + + @Override + @Aop(TransAop.READ_COMMITTED) + public void executeTask(String param, String id) { + Dict args = Json.fromJson(Dict.class, param); + AidFundMemberChangeRecord changeRecord = fetch(id); + if (args.getInt("submitType") == 1) { + //如果是通过 + if (ObjectUtil.equals(args.getStr("changeType"), "AIDFUND_MEMBER_CHANGE_TYPE_ONE")) { + //如果是加入基金 + dao().update(Sys_user.class, Chain.make("arrivalAtSchoolDate", args.getStr("arrivalAtSchoolDate")) + .add("aidFundMember", AidFundMemberMode.NORMAL.getCode()), + Cnd.where(Sys_user::getId, "=", changeRecord.getUserId())); + } else { + //如果是加入基金 + dao().update(Sys_user.class, Chain.make("aidFundMember", AidFundMemberMode.NONE.getCode()), + Cnd.where(Sys_user::getId, "=", changeRecord.getUserId())); + } + } + flowCommonService.executeTask(args); + } + + @Override + public int getPayMoney(String arrivalAtSchoolDate,String userId) { + if (StrUtil.isBlank(userId)){ + userId=SecurityUtil.getUserId(); + } + int money=0; + int schoolYear = DateUtil.year(DateUtil.parse(arrivalAtSchoolDate)); + int applyYear = DateUtil.thisYear(); + + List userIds = new ArrayList<>(); + userIds.add(userId); + Sys_user user = dao().fetch(Sys_user.class, userId); + if (StrUtil.isNotBlank(user.getOldLoginName())) { + Sys_user oldUser = dao().fetch(Sys_user.class,Cnd.where(Sys_user::getLoginname, "=", user.getOldLoginName())); + if (null != oldUser) { + userIds.add(oldUser.getId()); + } + } + List historyPays = dao().query(AidFundMemberPay.class, Cnd.where(AidFundMemberPay::getUserId, "in", userIds)); + if (CollectionUtil.isEmpty(historyPays)) { + if (applyYear == schoolYear) { + money=180; + } else if (schoolYear < 2015) { + money=(applyYear - 2015 + 1) * (180 + 18) + 180; + } else { + //往年需要补的钱 + int oldMoney = (applyYear - schoolYear) * (180 + 18); + money=oldMoney + 180; + } + } else { + //往年需要补的钱 拿到最近一年的缴费记录 + AidFundMemberPay maxYearPayRecord = historyPays.stream().filter(AidFundMemberPay::getIsPayed).max(Comparator.comparingInt(AidFundMemberPay::getYear)).orElse(null); + Integer maxPayYear = maxYearPayRecord.getYear(); + + int oldMoney = (applyYear - maxPayYear) * (180 + 18); + money=oldMoney + 180; + } + + return money; + } + + @Override + public List getUserPayRecordList(String userId) { + if (StrUtil.isBlank(userId)){ + userId=SecurityUtil.getUserId(); + } + Sys_user user = dao().fetch(Sys_user.class, Cnd.where(Sys_user::getId, "=", userId)); + if (StrUtil.isNotBlank(user.getOldLoginName())) { + Sys_user oldUser = dao().fetch(Sys_user.class, Cnd.where(Sys_user::getLoginname, "=", user.getOldLoginName())); + List payList = dao().query(AidFundMemberPay.class, Cnd.where(AidFundMemberPay::getUserId, "in", Lang.list(userId, oldUser.getId())).desc("year")); + return payList; + } + List payList = dao().query(AidFundMemberPay.class, Cnd.where(AidFundMemberPay::getUserId, "=", userId).desc("year")); + + return payList; + } +} diff --git a/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareListController.java b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareListController.java index e337c17f..d071875a 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareListController.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/controller/WelfareListController.java @@ -85,9 +85,10 @@ public class WelfareListController { @ApiOperation("查询福利会员") @SaCheckPermission("welfare.list.mange") @SLog(tag = "福利名单管理", msg = "管理员删除某个福利会员") - public Result delete(String projectId, String userId, String id) { + public Result delete(String id) { + WelfareList fetch = welfareListService.fetch(id); welfareListService.delete(id); - welfareListService.dao().clear(WelfareUserSelection.class, Cnd.where("welfareId", "=", projectId).and("selectUserId", "=", userId)); + welfareListService.dao().clear(WelfareUserSelection.class, Cnd.where("welfareId", "=", fetch.getProjectId()).and("selectUserId", "=", fetch.getUserId())); return Result.success(); } diff --git a/src/main/resources/application-dev.yaml b/src/main/resources/application-dev.yaml index d004017d..bd0e6322 100644 --- a/src/main/resources/application-dev.yaml +++ b/src/main/resources/application-dev.yaml @@ -21,7 +21,7 @@ jetty: #结合ftp使用,或用nginx代理ftp路径 #staticPath: /Users/wizzer/temp/files #开发模式静态资源 - staticPathLocal: D:/project/zhgh_cug_v4/src/main/resources/static + staticPathLocal: E:/projects/zhgh_cug_v4/src/main/resources/static security: tokenName: saToken @@ -87,7 +87,7 @@ xsssql: beetl: RESOURCE: #本地路径,开发时设置本地路径,便于调试 - rootLocal: D:/project/zhgh_cug_v4/src/main/resources/views/ + rootLocal: E:/projects/zhgh_cug_v4/src/main/resources/views/ root: views/ DELIMITER_STATEMENT_START: "" diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/apply/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/apply/index.html new file mode 100644 index 00000000..81ffdb6a --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/apply/index.html @@ -0,0 +1,218 @@ + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{item.name}} + + + + + 温馨提醒:入校时间关联会费缴纳金额,请确认是否正确,若有疑问请联系校工会!另外,务必按您的实际情况选择基金会员类型! + + +
+ + + +
+
+ 中国地质大学(武汉)教职工重大疾病互助基金管理办法 +
+
+
+
+
+
+ + + + + + + + 本次入会,您需要缴费会费{{payMoney}}元,请详知。 + + + 取消 + 提交 + + +
+
+
+ + + + + diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/applyMine/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/applyMine/index.html new file mode 100644 index 00000000..d1906536 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/applyMine/index.html @@ -0,0 +1,151 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/common/aidFundInfo.js b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/common/aidFundInfo.js new file mode 100644 index 00000000..aef51849 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/common/aidFundInfo.js @@ -0,0 +1,6 @@ +const AID_FUND_INFO = { + template: /*language=HTML*/ + ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/common/applyInfo.js b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/common/applyInfo.js new file mode 100644 index 00000000..837972eb --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/common/applyInfo.js @@ -0,0 +1,97 @@ +const APPLY_INFO = { + template: /*language=HTML*/ ` +
+
申请信息 + 点击查看流程图 +
+ + {{viewData.username}} + {{viewData.loginname}} + {{viewData.mobile}} + {{viewData.sex}} + {{$moment(viewData.arrivalAtSchoolDate).format('YYYY-MM-DD')}} + {{viewData.unitName}} + {{viewData.unionName}} + + + + + + + + +
+ `, + store, + dicts: ["AIDFUND_MEMBER_USER_TYPE", "AIDFUND_MEMBER_CHANGE_TYPE"], + data() { + return { + viewData: {}, + doneTasks: [], + row: null, + } + }, + methods: { + // 打开 + onOpen(row) { + this.row = row + this.info() + this.getDoneTasks() + }, + // 获取申请信息 + info() { + this.$axios.post("/platform/medicalMutualAid/aidFund/apply/info", {id: this.row.id}).then((res) => { + if (res.code === 0) { + this.viewData = res.data + } + }) + }, + // 获取已办任务审批记录 + getDoneTasks() { + this.$axios.post("/flow/common/doneTasks", {bizId: this.row.id}).then((res) => { + if (res.code === 0) { + this.doneTasks = res.data + } + }) + }, + // 查看流程图 + openChart() { + this.$refs.snakerChartRef.onOpenFull(this.row.instanceProcessDefineId, this.row.instanceId) + } + }, +} diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/common/payRecord.js b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/common/payRecord.js new file mode 100644 index 00000000..a2d86385 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/common/payRecord.js @@ -0,0 +1,40 @@ +const PAY_RECORD = { + template: /*language=HTML*/ + ` +
+ + + + + + + + + + + + + +
+ `, + data() { + return { + payRecordList: [], + } + }, + methods: { + getUserPayRecordList() { + this.$axios.post('/platform/medicalMutualAid/aidFund/apply/getUserPayRecordList').then(resp => { + if (resp.code === 0) { + this.payRecordList = resp.data + } + }) + }, + } +} diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/foundationAudit/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/foundationAudit/index.html new file mode 100644 index 00000000..68c60521 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/foundationAudit/index.html @@ -0,0 +1,314 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 已审核 + 未审核 + + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/manage/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/manage/index.html new file mode 100644 index 00000000..b344e4ea --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/manage/index.html @@ -0,0 +1,161 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/retirementAudit/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/retirementAudit/index.html new file mode 100644 index 00000000..a7206e77 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/retirementAudit/index.html @@ -0,0 +1,204 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + 已审核 + 未审核 + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/unionAudit/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/unionAudit/index.html new file mode 100644 index 00000000..a7206e77 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/unionAudit/index.html @@ -0,0 +1,204 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + 已审核 + 未审核 + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/src/main/resources/views/platform/zhgh/welfare/selectionSituation/index.html b/src/main/resources/views/platform/zhgh/welfare/selectionSituation/index.html index f79f32fa..c6cc5c5d 100644 --- a/src/main/resources/views/platform/zhgh/welfare/selectionSituation/index.html +++ b/src/main/resources/views/platform/zhgh/welfare/selectionSituation/index.html @@ -156,12 +156,12 @@ layout("/layouts/platform.html"){ computed: { welfareOptions() { if (this.pageForm.projectId) { - return this.projectOptions.find((item) => item.id === this.pageForm.projectId).options + return this.projectOptions.find((item) => item.id === this.pageForm.projectId)?.options } return [] }, provideMode() { - return this.projectOptions.find((item) => item.id === this.pageForm.projectId).provideMode + return this.projectOptions.find((item) => item.id === this.pageForm.projectId)?.provideMode } }, methods: { diff --git a/src/test/java/com/budwk/app/Test.java b/src/test/java/com/budwk/app/Test.java deleted file mode 100644 index 4342ea83..00000000 --- a/src/test/java/com/budwk/app/Test.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.budwk.app; - -public class Test { - - public static void main(String[] args) { - - } - - - -} diff --git a/src/test/java/com/budwk/app/Testzhf.java b/src/test/java/com/budwk/app/Testzhf.java new file mode 100644 index 00000000..8c06aa3b --- /dev/null +++ b/src/test/java/com/budwk/app/Testzhf.java @@ -0,0 +1,42 @@ +package com.budwk.app; + +import com.budwk.app.base.service.BaseService; +import com.budwk.app.sys.models.Sys_user; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.nutz.boot.test.junit4.NbJUnit4Runner; +import org.nutz.dao.Cnd; +import org.nutz.dao.Dao; +import org.nutz.dao.Sqls; +import org.nutz.dao.entity.Record; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.lang.Lang; +import org.nutz.lang.util.NutMap; + +import java.util.List; + +@IocBean +@RunWith(NbJUnit4Runner.class) +public class Testzhf { + + @Inject + private BaseService baseService; + + + @Test + public void test() { + + List sysUserList = baseService.dao().query(Sys_user.class, Cnd.NEW()); + List listMap = baseService.listMap(Sqls.create("select * from sys_user2")); + sysUserList.forEach(sysUser -> { + NutMap ored = listMap.stream().filter(record -> record.getString("id").equals(sysUser.getId())).findFirst().orElse(null); + if (Lang.isNotEmpty(ored)){ + sysUser.setArrivalAtSchoolDate(ored.getString("arrivalAtSchoolDate")); + } + }); + baseService.update(sysUserList); + } + + +}