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/democratic/suggestionBox/controller/SuggestionBoxQueryController.java b/src/main/java/com/budwk/app/zhgh/democratic/suggestionBox/controller/SuggestionBoxQueryController.java index 5e57190e..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 @@ -53,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) { + public Result pageData(Integer pageNumber, + Integer pageSize, + String searchKeyword, + String unionId, + String unitId, + Integer year) { Sql sql = Sqls.create(""" SELECT info.id, @@ -91,6 +96,11 @@ public class SuggestionBoxQueryController { if (StrUtil.isNotBlank(searchKeyword)) { cnd.where().andLike("info.title", searchKeyword); } + // 工会、单位名称查询条件 + 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 e85b1870..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, 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,6 +109,10 @@ public class SuggestionXghController { cnd.where().andLike("info.title", searchKeyword); } + // 工会、单位名称查询条件 + cnd.andEX("unionId", "=", unionId); + cnd.andEX("unitId", "=", unitId); + if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { cnd.desc("info.submitTime"); } else { 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 7b2ca84e..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 @@ -67,7 +67,7 @@ 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, 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/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/exerciseCard/apply/index.html b/src/main/resources/views/platform/zhgh/dayofficework/exerciseCard/apply/index.html new file mode 100644 index 00000000..67192a84 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/exerciseCard/apply/index.html @@ -0,0 +1,325 @@ + +
+ +

信息填报

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 保存 + +
+
+ + + + 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/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"> - - - - - - - + + + + + + + +