Merge branch 'main' of https://dd3skj.picp.vip/zhaoxinyu/v4
This commit is contained in:
@@ -45,6 +45,8 @@ RoleConstant {
|
||||
BRANCH_UNION_SHENGGHUO_WY("分工会生活委员"),
|
||||
BRANCH_UNION_TIAOJIE_WY("分工会调解委员"),
|
||||
|
||||
UNIT_PARTY_SECRETARY("单位党委书记"),
|
||||
|
||||
TEACHER_CONGRESS_DELEGATE_FORMAL("教代会正式代表"),
|
||||
TEACHER_CONGRESS_DELEGATE_ATTENDANCE("教代会列席代表"),
|
||||
TEACHER_CONGRESS_DELEGATE_SPECIALLY_INVITE("教代会特邀代表"),
|
||||
@@ -58,7 +60,6 @@ RoleConstant {
|
||||
PROPOSAL_UNIT_LEADER("提案承办单位领导"),
|
||||
PROPOSAL_UNIT_PROXY("提案承办单位代理答复人"),
|
||||
|
||||
|
||||
WORKER_CONGRESS_DELEGATE_FORMAL("工代会正式代表"),
|
||||
WORKER_CONGRESS_DELEGATE_ATTENDANCE("工代会列席代表"),
|
||||
WORKER_CONGRESS_DELEGATE_SPECIALLY_INVITE("工代会特邀代表"),
|
||||
|
||||
@@ -58,6 +58,7 @@ public class FlowDefineController {
|
||||
ProcessDefine define = dao.fetch(ProcessDefine.class, Cnd.where(ProcessDefine::getName, "=", defineKey).desc(ProcessDefine::getVersion));
|
||||
if (define != null) {
|
||||
request.setAttribute("defineId", define.getId());
|
||||
request.setAttribute("showImg", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.ClassScanner;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
@@ -21,6 +22,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.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -220,9 +222,16 @@ public class FlowDesignController {
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者分页数据")
|
||||
public Result assigneePage(Integer pageNumber, Integer pageSize, String keyword, @Param("userIds") String[] userIds) {
|
||||
public Result assigneePage(Integer pageNumber, Integer pageSize, String searchKeyword, @Param("userIds") String[] userIds) {
|
||||
Sql sql = Sqls.create("select id,loginname,username,unitName from vw_user $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("username", searchKeyword);
|
||||
group.orLike("loginname", searchKeyword);
|
||||
cnd.and(group);
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
// cnd.andEX("id", "in", userIds);
|
||||
Pagination pagination = sysUserService.listPageMap(pageNumber, pageSize, sql);
|
||||
return Result.success(pagination);
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.budwk.app.flow.handler;
|
||||
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.flow.engine.AssignmentHandler;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
import com.budwk.app.flow.engine.model.TaskModel;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.lang.Lang;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName FlowUnitPartySecretaryHandler
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/10/15 10:55
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public class FlowUnitPartySecretaryHandler implements AssignmentHandler {
|
||||
|
||||
@Override
|
||||
public List<String> assign(TaskModel model, Execution execution) {
|
||||
String unitId = SecurityUtil.getUnitId();
|
||||
|
||||
SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class);
|
||||
Sys_role role = sysRoleService.getByCode(RoleConstant.UNIT_PARTY_SECRETARY);
|
||||
|
||||
List<Sys_user_role> roles = ServiceContext.find(Dao.class).query(
|
||||
Sys_user_role.class,
|
||||
Cnd.where(Sys_user_role::getRoleId, "=", role.getId())
|
||||
.and(Sys_user_role::getUnitId, "=", unitId)
|
||||
);
|
||||
|
||||
if (Lang.isEmpty(roles)) {
|
||||
throw new RuntimeException("当前登录用户所在单位未设置单位党委书记,请联系校工会进行设置。");
|
||||
}
|
||||
return roles.stream().map(Sys_user_role::getUserId).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "获取当前登录用户所在单位党委书记";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return AssignmentHandler.super.getOrder();
|
||||
}
|
||||
}
|
||||
+116
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+145
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<JSONObject> usages;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("录入时间")
|
||||
private Date applyTime;
|
||||
|
||||
}
|
||||
|
||||
+16
@@ -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<ExerciseCard> {
|
||||
/**
|
||||
* 导入会员数据处理
|
||||
* @param file 文件
|
||||
* @param isFlag 是否清空更新
|
||||
*/
|
||||
NutMap handlingMemberImport(TempFile file, Boolean isFlag);
|
||||
}
|
||||
+178
@@ -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<ExerciseCard> 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<T> ts = EasyExcelUtil.syncReadModel(file.getFile(), ExercisePeopleImportVo.class, 0, 1);
|
||||
List<ExercisePeopleImportVo> list = JSONUtil.parseArray(JSONUtil.toJsonStr(ts)).toList(ExercisePeopleImportVo.class);
|
||||
|
||||
// 获取系统用户
|
||||
Cnd cnd = Cnd.NEW();
|
||||
List<Sys_user> dataUserList = dao().query(Sys_user.class, cnd);
|
||||
Map<String, Sys_user> 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<Record> vwUserList = vwUserSql.getList(Record.class);
|
||||
Map<String, Record> vwUserMap = vwUserList.stream().collect(Collectors.toMap(r -> r.getString("loginname"), r -> r));
|
||||
|
||||
List<ExerciseCard> exerciseCardList = new ArrayList<>();
|
||||
List<Sys_user> insertOrUpdateUserList = new ArrayList<>();
|
||||
|
||||
//返回错误记录
|
||||
List<ExercisePeopleImportVo> 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;
|
||||
}
|
||||
}
|
||||
+50
@@ -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;
|
||||
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.models.FundMember;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.service.FundMemberService;
|
||||
import io.swagger.annotations.Api;
|
||||
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;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/fundMember/branchUnionApproval")
|
||||
@Ok("json:full")
|
||||
@Api("基金会员-分工会审核")
|
||||
public class FundMemberBranchUnionApprovalController {
|
||||
|
||||
@Inject
|
||||
private FundMemberService fundMemberService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/fundMember/branchUnionApproval/index.html")
|
||||
@SaCheckPermission("fundMember.branchUnionApproval")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("fundMember.branchUnionApproval")
|
||||
public Result pageData(PageForm pageForm, String taskId, String searchKeyword, Integer year, boolean approval) {
|
||||
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 fund_member 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", "=", "fgh");
|
||||
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())){
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
cnd.where().andLike("info.title", searchKeyword);
|
||||
}
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = fundMemberService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.vo.ProcessTaskVO;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.models.FundMember;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.service.FundMemberService;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
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.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/fundMember/common")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "基金会员-公共")
|
||||
@Slf4j
|
||||
public class FundMemberCommonController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FundMemberService fundMemberService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
|
||||
|
||||
@At
|
||||
@SaCheckPermission("fundMember")
|
||||
public Result info(@Valid String id) {
|
||||
FundMember fundMember = fundMemberService.fetch(id);
|
||||
return Result.success(fundMember);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("fundMember")
|
||||
@Ok("void")
|
||||
@ApiOperation("导出申请表")
|
||||
public void exportDocx(@Valid String id, HttpServletResponse response) {
|
||||
FundMember fundMember = dao.fetch(FundMember.class, id);
|
||||
Map<String, Object> docData = BeanUtil.beanToMap(fundMember);
|
||||
|
||||
docData.put("birthday", DateUtil.format(fundMember.getBirthday(), "yyyy年MM月dd日"));
|
||||
docData.put("joinWorkTime", DateUtil.format(fundMember.getJoinWorkTime(), "yyyy年MM月dd日"));
|
||||
docData.put("retireTime", DateUtil.format(fundMember.getRetireTime(), "yyyy年MM月dd日"));
|
||||
|
||||
// 流程实例
|
||||
ProcessInstance processInstance = dao.fetch(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "=", id));
|
||||
List<ProcessTaskVO> doneTaskVos = new ArrayList<>();
|
||||
List<ProcessTask> doneTaskList = flowEngine.processTaskService().getDoneTaskList(processInstance.getId(), null);
|
||||
for (ProcessTask doneTask : doneTaskList) {
|
||||
ProcessTaskVO taskVO = flowEngine.processTaskService().findById(doneTask.getId());
|
||||
doneTaskVos.add(taskVO);
|
||||
}
|
||||
|
||||
// 按任务节点分组
|
||||
Map<String, List<ProcessTaskVO>> taskGroups = doneTaskVos.stream().collect(Collectors.groupingBy(ProcessTaskVO::getDisplayName));
|
||||
docData.putAll(taskGroups);
|
||||
|
||||
Configure configure = Configure.builder().build();
|
||||
|
||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
|
||||
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("fundMember"), configure).render(docData).writeAndClose(byteArrayOutputStream);
|
||||
CommonDownloadUtil.download(fundMember.getUserName() + "的医疗互助“爱心”基金入会申请表.docx", byteArrayOutputStream.toByteArray(), response);
|
||||
} catch (Exception e) {
|
||||
log.error("导出word异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
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.result.Result;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.models.FundMember;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.service.FundMemberService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/fundMember/mine")
|
||||
@Ok("json:full")
|
||||
@Api("基金会员-我的申请")
|
||||
public class FundMemberMineController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FundMemberService fundMemberService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/fundMember/mine/index.html")
|
||||
@SaCheckPermission("fundMember.mine")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("fundMember.mine")
|
||||
public Result pageData(Integer pageNumber, Integer pageSize, String searchKeyword, Integer year) {
|
||||
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,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask' AND taskState in (10,20)) AS startTaskId
|
||||
FROM
|
||||
fund_member info
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("info.createdBy", "=", SecurityUtil.getUserId());
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = fundMemberService.listPageMap(pageNumber, pageSize, sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("fundMember.mine")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("删除")
|
||||
@SLog(tag = "基金会员-我的申请", msg = "删除")
|
||||
public Result delete(@Param("id") String id) {
|
||||
dao.delete(FundMember.class, id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
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.zhgh.dayofficework.fund.service.FundMemberService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/fundMember/query")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "基金会员-查询")
|
||||
public class FundMemberQueryController {
|
||||
|
||||
@Inject
|
||||
private FundMemberService fundMemberService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/fundMember/query/index.html")
|
||||
@SaCheckPermission("fundMember.query")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("fundMember.query")
|
||||
public Result pageData(PageForm pageForm, Integer year) {
|
||||
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
|
||||
FROM
|
||||
fund_member info
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("info.userName", pageForm.getSearchKeyword());
|
||||
seg.orLike("info.loginName", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("YEAR(info.submitTime)", "=", year);
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = fundMemberService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("fundMember.query")
|
||||
@Ok("void")
|
||||
public void exportExcel(Integer year, HttpServletResponse response) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.service.FundMemberService;
|
||||
import io.swagger.annotations.Api;
|
||||
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;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/fundMember/schoolUnionApproval")
|
||||
@Ok("json:full")
|
||||
@Api("基金会员-校工会审核")
|
||||
public class FundMemberSchoolUnionApprovalController {
|
||||
|
||||
@Inject
|
||||
private FundMemberService fundMemberService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/fundMember/schoolUnionApproval/index.html")
|
||||
@SaCheckPermission("fundMember.schoolUnionApproval")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("fundMember.schoolUnionApproval")
|
||||
public Result pageData(PageForm pageForm, String taskId, String searchKeyword, Integer year, boolean approval) {
|
||||
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 fund_member 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", "=", "xgh");
|
||||
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())){
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
cnd.where().andLike("info.title", searchKeyword);
|
||||
}
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = fundMemberService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.models.FundMember;
|
||||
import com.budwk.app.zhgh.democratic.suggestionBox.models.SuggestionBox;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/fundMember/write")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "基金会员申请")
|
||||
public class FundMemberWriteController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/fundMember/write/index.html")
|
||||
@SaCheckPermission("fundMember.write")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("fundMember.write")
|
||||
@ApiOperation("保存申请")
|
||||
@SLog(tag = "建言献策-填写申请", msg = "保存申请")
|
||||
public Result save(@Param("data") FundMember fundMember) {
|
||||
dao.insertOrUpdate(fundMember);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("fundMember.write")
|
||||
@ApiOperation("提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "基金会员-填写申请", msg = "提交申请")
|
||||
public Result submit(@Param("data") FundMember fundMember) {
|
||||
fundMember.setSubmitTime(new Date());
|
||||
dao.insertOrUpdate(fundMember);
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, fundMember);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("FUND_MEMBER", fundMember.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("fundMember.write")
|
||||
@ApiOperation("重新提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "基金会员-填写申请", msg = "重新提交申请")
|
||||
public Result submitAgain(@Param("data") FundMember fundMember, @Param("taskId") Long taskId) {
|
||||
dao.insertOrUpdate(fundMember);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("fundMember.write")
|
||||
@ApiOperation("获取申请信息")
|
||||
public Result info(@Param("id") String id) {
|
||||
FundMember box = dao.fetch(FundMember.class, id);
|
||||
return Result.success(box);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.models;
|
||||
|
||||
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.util.Date;
|
||||
|
||||
@Data
|
||||
@Table("fund_member")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("基金会员")
|
||||
public class FundMember extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("工资号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@Comment("出生日期")
|
||||
@ColDefine(type = ColType.DATE)
|
||||
private Date birthday;
|
||||
|
||||
@Column
|
||||
@Comment("身份证号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String idCard;
|
||||
|
||||
@Column
|
||||
@Comment("参加工作时间")
|
||||
@ColDefine(type = ColType.DATE)
|
||||
private Date joinWorkTime;
|
||||
|
||||
@Column
|
||||
@Comment("退休时间")
|
||||
@ColDefine(type = ColType.DATE)
|
||||
private Date retireTime;
|
||||
|
||||
@Column
|
||||
@Comment("家庭住址")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String address;
|
||||
|
||||
@Column
|
||||
@Comment("手机号码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("住宅号码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String homePhone;
|
||||
|
||||
@Column
|
||||
@Comment("照片")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String avatar;
|
||||
|
||||
@Column
|
||||
@Comment("加入、退出")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("1")
|
||||
private Boolean isJoin;
|
||||
|
||||
@Column
|
||||
@Comment("提交时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date submitTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.models.FundMember;
|
||||
|
||||
public interface FundMemberService extends BaseService<FundMember> {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.models.FundMember;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.service.FundMemberService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class FundMemberServiceImpl extends BaseServiceImpl<FundMember> implements FundMemberService {
|
||||
public FundMemberServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -107,7 +107,7 @@ public class MeetingDelegationApproval {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("mi.name", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("mi.address", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("info.periodName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("mtp.periodName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if(year != null) {
|
||||
@@ -116,7 +116,7 @@ public class MeetingDelegationApproval {
|
||||
cnd.and("ins.createdAt", ">=", startTime);
|
||||
cnd.and("ins.createdAt", "<=", endTime);
|
||||
}
|
||||
cnd.andEX("mi.type", "=", type);
|
||||
cnd.andEX("mi.typeId", "=", type);
|
||||
|
||||
cnd.and("t.taskName", "=", "e0ef2404-7468-480a-97b6-b918e0a9232f");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
+2
-2
@@ -111,12 +111,12 @@ public class MeetingLeaveController {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("mi.name", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("mi.address", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("info.periodName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("mtp.periodName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
cnd.and("ins.id", "is not", null);
|
||||
cnd.andEX("mi.type", "=", type);
|
||||
cnd.andEX("mi.typeId", "=", type);
|
||||
if(year != null) {
|
||||
long startTime = DateUtil.parse(year + "-01-01").getTime();
|
||||
long endTime = DateUtil.parse(year + "-12-31").getTime();
|
||||
|
||||
+3
-3
@@ -38,7 +38,7 @@ import java.util.List;
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "会议请假团长审核")
|
||||
@Api(tags = "会议请假校工会审核")
|
||||
@At("/platform/meeting/schoolUnionApproval")
|
||||
public class MeetingSchoolUnionApproval {
|
||||
|
||||
@@ -106,7 +106,7 @@ public class MeetingSchoolUnionApproval {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("mi.name", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("mi.address", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("info.periodName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("mtp.periodName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if(year != null) {
|
||||
@@ -115,7 +115,7 @@ public class MeetingSchoolUnionApproval {
|
||||
cnd.and("ins.createdAt", ">=", startTime);
|
||||
cnd.and("ins.createdAt", "<=", endTime);
|
||||
}
|
||||
cnd.andEX("mi.type", "=", type);
|
||||
cnd.andEX("mi.typeId", "=", type);
|
||||
|
||||
cnd.and("t.taskName", "=", "e28e9ab0-5546-4d97-9939-47df088f38ab");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
+2
@@ -119,6 +119,8 @@ public class MeetingInfoServiceImpl extends BaseServiceImpl<MeetingInfo> impleme
|
||||
if (!newRelations.isEmpty()) {
|
||||
dao().insert(newRelations);
|
||||
}
|
||||
|
||||
dao().updateIgnoreNull(info);
|
||||
}
|
||||
|
||||
private MeetingTimePeriodUser buildRelation(String meetingId, String periodId, MeetingTimePeriodUser user) {
|
||||
|
||||
+216
@@ -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<RetireSouvenirsBatch> 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<ExcelExportEntity> 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<T> ts = EasyExcelUtil.syncReadModel(file.getFile(), RetireSouvenirsImportTemp.class, 0, 1);
|
||||
List<RetireSouvenirsImportTemp> importTemps = JSONUtil.parseArray(JSONUtil.toJsonStr(ts)).toList(RetireSouvenirsImportTemp.class);
|
||||
|
||||
List<String> loginNames = importTemps.stream().map(RetireSouvenirsImportTemp::getLoginName).filter(Strings::isNotBlank).toList();
|
||||
List<View_user> userList = dao.query(View_user.class, Cnd.where(View_user::getLoginname, "in", loginNames));
|
||||
Map<String, View_user> 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<RetireSouvenirsLedger> 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<RetireSouvenirsImportTemp> 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);
|
||||
}
|
||||
}
|
||||
+227
@@ -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<NutMap> listMap = ledgerService.listMap(sql);
|
||||
|
||||
List<RetireSouvenirsMsg> 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<String> 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<RetireSouvenirsMsg> 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<NutMap> listMap = ledgerService.listMap(sql);
|
||||
|
||||
List<ExcelExportEntity> 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;
|
||||
}
|
||||
}
|
||||
+43
@@ -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;
|
||||
}
|
||||
+54
@@ -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;
|
||||
}
|
||||
+58
@@ -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;
|
||||
}
|
||||
+14
@@ -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<RetireSouvenirsBatch> {
|
||||
}
|
||||
+14
@@ -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<RetireSouvenirsLedger> {
|
||||
}
|
||||
+22
@@ -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<RetireSouvenirsBatch> implements RetireSouvenirsBatchService {
|
||||
|
||||
public RetireSouvenirsBatchServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+22
@@ -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<RetireSouvenirsLedger> implements RetireSouvenirsLedgerService {
|
||||
|
||||
public RetireSouvenirsLedgerServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+33
@@ -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;
|
||||
}
|
||||
+23
@@ -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;
|
||||
}
|
||||
+2
-5
@@ -2,12 +2,9 @@ package com.budwk.app.zhgh.democratic.grassrootscongress.controller.meeting;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.grassrootscongress.param.GrassrootsCongressPageForm;
|
||||
import com.budwk.app.zhgh.democratic.grassrootscongress.service.GrassrootsCongressService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -16,7 +13,6 @@ 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.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
@@ -58,11 +54,12 @@ public class GrassrootsCongressMeetingStatisticsController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("ins.state","=", ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
cnd.and("ins.state", "=", ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
cnd.andEX("YEAR(info.createTime)", "=", pageForm.getYear());
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
cnd.and(Cnd.likeEX("info.meetingName", pageForm.getSearchKeyword()));
|
||||
}
|
||||
cnd.andEX("info.unionId", "=", pageForm.getUnionId());
|
||||
cnd.desc("info.createTime");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = grassrootsCongressService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
|
||||
+1
@@ -63,6 +63,7 @@ public class GrassrootsCongressMeetingInfo extends BaseModel {
|
||||
@Comment("所属工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("所属工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
|
||||
+26
-12
@@ -8,6 +8,7 @@ import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.engine.model.ProcessModel;
|
||||
import com.budwk.app.flow.engine.model.TaskModel;
|
||||
import com.budwk.app.flow.entity.ProcessDefine;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.flow.service.ProcessDefineService;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
@@ -72,7 +73,10 @@ public class ProposalDashboardController {
|
||||
.addv("name", taskModel.getDisplayName())
|
||||
.addv("id", taskModel.getName())
|
||||
.addv("type", "task")
|
||||
.addv("count", 0)).toList();
|
||||
.addv("count", 0)
|
||||
.addv("todoCount", 0)
|
||||
.addv("doneCount", 0)
|
||||
).toList();
|
||||
nodes.addAll(taskNodes);
|
||||
|
||||
// 立案结果
|
||||
@@ -88,22 +92,24 @@ public class ProposalDashboardController {
|
||||
// 查询待办任务
|
||||
Sql todoSql = Sqls.create("""
|
||||
SELECT
|
||||
t.taskName
|
||||
t.taskName,
|
||||
t.taskState
|
||||
FROM
|
||||
wf_process_task t
|
||||
INNER JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
INNER JOIN proposal_info info ON info.id = ins.businessNo
|
||||
WHERE
|
||||
t.taskState = 10
|
||||
AND info.sessionId = @sessionId
|
||||
info.sessionId = @sessionId
|
||||
""");
|
||||
todoSql.setParam("sessionId", sessionId);
|
||||
List<NutMap> todoTasks = processDefineService.listMap(todoSql);
|
||||
|
||||
for (NutMap node : nodes) {
|
||||
if (node.getString("type").equals("task")) {
|
||||
long count = todoTasks.stream().filter(task -> task.getString("taskName").equals(node.getString("id"))).count();
|
||||
node.put("count", count);
|
||||
long todoCount = todoTasks.stream().filter(task -> task.getInt("taskState") == ProcessTaskStateEnum.DOING.getCode() && task.getString("taskName").equals(node.getString("id"))).count();
|
||||
node.put("todoCount", todoCount);
|
||||
long doneCount = todoTasks.stream().filter(task -> task.getInt("taskState") == ProcessTaskStateEnum.FINISHED.getCode() && task.getString("taskName").equals(node.getString("id"))).count();
|
||||
node.put("doneCount", doneCount);
|
||||
} else if (node.getString("type").equals("total")) {
|
||||
int count = dao.count(ProposalInfo.class, Cnd.where(ProposalInfo::getSessionId, "=", sessionId));
|
||||
node.put("count", count);
|
||||
@@ -119,11 +125,10 @@ public class ProposalDashboardController {
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.dashboard")
|
||||
public Result pageData(PageForm pageForm, String sessionId, String selectNodeId, String selectNodeType) {
|
||||
public Result pageData(PageForm pageForm, String sessionId, String selectNodeId, String selectNodeType, String selectNodeMode) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
COUNT(p.consolidationIds) > 0 AS isConsolidation,
|
||||
type.name AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
@@ -137,24 +142,33 @@ public class ProposalDashboardController {
|
||||
GROUP_CONCAT(DISTINCT CASE WHEN pru.isMaster = 0 THEN pru.unitName END) AS slaveUnitNames
|
||||
FROM
|
||||
proposal_info info
|
||||
LEFT JOIN proposal_consolidation p ON JSON_CONTAINS(p.consolidationIds, JSON_QUOTE(info.id))
|
||||
LEFT JOIN proposal_type type on type.id = info.typeId
|
||||
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
|
||||
LEFT JOIN teacher_congress_delegate tcde on tcde.loginName = info.createUserLoginName
|
||||
LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id
|
||||
LEFT JOIN proposal_reply_unit pru ON pru.proposalId = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = @taskState
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("info.sessionId", "=", sessionId);
|
||||
cnd.groupBy("info.id");
|
||||
|
||||
if(StrUtil.isNotBlank(selectNodeType) && StrUtil.isNotBlank(selectNodeId)){
|
||||
switch (selectNodeType){
|
||||
// 默认显示进行中的任务
|
||||
sql.setParam("taskState", ProcessTaskStateEnum.DOING.getCode());
|
||||
|
||||
if (StrUtil.isNotBlank(selectNodeType) && StrUtil.isNotBlank(selectNodeId)) {
|
||||
switch (selectNodeType) {
|
||||
case "task":
|
||||
cnd.and("t.taskName", "=", selectNodeId);
|
||||
|
||||
if (selectNodeMode.equals("todo")) {
|
||||
sql.setParam("taskState", ProcessTaskStateEnum.DOING.getCode());
|
||||
} else {
|
||||
sql.setParam("taskState", ProcessTaskStateEnum.FINISHED.getCode());
|
||||
}
|
||||
|
||||
break;
|
||||
case "total":
|
||||
break;
|
||||
|
||||
+33
-16
@@ -4,12 +4,15 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
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.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalQueryComprehensiveParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
|
||||
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;
|
||||
@@ -36,12 +39,14 @@ public class ProposalQueryCollectProgressController {
|
||||
add(NutMap.NEW().addv("code", 10).addv("id", 10).addv("name", "撰写提案"));
|
||||
add(NutMap.NEW().addv("code", 20).addv("id", 20).addv("name", "附议提案"));
|
||||
add(NutMap.NEW().addv("code", 30).addv("id", 30).addv("name", "待团长审核"));
|
||||
add(NutMap.NEW().addv("code", 40).addv("id", 40).addv("name", "团长审核退回"));
|
||||
add(NutMap.NEW().addv("code", 50).addv("id", 50).addv("name", "团长审核通过"));
|
||||
add(NutMap.NEW().addv("code", 40).addv("id", 40).addv("name", "团长已审核"));
|
||||
}};
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
private ProposalCommonService proposalCommonService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/query/collectProgress/index.html")
|
||||
@@ -61,43 +66,55 @@ public class ProposalQueryCollectProgressController {
|
||||
info.createUserName,
|
||||
type.NAME AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName
|
||||
tcd.`name` AS delegationName,
|
||||
(SELECT count(1) FROM proposal_second WHERE proposalId = info.id) AS inviteCount,
|
||||
(SELECT count(1) FROM wf_process_task WHERE processInstanceId = ins.id AND taskName = 'second' AND taskState = 20) finishCount,
|
||||
ins.id AS instanceId,
|
||||
ins.state instanceState,
|
||||
t.displayName curTaskName
|
||||
FROM
|
||||
proposal_info info
|
||||
LEFT JOIN proposal_type type ON type.id = info.typeId
|
||||
LEFT JOIN teacher_congress_session tcs ON tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd ON tcd.id = info.delegationId
|
||||
LEFT JOIN teacher_congress_delegate tcde on tcde.loginName = info.createUserLoginName
|
||||
LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
sql.setParam("sessionId", pageForm.getSessionId());
|
||||
Cnd cnd = Cnd.NEW();
|
||||
ProposalQueryComprehensiveParam.buildSearch(cnd, pageForm);
|
||||
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
if (ArrayUtil.contains(pageForm.getCollectIds(), 10)) {
|
||||
seg.or("inst.processInstanceNodeCode", "=", 10);
|
||||
seg.or("t.taskName", "=", "startTask");
|
||||
}
|
||||
if (ArrayUtil.contains(pageForm.getCollectIds(), 20)) {
|
||||
seg.or("inst.processInstanceNodeCode", "=", 20);
|
||||
seg.or("t.taskName", "=", "second");
|
||||
}
|
||||
if (ArrayUtil.contains(pageForm.getCollectIds(), 30)) {
|
||||
seg.or("inst.processInstanceNodeCode", "=", 30);
|
||||
seg.or("t.taskName", "=", "delegation");
|
||||
}
|
||||
if (ArrayUtil.contains(pageForm.getCollectIds(), 40)) {
|
||||
seg.or("inst.processInstanceNodeCode", "=", 40);
|
||||
}
|
||||
if (ArrayUtil.contains(pageForm.getCollectIds(), 50)) {
|
||||
seg.or("inst.processInstanceNodeCode", ">", 50);
|
||||
seg.or("t.taskName", "not in", List.of("startTask", "second", "delegation"));
|
||||
seg.and("t.taskName", "is not", null);
|
||||
}
|
||||
if (!seg.isEmpty()) {
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
// cnd.and("inst.processInstanceNodeCode", "in", List.of(10, 20, 30, 40, 50));
|
||||
ProposalQueryComprehensiveParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
Pagination pagination = proposalCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> list = (List<NutMap>) pagination.getList();
|
||||
for (NutMap row : list) {
|
||||
int count = dao.count(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "=", row.getString("instanceId"))
|
||||
.and(ProcessTask::getTaskName, "=", "second")
|
||||
.and(ProcessTask::getTaskState, "=", ProcessTaskStateEnum.FINISHED.getCode())
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalCommissionerOpinion;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/proposal/commissioner")
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@Api(tags = "提案委员会委员查询")
|
||||
public class ProposalCommissionerController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ProposalCommonService proposalCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/commissioner/index.html")
|
||||
@SaCheckPermission("proposal.commissioner")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.commissioner")
|
||||
public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.NAME AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.displayName taskName,
|
||||
(SELECT count(1) FROM proposal_commissioner_opinion WHERE proposalId = info.id AND caseFilingResult = 'CONFIRM_FILING') CONFIRM_FILING_COUNT,
|
||||
(SELECT count(1) FROM proposal_commissioner_opinion WHERE proposalId = info.id AND caseFilingResult = 'SUGGESTION') SUGGESTION_COUNT,
|
||||
(SELECT count(1) FROM proposal_commissioner_opinion WHERE proposalId = info.id AND caseFilingResult = 'NOT') NOT_COUNT,
|
||||
pco.id pcoId
|
||||
FROM
|
||||
proposal_info info
|
||||
LEFT JOIN proposal_type type ON type.id = info.typeId
|
||||
LEFT JOIN teacher_congress_session tcs ON tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd ON tcd.id = info.delegationId
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN proposal_commissioner_opinion pco on pco.proposalId = info.id and pco.commissioner = @userId
|
||||
$condition
|
||||
""");
|
||||
sql.setParam("userId", SecurityUtil.getUserId());
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
ProposalSearchParam.buildSearch(cnd, pageForm);
|
||||
cnd.and("pco.id", approval ? "is not" : "is", null);
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = proposalCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.commissioner")
|
||||
@SLog(tag = "提案委员会委员意见", msg = "")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result doApproval(String proposalId, String opinion, String caseFilingResult, String caseFilingType) {
|
||||
dao.clear(ProposalCommissionerOpinion.class, Cnd.where(ProposalCommissionerOpinion::getProposalId, "=", proposalId).and(ProposalCommissionerOpinion::getCommissioner, "=", SecurityUtil.getUserId()));
|
||||
|
||||
ProposalCommissionerOpinion commissionerOpinion = new ProposalCommissionerOpinion();
|
||||
commissionerOpinion.setProposalId(proposalId);
|
||||
commissionerOpinion.setCommissioner(SecurityUtil.getUserId());
|
||||
commissionerOpinion.setOpinionText(opinion);
|
||||
commissionerOpinion.setCaseFilingResult(caseFilingResult);
|
||||
commissionerOpinion.setCaseFilingType(caseFilingType);
|
||||
commissionerOpinion.setOpinionTime(new Date());
|
||||
dao.insert(commissionerOpinion);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+1
-1
@@ -28,7 +28,7 @@ public class ProposalMasterUnitAssignmentHandler implements AssignmentHandler {
|
||||
|
||||
// 提案ID
|
||||
String proposalId = execution.getProcessInstance().getBusinessNo();
|
||||
|
||||
|
||||
// 主办单位
|
||||
ProposalReplyUnit masterUnit = dao.fetch(ProposalReplyUnit.class, Cnd.where(ProposalReplyUnit::getProposalId, "=", proposalId).and(ProposalReplyUnit::getIsMaster, "=", 1));
|
||||
if (masterUnit == null) {
|
||||
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.models;
|
||||
|
||||
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.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("proposal_commissioner_opinion")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("提案委员意见")
|
||||
@TableIndexes(value = {
|
||||
@Index(name = "INDEX_PROPOSAL_COMMISSIONER_OPINION_PROPOSAL_ID", fields = {"proposalId"}, unique = false)
|
||||
})
|
||||
public class ProposalCommissionerOpinion extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("提案ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String proposalId;
|
||||
|
||||
@Column
|
||||
@Comment("立案结果(字典表)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String caseFilingResult;
|
||||
|
||||
@Column
|
||||
@Comment("立案类型(重点、普通提案)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String caseFilingType;
|
||||
|
||||
@Column
|
||||
@Comment("委员意见")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String opinionText;
|
||||
|
||||
@Column
|
||||
@Comment("委员意见时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date opinionTime;
|
||||
|
||||
@Column
|
||||
@Comment("委员ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String commissioner;
|
||||
|
||||
}
|
||||
+3
@@ -50,6 +50,9 @@ public class ProposalQueryComprehensiveParam extends PageForm {
|
||||
@ApiModelProperty(name = "征集进度状态")
|
||||
private Integer[] collectIds;
|
||||
|
||||
@ApiModelProperty(name = "通用关键字")
|
||||
private String commonKeyword;
|
||||
|
||||
|
||||
/**
|
||||
* 构建通用查询参数
|
||||
|
||||
+12
-2
@@ -6,6 +6,7 @@ import com.budwk.app.base.utils.PageUtil;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
|
||||
/**
|
||||
* 提案通用搜索
|
||||
@@ -20,6 +21,7 @@ public class ProposalSearchParam extends PageForm {
|
||||
private String delegationId;
|
||||
private String createUserName;
|
||||
private String createUserLoginName;
|
||||
private String createUserKeyword;
|
||||
private String caseFilingResult;
|
||||
|
||||
/**
|
||||
@@ -46,11 +48,19 @@ public class ProposalSearchParam extends PageForm {
|
||||
if (StrUtil.isNotBlank(searchParam.getCreateUserLoginName())) {
|
||||
cnd.where().andLike("info.createUserLoginName", searchParam.getCreateUserLoginName());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(searchParam.getCreateUserKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("info.createUserName", searchParam.getCreateUserKeyword());
|
||||
seg.orLike("info.createUserLoginName", searchParam.getCreateUserKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
cnd.andEX("info.caseFilingResult", "=", searchParam.getCaseFilingResult());
|
||||
|
||||
if(StrUtil.isAllNotBlank(searchParam.getPageOrderName(), searchParam.getPageOrderBy())){
|
||||
if (StrUtil.isAllNotBlank(searchParam.getPageOrderName(), searchParam.getPageOrderBy())) {
|
||||
cnd.orderBy(searchParam.getPageOrderName(), PageUtil.getOrder(searchParam.getPageOrderBy()));
|
||||
}else{
|
||||
} else {
|
||||
cnd.asc("info.code");
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -125,6 +125,22 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
info.put("merges", mergeInfos);
|
||||
}
|
||||
|
||||
// 提案委员会成员意见
|
||||
Sql commissionerSql = Sqls.create("""
|
||||
SELECT
|
||||
pco.*,
|
||||
u.username commissionerName,
|
||||
u.loginname commissionerLoginName
|
||||
FROM
|
||||
proposal_commissioner_opinion pco
|
||||
LEFT JOIN vw_user u ON u.id = pco.commissioner
|
||||
WHERE
|
||||
pco.proposalId = @proposalId
|
||||
""");
|
||||
commissionerSql.setParam("proposalId", id);
|
||||
List<NutMap> commissionerOpinions = listMap(commissionerSql);
|
||||
info.put("commissionerOpinions", commissionerOpinions);
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
+11
-1
@@ -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<NutMap> pagination = suggestionBoxService.listPageMap(pageNumber, pageSize, sql);
|
||||
|
||||
+12
-1
@@ -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 {
|
||||
|
||||
+45
-4
@@ -115,16 +115,57 @@ public class TeacherCongressDelegateManageController {
|
||||
delegate.setSessionId(param.getSessionId());
|
||||
delegate.setRoleId(param.getRoleId());
|
||||
}
|
||||
|
||||
dao.insert(delegates);
|
||||
|
||||
for (String userId : userIds) {
|
||||
dao.insert("sys_user_role", Chain.make("userId", userId).add("roleId", param.getRoleId()).add("tcSessionId", param.getSessionId()).add("tcDelegationId", param.getDelegationId()));
|
||||
}
|
||||
// 删除掉旧的权限
|
||||
dao.clear(Sys_user_role.class, Cnd.where(Sys_user_role::getUserId, "in", userIds)
|
||||
.and(Sys_user_role::getTcSessionId, "=", param.getSessionId())
|
||||
.and(Sys_user_role::getRoleId, "=", param.getRoleId()));
|
||||
|
||||
List<Sys_user_role> userRoles = userIds.stream().map(userId -> {
|
||||
Sys_user_role role = new Sys_user_role();
|
||||
role.setUserId(userId);
|
||||
role.setTcSessionId(param.getSessionId());
|
||||
role.setTcDelegationId(param.getDelegationId());
|
||||
role.setRoleId(param.getRoleId());
|
||||
return role;
|
||||
}).toList();
|
||||
dao.insert(userRoles);
|
||||
|
||||
sysUserService.clearCache();
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("tc.delegate.manage")
|
||||
@SLog(tag = "民主管理", msg = "教代会代表管理修改代表")
|
||||
public Result update(@Valid TeacherCongressDelegateManageUpdateParam param) {
|
||||
// 查询原来的记录
|
||||
Teacher_congress_delegate old = dao.fetch(Teacher_congress_delegate.class, param.getId());
|
||||
// 删除掉旧的权限
|
||||
dao.clear(Sys_user_role.class, Cnd.where(Sys_user_role::getUserId, "=", old.getUserId())
|
||||
.and(Sys_user_role::getRoleId, "=", old.getRoleId())
|
||||
.and(Sys_user_role::getTcSessionId, "=", old.getSessionId())
|
||||
.and(Sys_user_role::getTcDelegationId, "=", old.getDelegationId()));
|
||||
|
||||
old.setDelegationId(param.getDelegationId());
|
||||
dao.update(old, "delegationId");
|
||||
|
||||
// 新增权限
|
||||
Sys_user_role role = new Sys_user_role();
|
||||
role.setUserId(param.getUserId());
|
||||
role.setTcSessionId(param.getSessionId());
|
||||
role.setTcDelegationId(param.getDelegationId());
|
||||
role.setRoleId(param.getRoleId());
|
||||
dao.insert(role);
|
||||
|
||||
sysUserService.clearCache();
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("tc.delegate.manage")
|
||||
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
package com.budwk.app.zhgh.democratic.teachercongress.delegate.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_session;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
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.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/zhgh/democratic/teacherCongress/delegate/transition")
|
||||
@Api(tags = "教代会代表换届变动信息")
|
||||
@Ok("json:full")
|
||||
public class TeacherCongressDelegateTransitionController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/teachercongress/delegate/transition/index.html")
|
||||
@SaCheckPermission("tc.delegate.transition")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("tc.delegate.transition")
|
||||
public Result pageData(String sessionId) {
|
||||
// 当前届次
|
||||
Teacher_congress_session session = dao.fetch(Teacher_congress_session.class, sessionId);
|
||||
// 上一届次
|
||||
Teacher_congress_session lastSession = dao.fetch(Teacher_congress_session.class, Cnd.where(Teacher_congress_session::getStartDate, "<", session.getStartDate()).desc(Teacher_congress_session::getStartDate));
|
||||
// 当前届次代表团
|
||||
List<Teacher_congress_delegation> delegations = dao.query(Teacher_congress_delegation.class, Cnd.where(Teacher_congress_delegation::getSessionId, "=", sessionId).asc(Teacher_congress_delegation::getCode));
|
||||
|
||||
// 当前届次代表
|
||||
List<Teacher_congress_delegate> delegates = dao.query(Teacher_congress_delegate.class, Cnd.where(Teacher_congress_delegate::getSessionId, "=", sessionId));
|
||||
dao.fetchLinks(delegates, "delegation");
|
||||
// 上一届次代表
|
||||
List<Teacher_congress_delegate> lastDelegates = dao.query(Teacher_congress_delegate.class, Cnd.where(Teacher_congress_delegate::getSessionId, "=", lastSession.getId()));
|
||||
dao.fetchLinks(lastDelegates, "delegation");
|
||||
|
||||
// 代表数据
|
||||
List<NutMap> delegateFull = delegates.stream().map(delegate -> {
|
||||
NutMap delegateMap = NutMap.NEW();
|
||||
delegateMap.put("userId", delegate.getUserId());
|
||||
delegateMap.put("userName", delegate.getUserName());
|
||||
|
||||
// 本届次代表团信息
|
||||
delegateMap.put("delegationId", delegate.getDelegationId());
|
||||
delegateMap.put("delegationName", delegate.getDelegation().getName());
|
||||
delegateMap.put("delegationCode", delegate.getDelegation().getCode());
|
||||
|
||||
// 上一届次代表团信息
|
||||
lastDelegates.stream().filter(lastDelegate -> lastDelegate.getUserId().equals(delegate.getUserId())).findFirst().ifPresentOrElse(lastDelegate -> {
|
||||
delegateMap.put("lastDelegationId", lastDelegate.getDelegationId());
|
||||
delegateMap.put("lastDelegationName", lastDelegate.getDelegation().getName());
|
||||
delegateMap.put("lastDelegationCode", lastDelegate.getDelegation().getCode());
|
||||
}, () -> {
|
||||
delegateMap.put("lastDelegationId", "");
|
||||
delegateMap.put("lastDelegationName", "");
|
||||
delegateMap.put("lastDelegationCode", "");
|
||||
});
|
||||
|
||||
return delegateMap;
|
||||
}).toList();
|
||||
|
||||
|
||||
List<HashMap<String, Object>> list = delegations.stream().map(delegation -> {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("name", delegation.getName());
|
||||
map.put("code", delegation.getCode());
|
||||
// 上一届次人数
|
||||
map.put("lastCount", delegateFull.stream().filter(delegate -> delegate.getString("lastDelegationCode").equals(delegation.getCode())).count());
|
||||
// 增补代表数 (上一届次不是代表 但是本届次是代表)
|
||||
map.put("addCount", delegateFull.stream().filter(delegate -> StrUtil.isBlank(delegate.getString("lastDelegationCode")) && delegate.getString("delegationCode").equals(delegation.getCode())));
|
||||
// 转入代表数 (上一届次是代表 但是在别的代表团)
|
||||
map.put("transferCount", delegateFull.stream().filter(delegate -> !delegate.getString("lastDelegationCode").equals(delegation.getCode()) && delegate.getString("delegationCode").equals(delegation.getCode())));
|
||||
// 转出代表数 (上一届次在本团 本届次转出去了)
|
||||
map.put("transferOutCount", delegateFull.stream().filter(delegate -> delegate.getString("lastDelegationCode").equals(delegation.getCode()) && StrUtil.isNotBlank(delegate.getString("delegationCode")) && !delegate.getString("delegationCode").equals(delegation.getCode())));
|
||||
// 减少代表数 (上一届次是代表 本届次不是代表)
|
||||
map.put("reduceCount", delegateFull.stream().filter(delegate -> delegate.getString("lastDelegationCode").equals(delegation.getCode()) && StrUtil.isBlank(delegate.getString("delegationCode"))));
|
||||
// 当前代表数
|
||||
map.put("currentCount", delegateFull.stream().filter(delegate -> delegate.getString("delegationCode").equals(delegation.getCode())).count());
|
||||
return map;
|
||||
}).toList();
|
||||
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
+3
@@ -2,6 +2,7 @@ package com.budwk.app.zhgh.democratic.teachercongress.delegate.models;
|
||||
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
@@ -85,4 +86,6 @@ public class Teacher_congress_delegate extends BaseModel {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String roleId;
|
||||
|
||||
@One(field = "delegationId")
|
||||
private Teacher_congress_delegation delegation;
|
||||
}
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.budwk.app.zhgh.democratic.teachercongress.delegate.param;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 教代会代表更新对象
|
||||
*/
|
||||
@Data
|
||||
public class TeacherCongressDelegateManageUpdateParam {
|
||||
|
||||
@NotBlank(message = "主键不能为空")
|
||||
private String id;
|
||||
|
||||
@NotBlank(message = "教代会届次不能为空")
|
||||
private String sessionId;
|
||||
|
||||
@NotBlank(message = "代表团不能为空")
|
||||
private String delegationId;
|
||||
|
||||
@NotBlank(message = "代表类型不能为空")
|
||||
private String roleId;
|
||||
|
||||
@NotEmpty(message = "用户不能为空")
|
||||
private String userId;
|
||||
|
||||
|
||||
}
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
@@ -88,7 +89,7 @@ public class ContributionTypeController {
|
||||
|
||||
@At
|
||||
@ApiOperation("查询慈善捐助专题")
|
||||
@SaCheckPermission("contribution")
|
||||
@SaCheckLogin
|
||||
public Result queryContributionType() {
|
||||
List<ContributionType> list = typeService.query(Cnd.NEW().desc(ContributionType::getTypeCode));
|
||||
return Result.success(list);
|
||||
@@ -96,7 +97,7 @@ public class ContributionTypeController {
|
||||
|
||||
@At
|
||||
@ApiOperation("查询单个慈善捐助专题")
|
||||
@SaCheckPermission("contribution")
|
||||
@SaCheckLogin
|
||||
public Result fetchOne(String id) {
|
||||
ContributionType type = typeService.fetch(id);
|
||||
List<ContributionProject> list = dao.query(ContributionProject.class, Cnd.where(ContributionProject::getContributionTypeCode, "=", type.getTypeCode()).and(ContributionProject::getIsContributionEnable, "=", true));
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.contribution.h5Controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -95,7 +96,7 @@ public class H5ContributionListController {
|
||||
|
||||
@At
|
||||
@ApiOperation("查询单个慈善捐助专题")
|
||||
@SaCheckPermission("contribution")
|
||||
@SaCheckLogin
|
||||
public Result fetchOne(String id) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
|
||||
+1
-1
@@ -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,
|
||||
|
||||
-130
@@ -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<NutMap> pagination = mutualInsuranceUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
|
||||
-130
@@ -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<NutMap> pagination = mutualInsuranceUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
|
||||
-130
@@ -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<NutMap> pagination = mutualInsuranceUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user