女职工卫生费
This commit is contained in:
+33
-8
@@ -9,7 +9,10 @@ import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.dayofficework.cadreTraining.model.CadreTrainingAct;
|
||||
import com.budwk.app.zhgh.dayofficework.exerciseCard.vo.ExercisePeopleImportVo;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsBatch;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryProject;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryUser;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.service.WomanSanitaryProjectService;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.service.WomanSanitaryUserService;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.vo.WomanSanitaryUserImportVo;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -38,6 +41,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -56,6 +60,8 @@ public class WomanSanitaryManageController {
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private WomanSanitaryProjectService womanSanitaryProjectService;
|
||||
@Inject
|
||||
private WomanSanitaryUserService womanSanitaryUserService;
|
||||
|
||||
|
||||
@@ -78,7 +84,18 @@ public class WomanSanitaryManageController {
|
||||
String unionId,
|
||||
String unitId,
|
||||
String searchKeyword,
|
||||
String sex) {
|
||||
Boolean issue,
|
||||
String projectId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
project.projectName
|
||||
|
||||
FROM
|
||||
woman_sanitary_user info
|
||||
LEFT JOIN `woman_sanitary_project` project ON project.id = info.projectId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
// 年度查询条件
|
||||
cnd.andEX("year(applyTime)", "=", year);
|
||||
@@ -94,12 +111,12 @@ public class WomanSanitaryManageController {
|
||||
// 工会、单位名称查询条件
|
||||
cnd.andEX("unionId", "=", unionId);
|
||||
cnd.andEX("unitId", "=", unitId);
|
||||
|
||||
// 性别查询条件
|
||||
cnd.andEX("sex", "=", sex);
|
||||
cnd.andEX("info.projectId", "=", projectId);
|
||||
cnd.andEX("issue", "=", issue);
|
||||
|
||||
cnd.desc("applyTime");
|
||||
Pagination pagination = womanSanitaryUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = womanSanitaryUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@@ -113,6 +130,14 @@ public class WomanSanitaryManageController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询事项")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result selectList() {
|
||||
List<WomanSanitaryProject> list = womanSanitaryProjectService.query(Cnd.NEW().desc(WomanSanitaryProject::getCreatedAt));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"womanSanitary.manage", "h5.womanSanitary.manage"}, mode = SaMode.OR)
|
||||
public Result findOne(String id){
|
||||
@@ -174,10 +199,10 @@ public class WomanSanitaryManageController {
|
||||
@ApiOperation("导入人员")
|
||||
@SaCheckPermission("womanSanitary.manage")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Result importData(TempFile file, Boolean isFlag) {
|
||||
public Result importData(TempFile file,String businessId) {
|
||||
try {
|
||||
System.out.println(isFlag);
|
||||
NutMap nutMap = womanSanitaryUserService.handlingMemberImport(file, isFlag);
|
||||
|
||||
NutMap nutMap = womanSanitaryUserService.handlingMemberImport(file, businessId);
|
||||
if (Lang.isNotEmpty(nutMap)) {
|
||||
return Result.success(nutMap);
|
||||
}
|
||||
|
||||
+95
-10
@@ -1,23 +1,28 @@
|
||||
package com.budwk.app.zhgh.dayofficework.womanSanitary.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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.CommonDownloadUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.cadreTraining.model.CadreTrainingAct;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryProject;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryUser;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.service.WomanSanitaryProjectService;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.service.WomanSanitaryUserService;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.vo.WomanSanitaryUserExportVo;
|
||||
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.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;
|
||||
@@ -25,7 +30,9 @@ import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -59,15 +66,46 @@ public class WomanSanitaryQueryController {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页")
|
||||
@ApiOperation("人员分页")
|
||||
@SaCheckPermission(value = {"womanSanitary.query", "h5.womanSanitary.query"}, mode = SaMode.OR)
|
||||
public Result pageData(@Valid PageForm pageForm, Integer year) {
|
||||
public Result pageData(@Valid PageForm pageForm,
|
||||
Integer year,
|
||||
String unionId,
|
||||
String unitId,
|
||||
String searchKeyword,
|
||||
Boolean issue,
|
||||
String projectId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
project.projectName
|
||||
|
||||
FROM
|
||||
woman_sanitary_user info
|
||||
LEFT JOIN `woman_sanitary_project` project ON project.id = info.projectId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("year", "=", year);
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
cnd.and(Cnd.likeEX("projectName", pageForm.getSearchKeyword()));
|
||||
// 年度查询条件
|
||||
cnd.andEX("year(applyTime)", "=", year);
|
||||
|
||||
// 姓名和工号查询条件
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("userName", "%" + searchKeyword + "%");
|
||||
seg.orLike("loginName", "%" + searchKeyword + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
Pagination pagination = womanSanitaryUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
|
||||
// 工会、单位名称查询条件
|
||||
cnd.andEX("unionId", "=", unionId);
|
||||
cnd.andEX("unitId", "=", unitId);
|
||||
cnd.andEX("info.projectId", "=", projectId);
|
||||
cnd.andEX("issue", "=", issue);
|
||||
|
||||
cnd.desc("applyTime");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = womanSanitaryUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@@ -82,4 +120,51 @@ public class WomanSanitaryQueryController {
|
||||
dao.clear(CadreTrainingAct.class, Cnd.where(CadreTrainingAct::getId, "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission(value = {"womanSanitary.query", "h5.womanSanitary.query"}, mode = SaMode.OR)
|
||||
@ApiOperation("导出女职工卫生费统计表")
|
||||
public void onExport(@Param(value = "projectId") String projectId,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "searchKeyword") String searchKeyword,
|
||||
@Param(value = "sex") String sex,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "issue") Boolean issue,
|
||||
HttpServletResponse response) {
|
||||
//查询审核通过的数据
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
project.projectName
|
||||
FROM
|
||||
woman_sanitary_user info
|
||||
LEFT JOIN `woman_sanitary_project` project ON project.id = info.projectId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
// 姓名和工号查询条件
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("userName", "%" + searchKeyword + "%");
|
||||
seg.orLike("loginName", "%" + searchKeyword + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("year(applyTime)", "=", year);
|
||||
cnd.andEX("unionId", "=", unionId);
|
||||
cnd.andEX("unitId", "=", unitId);
|
||||
cnd.andEX("info.projectId", "=", projectId);
|
||||
cnd.andEX("issue", "=", issue);
|
||||
|
||||
cnd.desc("info.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
List<WomanSanitaryUserExportVo> list = womanSanitaryUserService.listVO(sql, WomanSanitaryUserExportVo.class);
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, WomanSanitaryUserExportVo.class, list);
|
||||
CommonDownloadUtil.download("女职工卫生费统计表.xlsx", workbook, response);
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -31,11 +31,6 @@ public class WomanSanitaryUser extends BaseModel implements Serializable {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String projectId;
|
||||
|
||||
@Column
|
||||
@Comment("项目名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String projectName;
|
||||
|
||||
@Column
|
||||
@Comment("userid")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
|
||||
+1
-2
@@ -10,7 +10,6 @@ public interface WomanSanitaryUserService extends BaseService<WomanSanitaryUser>
|
||||
/**
|
||||
* 导入会员数据处理
|
||||
* @param file 文件
|
||||
* @param isFlag 是否清空更新
|
||||
*/
|
||||
NutMap handlingMemberImport(TempFile file, Boolean isFlag);
|
||||
NutMap handlingMemberImport(TempFile file, String projectId);
|
||||
}
|
||||
|
||||
+3
-2
@@ -52,7 +52,7 @@ public class WomanSanitaryUserServiceImpl extends BaseServiceImpl<WomanSanitaryU
|
||||
// 修改导入部分的代码
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@Override
|
||||
public NutMap handlingMemberImport(TempFile file, Boolean isFlag) {
|
||||
public NutMap handlingMemberImport(TempFile file,String projectId ) {
|
||||
// 修改1: 使用正确的VO类
|
||||
List<T> ts = EasyExcelUtil.syncReadModel(file.getFile(), WomanSanitaryUserImportVo.class, 0, 1);
|
||||
List<WomanSanitaryUserImportVo> list = JSONUtil.parseArray(JSONUtil.toJsonStr(ts)).toList(WomanSanitaryUserImportVo.class);
|
||||
@@ -129,6 +129,7 @@ public class WomanSanitaryUserServiceImpl extends BaseServiceImpl<WomanSanitaryU
|
||||
womanUser.setLoginName(v.getLoginName());
|
||||
womanUser.setApplyTime(new Date()); // 设置当前时间为申请时间
|
||||
womanUser.setIssue(false);
|
||||
womanUser.setProjectId(projectId);
|
||||
|
||||
if (v.getMoney() != null) {
|
||||
try {
|
||||
@@ -159,7 +160,7 @@ public class WomanSanitaryUserServiceImpl extends BaseServiceImpl<WomanSanitaryU
|
||||
nutMap.setv("successCount", Math.max(list.size() - errorInfos.size(), 0));
|
||||
nutMap.setv("errorCount", errorInfos.size());
|
||||
nutMap.setv("errorList", errorInfos.stream().map(v -> {
|
||||
return NutMap.NEW().addv("工号", v.getLoginName()).addv("姓名", v.getUsername()).addv("错误原因", v.getErrorInfo());
|
||||
return NutMap.NEW().addv("工号", v.getLoginName()).addv("姓名", v.getUserName()).addv("错误原因", v.getErrorInfo());
|
||||
}).collect(Collectors.toList()));
|
||||
return nutMap;
|
||||
}
|
||||
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package com.budwk.app.zhgh.dayofficework.womanSanitary.vo;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author hongqiwei
|
||||
* @name:WomanSanitaryUserImportVo
|
||||
* @Date 2025/11/3 13:56
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
public class WomanSanitaryUserExportVo {
|
||||
|
||||
@Excel(name = "工号", width = 20)
|
||||
private String loginName;
|
||||
|
||||
@Excel(name = "姓名", width = 20)
|
||||
private String userName;
|
||||
|
||||
@Excel(name = "性别", width = 20)
|
||||
private String sex;
|
||||
|
||||
@Excel(name = "事项", width = 20)
|
||||
private String projectName;
|
||||
|
||||
@Excel(name = "分工会", width = 20)
|
||||
private String unionName;
|
||||
|
||||
@Excel(name = "单位", width = 20)
|
||||
private String unitName;
|
||||
|
||||
@Excel(name = "电话", width = 20)
|
||||
private String mobile;
|
||||
|
||||
@Excel(name = "发放金额", width = 20)
|
||||
private Double money;
|
||||
|
||||
@Excel(name = "是否发放", width = 20)
|
||||
private String issueDisplay;
|
||||
|
||||
@Excel(name = "申请时间", width = 20, format = "yyyy-MM-dd")
|
||||
private String applyTime;
|
||||
|
||||
@ExcelIgnore
|
||||
private Boolean issue;
|
||||
|
||||
|
||||
// 添加getter方法用于自动计算显示值
|
||||
public String getIssueDisplay() {
|
||||
if (this.issue == null) {
|
||||
return "未发放";
|
||||
}
|
||||
return this.issue ? "已发放" : "未发放";
|
||||
}
|
||||
|
||||
public void setIssue(Boolean issue) {
|
||||
this.issue = issue;
|
||||
}
|
||||
|
||||
}
|
||||
+3
-3
@@ -11,8 +11,8 @@ import lombok.EqualsAndHashCode;
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author hongqiwei
|
||||
* @name:ExercisePeopleImportVo
|
||||
* @Date 2025/10/14 10:04
|
||||
* @name:WomanSanitaryUserImportVo
|
||||
* @Date 2025/11/13 14:04
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
@@ -26,7 +26,7 @@ public class WomanSanitaryUserImportVo {
|
||||
private String loginName;
|
||||
|
||||
@ExcelProperty("姓名")
|
||||
private String username;
|
||||
private String userName;
|
||||
|
||||
@ExcelProperty("性别")
|
||||
private String sex;
|
||||
|
||||
+9
-7
@@ -126,28 +126,30 @@ public class MutualInsuranceCollectController {
|
||||
public void onExport(@Param(value = "projectId") String projectId,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "userName") String userName,
|
||||
@Param(value = "searchKeyword") String searchKeyword,
|
||||
@Param(value = "sex") String sex,
|
||||
HttpServletResponse response) {
|
||||
//查询审核通过的数据
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.state instanceState
|
||||
info.*
|
||||
FROM
|
||||
mutual_insurance_user_info info
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(userName)) {
|
||||
cnd.and("info.userName", "like", "%" + userName + "%");
|
||||
// 姓名和工号查询条件
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("info.userName", "%" + searchKeyword + "%");
|
||||
seg.orLike("info.loginName", "%" + searchKeyword + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("info.projectId", "=", projectId);
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
cnd.andEX("info.sex", "=", sex);
|
||||
cnd.and("ins.state", "=", 20);
|
||||
|
||||
|
||||
cnd.desc("info.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Reference in New Issue
Block a user