diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/cadreTraining/controller/CadreTrainingSignUpController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/cadreTraining/controller/CadreTrainingSignUpController.java index 604a2745..115f5810 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/cadreTraining/controller/CadreTrainingSignUpController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/cadreTraining/controller/CadreTrainingSignUpController.java @@ -32,6 +32,7 @@ import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; import javax.validation.Valid; +import java.util.Date; import java.util.List; @IocBean @@ -80,7 +81,7 @@ public class CadreTrainingSignUpController { @ApiOperation("提交申请") @SaCheckPermission(value = {"cadreTraining.branchUnionSignUp", "h5.cadreTraining.branchUnionSignUp"}, mode = SaMode.OR) public Result submit(@Param("data") CadreTrainingSignUp cadreTrainingSignUp) { - if (StrUtil.isBlank(cadreTrainingSignUp.getId())) cadreTrainingSignUp.setApplyTime(DateUtil.now()); + if (StrUtil.isBlank(cadreTrainingSignUp.getId())) cadreTrainingSignUp.setApplyTime(new Date()); dao.insertOrUpdate(cadreTrainingSignUp); // 开启流程实例 diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/cadreTraining/model/CadreTrainingSignUp.java b/src/main/java/com/budwk/app/zhgh/dayofficework/cadreTraining/model/CadreTrainingSignUp.java index 5d49f5af..53b53730 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/cadreTraining/model/CadreTrainingSignUp.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/cadreTraining/model/CadreTrainingSignUp.java @@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode; import org.nutz.dao.entity.annotation.*; import org.nutz.dao.interceptor.annotation.PrevInsert; +import java.util.Date; import java.util.List; @Data @@ -80,8 +81,8 @@ public class CadreTrainingSignUp extends BaseModel { @Column @Comment("报名时间") - @ColDefine(type = ColType.VARCHAR, width = 100) - private String applyTime; + @ColDefine(type = ColType.DATETIME) + private Date applyTime; @Column @Comment("备注") diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/controller/ExerciseCardApplyController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/controller/ExerciseCardApplyController.java new file mode 100644 index 00000000..0340018b --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/controller/ExerciseCardApplyController.java @@ -0,0 +1,116 @@ +package com.budwk.app.zhgh.dayofficework.exerciseCard.controller; + +import cn.dev33.satoken.annotation.SaCheckLogin; +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +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.result.Result; +import com.budwk.app.base.service.BaseService; +import com.budwk.app.web.commons.auth.utils.AuthUtil; +import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.zhgh.dayofficework.exerciseCard.model.ExerciseCard; +import com.budwk.app.zhgh.dayofficework.exerciseCard.service.ExerciseCardService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +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.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.lang.Strings; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; +import org.nutz.mvc.annotation.Param; + +import java.util.Date; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2025/10/13 15:00 + */ + +@IocBean +@At("/platform/exerciseCard/apply") +@Api("健身卡-信息填报") +@Ok("json:full") +@Slf4j +public class ExerciseCardApplyController { + + @Inject + private Dao dao; + @Inject + private BaseService baseService; + @Inject + private ExerciseCardService exerciseCardService; + + @At("/index") + @Ok("beetl:/platform/zhgh/dayofficework/exerciseCard/apply/index.html") + @SaCheckPermission("exerciseCard.apply") + public void index() { + } + + @At + @ApiOperation("保存申请") + @SaCheckPermission(value = {"exerciseCard.apply", "h5.exerciseCard.apply"}, mode = SaMode.OR) + @SLog(tag = "健身卡-信息填报", msg = "保存信息填报") + public Result save(@Param("data") ExerciseCard exerciseCard) { + if (StrUtil.isBlank(exerciseCard.getId())) exerciseCard.setApplyTime(new Date()); + dao.insertOrUpdate(exerciseCard); + return Result.success(); + } + + @At + @SaCheckLogin + public Result findOne(String id) { + return Result.success(baseService.dao().fetch(ExerciseCard.class, id)); + } + + @At + @ApiOperation("获取受助人") + @SaCheckPermission("exerciseCard.apply") + public Result queryUsers(String key){ + Sql sql = Sqls.create(""" + SELECT + id, + loginname, + username, + birthday, + mobile, + sex, + unitName, + unionName, + unionId, + unitId + FROM + `vw_user` + $condition + """); + Cnd cnd = Cnd.NEW(); + + if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) { + if (AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_OPERATOR.name())) { + cnd.and("unionId", "=", SecurityUtil.getUnionId()); + } else { + cnd.and("id", "=", SecurityUtil.getUserId()); + } + } + if (Strings.isNotBlank(key)) { + SqlExpressionGroup group = new SqlExpressionGroup(); + group.orLike("username", key); + group.orLike("loginname", key); + cnd.and(group); + } + sql.setCondition(cnd); + Pagination pagination = exerciseCardService.listPageMap(1, 10, sql); + return Result.success().addData(pagination.getList()); + } + +} + diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/controller/ExerciseCardQueryController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/controller/ExerciseCardQueryController.java new file mode 100644 index 00000000..94ec92b1 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/controller/ExerciseCardQueryController.java @@ -0,0 +1,145 @@ +package com.budwk.app.zhgh.dayofficework.exerciseCard.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.EasyExcel; +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.zhgh.dayofficework.exerciseCard.service.ExerciseCardService; +import com.budwk.app.zhgh.dayofficework.exerciseCard.vo.ExercisePeopleImportVo; +import com.budwk.app.zhgh.staffbenefit.maternityLeave.service.MaternityLeaveService; +import com.budwk.app.zhgh.staffmanage.member.vo.MemberImportVo; +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.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.annotation.Param; +import org.nutz.mvc.upload.TempFile; +import org.nutz.mvc.upload.UploadAdaptor; + +import javax.servlet.http.HttpServletResponse; +import java.net.URLEncoder; +import java.util.ArrayList; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2025/10/13 15:11 + */ + +@IocBean +@At("/platform/exerciseCard/query") +@Api("查询条件") +@Ok("json:full") +@Slf4j +public class ExerciseCardQueryController { + + @Inject + private Dao dao; + @Inject + private ExerciseCardService exerciseCardService; + + @At("/index") + @Ok("beetl:/platform/zhgh/dayofficework/exerciseCard/query/index.html") + @SaCheckPermission("exerciseCard.query") + public void index() { + } + + @At + @ApiOperation("分页查询") + @SaCheckPermission(value = {"exerciseCard.query", "h5.exerciseCard.query"}, mode = SaMode.OR) + public Result pageData(PageForm pageForm, + Integer year, + String unionId, + String unitId, + String searchKeyword, + String sex) { + Cnd cnd = Cnd.NEW(); + // 年度查询条件 + cnd.andEX("year(applyTime)", "=", year); + + // 姓名和工号查询条件 + if (StrUtil.isNotBlank(searchKeyword)) { + SqlExpressionGroup seg = new SqlExpressionGroup(); + seg.orLike("userName", "%" + searchKeyword + "%"); + seg.orLike("loginName", "%" + searchKeyword + "%"); + cnd.and(seg); + } + + // 工会、单位名称查询条件 + cnd.andEX("unionId", "=", unionId); + cnd.andEX("unitId", "=", unitId); + + // 性别查询条件 + cnd.andEX("sex", "=", sex); + + cnd.desc("applyTime"); + Pagination pagination = exerciseCardService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd); + return Result.success(pagination); + } + @At + @ApiOperation("删除") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission(value = {"exerciseCard.query", "h5.exerciseCard.query"}, mode = SaMode.OR) + @SLog( tag = "删除工会报销", msg = "删除工会报销") + public Result delete(@Param("id") String id) { + exerciseCardService.delete(id); + return Result.success(); + } + + @At + @Ok("void") + @ApiOperation("导入模板下载") + @SaCheckPermission("exerciseCard.query") + public void downloadTemplate(HttpServletResponse response) { + try { + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setCharacterEncoding("utf-8"); + String fileName = URLEncoder.encode("人员导入模版", "UTF-8").replaceAll("\\+", "%20"); + response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); + EasyExcel.write(response.getOutputStream(), ExercisePeopleImportVo.class) + .sheet("人员导入模版") + .doWrite(ArrayList::new); + } catch (Exception e) { + throw new RuntimeException("导出失败"); + } + } + + + + @At + @Aop(TransAop.READ_COMMITTED) + @ApiOperation("导入人员") + @SaCheckPermission("exerciseCard.query") + @AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"}) + public Result importData(TempFile file, Boolean isFlag) { + try { + System.out.println(isFlag); + NutMap nutMap = exerciseCardService.handlingMemberImport(file, isFlag); + if (Lang.isNotEmpty(nutMap)) { + return Result.success(nutMap); + } + return Result.success("导入成功"); + } catch (Exception e) { + e.printStackTrace(); + return Result.error(); + } + } +} + diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/model/ExerciseCard.java b/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/model/ExerciseCard.java new file mode 100644 index 00000000..903baa63 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/model/ExerciseCard.java @@ -0,0 +1,99 @@ +package com.budwk.app.zhgh.dayofficework.exerciseCard.model; + +import cn.hutool.json.JSONObject; +import com.budwk.app.base.model.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.nutz.dao.entity.annotation.*; +import org.nutz.dao.interceptor.annotation.PrevInsert; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2025/10/13 14:39 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@Table("exercise_card") +@TableMeta("{'mysql-charset':'utf8mb4'}") +@Comment("健身卡") +public class ExerciseCard extends BaseModel implements Serializable { + + @Name + @Comment("id") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) + private String id; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 32) + @Comment("userId") + private String userId; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 32) + @Comment("姓名") + private String userName; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 32) + @Comment("性别") + private String sex; + + @Column + @ColDefine(type = ColType.DATE) + @Comment("出生年月") + private Date birthday; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 32) + @Comment("工号") + private String loginName; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 32) + @Comment("所在工会Id") + private String unionId; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("所在工会") + private String unionName; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 32) + @Comment("所在单位Id") + private String unitId; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("所在单位") + private String unitName; + + @Column + @Comment("初始额度") + @ColDefine(type = ColType.FLOAT, width = 10, precision = 2) + private Double initMoney; + + @Column + @Comment("当前额度") + @ColDefine(type = ColType.FLOAT, width = 10, precision = 2) + private Double money; + + @Column + @Comment("健身卡使用情况记录") + @ColDefine(type = ColType.MYSQL_JSON) + private List usages; + + @Column + @ColDefine(type = ColType.DATETIME) + @Comment("录入时间") + private Date applyTime; + +} + diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/service/ExerciseCardService.java b/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/service/ExerciseCardService.java new file mode 100644 index 00000000..470b47c3 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/service/ExerciseCardService.java @@ -0,0 +1,16 @@ +package com.budwk.app.zhgh.dayofficework.exerciseCard.service; + +import com.budwk.app.base.service.BaseService; +import com.budwk.app.zhgh.dayofficework.exerciseCard.model.ExerciseCard; +import org.nutz.lang.util.NutMap; +import org.nutz.mvc.upload.TempFile; + + +public interface ExerciseCardService extends BaseService { + /** + * 导入会员数据处理 + * @param file 文件 + * @param isFlag 是否清空更新 + */ + NutMap handlingMemberImport(TempFile file, Boolean isFlag); +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/service/impl/ExerciseCardServiceImpl.java b/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/service/impl/ExerciseCardServiceImpl.java new file mode 100644 index 00000000..2fb27427 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/service/impl/ExerciseCardServiceImpl.java @@ -0,0 +1,178 @@ +package com.budwk.app.zhgh.dayofficework.exerciseCard.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; +import com.budwk.app.base.service.impl.BaseServiceImpl; +import com.budwk.app.base.utils.EasyExcelUtil; +import com.budwk.app.base.utils.ManyAddOrRenewUtil; +import com.budwk.app.sys.models.Sys_user; +import com.budwk.app.zhgh.dayofficework.exerciseCard.model.ExerciseCard; +import com.budwk.app.zhgh.dayofficework.exerciseCard.service.ExerciseCardService; +import com.budwk.app.zhgh.dayofficework.exerciseCard.vo.ExercisePeopleImportVo; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.formula.functions.T; +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.lang.Lang; +import org.nutz.lang.random.R; +import org.nutz.lang.util.NutMap; +import org.nutz.mvc.upload.TempFile; +import org.nutz.dao.entity.Record; + +import java.util.Date; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2025/10/13 15:19 + */ + +@Slf4j +@IocBean(args = {"refer:dao"}) +public class ExerciseCardServiceImpl extends BaseServiceImpl implements ExerciseCardService { + + @Inject + private ManyAddOrRenewUtil manyAddOrRenewUtil; + + public ExerciseCardServiceImpl(Dao dao) {super(dao);} + + @Aop(TransAop.READ_COMMITTED) + @Override + public NutMap handlingMemberImport(TempFile file, Boolean isFlag) { + List ts = EasyExcelUtil.syncReadModel(file.getFile(), ExercisePeopleImportVo.class, 0, 1); + List list = JSONUtil.parseArray(JSONUtil.toJsonStr(ts)).toList(ExercisePeopleImportVo.class); + + // 获取系统用户 + Cnd cnd = Cnd.NEW(); + List dataUserList = dao().query(Sys_user.class, cnd); + Map userMap = dataUserList.stream().collect(Collectors.toMap(Sys_user::getLoginname, v -> v)); + + Sql vwUserSql = Sqls.create(""" + SELECT + id, + loginname, + username, + birthday, + mobile, + sex, + unitName, + unionName, + unionId, + unitId + FROM + `vw_user` + """); + vwUserSql.setCallback(Sqls.callback.records()); + dao().execute(vwUserSql); + List vwUserList = vwUserSql.getList(Record.class); + Map vwUserMap = vwUserList.stream().collect(Collectors.toMap(r -> r.getString("loginname"), r -> r)); + + List exerciseCardList = new ArrayList<>(); + List insertOrUpdateUserList = new ArrayList<>(); + + //返回错误记录 + List errorInfos = new ArrayList<>(); + + for (ExercisePeopleImportVo v : list) { + if (StrUtil.isNotBlank(v.getLoginName())) { + v.setLoginName(v.getLoginName().trim()); + } else { + v.setErrorInfo("工号不能为空!"); + errorInfos.add(v); + continue; + } + + //判断是否在系统中 + Sys_user user = userMap.get(v.getLoginName()); + + if (user == null) { + v.setErrorInfo("该人员没有录入系统中!"); + errorInfos.add(v); + continue; + } + //设置excel列的数据 + user.setUsername(v.getUsername()); + if (StrUtil.isNotBlank(v.getSex())) { + user.setSex(v.getSex()); + } + + insertOrUpdateUserList.add(user); + + // 创建运动卡记录并设置用户详细信息 + ExerciseCard exerciseCard = new ExerciseCard(); + exerciseCard.setId(R.UU32()); + + // 根据工号查询vw_user视图,设置人员信息 + Record vwUser = vwUserMap.get(v.getLoginName()); + if (vwUser != null) { + exerciseCard.setUserId(vwUser.getString("id")); + exerciseCard.setBirthday(DateUtil.parse(vwUser.getString("birthday"), "yyyy-MM-dd")); + exerciseCard.setUnionId(vwUser.getString("unionId")); + exerciseCard.setUnitId(vwUser.getString("unitId")); + exerciseCard.setSex(vwUser.getString("sex")); + exerciseCard.setUnionName(vwUser.getString("unionName")); + exerciseCard.setUnitName(vwUser.getString("unitName")); + } + + // 设置其他基本信息 + exerciseCard.setLoginName(v.getLoginName()); + exerciseCard.setUserName(v.getUsername()); + exerciseCard.setApplyTime(new Date()); // 设置当前时间为申请时间 + + // 设置额度信息 + if (v.getInitMoney() != null) { + try { + exerciseCard.setInitMoney(Double.valueOf(v.getInitMoney())); + } catch (NumberFormatException e) { + v.setErrorInfo("初始额度格式错误!"); + errorInfos.add(v); + continue; + } + } + if (v.getMoney() != null) { + try { + exerciseCard.setMoney(Double.valueOf(v.getMoney())); + } catch (NumberFormatException e) { + v.setErrorInfo("当前额度格式错误!"); + errorInfos.add(v); + continue; + } + } + + exerciseCardList.add(exerciseCard); + } + + if (Lang.isNotEmpty(insertOrUpdateUserList)) { + manyAddOrRenewUtil.asyncExecuteInsertOrUpdate(insertOrUpdateUserList,200); + + // 批量保存运动卡记录 + if (Lang.isNotEmpty(exerciseCardList)) { + manyAddOrRenewUtil.asyncExecuteInsert(exerciseCardList,200); + } + } + + //如果有错误数据就返回给前端 + if (Lang.isNotEmpty(errorInfos)) { + NutMap nutMap = NutMap.NEW(); + nutMap.setv("totalCount", list.size()); + 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()); + }).collect(Collectors.toList())); + return nutMap; + } + return null; + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/vo/ExercisePeopleImportVo.java b/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/vo/ExercisePeopleImportVo.java new file mode 100644 index 00000000..087f5d37 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/exerciseCard/vo/ExercisePeopleImportVo.java @@ -0,0 +1,50 @@ +package com.budwk.app.zhgh.dayofficework.exerciseCard.vo; + +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:ExercisePeopleImportVo + * @Date 2025/10/14 10:04 + * @注释 + */ +@Data +@EqualsAndHashCode +@ContentRowHeight(20) // 内容行高 +@HeadRowHeight(20) // 表头行高 +@ColumnWidth(25) //列宽 +public class ExercisePeopleImportVo { + + @ExcelProperty("工号") + private String loginName; + + @ExcelProperty("姓名") + private String username; + + @ExcelProperty("性别") + private String sex; + + @ExcelProperty("工会") + private String unionName; + + @ExcelProperty("单位") + private String unitName; + + @ExcelProperty("初始额度") + private Double initMoney; + + @ExcelProperty("当前额度") + private Double money; + + + @ExcelIgnore + private String errorInfo; + +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/controller/RetireSouvenirsBatchController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/controller/RetireSouvenirsBatchController.java new file mode 100644 index 00000000..9ce322cb --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/controller/RetireSouvenirsBatchController.java @@ -0,0 +1,216 @@ +package com.budwk.app.zhgh.dayofficework.retiresouvenirs.controller; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; +import com.budwk.app.base.annotation.SLog; +import com.budwk.app.base.model.ExcelImportRes; +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.EasyExcelUtil; +import com.budwk.app.sys.views.View_user; +import com.budwk.app.zhgh.dayofficework.healthCheckup.template.HealthCheckupImportTemp; +import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsBatch; +import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsLedger; +import com.budwk.app.zhgh.dayofficework.retiresouvenirs.service.RetireSouvenirsBatchService; +import com.budwk.app.zhgh.dayofficework.retiresouvenirs.template.RetireSouvenirsImportTemp; +import io.swagger.annotations.ApiOperation; +import org.apache.poi.ss.formula.functions.T; +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.ioc.aop.Aop; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.lang.Strings; +import org.nutz.mvc.annotation.AdaptBy; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; +import org.nutz.mvc.annotation.Param; +import org.nutz.mvc.upload.TempFile; +import org.nutz.mvc.upload.UploadAdaptor; + +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @ClassName RetireSouvenirsBatchController + * @Author JyuHsin + * @Date 2025/10/14 9:51 + * @Version 1.0 + * @Description TODO + */ +@IocBean +@Ok("json:full") +@ApiOperation("批次管理") +@At("/platform/retireSouvenirs/batch") +public class RetireSouvenirsBatchController { + + @Inject + private Dao dao; + @Inject + private RetireSouvenirsBatchService batchService; + + @At("") + @Ok("beetl:/platform/zhgh/dayofficework/retiresouvenirs/batch/index.html") + @SaCheckPermission("retireSouvenirs.batch") + public void index() { + } + + @At + @ApiOperation("分页查询") + @SaCheckPermission("retireSouvenirs.batch") + public Result pageData(PageForm pageForm, + @Param(value = "year") Integer year) { + Sql sql = Sqls.create(""" + select + b.*, + u.username as userName, + (select count(1) from retire_souvenirs_ledger where batchId = b.id) as count + from + retire_souvenirs_batch b + left join vw_user u on u.id = b .createdBy + $condition + """); + Cnd cnd = Cnd.NEW(); + + cnd.andEX("b.year", "=", year); + cnd.and(Cnd.likeEX("b.name", pageForm.getSearchKeyword())); + + sql.setCondition(cnd); + Pagination pagination = batchService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } + + @At + @ApiOperation("新增/修改批次") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("retireSouvenirs.batch") + @SLog(tag = "退休人员纪念品-批次管理", msg = "新增/修改批次") + public Result submit(RetireSouvenirsBatch batch) { + batchService.insertOrUpdate(batch); + return Result.success(); + } + + @At + @ApiOperation("删除批次") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("retireSouvenirs.batch") + @SLog(tag = "退休人员纪念品-批次管理", msg = "删除批次") + public Result delete(String id) { + batchService.delete(id); + batchService.dao().clear(RetireSouvenirsLedger.class, Cnd.where(RetireSouvenirsLedger::getBatchId, "=", id)); + return Result.success(); + } + + @At + @ApiOperation("查询批次") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("retireSouvenirs") + public Result selectList() { + List list = batchService.query(Cnd.NEW().desc(RetireSouvenirsBatch::getCreatedAt)); + return Result.success(list); + } + + @At + @Ok("void") + @ApiOperation("下载人员名单导入模版") + @SaCheckPermission("retireSouvenirs.batch") + public void downloadTem(HttpServletResponse response) { + List entities = new ArrayList<>(); + entities.add(new ExcelExportEntity("工号", "loginName", 20)); + entities.add(new ExcelExportEntity("姓名", "userName", 20)); + entities.add(new ExcelExportEntity("退休时间", "retireTime", 20)); + ExportParams exportParams = new ExportParams(); + Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, Collections.emptyList()); + CommonDownloadUtil.download("退休人员名单导入模版.xlsx", workbook, response); + } + + @At + @ApiOperation("退休人员名单导入") + @SLog(tag = "退休人员纪念品-批次管理", msg = "人员名单导入") + @SaCheckPermission("retireSouvenirs.batch") + @Aop(TransAop.READ_COMMITTED) + @AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"}) + public Result temImport(TempFile file, String batchId, String type) { + + if(StrUtil.isBlank(batchId)) { + return Result.error("批次信息为空"); + } + if("clear".equals(type)) { + dao.clear(RetireSouvenirsLedger.class, Cnd.where(RetireSouvenirsLedger::getBatchId, "=", batchId)); + } + + List ts = EasyExcelUtil.syncReadModel(file.getFile(), RetireSouvenirsImportTemp.class, 0, 1); + List importTemps = JSONUtil.parseArray(JSONUtil.toJsonStr(ts)).toList(RetireSouvenirsImportTemp.class); + + List loginNames = importTemps.stream().map(RetireSouvenirsImportTemp::getLoginName).filter(Strings::isNotBlank).toList(); + List userList = dao.query(View_user.class, Cnd.where(View_user::getLoginname, "in", loginNames)); + Map userMap = userList.stream().collect(Collectors.toMap(View_user::getLoginname, o -> o)); + + String[] patterns = { + "yyyy-MM-dd", + "yyyy/MM/dd", + "yyyy-MM", + "yyyy/MM", + "yyyyMM", + "yyyyMMdd", + "yyyy年MM月dd日", + "yyyy年M月d日" + }; + + List result = new ArrayList<>(); + for (int i = 0; i < importTemps.size(); i++) { + RetireSouvenirsImportTemp temp = importTemps.get(i); + + if (StrUtil.isBlank(temp.getLoginName())) { + temp.setErrInfo("工号为空", i + 1); + continue; + } + if (importTemps.stream().filter(s -> s.getLoginName().equals(temp.getLoginName())).count() > 1) { + temp.setErrInfo("重复数据", i + 1); + } + View_user user = userMap.get(temp.getLoginName()); + if (user == null) { + temp.setErrInfo("无此用户", i + 1); + continue; + } + + DateTime retireTime = DateUtil.parse(temp.getRetireTime(), patterns); + String format = DateUtil.format(retireTime, DatePattern.NORM_DATE_PATTERN); + + RetireSouvenirsLedger ledger = new RetireSouvenirsLedger(); + ledger.setBatchId(batchId); + ledger.setUserId(user.getId()); + ledger.setReceive(false); + ledger.setRetireTime(format); + result.add(ledger); + } + + dao.insert(result); + // 创建结果集 + ExcelImportRes excelImportRes = new ExcelImportRes<>(); + excelImportRes.setTotalRecords(importTemps.size()); + excelImportRes.setSuccessCount(Math.max(result.size() - excelImportRes.getFailedCount(), 0)); + // 添加错误记录 + excelImportRes.setErrorDetails(importTemps.stream().filter(s -> StrUtil.isNotBlank(s.getErrMsg())).toList()); + excelImportRes.setFailedCount(excelImportRes.getErrorDetails().size()); + + return Result.success(excelImportRes); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/controller/RetireSouvenirsLedgerController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/controller/RetireSouvenirsLedgerController.java new file mode 100644 index 00000000..b56112d2 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/controller/RetireSouvenirsLedgerController.java @@ -0,0 +1,227 @@ +package com.budwk.app.zhgh.dayofficework.retiresouvenirs.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 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.CommonDownloadUtil; +import com.budwk.app.base.utils.PageUtil; +import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.zhgh.dayofficework.message.service.GlobalMessageSendService; +import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsLedger; +import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsMsg; +import com.budwk.app.zhgh.dayofficework.retiresouvenirs.service.RetireSouvenirsLedgerService; +import com.budwk.app.zhgh.dayofficework.retiresouvenirs.vo.RetireSouvenirsLedgerPageForm; +import io.swagger.annotations.ApiOperation; +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.entity.annotation.SQL; +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.List; + +/** + * @ClassName RetireSouvenirsLedgerController + * @Author JyuHsin + * @Date 2025/10/14 9:52 + * @Version 1.0 + * @Description TODO + */ +@IocBean +@Ok("json:full") +@ApiOperation("人员台账") +@At("/platform/retireSouvenirs/ledger") +public class RetireSouvenirsLedgerController { + + @Inject + private Dao dao; + @Inject + private RetireSouvenirsLedgerService ledgerService; + @Inject + private GlobalMessageSendService sendService; + + @At("") + @Ok("beetl:/platform/zhgh/dayofficework/retiresouvenirs/ledger/index.html") + @SaCheckPermission("retireSouvenirs.ledger") + public void index() { + } + + @At + @ApiOperation("分页查询") + @SaCheckPermission("retireSouvenirs.ledger") + public Result pageData(RetireSouvenirsLedgerPageForm pageForm) { + Sql sql = this.generateSql(pageForm); + Pagination pagination = ledgerService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } + + @At + @ApiOperation("删除人员") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("retireSouvenirs.ledger") + @SLog(tag = "退休人员纪念品-人员台账", msg = "删除人员") + public Result delete(String id) { + ledgerService.delete(id); + return Result.success(); + } + + @At + @ApiOperation("设置领取状态") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("retireSouvenirs.ledger") + @SLog(tag = "退休人员纪念品-人员台账", msg = "设置领取状态") + public Result receive(String id) { + RetireSouvenirsLedger ledger = ledgerService.fetch(id); + ledger.setReceive(!ledger.getReceive()); + ledgerService.update(ledger); + return Result.success(); + } + + @At + @ApiOperation("短信提醒") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("retireSouvenirs.ledger") + @SLog(tag = "退休人员纪念品-人员台账", msg = "短信提醒") + public Result msg(@Param(value = "pageForm") RetireSouvenirsLedgerPageForm pageForm, + @Param(value = "message") String message) { + Sql sql = this.generateSql(pageForm); + List listMap = ledgerService.listMap(sql); + + List msgList = listMap.stream().map(o -> { + RetireSouvenirsMsg msg = new RetireSouvenirsMsg(); + msg.setBatchId(pageForm.getBatchId()); + msg.setUserId(o.getString("userId")); + msg.setSendUserId(SecurityUtil.getUserId()); + msg.setSendUserName(SecurityUtil.getUserUsername()); + msg.setMessage(message); + msg.setSendTime(DateUtil.now()); + return msg; + }).toList(); + List list = listMap.stream().map(o -> o.getString("loginName")).toList(); + + sendService.sendMessage("智慧工会", message, list); + dao.insert(msgList); + return Result.success(); + } + + @At + @ApiOperation("查询短信发送记录") + @SaCheckPermission("retireSouvenirs.ledger") + public Result selectMsgList(String batchId, String userId) { + Cnd cnd = Cnd.NEW(); + cnd.and(RetireSouvenirsMsg::getBatchId, "=", batchId); + cnd.and(RetireSouvenirsMsg::getUserId, "=", userId); + cnd.desc(RetireSouvenirsMsg::getSendTime); + List list = dao.query(RetireSouvenirsMsg.class, cnd); + return Result.success(list); + } + + @At + @ApiOperation("删除短信发送记录") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("retireSouvenirs.ledger") + @SLog(tag = "退休人员纪念品-人员台账", msg = "删除短信发送记录") + public Result deleteMsg(String id) { + dao.delete(RetireSouvenirsMsg.class, id); + return Result.success(); + } + + @At + @Ok("void") + @SaCheckPermission("retireSouvenirs.ledger") + @ApiOperation("导出退休人员名单") + public void download(RetireSouvenirsLedgerPageForm pageForm, + HttpServletResponse response) { + Sql sql = this.generateSql(pageForm); + List listMap = ledgerService.listMap(sql); + + List exportEntities = new ArrayList<>(); + exportEntities.add(new ExcelExportEntity("姓名", "userName", 16)); + exportEntities.add(new ExcelExportEntity("工号", "loginName", 16)); + exportEntities.add(new ExcelExportEntity("性别", "sex", 10)); + exportEntities.add(new ExcelExportEntity("联系方式", "mobile", 20)); + exportEntities.add(new ExcelExportEntity("所属单位", "unitName", 30)); + exportEntities.add(new ExcelExportEntity("所属工会", "unionName", 30)); + exportEntities.add(new ExcelExportEntity("退休时间", "retireTimeFormat", 20)); + exportEntities.add(new ExcelExportEntity("是否领取", "receiveStatus", 10)); + exportEntities.add(new ExcelExportEntity("签字", "sign", 20)); + + try { + ExportParams exportParams = new ExportParams(); + exportParams.setType(ExcelType.XSSF); + Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, listMap); + CommonDownloadUtil.download("退休人员名单台账.xlsx", workbook, response); + } catch (Exception e) { + e.printStackTrace(); + } + } + + private Sql generateSql(RetireSouvenirsLedgerPageForm pageForm) { + Sql sql = Sqls.create(""" + SELECT + l.*, + u.userName, + u.loginName, + u.sex, + u.mobile, + u.unitName, + u.unionName, + if(l.receive = true, '已领取', '未领取') as receiveStatus, + DATE_FORMAT(l.retireTime, '%Y-%m') as retireTimeFormat, + (select count(1) from retire_souvenirs_msg where batchId = l.batchId and userId = l.userId) as msgCount + FROM + retire_souvenirs_ledger l + LEFT JOIN vw_user u ON u.id = l.userId + $condition + """); + Cnd cnd = Cnd.NEW(); + + cnd.andEX("l.batchId", "=", pageForm.getBatchId()); + cnd.andEX("year(l.retireTime)", "=", pageForm.getYear()); + if("prev".equals(pageForm.getSelectTime())) { + String time = DateUtil.thisYear() + "-" + String.format("%02d", pageForm.getMonth()) + "-01"; + cnd.andEX("l.retireTime", "<", time); + } else { + cnd.andEX("month(l.retireTime)", "=", pageForm.getMonth()); + } + cnd.andEX("u.unitId", "=", pageForm.getUnitId()); + cnd.andEX("u.unionId", "=", pageForm.getUnionId()); + cnd.andEX("l.receive", "=", pageForm.getReceive()); + + if(StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + SqlExpressionGroup group = new SqlExpressionGroup(); + group.orLike("u.userName", pageForm.getSearchKeyword()); + group.orLike("u.loginName", pageForm.getSearchKeyword()); + cnd.and(group); + } + + if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { + cnd.asc("l.receive").asc("l.retireTime"); + } else { + cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); + } + + sql.setCondition(cnd); + return sql; + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/model/RetireSouvenirsBatch.java b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/model/RetireSouvenirsBatch.java new file mode 100644 index 00000000..33e0c996 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/model/RetireSouvenirsBatch.java @@ -0,0 +1,43 @@ +package com.budwk.app.zhgh.dayofficework.retiresouvenirs.model; + +import com.budwk.app.base.model.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.nutz.dao.entity.annotation.*; +import org.nutz.dao.interceptor.annotation.PrevInsert; + +/** + * @ClassName RetireSouvenirsBatch + * @Author JyuHsin + * @Date 2025/10/14 9:52 + * @Version 1.0 + * @Description 退休人员纪念品批次管理 + */ +@Data +@Table +@Comment("退休人员纪念品-批次管理") +@EqualsAndHashCode(callSuper = true) +public class RetireSouvenirsBatch extends BaseModel { + + @Name + @Column + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) + private String id; + + @Column + @Comment("年度") + @ColDefine(type = ColType.INT) + private Integer year; + + @Column + @Comment("批次名称") + @ColDefine(type = ColType.VARCHAR, width = 100) + private String name; + + @Column + @Comment("备注") + @ColDefine(type = ColType.VARCHAR, width = 600) + private String remark; +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/model/RetireSouvenirsLedger.java b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/model/RetireSouvenirsLedger.java new file mode 100644 index 00000000..2a74d722 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/model/RetireSouvenirsLedger.java @@ -0,0 +1,54 @@ +package com.budwk.app.zhgh.dayofficework.retiresouvenirs.model; + +import com.budwk.app.base.model.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.nutz.dao.entity.annotation.*; +import org.nutz.dao.interceptor.annotation.PrevInsert; + +/** + * @ClassName RetireSouvenirsLedger + * @Author JyuHsin + * @Date 2025/10/14 9:52 + * @Version 1.0 + * @Description 退休人员纪念品人员台账管理 + */ +@Data +@Table +@Comment("退休人员纪念品-人员台账") +@EqualsAndHashCode(callSuper = true) +public class RetireSouvenirsLedger extends BaseModel { + + @Name + @Column + @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 batchId; + + @Column + @Comment("人员Id") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String userId; + + @Column + @Comment("退休时间") + @ColDefine(type = ColType.VARCHAR, width = 30) + private String retireTime; + + @Column + @Comment("是否领取") + @ColDefine(type = ColType.BOOLEAN) + @Default("0") + private Boolean receive; + + @Column + @Comment("领取时间") + @ColDefine(type = ColType.VARCHAR, width = 30) + private String receiveTime; +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/model/RetireSouvenirsMsg.java b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/model/RetireSouvenirsMsg.java new file mode 100644 index 00000000..633d11ff --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/model/RetireSouvenirsMsg.java @@ -0,0 +1,58 @@ +package com.budwk.app.zhgh.dayofficework.retiresouvenirs.model; + +import com.budwk.app.base.model.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.nutz.dao.entity.annotation.*; +import org.nutz.dao.interceptor.annotation.PrevInsert; + +/** + * @ClassName RetireSouvenirsMsg + * @Author JyuHsin + * @Date 2025/10/15 10:03 + * @Version 1.0 + * @Description TODO + */ +@Data +@Table +@Comment("退休人员纪念品-短信发送记录") +@EqualsAndHashCode(callSuper = true) +public class RetireSouvenirsMsg extends BaseModel { + + @Name + @Column + @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 batchId; + + @Column + @Comment("人员Id") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String userId; + + @Column + @Comment("发送人") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String sendUserId; + + @Column + @Comment("发送人姓名") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String sendUserName; + + @Column + @Comment("发送内容") + @ColDefine(type = ColType.VARCHAR, width = 600) + private String message; + + @Column + @Comment("发送时间") + @ColDefine(type = ColType.VARCHAR, width = 30) + private String sendTime; +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/service/RetireSouvenirsBatchService.java b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/service/RetireSouvenirsBatchService.java new file mode 100644 index 00000000..e9ed96a4 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/service/RetireSouvenirsBatchService.java @@ -0,0 +1,14 @@ +package com.budwk.app.zhgh.dayofficework.retiresouvenirs.service; + +import com.budwk.app.base.service.BaseService; +import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsBatch; + +/** + * @ClassName RetireSouvenirsBatchService + * @Author JyuHsin + * @Date 2025/10/14 14:22 + * @Version 1.0 + * @Description TODO + */ +public interface RetireSouvenirsBatchService extends BaseService { +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/service/RetireSouvenirsLedgerService.java b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/service/RetireSouvenirsLedgerService.java new file mode 100644 index 00000000..e83cdfe8 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/service/RetireSouvenirsLedgerService.java @@ -0,0 +1,14 @@ +package com.budwk.app.zhgh.dayofficework.retiresouvenirs.service; + +import com.budwk.app.base.service.BaseService; +import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsLedger; + +/** + * @ClassName RetireSouvenirsLedgerService + * @Author JyuHsin + * @Date 2025/10/14 14:22 + * @Version 1.0 + * @Description TODO + */ +public interface RetireSouvenirsLedgerService extends BaseService { +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/service/impl/RetireSouvenirsBatchServiceImpl.java b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/service/impl/RetireSouvenirsBatchServiceImpl.java new file mode 100644 index 00000000..9a4ecea3 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/service/impl/RetireSouvenirsBatchServiceImpl.java @@ -0,0 +1,22 @@ +package com.budwk.app.zhgh.dayofficework.retiresouvenirs.service.impl; + +import com.budwk.app.base.service.impl.BaseServiceImpl; +import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsBatch; +import com.budwk.app.zhgh.dayofficework.retiresouvenirs.service.RetireSouvenirsBatchService; +import org.nutz.dao.Dao; +import org.nutz.ioc.loader.annotation.IocBean; + +/** + * @ClassName RetireSouvenirsBatchServiceImpl + * @Author JyuHsin + * @Date 2025/10/14 14:22 + * @Version 1.0 + * @Description TODO + */ +@IocBean(args = {"refer:dao"}) +public class RetireSouvenirsBatchServiceImpl extends BaseServiceImpl implements RetireSouvenirsBatchService { + + public RetireSouvenirsBatchServiceImpl(Dao dao) { + super(dao); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/service/impl/RetireSouvenirsLedgerServiceImpl.java b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/service/impl/RetireSouvenirsLedgerServiceImpl.java new file mode 100644 index 00000000..85ab4bb7 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/service/impl/RetireSouvenirsLedgerServiceImpl.java @@ -0,0 +1,22 @@ +package com.budwk.app.zhgh.dayofficework.retiresouvenirs.service.impl; + +import com.budwk.app.base.service.impl.BaseServiceImpl; +import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsLedger; +import com.budwk.app.zhgh.dayofficework.retiresouvenirs.service.RetireSouvenirsLedgerService; +import org.nutz.dao.Dao; +import org.nutz.ioc.loader.annotation.IocBean; + +/** + * @ClassName RetireSouvenirsLedgerServiceImpl + * @Author JyuHsin + * @Date 2025/10/14 14:23 + * @Version 1.0 + * @Description TODO + */ +@IocBean(args = {"refer:dao"}) +public class RetireSouvenirsLedgerServiceImpl extends BaseServiceImpl implements RetireSouvenirsLedgerService { + + public RetireSouvenirsLedgerServiceImpl(Dao dao) { + super(dao); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/template/RetireSouvenirsImportTemp.java b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/template/RetireSouvenirsImportTemp.java new file mode 100644 index 00000000..1af8d967 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/template/RetireSouvenirsImportTemp.java @@ -0,0 +1,33 @@ +package com.budwk.app.zhgh.dayofficework.retiresouvenirs.template; + +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 com.budwk.app.base.model.ExcelImportError; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @ClassName RetireSouvenirsImportTemp + * @Author JyuHsin + * @Date 2025/10/14 15:21 + * @Version 1.0 + * @Description TODO + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ContentRowHeight(20) +@HeadRowHeight(20) +@ColumnWidth(25) +public class RetireSouvenirsImportTemp extends ExcelImportError { + + @ExcelProperty("工号" ) + private String loginName; + + @ExcelProperty("姓名") + private String userName; + + @ExcelProperty("退休时间") + private String retireTime; +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/vo/RetireSouvenirsLedgerPageForm.java b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/vo/RetireSouvenirsLedgerPageForm.java new file mode 100644 index 00000000..88ce264b --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/retiresouvenirs/vo/RetireSouvenirsLedgerPageForm.java @@ -0,0 +1,23 @@ +package com.budwk.app.zhgh.dayofficework.retiresouvenirs.vo; + +import com.budwk.app.base.param.PageForm; +import lombok.Data; + +/** + * @ClassName RetireSouvenirsLedgerPageForm + * @Author JyuHsin + * @Date 2025/10/15 9:52 + * @Version 1.0 + * @Description TODO + */ +@Data +public class RetireSouvenirsLedgerPageForm extends PageForm { + + private String batchId; + private Integer year; + private Integer month; + private String unitId; + private String unionId; + private String selectTime; + private Boolean receive; +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseApplyController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseApplyController.java index 9269b096..711ee84c 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseApplyController.java @@ -84,7 +84,7 @@ public class UnionReimburseApplyController { @SaCheckPermission(value = {"unionReimburse.apply", "h5.unionReimburse.apply"}, mode = SaMode.OR) @SLog(type = "unionReimburse", tag = "工会报销-报销申请", msg = "保存报销申请") public Result save(@Param("data") UnionReimburse unionReimburse) { - if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(DateUtil.now()); + if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(new Date()); dao.insertOrUpdate(unionReimburse); return Result.success(); } @@ -93,7 +93,7 @@ public class UnionReimburseApplyController { @ApiOperation("提交申请") @SaCheckPermission(value = {"unionReimburse.apply", "h5.unionReimburse.apply"}, mode = SaMode.OR) public Result submit(@Param("data") UnionReimburse unionReimburse) { - if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(DateUtil.now()); + if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(new Date()); dao.insertOrUpdate(unionReimburse); // 开启流程实例 @@ -115,7 +115,7 @@ public class UnionReimburseApplyController { @Aop(TransAop.READ_COMMITTED) @SaCheckPermission(value = {"unionReimburse.apply", "h5.unionReimburse.apply"}, mode = SaMode.OR) public Result submitAgain(@Param("data") UnionReimburse unionReimburse, @Param("taskId") Long taskId) { - if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(DateUtil.now()); + if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(new Date()); dao.insertOrUpdate(unionReimburse); diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseCollectController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseCollectController.java index 939e2b28..4e8d21a0 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseCollectController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseCollectController.java @@ -24,6 +24,7 @@ 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.Inject; import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.lang.util.NutMap; @@ -71,7 +72,7 @@ public class UnionReimburseCollectController { @Param(value = "unionId") String unionId, @Param(value = "unitId") String unitId, @Param(value = "reimburseProject") String reimburseProject, - @Param(value = "userName") String userName) { + @Param(value = "userName") String searchKeyword) { Sql sql = Sqls.create(""" SELECT info.*, @@ -108,9 +109,12 @@ public class UnionReimburseCollectController { // 报销项目查询条件 cnd.andEX("info.reimburseProject", "=", reimburseProject); - // 经办人姓名查询条件 - 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); } // 只查询流程实例状态为20的数据(已完成状态) diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseMineController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseMineController.java index 894c4810..2a0a54e9 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseMineController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseMineController.java @@ -18,6 +18,7 @@ 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; @@ -61,11 +62,11 @@ public class UnionReimburseMineController { @ApiOperation("分页查询") @SaCheckPermission(value = {"unionReimburse.mine", "h5.unionReimburse.mine"}, mode = SaMode.OR) public Result pageData(PageForm pageForm, - @Param(value = "year") Integer year, - @Param(value = "unionId") String unionId, - @Param(value = "unitId") String unitId, - @Param(value = "reimburseProject") String reimburseProject, - @Param(value = "userName") String userName) { + Integer year, + String unionId, + String unitId, + String reimburseProject, + String searchKeyword) { Sql sql = Sqls.create(""" SELECT info.*, @@ -102,9 +103,12 @@ public class UnionReimburseMineController { // 报销项目查询条件 cnd.andEX("info.reimburseProject", "=", reimburseProject); - // 经办人姓名查询条件 - 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.desc("info.createTime"); cnd.and("info.userId", "=", SecurityUtil.getUserId()); diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseReviewController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseReviewController.java index 1fc76ddf..fc05c745 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseReviewController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/controller/UnionReimburseReviewController.java @@ -18,6 +18,7 @@ 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; @@ -57,7 +58,7 @@ public class UnionReimburseReviewController { String unionId, String unitId, String reimburseProject, - String userName) { + String searchKeyword) { Sql sql = Sqls.create(""" SELECT info.*, @@ -106,9 +107,12 @@ public class UnionReimburseReviewController { cnd.andEX("info.reimburseProject", "=", reimburseProject); - // 经办人姓名查询条件 - 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); } if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { cnd.desc("info.createTime"); diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/interceptor/UnionReimburseFundSourceInterceptor.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/interceptor/UnionReimburseFundSourceInterceptor.java index f46a612a..58b3c7be 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/interceptor/UnionReimburseFundSourceInterceptor.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/interceptor/UnionReimburseFundSourceInterceptor.java @@ -50,7 +50,7 @@ public class UnionReimburseFundSourceInterceptor implements FlowInterceptor { detail.setAdjustReason(unionReimburse.getReimburseProject()); detail.setProjectName(unionReimburse.getActivityName()); detail.setActivityNumber(unionReimburse.getActivityNumber()); - detail.setActivityTime(unionReimburse.getCreateTime()); + detail.setActivityTime(String.valueOf(unionReimburse.getCreateTime())); detail.setOutlayManageId(outlayManageSchool.getId()); dao.insert(detail); @@ -74,7 +74,7 @@ public class UnionReimburseFundSourceInterceptor implements FlowInterceptor { detail.setAdjustReason(unionReimburse.getReimburseProject()); detail.setProjectName(unionReimburse.getActivityName()); detail.setActivityNumber(unionReimburse.getActivityNumber()); - detail.setActivityTime(unionReimburse.getCreateTime()); + detail.setActivityTime(String.valueOf(unionReimburse.getCreateTime())); detail.setOutlayManageId(outlayManageUnion.getId()); dao.insert(detail); @@ -98,7 +98,7 @@ public class UnionReimburseFundSourceInterceptor implements FlowInterceptor { detail.setAdjustReason(unionReimburse.getReimburseProject()); detail.setProjectName(unionReimburse.getActivityName()); detail.setActivityNumber(unionReimburse.getActivityNumber()); - detail.setActivityTime(unionReimburse.getCreateTime()); + detail.setActivityTime(String.valueOf(unionReimburse.getCreateTime())); detail.setOutlayManageId(outlayManageClub.getId()); dao.insert(detail); diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/model/UnionReimburse.java b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/model/UnionReimburse.java index 1785783c..04bc72c3 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/model/UnionReimburse.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/unionReimburse/model/UnionReimburse.java @@ -172,7 +172,7 @@ public class UnionReimburse extends BaseModel { @Column @Comment("慰问时间") - @ColDefine(type = ColType.DATETIME, width = 30) + @ColDefine(type = ColType.DATETIME) private Date condolenceTime; @@ -198,7 +198,7 @@ public class UnionReimburse extends BaseModel { @Column @Comment("活动时间") - @ColDefine(type = ColType.DATETIME, width = 30) + @ColDefine(type = ColType.DATETIME) private Date activityTime; @Column @@ -222,7 +222,7 @@ public class UnionReimburse extends BaseModel { @Column @Comment("申请时间") - @ColDefine(type = ColType.VARCHAR, width = 30) - private String createTime; + @ColDefine(type = ColType.DATETIME) + private Date createTime; } diff --git a/src/main/java/com/budwk/app/zhgh/democratic/suggestionBox/controller/SuggestionBoxQueryController.java b/src/main/java/com/budwk/app/zhgh/democratic/suggestionBox/controller/SuggestionBoxQueryController.java index f065bb65..1213feb9 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/suggestionBox/controller/SuggestionBoxQueryController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/suggestionBox/controller/SuggestionBoxQueryController.java @@ -1,5 +1,6 @@ package com.budwk.app.zhgh.democratic.suggestionBox.controller; +import cn.dev33.satoken.annotation.SaCheckLogin; import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaMode; import cn.hutool.core.util.StrUtil; @@ -52,7 +53,12 @@ public class SuggestionBoxQueryController { @At @SaCheckPermission(value = {"suggestionBox.query", "h5.suggestionBox.query"}, mode = SaMode.OR) - public Result pageData(Integer pageNumber, Integer pageSize, String searchKeyword, Integer year, String unionId, String unitId) { + public Result pageData(Integer pageNumber, + Integer pageSize, + String searchKeyword, + String unionId, + String unitId, + Integer year) { Sql sql = Sqls.create(""" SELECT info.id, @@ -90,8 +96,11 @@ public class SuggestionBoxQueryController { if (StrUtil.isNotBlank(searchKeyword)) { cnd.where().andLike("info.title", searchKeyword); } - cnd.and("info.unionId", "=", unionId); - cnd.and("info.unitId", "=", unitId); + // 工会、单位名称查询条件 + cnd.andEX("unionId", "=", unionId); + cnd.andEX("unitId", "=", unitId); + // 只查询流程实例状态为20的数据(已完成状态) + cnd.and("ins.state", "=", 20); cnd.desc("info.submitTime"); sql.setCondition(cnd); Pagination pagination = suggestionBoxService.listPageMap(pageNumber, pageSize, sql); diff --git a/src/main/java/com/budwk/app/zhgh/democratic/suggestionBox/controller/SuggestionXghController.java b/src/main/java/com/budwk/app/zhgh/democratic/suggestionBox/controller/SuggestionXghController.java index e4a80c86..2a864f3d 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/suggestionBox/controller/SuggestionXghController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/suggestionBox/controller/SuggestionXghController.java @@ -15,6 +15,7 @@ import io.swagger.annotations.ApiOperation; 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; @@ -51,7 +52,13 @@ public class SuggestionXghController { @At @SaCheckPermission(value = {"suggestionBox.xgh", "h5.suggestionBox.xgh"}, mode = SaMode.OR) - public Result pageData(PageForm pageForm, String taskId, String searchKeyword, Integer year, String unionId, String unitId, boolean approval) { + public Result pageData(PageForm pageForm, + String taskId, + String searchKeyword, + Integer year, + String unionId, + String unitId, + boolean approval) { Sql sql = Sqls.create(""" SELECT info.id, @@ -102,8 +109,9 @@ public class SuggestionXghController { cnd.where().andLike("info.title", searchKeyword); } - cnd.and("info.unionId", "=", unionId); - cnd.and("info.unitId", "=", unitId); + // 工会、单位名称查询条件 + cnd.andEX("unionId", "=", unionId); + cnd.andEX("unitId", "=", unitId); if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { cnd.desc("info.submitTime"); diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/controller/DsznfmtxCollectController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/controller/DsznfmtxCollectController.java index e1789f38..b20a3f1c 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/controller/DsznfmtxCollectController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/controller/DsznfmtxCollectController.java @@ -23,6 +23,7 @@ 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; @@ -70,7 +71,7 @@ public class DsznfmtxCollectController { Integer year, String unionId, String unitId, - String userName, + String searchKeyword, String sex) { Sql sql = Sqls.create(""" SELECT @@ -109,9 +110,12 @@ public class DsznfmtxCollectController { // 性别查询条件 cnd.andEX("info.sex", "=", sex); - // 姓名查询条件 - 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); } // 只查询流程实例状态为20的数据(已完成状态) diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/controller/DsznfmtxSchoolAuditController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/controller/DsznfmtxSchoolAuditController.java index ad275b7c..cad610d0 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/controller/DsznfmtxSchoolAuditController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/controller/DsznfmtxSchoolAuditController.java @@ -16,6 +16,7 @@ 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; @@ -59,7 +60,7 @@ public class DsznfmtxSchoolAuditController { Integer year, String unionId, String unitId, - String userName, + String searchKeyword, String sex) { Sql sql = Sqls.create(""" SELECT @@ -108,9 +109,12 @@ public class DsznfmtxSchoolAuditController { // 性别查询条件 cnd.andEX("info.sex", "=", sex); - // 姓名查询条件 - 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); } if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { cnd.desc("info.applyTime"); diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/controller/DsznfmtxUnionAuditController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/controller/DsznfmtxUnionAuditController.java index d7aab081..1c8838b3 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/controller/DsznfmtxUnionAuditController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/controller/DsznfmtxUnionAuditController.java @@ -16,6 +16,7 @@ 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; @@ -59,7 +60,7 @@ public class DsznfmtxUnionAuditController { Integer year, String unionId, String unitId, - String userName, + String searchKeyword, String sex) { Sql sql = Sqls.create(""" SELECT @@ -108,9 +109,12 @@ public class DsznfmtxUnionAuditController { // 性别查询条件 cnd.andEX("info.sex", "=", sex); - // 姓名查询条件 - 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); } if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { cnd.desc("info.applyTime"); diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/models/Dsznfmtx.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/models/Dsznfmtx.java index 4f230fdc..aa5370c1 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/models/Dsznfmtx.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/dsznfmtx/models/Dsznfmtx.java @@ -6,6 +6,7 @@ import com.budwk.app.base.model.BaseModel; import lombok.Data; import lombok.EqualsAndHashCode; import org.nutz.dao.entity.annotation.*; +import org.nutz.dao.interceptor.annotation.PrevInsert; import java.io.Serializable; import java.util.Date; @@ -24,11 +25,10 @@ import java.util.List; @Comment("独生子女父母退休") public class Dsznfmtx extends BaseModel implements Serializable { - @Column @Name @Comment("id") @ColDefine(type = ColType.VARCHAR, width = 32) - @Prev(els = {@EL("uuid()")}) + @PrevInsert(uu32 = true) private String id; @Column @@ -47,7 +47,7 @@ public class Dsznfmtx extends BaseModel implements Serializable { private String sex; @Column - @ColDefine(type = ColType.DATETIME, width = 30) + @ColDefine(type = ColType.DATE) @Comment("出生年月") private Date birthday; @@ -77,7 +77,7 @@ public class Dsznfmtx extends BaseModel implements Serializable { private String unitName; @Column - @ColDefine(type = ColType.DATETIME, width = 30) + @ColDefine(type = ColType.DATE) @Comment("退休时间") private Date retireTime; @@ -97,17 +97,17 @@ public class Dsznfmtx extends BaseModel implements Serializable { private String loverUnitName; @Column - @ColDefine(type = ColType.DATETIME, width = 30) + @ColDefine(type = ColType.DATE) @Comment("结婚日期") private Date marryTime; @Column - @ColDefine(type = ColType.DATETIME, width = 30) + @ColDefine(type = ColType.DATE) @Comment("子女出生日期") private Date childrenBirthday; @Column - @ColDefine(type = ColType.DATETIME, width = 30) + @ColDefine(type = ColType.DATE) @Comment("领独生子女证时间") private Date getCertificateTime; @@ -117,7 +117,7 @@ public class Dsznfmtx extends BaseModel implements Serializable { private String bonus; @Column - @ColDefine(type = ColType.DATETIME,width = 50) + @ColDefine(type = ColType.DATETIME) @Comment("申请时间") private Date applyTime; diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveCollectController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveCollectController.java index 743fa988..1dbdff00 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveCollectController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveCollectController.java @@ -24,6 +24,7 @@ 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; @@ -66,12 +67,12 @@ public class MaternityLeaveCollectController { @At @ApiOperation("分页查询") - @SaCheckPermission(value = {"unionReimburse.collect", "h5.unionReimburse.collect"}, mode = SaMode.OR) + @SaCheckPermission(value = {"maternityLeave.collect", "h5.maternityLeave.collect"}, mode = SaMode.OR) public Result pageData(PageForm pageForm, Integer year, String unionId, String unitId, - String userName, + String searchKeyword, String sex) { Sql sql = Sqls.create(""" SELECT @@ -110,9 +111,12 @@ public class MaternityLeaveCollectController { // 性别查询条件 cnd.andEX("info.sex", "=", sex); - // 姓名查询条件 - 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); } // 只查询流程实例状态为20的数据(已完成状态) diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveSchoolAuditController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveSchoolAuditController.java index 471f0376..4187092b 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveSchoolAuditController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveSchoolAuditController.java @@ -16,6 +16,7 @@ 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; @@ -59,7 +60,7 @@ public class MaternityLeaveSchoolAuditController { Integer year, String unionId, String unitId, - String userName, + String searchKeyword, String sex) { Sql sql = Sqls.create(""" SELECT @@ -108,9 +109,12 @@ public class MaternityLeaveSchoolAuditController { // 性别查询条件 cnd.andEX("info.sex", "=", sex); - // 姓名查询条件 - 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); } if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { cnd.desc("info.applyTime"); diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveUnionAuditController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveUnionAuditController.java index 7e99c34e..3b2c7b63 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveUnionAuditController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveUnionAuditController.java @@ -16,6 +16,7 @@ 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; @@ -59,7 +60,7 @@ public class MaternityLeaveUnionAuditController { Integer year, String unionId, String unitId, - String userName, + String searchKeyword, String sex) { Sql sql = Sqls.create(""" SELECT @@ -108,9 +109,12 @@ public class MaternityLeaveUnionAuditController { // 性别查询条件 cnd.andEX("info.sex", "=", sex); - // 姓名查询条件 - 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); } if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { cnd.desc("info.applyTime"); diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/models/MaternityLeave.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/models/MaternityLeave.java index 78868b40..4befb2ba 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/models/MaternityLeave.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/models/MaternityLeave.java @@ -1,9 +1,11 @@ package com.budwk.app.zhgh.staffbenefit.maternityLeave.models; +import com.aspose.slides.internal.og.all; import com.budwk.app.base.model.BaseModel; import lombok.Data; import lombok.EqualsAndHashCode; import org.nutz.dao.entity.annotation.*; +import org.nutz.dao.interceptor.annotation.PrevInsert; import java.io.Serializable; import java.util.Date; @@ -21,11 +23,10 @@ import java.util.Date; @Comment("生育休假") public class MaternityLeave extends BaseModel implements Serializable { - @Column @Name @Comment("id") @ColDefine(type = ColType.VARCHAR, width = 32) - @Prev(els = {@EL("uuid()")}) + @PrevInsert(uu32 = true) private String id; @Column @@ -49,7 +50,7 @@ public class MaternityLeave extends BaseModel implements Serializable { private String nation; @Column - @ColDefine(type = ColType.DATETIME, width = 30) + @ColDefine(type = ColType.DATE) @Comment("出生年月") private Date birthday; @@ -99,7 +100,7 @@ public class MaternityLeave extends BaseModel implements Serializable { private String loverNation; @Column - @ColDefine(type = ColType.DATETIME, width = 30) + @ColDefine(type = ColType.DATE) @Comment("出生年月") private Date loverBirthday; @@ -154,22 +155,22 @@ public class MaternityLeave extends BaseModel implements Serializable { private String leaveDays; @Column - @ColDefine(type = ColType.DATETIME, width = 30) + @ColDefine(type = ColType.DATE) @Comment("子女出生日期") private Date childrenBirthday; @Column - @ColDefine(type = ColType.DATETIME, width = 30) + @ColDefine(type = ColType.DATE) @Comment("休假开始时间") private Date startTime; @Column - @ColDefine(type = ColType.DATETIME, width = 30) + @ColDefine(type = ColType.DATE) @Comment("休假结束时间") private Date endTime; @Column - @ColDefine(type = ColType.VARCHAR,width = 50) + @ColDefine(type = ColType.DATETIME) @Comment("填写时间") private Date applyTime; diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/controller/MutualInsuranceCollectController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/controller/MutualInsuranceCollectController.java index 4a660e72..64c3deb7 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/controller/MutualInsuranceCollectController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/controller/MutualInsuranceCollectController.java @@ -24,6 +24,7 @@ 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; @@ -71,7 +72,7 @@ public class MutualInsuranceCollectController { String projectId, String unionId, String unitId, - String userName, + String searchKeyword, String sex) { Sql sql = Sqls.create(""" SELECT @@ -113,9 +114,12 @@ public class MutualInsuranceCollectController { // 性别查询条件 cnd.andEX("info.sex", "=", sex); - // 姓名查询条件 - 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); } // 只查询流程实例状态为20的数据(已完成状态) diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/controller/MutualInsuranceSchoolAuditController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/controller/MutualInsuranceSchoolAuditController.java deleted file mode 100644 index ab2ed14d..00000000 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/controller/MutualInsuranceSchoolAuditController.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.budwk.app.zhgh.staffbenefit.mutualInsurance.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.mutualInsurance.service.MutualInsuranceUserService; -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.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.List; - -/** - * @author : hongqiwei - * @description : - * @createDate : 2025/9/23 17:35 - */ - -@IocBean -@At("/platform/mutualInsurance/schoolAudit") -@Api("校工会审核") -@Ok("json:full") -@Slf4j -public class MutualInsuranceSchoolAuditController { - - @Inject - private MutualInsuranceUserService mutualInsuranceUserService; - - @At("/index") - @Ok("beetl:/platform/zhgh/staffbenefit/mutualInsurance/schoolAudit/index.html") - @SaCheckPermission("mutualInsurance.schoolAudit") - public void index() { - } - @At("/h5") - @Ok("beetl:/platform/zhghh5/staffbenefit/mutualInsurance/schoolAudit/index.html") - @SaCheckPermission("h5.mutualInsurance.schoolAudit") - public void h5Index() { - } - - @At - @ApiOperation("分页查询") - @SaCheckPermission(value = {"mutualInsurance.schoolAudit", "h5.mutualInsurance.schoolAudit"}, mode = SaMode.OR) - public Result pageData(PageForm pageForm, - boolean approval, - String projectId, - String unionId, - String unitId, - String userName, - String sex) { - Sql sql = Sqls.create(""" - SELECT - info.*, - 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 mutual_insurance_user_info info ON info.id = ins.businessNo - 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(); - cnd.and("t.taskName", "=", "3e4e3785-64f4-4e7c-89bc-ea54dca216cd"); - cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); - - if (approval) { - cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode())); - } else { - cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode()); - } - // 年度查询条件 -// cnd.andEX("year(info.applyTime)", "=", year); - - //事项id查询 - cnd.andEX("info.projectId", "=", projectId); - - // 工会、单位名称查询条件 - cnd.andEX("info.unionId", "=", unionId); - cnd.andEX("info.unitId", "=", unitId); - - // 性别查询条件 - cnd.andEX("info.sex", "=", sex); - - // 姓名查询条件 - if (StrUtil.isNotBlank(userName)) { - cnd.and("info.userName", "like", "%" + userName + "%"); - } - if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { - cnd.desc("info.applyTime"); - } else { - cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); - } - cnd.groupBy("t.id"); - cnd.desc("t.createdAt"); - sql.setCondition(cnd); - Pagination pagination = mutualInsuranceUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); - return Result.success(pagination); - } -} - diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/controller/MutualInsuranceSecretaryAuditController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/controller/MutualInsuranceSecretaryAuditController.java deleted file mode 100644 index e09183a3..00000000 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/controller/MutualInsuranceSecretaryAuditController.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.budwk.app.zhgh.staffbenefit.mutualInsurance.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.mutualInsurance.service.MutualInsuranceUserService; -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.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.List; - -/** - * @author : hongqiwei - * @description : - * @createDate : 2025/9/23 17:42 - */ - -@IocBean -@At("/platform/mutualInsurance/secretaryAudit") -@Api("党委书记审核") -@Ok("json:full") -@Slf4j -public class MutualInsuranceSecretaryAuditController { - - @Inject - private MutualInsuranceUserService mutualInsuranceUserService; - - @At("/index") - @Ok("beetl:/platform/zhgh/staffbenefit/mutualInsurance/secretaryAudit/index.html") - @SaCheckPermission("mutualInsurance.secretaryAudit") - public void index() { - } - @At("/h5") - @Ok("beetl:/platform/zhghh5/staffbenefit/mutualInsurance/secretaryAudit/index.html") - @SaCheckPermission("h5.mutualInsurance.secretaryAudit") - public void h5Index() { - } - - @At - @ApiOperation("分页查询") - @SaCheckPermission(value = {"mutualInsurance.secretaryAudit", "h5.mutualInsurance.secretaryAudit"}, mode = SaMode.OR) - public Result pageData(PageForm pageForm, - boolean approval, - String projectId, - String unionId, - String unitId, - String userName, - String sex) { - Sql sql = Sqls.create(""" - SELECT - info.*, - 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 mutual_insurance_user_info info ON info.id = ins.businessNo - 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(); - cnd.and("t.taskName", "=", "8567fa6e-7207-4958-ab82-767e22d04159"); - cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); - - if (approval) { - cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode())); - } else { - cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode()); - } - // 年度查询条件 -// cnd.andEX("year(info.applyTime)", "=", year); - - //事项id查询 - cnd.andEX("info.projectId", "=", projectId); - - // 工会、单位名称查询条件 - cnd.andEX("info.unionId", "=", unionId); - cnd.andEX("info.unitId", "=", unitId); - - // 性别查询条件 - cnd.andEX("info.sex", "=", sex); - - // 姓名查询条件 - if (StrUtil.isNotBlank(userName)) { - cnd.and("info.userName", "like", "%" + userName + "%"); - } - if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { - cnd.desc("info.applyTime"); - } else { - cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); - } - cnd.groupBy("t.id"); - cnd.desc("t.createdAt"); - sql.setCondition(cnd); - Pagination pagination = mutualInsuranceUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); - return Result.success(pagination); - } -} - diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/controller/MutualInsuranceUnionAuditController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/controller/MutualInsuranceUnionAuditController.java deleted file mode 100644 index 7dde774a..00000000 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/controller/MutualInsuranceUnionAuditController.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.budwk.app.zhgh.staffbenefit.mutualInsurance.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.mutualInsurance.service.MutualInsuranceUserService; -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.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.List; - -/** - * @author : hongqiwei - * @description : - * @createDate : 2025/9/23 17:35 - */ - -@IocBean -@At("/platform/mutualInsurance/unionAudit") -@Api("分工会审核") -@Ok("json:full") -@Slf4j -public class MutualInsuranceUnionAuditController { - - @Inject - private MutualInsuranceUserService mutualInsuranceUserService; - @At("/index") - @Ok("beetl:/platform/zhgh/staffbenefit/mutualInsurance/unionAudit/index.html") - @SaCheckPermission("mutualInsurance.unionAudit") - public void index() { - } - @At("/h5") - @Ok("beetl:/platform/zhghh5/staffbenefit/mutualInsurance/unionAudit/index.html") - @SaCheckPermission("h5.mutualInsurance.unionAudit") - public void h5Index() { - } - - @At - @ApiOperation("分页查询") - @SaCheckPermission(value = {"mutualInsurance.unionAudit", "h5.mutualInsurance.unionAudit"}, mode = SaMode.OR) - public Result pageData(PageForm pageForm, - boolean approval, - String projectId, - String unionId, - String unitId, - String userName, - String sex) { - Sql sql = Sqls.create(""" - SELECT - info.*, - 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 mutual_insurance_user_info info ON info.id = ins.businessNo - 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(); - cnd.and("t.taskName", "=", "7e4a33fb-cd1e-4373-9bc5-815125568471"); - cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); - - if (approval) { - cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode())); - } else { - cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode()); - } - // 年度查询条件 -// cnd.andEX("year(info.applyTime)", "=", year); - - //事项id查询 - cnd.andEX("info.projectId", "=", projectId); - - // 工会、单位名称查询条件 - cnd.andEX("info.unionId", "=", unionId); - cnd.andEX("info.unitId", "=", unitId); - - // 性别查询条件 - cnd.andEX("info.sex", "=", sex); - - // 姓名查询条件 - if (StrUtil.isNotBlank(userName)) { - cnd.and("info.userName", "like", "%" + userName + "%"); - } - if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { - cnd.desc("info.applyTime"); - } else { - cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); - } - cnd.groupBy("t.id"); - cnd.desc("t.createdAt"); - sql.setCondition(cnd); - Pagination pagination = mutualInsuranceUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); - return Result.success(pagination); - } - -} - diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/model/MutualInsuranceUserInfo.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/model/MutualInsuranceUserInfo.java index dfc549bc..837c581d 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/model/MutualInsuranceUserInfo.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/mutualInsurance/model/MutualInsuranceUserInfo.java @@ -140,7 +140,7 @@ public class MutualInsuranceUserInfo extends BaseModel implements Serializable { @Column @Comment("出险时间") - @ColDefine(type = ColType.DATE) + @ColDefine(type = ColType.DATETIME) private Date dangerTime; @Column diff --git a/src/main/java/com/budwk/app/zhgh/staffmanage/childManage/controller/ChildManageWriteController.java b/src/main/java/com/budwk/app/zhgh/staffmanage/childManage/controller/ChildManageWriteController.java index fdee6cb2..0aaed48f 100644 --- a/src/main/java/com/budwk/app/zhgh/staffmanage/childManage/controller/ChildManageWriteController.java +++ b/src/main/java/com/budwk/app/zhgh/staffmanage/childManage/controller/ChildManageWriteController.java @@ -29,6 +29,8 @@ import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; +import java.util.Date; + @IocBean @At("/platform/childManage/write") @Ok("json:full") @@ -58,7 +60,7 @@ public class ChildManageWriteController { @SaCheckPermission(value = {"childManage.write", "h5.childManage.write"}, mode = SaMode.OR) @SLog(tag = "子女信息管理-信息填写", msg = "保存子女信息") public Result save(@Param("data") ChildManage childManage) { - if(StrUtil.isBlank(childManage.getId())) childManage.setApplyTime(DateUtil.now()); + if(StrUtil.isBlank(childManage.getId())) childManage.setApplyTime(new Date()); dao.insertOrUpdate(childManage); return Result.success(); } diff --git a/src/main/java/com/budwk/app/zhgh/staffmanage/childManage/models/ChildManage.java b/src/main/java/com/budwk/app/zhgh/staffmanage/childManage/models/ChildManage.java index 310440a4..555c6593 100644 --- a/src/main/java/com/budwk/app/zhgh/staffmanage/childManage/models/ChildManage.java +++ b/src/main/java/com/budwk/app/zhgh/staffmanage/childManage/models/ChildManage.java @@ -6,8 +6,10 @@ import com.budwk.app.base.model.BaseModel; import lombok.Data; import lombok.EqualsAndHashCode; import org.nutz.dao.entity.annotation.*; +import org.nutz.dao.interceptor.annotation.PrevInsert; import java.io.Serializable; +import java.util.Date; import java.util.List; /** @@ -31,7 +33,7 @@ public class ChildManage extends BaseModel implements Serializable { @Name @Comment("id") @ColDefine(type = ColType.VARCHAR, width = 32) - @Prev(els = {@EL("uuid()")}) + @PrevInsert(uu32 = true) private String id; @@ -137,9 +139,9 @@ public class ChildManage extends BaseModel implements Serializable { private String childrenIdCard; @Column - @ColDefine(type = ColType.VARCHAR,width = 30) + @ColDefine(type = ColType.DATE) @Comment("出身年月") - private String childrenBirthday; + private Date childrenBirthday; @Column @ColDefine(type = ColType.VARCHAR,width = 30) @@ -178,9 +180,9 @@ public class ChildManage extends BaseModel implements Serializable { private String note; @Column - @ColDefine(type = ColType.VARCHAR,width = 50) + @ColDefine(type = ColType.DATETIME) @Comment("填写时间") - private String applyTime; + private Date applyTime; } diff --git a/src/main/resources/views/platform/zhgh/activity/declarereimbursement/declare/apply/index.html b/src/main/resources/views/platform/zhgh/activity/declarereimbursement/declare/apply/index.html index 0ec0425f..4706441a 100644 --- a/src/main/resources/views/platform/zhgh/activity/declarereimbursement/declare/apply/index.html +++ b/src/main/resources/views/platform/zhgh/activity/declarereimbursement/declare/apply/index.html @@ -49,7 +49,7 @@ layout("/layouts/platform.html"){ @@ -317,6 +317,8 @@ layout("/layouts/platform.html"){ }, async created() { this.init() + //社团查询 + this.$businessTool.listCLubByRole().then((res) => (this.clubList = res)) } }) diff --git a/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/collect/index.html b/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/collect/index.html index 6a13a098..333c3d37 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/collect/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/collect/index.html @@ -25,8 +25,8 @@ layout("/layouts/platform.html"){ > - - + + @@ -34,9 +34,9 @@ layout("/layouts/platform.html"){ - + + placeholder="请选择分工会" clearable> - + + placeholder="请选择单位" clearable> - - + + @@ -33,9 +33,9 @@ layout("/layouts/platform.html"){ - + + placeholder="请选择分工会" clearable> - + + placeholder="请选择单位" clearable> +
+ +

信息填报

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 保存 + +
+
+ + + + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/exerciseCard/common/info.js b/src/main/resources/views/platform/zhgh/dayofficework/exerciseCard/common/info.js new file mode 100644 index 00000000..4238e9a1 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/exerciseCard/common/info.js @@ -0,0 +1,85 @@ +const EXERCISECARD_INFO = { + template: /*language=HTML*/ ` +
+ + + {{viewData.loginName}} + {{viewData.userName}} + {{viewData.sex}} + {{formatDate(viewData.birthday)}} + {{viewData.unionName}} + {{viewData.unitName}} + {{viewData.initMoney}} + {{viewData.money}} + + + + + + + + + + + +
+ `, + store, + data() { + return { + visible: false, + viewData: { + usages: [] // 初始化使用记录数组 + }, + doneTasks: [], + row: null + } + }, + methods: { + // 添加日期格式化方法 + formatDate(date) { + if (!date) return ''; + // 如果已经是 yyyy-MM-dd 格式,直接返回 + if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) { + // 如果包含时间,只取日期部分 + if (date.length > 10) { + return date.substring(0, 10); + } + return date; + } + // 否则转换为 yyyy-MM-dd 格式 + try { + const d = new Date(date); + if (isNaN(d.getTime())) { + return date; + } + const year = d.getFullYear(); + const month = String(d.getMonth() + 1).padStart(2, '0'); + const day = String(d.getDate()).padStart(2, '0'); + return year + '-' + month + '-' + day; + } catch (e) { + return date; + } + }, + + // 打开 + onOpen(row) { + this.row = row + this.visible = true + this.getInfo() + }, + + // 获取申请信息 + getInfo() { + this.$axios.post('/platform/exerciseCard/apply/findOne', {id: this.row.id}).then((res) => { + if (res.code === 0) { + this.viewData = res.data || {} + // 确保usages字段存在 + if (!this.viewData.usages) { + this.$set(this.viewData, 'usages', []) + } + } + }) + }, + } +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/exerciseCard/query/index.html b/src/main/resources/views/platform/zhgh/dayofficework/exerciseCard/query/index.html new file mode 100644 index 00000000..d75ccb98 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/exerciseCard/query/index.html @@ -0,0 +1,153 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 导入人员 + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/retiresouvenirs/batch/basicForm.js b/src/main/resources/views/platform/zhgh/dayofficework/retiresouvenirs/batch/basicForm.js new file mode 100644 index 00000000..29e928e1 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/retiresouvenirs/batch/basicForm.js @@ -0,0 +1,78 @@ +const basicForm = { + template: /*language=HTML*/ ` +
+ + + + + + + + + + + + + + +
+ `, + data() { + return { + formData: { + year: new Date().getFullYear().toString(), + }, + formRules: { + year: [{required: true, message: '必填', trigger: ['blur']}], + name: [{required: true, message: '必填', trigger: ['blur']}], + }, + visible: false, + } + }, + methods: { + onOpen(row) { + if(row && row.id) { + this.$set(row, 'year', row.year.toString()) + this.formData = clone(row) + } else { + this.formData = { + year: new Date().getFullYear().toString() + } + } + this.visible = true + }, + onSubmit() { + this.$refs.formRef.validate((valid) => { + if (valid) { + this.$confirm("您确定要提交吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(async () => { + const resp = await this.$axios.post("/platform/retireSouvenirs/batch/submit", this.formData) + if (resp.code === 0) { + this.$message.success(resp.msg) + this.$emit('refresh') + this.visible = false + } else { + this.$message.warning(resp.msg) + } + }) + } + }) + }, + }, + style: /*language=CSS*/ ` + + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/retiresouvenirs/batch/index.html b/src/main/resources/views/platform/zhgh/dayofficework/retiresouvenirs/batch/index.html new file mode 100644 index 00000000..404f1f7e --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/retiresouvenirs/batch/index.html @@ -0,0 +1,163 @@ + + + + +
+ + + + + + + +
+ + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/retiresouvenirs/ledger/index.html b/src/main/resources/views/platform/zhgh/dayofficework/retiresouvenirs/ledger/index.html new file mode 100644 index 00000000..cce0f635 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/retiresouvenirs/ledger/index.html @@ -0,0 +1,383 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/apply/index.html b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/apply/index.html index d5c613fe..ec4e747a 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/apply/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/apply/index.html @@ -252,9 +252,9 @@ layout("/layouts/platform.html"){ reimburseProject: [{required: true, message: '请选择报销项目', trigger: ["change", "blur"]}], reimburseFundSource: [{required: true, message: '请选择经费来源', trigger: ["change", "blur"]}], bankUserName: [{required: true, message: '请填写户名', trigger: ["change", "blur"]}], - bankCardNumber: [{required: true, message: '请填写银行账号', trigger: ["change", "blur"]}], + bankCardNumber: [ {required: true, message: '请填写银行账号', trigger: ["change", "blur"]},{ pattern: /^([1-9]{1})(\d{15}|\d{18})$/, message: '请输入正确的银行卡号', trigger: 'blur' }], bankOfDeposit: [{required: true, message: '请填写开户行', trigger: ["change", "blur"]}], - condolencePeopleMobile: [{required: true, message: '请填写联系方式', trigger: ["change", "blur"]}], + condolenceMobile: [{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }], condolenceTime: [{required: true, message: '请选择慰问时间', trigger: ["change", "blur"]}], invoiceNumber: [{required: true, message: '请填写发票张数', trigger: ["change", "blur"]}], invoice: [{required: true, message: '请填写发票号码', trigger: ["change", "blur"]}], @@ -547,9 +547,6 @@ layout("/layouts/platform.html"){ id: this.formData.condolenceId, userName: this.formData.condolenceName, mobile: this.formData.condolenceMobile || '', - loginName: this.formData.condolenceLoginName || '', - unitName: this.formData.condolenceUnitName || '', - sex: this.formData.condolenceSex || '' }); } } diff --git a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/collect/index.html b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/collect/index.html index ae1c4e35..c5c214dd 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/collect/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/collect/index.html @@ -9,9 +9,12 @@ layout("/layouts/platform.html"){
- + + + + + placeholder="请选择分工会" clearable> - + + placeholder="请选择单位" clearable> - - - - - - - @@ -129,32 +112,10 @@ layout("/layouts/platform.html"){ pageDataUrl: "/platform/unionReimburse/collect/pageData", unionOptions: [], unitOptions: [], - userOptions: [], } } , methods: { - //查询经办人 - createRemoteMethod(options) { - return (keyword) => { - this.selectQueryUser(keyword, options) - } - }, - selectQueryUser(keyword, options) { - options.length = 0 - this.$axios.post("/platform/UnionReimburse/apply/listUser", {keyword: keyword}).then((res) => { - if (res.code === 0) { - options.push(...res.data) - } - }) - }, - userChange(val) { - const user = this.userOptions.find(o => o.id === val) - if (user) { - const { userName } = user - this.$set(this.pageForm, "userName", userName) - } - }, onView(row) { this.$refs.guava.edit(()=>{ this.showApprovalForm = false diff --git a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/info.js b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/info.js index ca922283..01215c81 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/info.js +++ b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/info.js @@ -40,13 +40,13 @@ const unionReimburseInfo = { {{viewData.condolenceMobile}} {{viewData.typeName}} {{viewData.money}} - {{viewData.condolenceTime}} + {{formatDate(viewData.condolenceTime)}} {{viewData.activityName}} {{viewData.activityType}} {{viewData.activityNumber}} {{viewData.activityPlace}} {{viewData.money}} - {{viewData.activityTime}} + {{formatDate(viewData.activityTime)}} {{viewData.invoiceNumber}} {{viewData.invoice}} {{viewData.paymentNotes}} @@ -110,6 +110,31 @@ const unionReimburseInfo = { this.getInfo() this.getDoneTasks() }, + // 添加日期格式化方法 + formatDate(date) { + if (!date) return ''; + // 如果已经是 yyyy-MM-dd 格式,直接返回 + if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) { + // 如果包含时间,只取日期部分 + if (date.length > 10) { + return date.substring(0, 10); + } + return date; + } + // 否则转换为 yyyy-MM-dd 格式 + try { + const d = new Date(date); + if (isNaN(d.getTime())) { + return date; + } + const year = d.getFullYear(); + const month = String(d.getMonth() + 1).padStart(2, '0'); + const day = String(d.getDate()).padStart(2, '0'); + return year + '-' + month + '-' + day; + } catch (e) { + return date; + } + }, // 获取申请信息 getInfo() { diff --git a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/mine/index.html b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/mine/index.html index 70086a44..7e88be3a 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/mine/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/mine/index.html @@ -9,9 +9,12 @@ layout("/layouts/platform.html"){ - + + + + + placeholder="请选择分工会" clearable> - + + placeholder="请选择单位" clearable> - - - - - - - @@ -129,33 +112,10 @@ layout("/layouts/platform.html"){ pageDataUrl: "/platform/unionReimburse/mine/pageData", unionOptions: [], unitOptions: [], - userOptions: [], } } , methods: { - //查询经办人 - createRemoteMethod(options) { - return (keyword) => { - this.selectQueryUser(keyword, options) - } - }, - selectQueryUser(keyword, options) { - options.length = 0 - this.$axios.post("/platform/UnionReimburse/apply/listUser", {keyword: keyword}).then((res) => { - if (res.code === 0) { - options.push(...res.data) - } - }) - }, - userChange(val) { - const user = this.userOptions.find(o => o.id === val) - if (user) { - const { userName } = user - this.$set(this.pageForm, "userName", userName) - } - }, - onView(row) { this.$refs.guava.view(()=>{ this.$refs.unionReimburseInfoRef.onOpen(row) diff --git a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/review/index.html b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/review/index.html index 7212302b..fc85fc29 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/review/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/review/index.html @@ -9,9 +9,12 @@ layout("/layouts/platform.html"){ - + + + + + placeholder="请选择分工会" clearable> - + + placeholder="请选择单位" clearable> - - - - - - - @@ -158,33 +141,10 @@ layout("/layouts/platform.html"){ showApprovalForm: false, unionOptions: [], unitOptions: [], - userOptions: [], } } , methods: { - //查询经办人 - createRemoteMethod(options) { - return (keyword) => { - this.selectQueryUser(keyword, options) - } - }, - selectQueryUser(keyword, options) { - options.length = 0 - this.$axios.post("/platform/UnionReimburse/apply/listUser", {keyword: keyword}).then((res) => { - if (res.code === 0) { - options.push(...res.data) - } - }) - }, - userChange(val) { - const user = this.userOptions.find(o => o.id === val) - if (user) { - const { userName } = user - this.$set(this.pageForm, "userName", userName) - } - }, - onView(row) { this.$refs.guava.edit(()=>{ this.showApprovalForm = false diff --git a/src/main/resources/views/platform/zhgh/democratic/executiveCommittee/delegationTwoPush/index.html b/src/main/resources/views/platform/zhgh/democratic/executiveCommittee/delegationTwoPush/index.html index 892fccc1..acd1bb32 100644 --- a/src/main/resources/views/platform/zhgh/democratic/executiveCommittee/delegationTwoPush/index.html +++ b/src/main/resources/views/platform/zhgh/democratic/executiveCommittee/delegationTwoPush/index.html @@ -17,7 +17,7 @@ layout("/layouts/platform.html"){ filterable placeholder="请选择教代会" style="width:100%;" - @change="doSearch" + @change="getAllDelegation(pageForm.teacherMeetId);doSearch()" > + + + + + @@ -58,13 +65,14 @@ layout("/layouts/platform.html"){ fixed type="index" width="50"> - - - - - - - + + + + + + + +