commit
This commit is contained in:
@@ -418,4 +418,9 @@ public class Sys_user extends BaseModel implements Serializable {
|
||||
@Comment("基金会员加入时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date aidFundMemberJoinTime;
|
||||
|
||||
@Column
|
||||
@Comment("基金会员退出时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date aidFundMemberQuitTime;
|
||||
}
|
||||
|
||||
@@ -210,4 +210,16 @@ public class View_user {
|
||||
|
||||
@Column
|
||||
private Boolean aidFundMember;
|
||||
|
||||
@Column
|
||||
private String aidFundMemberUserType;
|
||||
|
||||
@Column
|
||||
private String aidFundDeductTime;
|
||||
|
||||
@Column
|
||||
private Date aidFundMemberJoinTime;
|
||||
|
||||
@Column
|
||||
private Date aidFundMemberQuitTime;
|
||||
}
|
||||
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.model.AidFundMemberPay;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.param.AidFundPageForm;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberPayService;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.template.AidFundPayTemp;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
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 org.nutz.mvc.annotation.AdaptBy;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.upload.TempFile;
|
||||
import org.nutz.mvc.upload.UploadAdaptor;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/1/20 14:54
|
||||
* @description 缴费记录
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/medicalMutualAid/aidFund/payRecord")
|
||||
@Api("基金会员缴费记录")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class AIdFundPayRecordController {
|
||||
|
||||
|
||||
@Inject
|
||||
private AidFundMemberPayService aidFundMemberPayService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/payRecord/index.html")
|
||||
@SaCheckPermission("medicalMutualAid.aidFund.payRecord")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("medicalMutualAid.aidFund.payRecord")
|
||||
public Result pageData(AidFundPageForm pageForm) {
|
||||
Sql sql = aidFundMemberPayService.getSql(pageForm);
|
||||
Pagination pagination = aidFundMemberPayService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("基金会员设置已缴费未缴费")
|
||||
@SLog(tag = "基金会员-基金会员台账", msg = "设置已缴费未缴费")
|
||||
@SaCheckPermission("medicalMutualAid.aidFund.payRecord")
|
||||
public Result onPayed(String id, Boolean isPayed) {
|
||||
if (ObjectUtil.isEmpty(id)) {
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
aidFundMemberPayService.update(Chain.make("isPayed", isPayed), Cnd.where("id", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("清空基金会员缴费名单")
|
||||
@SLog(tag = "基金会员-基金会员台账", msg = "清空基金会员缴费名单")
|
||||
@SaCheckPermission("medicalMutualAid.aidFund.payRecord")
|
||||
public Result clearPayRecord(Integer year) {
|
||||
if (ObjectUtil.isEmpty(year)) {
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
aidFundMemberPayService.clear(Cnd.where(AidFundMemberPay::getYear, "=", year));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@ApiOperation("导出缴费名单")
|
||||
@SaCheckPermission("medicalMutualAid.aidFund.payRecord")
|
||||
public void exportPayRecord(AidFundPageForm pageForm, HttpServletResponse response) {
|
||||
|
||||
Sql sql = aidFundMemberPayService.getSql(pageForm);
|
||||
List<NutMap> listMap = aidFundMemberPayService.listMap(sql);
|
||||
listMap.forEach(map -> {
|
||||
map.put("payedText", map.getBoolean("isPayed") ? "已缴费" : "未缴费");
|
||||
});
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("年度", "year", 20));
|
||||
entityList.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
entityList.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
entityList.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
entityList.add(new ExcelExportEntity("基金会员类型", "aidFundMemberUserType", 20));
|
||||
entityList.add(new ExcelExportEntity("所属单位", "unitName", 20));
|
||||
entityList.add(new ExcelExportEntity("所属工会", "unionName", 20));
|
||||
entityList.add(new ExcelExportEntity("缴费金额", "money", 20));
|
||||
entityList.add(new ExcelExportEntity("是否缴费", "payedText", 20));
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, listMap);
|
||||
CommonDownloadUtil.download(pageForm.getYear() + "会员缴费名单.xlsx", workbook, response);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@ApiOperation("下载导入模版")
|
||||
@SaCheckPermission("medicalMutualAid.aidFund.payRecord")
|
||||
public void downloadImportTemp(HttpServletResponse response) {
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, new ArrayList<>());
|
||||
CommonDownloadUtil.download("会员缴费导入模版.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("导入缴费信息")
|
||||
@SaCheckPermission("member.payment.summary")
|
||||
@SLog(tag = "导入缴费信息", msg = "导入缴费信息")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Result doImport(TempFile file, Integer year) {
|
||||
try {
|
||||
if (ObjectUtil.isEmpty(year)){
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
List<AidFundPayTemp> payTempList = ExcelImportUtil.importExcel(file.getFile(), AidFundPayTemp.class, new ImportParams());
|
||||
List<AidFundPayTemp> errorInfos = new ArrayList<>();
|
||||
List<String> needInsertList = new ArrayList<>();
|
||||
List<String> loginNames = payTempList.stream().map(AidFundPayTemp::getLoginname).toList();
|
||||
|
||||
List<Sys_user> sysUserList = aidFundMemberPayService.dao().query(Sys_user.class, Cnd.where(Sys_user::getLoginname, "in", loginNames));
|
||||
List<String> userIds = sysUserList.stream().map(Sys_user::getId).toList();
|
||||
|
||||
List<AidFundMemberPay> payList = aidFundMemberPayService.query(Cnd.where(AidFundMemberPay::getUserId, "in", userIds).and(AidFundMemberPay::getYear, "=", year));
|
||||
|
||||
for (AidFundPayTemp payTemp : payTempList) {
|
||||
String loginname = payTemp.getLoginname().trim();
|
||||
Sys_user sysUser = sysUserList.stream().filter(v -> v.getLoginname().equals(loginname)).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(sysUser)) {
|
||||
payTemp.setResult("工号不存在");
|
||||
errorInfos.add(payTemp);
|
||||
continue;
|
||||
}
|
||||
|
||||
AidFundMemberPay aidFundMemberPay = payList.stream().filter(v -> v.getUserId().equals(sysUser.getId())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(aidFundMemberPay)) {
|
||||
payTemp.setResult("未在导入年度找到该用户");
|
||||
errorInfos.add(payTemp);
|
||||
continue;
|
||||
}
|
||||
|
||||
needInsertList.add(sysUser.getId());
|
||||
}
|
||||
|
||||
|
||||
int i = 0;
|
||||
if (Lang.isNotEmpty(needInsertList)) {
|
||||
i = aidFundMemberPayService.update(Chain.make("isPayed", true), Cnd.where("userId", "in", needInsertList));
|
||||
}
|
||||
|
||||
if (Lang.isNotEmpty(errorInfos)) {
|
||||
NutMap nutMap = NutMap.NEW();
|
||||
nutMap.setv("totalCount", payTempList.size());
|
||||
nutMap.setv("successCount", i);
|
||||
nutMap.setv("errorCount", errorInfos.size());
|
||||
nutMap.setv("errorList", errorInfos.stream().map(v -> {
|
||||
return NutMap.NEW().addv("工号", v.getLoginname()).addv("姓名", v.getUsername()).addv("错误原因", v.getResult());
|
||||
}).collect(Collectors.toList()));
|
||||
return Result.success(nutMap);
|
||||
}
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
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.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.param.AidFundPageForm;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberChangeRecordService;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/1/19 17:55
|
||||
* @description 基金会员变更记录
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/medicalMutualAid/aidFund/changeRecord")
|
||||
@Api("基金会员变更记录")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class AidFundChangeRecordController {
|
||||
|
||||
|
||||
@Inject
|
||||
private AidFundMemberChangeRecordService changeRecordService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/changeRecord/index.html")
|
||||
@SaCheckPermission("medicalMutualAid.aidFund.changeRecord")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("medicalMutualAid.aidFund.changeRecord")
|
||||
public Result pageData(AidFundPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
us.sex,
|
||||
us.username,
|
||||
us.loginname,
|
||||
us.arrivalAtSchoolDate,
|
||||
us.mobile,
|
||||
us.unitName,
|
||||
us.unionName,
|
||||
us.aidFundMemberUserType,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask' AND taskState in (10,20)) AS startTaskId
|
||||
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("us.aidFundMemberUserType", "=", pageForm.getAidFundMemberUserType());
|
||||
cnd.andEX("us.unitid", "=", pageForm.getUnitId());
|
||||
cnd.andEX("us.unionid", "=", pageForm.getUnionId());
|
||||
cnd.andEX("info.changeType", "=", pageForm.getChangeType());
|
||||
cnd.andEX("YEAR(info.applyTime)", "=", pageForm.getYear());
|
||||
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.or("ins.state","=",20);
|
||||
group.or("ins.state","is",null);
|
||||
cnd.and(group);
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("us.unitCode");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination pagination = changeRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.sys.models.Sys_union;
|
||||
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.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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/1/21 09:21
|
||||
* @description 变更统计
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/medicalMutualAid/aidFund/changeRecordStatistics")
|
||||
@Api("基金会员会员变更统计")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class AidFundChangeRecordStatisticsController {
|
||||
|
||||
@Inject
|
||||
private AidFundMemberChangeRecordService changeRecordService;
|
||||
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/changeRecordStatistics/index.html")
|
||||
@SaCheckPermission("medicalMutualAid.aidFund.changeRecordStatistics")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("medicalMutualAid.aidFund.changeRecordStatistics")
|
||||
public Result pageData(AidFundPageForm pageForm){
|
||||
List<Sys_union> unionList = changeRecordService.dao().query(Sys_union.class, Cnd.NEW());
|
||||
|
||||
List<NutMap> maps = new ArrayList<>();
|
||||
|
||||
unionList.forEach(union->{
|
||||
NutMap map = new NutMap();
|
||||
map.put("unionName", union.getName());
|
||||
});
|
||||
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
-7
@@ -2,8 +2,6 @@ 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;
|
||||
@@ -11,10 +9,6 @@ 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;
|
||||
@@ -27,7 +21,6 @@ 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;
|
||||
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.param.AidFundPageForm;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberHistoryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
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 javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/1/20 18:04
|
||||
* @description 会员历史台账
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/medicalMutualAid/aidFund/historyRecord")
|
||||
@Api("基金会员历史台账")
|
||||
@Ok("json:full")
|
||||
@Slf4j
|
||||
public class AidFundHistoryRecordController {
|
||||
|
||||
|
||||
@Inject
|
||||
private AidFundMemberHistoryService aidFundMemberHistoryService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/historyRecord/index.html")
|
||||
@SaCheckPermission("medicalMutualAid.aidFund.historyRecord")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("medicalMutualAid.aidFund.historyRecord")
|
||||
public Result pageData(AidFundPageForm pageForm) {
|
||||
Sql sql = aidFundMemberHistoryService.getSql(pageForm);
|
||||
Pagination pagination = aidFundMemberHistoryService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@ApiOperation("导出缴费名单")
|
||||
@SaCheckPermission("medicalMutualAid.aidFund.payRecord")
|
||||
public void exportHistoryRecord(AidFundPageForm pageForm, HttpServletResponse response) {
|
||||
|
||||
Sql sql = aidFundMemberHistoryService.getSql(pageForm);
|
||||
List<NutMap> listMap = aidFundMemberHistoryService.listMap(sql);
|
||||
listMap.forEach(map -> {
|
||||
map.put("aidFundMemberJoinTime", DateUtil.format(map.getTime("aidFundMemberJoinTime"), "yyyy-MM-dd"));
|
||||
});
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("年度", "year", 20));
|
||||
entityList.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
entityList.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
entityList.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
entityList.add(new ExcelExportEntity("基金会员类型", "aidFundMemberUserType", 20));
|
||||
entityList.add(new ExcelExportEntity("所属单位", "unitName", 20));
|
||||
entityList.add(new ExcelExportEntity("所属工会", "unionName", 20));
|
||||
entityList.add(new ExcelExportEntity("加入时间", "aidFundMemberJoinTime", 20));
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, listMap);
|
||||
CommonDownloadUtil.download(pageForm.getYear() + "会员历史名单.xlsx", workbook, response);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+149
-4
@@ -1,34 +1,54 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
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.model.AidFundMemberChangeRecord;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.param.AidFundPageForm;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberChangeRecordService;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
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.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/1/17 16:52
|
||||
@@ -47,7 +67,7 @@ public class AidFundManageController {
|
||||
|
||||
|
||||
@Inject
|
||||
private AidFundMemberChangeRecordService changeRecordService;
|
||||
private AidFundMemberService aidFundMemberService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/medicalMutualAid/aidFund/manage/index.html")
|
||||
@@ -59,9 +79,20 @@ public class AidFundManageController {
|
||||
@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
|
||||
SELECT
|
||||
id,
|
||||
loginname,
|
||||
username,
|
||||
sex,
|
||||
arrivalAtSchoolDate,
|
||||
unitName,
|
||||
unionName,
|
||||
aidFundMemberUserType,
|
||||
aidFundMemberJoinTime
|
||||
FROM
|
||||
vw_user
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) {
|
||||
@@ -71,6 +102,10 @@ public class AidFundManageController {
|
||||
cnd.and(View_user::getUnionId, "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
}
|
||||
|
||||
if (pageForm.getNotPayedCurrentYear()) {
|
||||
cnd.and("id", "in", Sqls.create("SELECT userid FROM `aid_fund_member_pay` where `year` = YEAR(CURDATE()) and isPayed = 0"));
|
||||
}
|
||||
cnd.andEX(Sys_user::getAidFundMemberUserType, "=", pageForm.getAidFundMemberUserType());
|
||||
cnd.andEX(View_user::getUnionId, "=", pageForm.getUnionId());
|
||||
cnd.andEX(View_user::getUnitId, "=", pageForm.getUnitId());
|
||||
@@ -94,4 +129,114 @@ public class AidFundManageController {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"medicalMutualAid.aidFund.retirementAudit", "h5.medicalMutualAid.aidFund.retirementAudit"}, mode = SaMode.OR)
|
||||
@Ok("void")
|
||||
@ApiOperation("导出本年新进会员")
|
||||
public void exportNewMember(HttpServletResponse response) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
`vw_user`
|
||||
WHERE
|
||||
aidFundMember = 1
|
||||
AND YEAR(aidFundMemberJoinTime) = YEAR(NOW())
|
||||
ORDER BY
|
||||
aidFundMemberJoinTime DESC
|
||||
""");
|
||||
List<NutMap> listMap = userService.listMap(sql);
|
||||
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
entityList.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
entityList.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
entityList.add(new ExcelExportEntity("会员类型", "aidFundMemberUserType", 20));
|
||||
entityList.add(new ExcelExportEntity("单位", "unitName", 20));
|
||||
entityList.add(new ExcelExportEntity("工会", "unionName", 20));
|
||||
entityList.add(new ExcelExportEntity("加入时间", "aidFundMemberJoinTime", 20));
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, listMap);
|
||||
CommonDownloadUtil.download(DateUtil.thisYear()+"年度新加入会员名单.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"medicalMutualAid.aidFund.retirementAudit", "h5.medicalMutualAid.aidFund.retirementAudit"}, mode = SaMode.OR)
|
||||
@ApiOperation("生成缴费名单")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "基金会员-基金会员台账", msg = "生成缴费名单")
|
||||
public Result createPayList(Integer year) {
|
||||
aidFundMemberService.createPayList(year);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"medicalMutualAid.aidFund.retirementAudit", "h5.medicalMutualAid.aidFund.retirementAudit"}, mode = SaMode.OR)
|
||||
@SLog(tag = "基金会员-基金会员台账", msg = "备份基金会员")
|
||||
@ApiOperation("备份基金会员")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result backupMember(Integer year) {
|
||||
aidFundMemberService.backupMember(year);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"medicalMutualAid.aidFund.retirementAudit", "h5.medicalMutualAid.aidFund.retirementAudit"}, mode = SaMode.OR)
|
||||
@SLog(tag = "基金会员-基金会员台账", msg = "批量设置退会")
|
||||
@ApiOperation("批量设置退会")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result batchExit(@Param("ids") String[] ids) {
|
||||
if (ObjectUtil.isEmpty(ids)) {
|
||||
return Result.error("请选择要退会的人员");
|
||||
}
|
||||
List<AidFundMemberChangeRecord> recordArrayList = new ArrayList<>();
|
||||
for (String id : ids) {
|
||||
AidFundMemberChangeRecord record = new AidFundMemberChangeRecord()
|
||||
.setUserId(id)
|
||||
.setApplyTime(new Date())
|
||||
.setChangeType("AIDFUND_MEMBER_CHANGE_TYPE_SEVEN");
|
||||
recordArrayList.add(record);
|
||||
}
|
||||
userService.update(Chain.make("aidFundMember", AidFundMemberMode.NONE.getCode())
|
||||
.add("aidFundMemberQuitTime", new Date()), Cnd.where("id", "in", ids));
|
||||
userService.insert(recordArrayList);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"medicalMutualAid.aidFund.retirementAudit", "h5.medicalMutualAid.aidFund.retirementAudit"}, mode = SaMode.OR)
|
||||
@SLog(tag = "基金会员-基金会员台账", msg = "修改基金会员类型")
|
||||
@ApiOperation("修改基金会员类型")
|
||||
public Result doEditAidFundMemberUserType(String userId, String aidFundMemberUserType) {
|
||||
userService.update(Chain.make("aidFundMemberUserType", aidFundMemberUserType), Cnd.where("id", "=", userId));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"medicalMutualAid.aidFund.retirementAudit", "h5.medicalMutualAid.aidFund.retirementAudit"}, mode = SaMode.OR)
|
||||
@SLog(tag = "基金会员-基金会员台账", msg = "更改基金会员状态")
|
||||
@ApiOperation("更改基金会员状态")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result doEditChangeType(String userId, String changeType) {
|
||||
|
||||
AidFundMemberChangeRecord record = new AidFundMemberChangeRecord()
|
||||
.setUserId(userId)
|
||||
.setApplyTime(new Date())
|
||||
.setChangeType(changeType);
|
||||
aidFundMemberService.insert(record);
|
||||
userService.update(Chain.make("aidFundMember", AidFundMemberMode.NONE.getCode())
|
||||
.add("aidFundMemberQuitTime", new Date()), Cnd.where("id", "=", userId));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
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/20
|
||||
* @since 1.0
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("aid_fund_member_history")
|
||||
@Comment("历史基金会员")
|
||||
public class AidFundMemberHistory extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("年份")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
private Integer year;
|
||||
|
||||
@Column
|
||||
@Comment("用户id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 120)
|
||||
private String loginname;
|
||||
|
||||
@Column
|
||||
@Comment("姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String username;
|
||||
|
||||
@Column
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 4)
|
||||
private String sex;
|
||||
|
||||
@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;
|
||||
|
||||
@Column
|
||||
@Comment("所在单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("所在单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 120)
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@Comment("所在工会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("所在工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 120)
|
||||
private String unionName;
|
||||
|
||||
}
|
||||
+10
-1
@@ -15,4 +15,13 @@ public class AidFundPageForm extends PageForm {
|
||||
private String aidFundMemberUserType;
|
||||
private String unionId;
|
||||
private String unitId;
|
||||
}
|
||||
//是否当年未缴费
|
||||
private Boolean notPayedCurrentYear;
|
||||
|
||||
//基金会员变更类型
|
||||
private String changeType;
|
||||
private Integer year;
|
||||
|
||||
//是否扣款null全部、1已缴费、0未缴费
|
||||
private Integer isPayed;
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
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.AidFundMemberHistory;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.param.AidFundPageForm;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
public interface AidFundMemberHistoryService extends BaseService<AidFundMemberHistory> {
|
||||
|
||||
Sql getSql(AidFundPageForm pageForm);
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
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.AidFundMemberPay;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.param.AidFundPageForm;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
public interface AidFundMemberPayService extends BaseService<AidFundMemberPay> {
|
||||
|
||||
|
||||
Sql getSql(AidFundPageForm pageForm);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
|
||||
public interface AidFundMemberService extends BaseService {
|
||||
|
||||
|
||||
/**
|
||||
* 生成缴费列表
|
||||
* @param year
|
||||
*/
|
||||
void createPayList(Integer year);
|
||||
|
||||
/**
|
||||
* 备份会员
|
||||
* @param year
|
||||
*/
|
||||
void backupMember(Integer year);
|
||||
|
||||
|
||||
/**
|
||||
* 获取缴费金额
|
||||
* @param user
|
||||
* @param year
|
||||
* @return
|
||||
*/
|
||||
Double getPayMoney(Sys_user user, Integer year);
|
||||
}
|
||||
+14
-14
@@ -50,12 +50,12 @@ public class AidFundMemberChangeRecordServiceImpl extends BaseServiceImpl<AidFun
|
||||
//如果是通过
|
||||
if (ObjectUtil.equals(args.getStr("changeType"), "AIDFUND_MEMBER_CHANGE_TYPE_ONE")) {
|
||||
//如果是加入基金
|
||||
dao().update(Sys_user.class, Chain.make("arrivalAtSchoolDate", args.getStr("arrivalAtSchoolDate"))
|
||||
dao().update(Sys_user.class, Chain.make("arrivalAtSchoolDate", args.getStr("arrivalAtSchoolDate")).add("aidFundMemberJoinTime", new Date())
|
||||
.add("aidFundMember", AidFundMemberMode.NORMAL.getCode()),
|
||||
Cnd.where(Sys_user::getId, "=", changeRecord.getUserId()));
|
||||
} else {
|
||||
//如果是加入基金
|
||||
dao().update(Sys_user.class, Chain.make("aidFundMember", AidFundMemberMode.NONE.getCode()),
|
||||
dao().update(Sys_user.class, Chain.make("aidFundMember", AidFundMemberMode.NONE.getCode())
|
||||
.add("aidFundMemberQuitTime", new Date()),
|
||||
Cnd.where(Sys_user::getId, "=", changeRecord.getUserId()));
|
||||
}
|
||||
}
|
||||
@@ -63,11 +63,11 @@ public class AidFundMemberChangeRecordServiceImpl extends BaseServiceImpl<AidFun
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPayMoney(String arrivalAtSchoolDate,String userId) {
|
||||
if (StrUtil.isBlank(userId)){
|
||||
userId=SecurityUtil.getUserId();
|
||||
public int getPayMoney(String arrivalAtSchoolDate, String userId) {
|
||||
if (StrUtil.isBlank(userId)) {
|
||||
userId = SecurityUtil.getUserId();
|
||||
}
|
||||
int money=0;
|
||||
int money = 0;
|
||||
int schoolYear = DateUtil.year(DateUtil.parse(arrivalAtSchoolDate));
|
||||
int applyYear = DateUtil.thisYear();
|
||||
|
||||
@@ -75,7 +75,7 @@ public class AidFundMemberChangeRecordServiceImpl extends BaseServiceImpl<AidFun
|
||||
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()));
|
||||
Sys_user oldUser = dao().fetch(Sys_user.class, Cnd.where(Sys_user::getLoginname, "=", user.getOldLoginName()));
|
||||
if (null != oldUser) {
|
||||
userIds.add(oldUser.getId());
|
||||
}
|
||||
@@ -83,13 +83,13 @@ public class AidFundMemberChangeRecordServiceImpl extends BaseServiceImpl<AidFun
|
||||
List<AidFundMemberPay> historyPays = dao().query(AidFundMemberPay.class, Cnd.where(AidFundMemberPay::getUserId, "in", userIds));
|
||||
if (CollectionUtil.isEmpty(historyPays)) {
|
||||
if (applyYear == schoolYear) {
|
||||
money=180;
|
||||
money = 180;
|
||||
} else if (schoolYear < 2015) {
|
||||
money=(applyYear - 2015 + 1) * (180 + 18) + 180;
|
||||
money = (applyYear - 2015 + 1) * (180 + 18) + 180;
|
||||
} else {
|
||||
//往年需要补的钱
|
||||
int oldMoney = (applyYear - schoolYear) * (180 + 18);
|
||||
money=oldMoney + 180;
|
||||
money = oldMoney + 180;
|
||||
}
|
||||
} else {
|
||||
//往年需要补的钱 拿到最近一年的缴费记录
|
||||
@@ -97,7 +97,7 @@ public class AidFundMemberChangeRecordServiceImpl extends BaseServiceImpl<AidFun
|
||||
Integer maxPayYear = maxYearPayRecord.getYear();
|
||||
|
||||
int oldMoney = (applyYear - maxPayYear) * (180 + 18);
|
||||
money=oldMoney + 180;
|
||||
money = oldMoney + 180;
|
||||
}
|
||||
|
||||
return money;
|
||||
@@ -105,8 +105,8 @@ public class AidFundMemberChangeRecordServiceImpl extends BaseServiceImpl<AidFun
|
||||
|
||||
@Override
|
||||
public List<AidFundMemberPay> getUserPayRecordList(String userId) {
|
||||
if (StrUtil.isBlank(userId)){
|
||||
userId=SecurityUtil.getUserId();
|
||||
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())) {
|
||||
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.model.AidFundMemberHistory;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.param.AidFundPageForm;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberHistoryService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/1/20 18:07
|
||||
* @description
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class AidFundMemberHistoryServiceImpl extends BaseServiceImpl<AidFundMemberHistory> implements AidFundMemberHistoryService {
|
||||
public AidFundMemberHistoryServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sql getSql(AidFundPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
hi.*,
|
||||
us.aidFundMemberJoinTime
|
||||
FROM
|
||||
`aid_fund_member_history` hi
|
||||
LEFT JOIN sys_user us ON us.id = hi.userId
|
||||
$condition
|
||||
""");
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())){
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("hi.loginname", pageForm.getSearchKeyword());
|
||||
group.orLike("hi.username", pageForm.getSearchKeyword());
|
||||
cnd.and(group);
|
||||
}
|
||||
cnd.andEX("hi.aidFundMemberUserType", "=", pageForm.getAidFundMemberUserType());
|
||||
cnd.andEX("hi.unitId", "=", pageForm.getUnitId());
|
||||
cnd.andEX("hi.unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("hi.year", "=", pageForm.getYear());
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("hi.unitName");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
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.model.AidFundMemberPay;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.param.AidFundPageForm;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberPayService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/1/20 15:04
|
||||
* @description
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class AidFundMemberPayServiceImpl extends BaseServiceImpl<AidFundMemberPay> implements AidFundMemberPayService {
|
||||
public AidFundMemberPayServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sql getSql(AidFundPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
pay.isPayed,
|
||||
pay.money,
|
||||
pay.year,
|
||||
pay.aidFundMemberUserType,
|
||||
pay.id,
|
||||
pay.userId,
|
||||
us.username,
|
||||
us.loginname,
|
||||
us.sex,
|
||||
us.unitName,
|
||||
us.unionName
|
||||
FROM
|
||||
`aid_fund_member_pay` pay
|
||||
LEFT JOIN vw_user us ON us.id = pay.userId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())){
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("us.loginname", pageForm.getSearchKeyword());
|
||||
group.orLike("us.username", pageForm.getSearchKeyword());
|
||||
cnd.and(group);
|
||||
}
|
||||
cnd.andEX("pay.aidFundMemberUserType", "=", pageForm.getAidFundMemberUserType());
|
||||
cnd.andEX("us.unitid", "=", pageForm.getUnitId());
|
||||
cnd.andEX("us.unionid", "=", pageForm.getUnionId());
|
||||
cnd.andEX("pay.year", "=", pageForm.getYear());
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
if (AuthUtil.hasRole(RoleConstant.RETIREMENT_WORKPLACE.name())) {
|
||||
// 离退休人员
|
||||
group.or("pay.aidFundMemberUserType", "=", "离退休人员");
|
||||
}
|
||||
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
|
||||
//分工会主席
|
||||
group.or("us.unionid", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.RETIREMENT_WORKPLACE.name(), RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
|
||||
// 非管理员
|
||||
cnd.andEX("pay.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
cnd.and(group);
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(pageForm.getIsPayed())){
|
||||
cnd.and("pay.isPayed", "=", pageForm.getIsPayed());
|
||||
}
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("us.unitCode");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.mode.AidFundMemberMode;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.model.AidFundMemberHistory;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.model.AidFundMemberPay;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.service.AidFundMemberService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/1/19 14:49
|
||||
* @description
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class AidFundMemberServiceImpl extends BaseServiceImpl implements AidFundMemberService {
|
||||
public AidFundMemberServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPayList(Integer year) {
|
||||
if (year > DateUtil.thisYear()) {
|
||||
//如果传过来的年大于本年,代表今年生成明年的数据
|
||||
year = Calendar.getInstance().get(Calendar.YEAR) + 1;
|
||||
} else {
|
||||
//否者就是生成本年的
|
||||
}
|
||||
|
||||
dao().clear(AidFundMemberPay.class, Cnd.where(AidFundMemberPay::getYear, "=", year));
|
||||
|
||||
List<Sys_user> aidFundMembers = dao().query(Sys_user.class, Cnd.where("aidFundMember", "=", AidFundMemberMode.NORMAL.getCode()));
|
||||
List<AidFundMemberPay> pays = new ArrayList<>();
|
||||
|
||||
for (Sys_user member : aidFundMembers) {
|
||||
AidFundMemberPay pay = new AidFundMemberPay()
|
||||
.setUserId(member.getId())
|
||||
.setMoney(getPayMoney(member, year - 1))
|
||||
.setYear(year)
|
||||
.setIsPayed(false)
|
||||
.setPersonType(member.getPersonType())
|
||||
.setAidFundMemberUserType(member.getAidFundMemberUserType())
|
||||
.setUserState(member.getUserState());
|
||||
pays.add(pay);
|
||||
}
|
||||
|
||||
dao().insert(pays);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backupMember(Integer year) {
|
||||
dao().clear(AidFundMemberHistory.class, Cnd.where(AidFundMemberHistory::getYear, "=", year));
|
||||
List<AidFundMemberHistory> historyMemberArrayList = new ArrayList<>();
|
||||
List<View_user> sysUserList = dao().query(View_user.class, Cnd.where(View_user::getAidFundMember, "=", AidFundMemberMode.NORMAL.getCode()));
|
||||
sysUserList.forEach(user -> {
|
||||
AidFundMemberHistory aidFundHistoryMember = new AidFundMemberHistory();
|
||||
aidFundHistoryMember.setYear(year);
|
||||
aidFundHistoryMember.setUserId(user.getId());
|
||||
aidFundHistoryMember.setLoginname(user.getLoginname());
|
||||
aidFundHistoryMember.setUsername(user.getUsername());
|
||||
aidFundHistoryMember.setSex(user.getSex());
|
||||
aidFundHistoryMember.setAidFundMemberUserType(user.getAidFundMemberUserType());
|
||||
aidFundHistoryMember.setPersonType(user.getPersonType());
|
||||
aidFundHistoryMember.setUserState(user.getUserState());
|
||||
aidFundHistoryMember.setUnitId(user.getUnitId());
|
||||
aidFundHistoryMember.setUnitName(user.getUnitName());
|
||||
aidFundHistoryMember.setUnionId(user.getUnionId());
|
||||
aidFundHistoryMember.setUnionName(user.getUnionName());
|
||||
historyMemberArrayList.add(aidFundHistoryMember);
|
||||
});
|
||||
insert(historyMemberArrayList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double getPayMoney(Sys_user user, Integer year) {
|
||||
Double money = 180.0;
|
||||
int critical = 2015;
|
||||
|
||||
Date joinTime = ObjectUtil.defaultIfNull(user.getAidFundMemberJoinTime(), DateUtil.date());
|
||||
int joinYear = DateUtil.year(joinTime);
|
||||
|
||||
if (joinYear < year) {
|
||||
return money;
|
||||
}
|
||||
|
||||
//退出过的话从退出的那年开始算
|
||||
Date quitTime = user.getAidFundMemberQuitTime();
|
||||
if (quitTime != null) {
|
||||
int quitYear = DateUtil.year(quitTime);
|
||||
return (year + 1 - quitYear) * money + (year - quitYear) * money * 0.1;
|
||||
}
|
||||
|
||||
String schoolTime = user.getArrivalAtSchoolDate();
|
||||
if (Strings.isBlank(schoolTime)) {
|
||||
return money;
|
||||
}
|
||||
|
||||
//TMD存的字符串
|
||||
//入校年份
|
||||
int schoolYear = Integer.parseInt(schoolTime.substring(0, 4));
|
||||
int beforeYear = Math.max(schoolYear, critical);
|
||||
if (schoolYear < 2015) {
|
||||
return (year + 1 - beforeYear + 1) * money + (year - beforeYear + 1) * money * 0.1;
|
||||
}
|
||||
return (year + 1 - beforeYear) * money + (year - beforeYear) * money * 0.1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.medicalMutualAid.aidFund.template;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2026/1/20 17:39
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
public class AidFundPayTemp {
|
||||
|
||||
@Excel(name = "工号")
|
||||
private String loginname;
|
||||
@Excel(name = "姓名")
|
||||
private String username;
|
||||
|
||||
String result;
|
||||
}
|
||||
Reference in New Issue
Block a user