commit
This commit is contained in:
+207
@@ -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<Sys_user> userList = userService.query(Cnd.where("idCard", "=", user.getIdCard()));
|
||||
|
||||
List<AidFundMemberChangeRecord> recordList = changeRecordService.query(Cnd.where("userId", "in", userList.stream().map(Sys_user::getId).toList()));
|
||||
List<String> recordIds = recordList.stream().map(AidFundMemberChangeRecord::getId).toList();
|
||||
List<ProcessInstance> 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<String> 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<ProcessTask> 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+145
@@ -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<NutMap> 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();
|
||||
}
|
||||
|
||||
}
|
||||
+166
@@ -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<NutMap> pageVO = changeRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
|
||||
List<NutMap> 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();
|
||||
}
|
||||
|
||||
}
|
||||
+97
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+129
@@ -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<NutMap> pageVO = changeRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+127
@@ -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<NutMap> pageVO = changeRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
}
|
||||
+33
@@ -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;
|
||||
}
|
||||
+47
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
+67
@@ -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;
|
||||
|
||||
}
|
||||
+18
@@ -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;
|
||||
}
|
||||
+18
@@ -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<AidFundMemberChangeRecord> {
|
||||
|
||||
|
||||
void executeTask( String param, String id);
|
||||
|
||||
|
||||
int getPayMoney(String arrivalAtSchoolDate,String userId);
|
||||
List<AidFundMemberPay> getUserPayRecordList(String userId);
|
||||
}
|
||||
+121
@@ -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<AidFundMemberChangeRecord> 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<String> 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<AidFundMemberPay> 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<AidFundMemberPay> 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<AidFundMemberPay> payList = dao().query(AidFundMemberPay.class, Cnd.where(AidFundMemberPay::getUserId, "in", Lang.list(userId, oldUser.getId())).desc("year"));
|
||||
return payList;
|
||||
}
|
||||
List<AidFundMemberPay> payList = dao().query(AidFundMemberPay.class, Cnd.where(AidFundMemberPay::getUserId, "=", userId).desc("year"));
|
||||
|
||||
return payList;
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user