Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -25,6 +25,7 @@ RoleConstant {
|
||||
SCHOOL_UNION_WC_ADMIN("校工会工代会管理员"),
|
||||
SCHOOL_UNION_DC_ADMIN("校工会民主管理员"),
|
||||
SCHOOL_UNION_PROPOSAL_ADMIN("校工会提案管理员"),
|
||||
APPEAL_COMMITTEE_MEMBER("申诉处理委员会成员"),
|
||||
SCHOOL_UNION_CLUB_ADMIN("校工会协会管理员"),
|
||||
SCHOOL_UNION_ACTIVITY_ADMIN("校工会活动管理员"),
|
||||
SCHOOL_UNION_ARTICLE_CLUB_ADMIN("校工会协会新闻审批管理员"),
|
||||
|
||||
@@ -61,6 +61,9 @@ public class FlowEngineImpl implements FlowEngine {
|
||||
@Override
|
||||
public ProcessInstance startProcessInstanceByKey(String key, String businessKey, String operator, Dict args) {
|
||||
ProcessDefine define = processDefineService.getLastByName(key);
|
||||
if (define == null) {
|
||||
throw new BaseException("流程定义不存在或未启用:" + key);
|
||||
}
|
||||
return startProcessInstanceById(define.getId(), businessKey, operator, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.budwk.app.flow.handler;
|
||||
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.exception.BaseException;
|
||||
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 org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.lang.Lang;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 获取申诉处理委员会成员
|
||||
*/
|
||||
public class FlowAppealCommitteeAssignmentHandler implements AssignmentHandler {
|
||||
|
||||
@Override
|
||||
public List<String> assign(TaskModel model, Execution execution) {
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
userRole.userId
|
||||
FROM
|
||||
`sys_user_role` userRole
|
||||
LEFT JOIN sys_role role ON role.id = userRole.roleId
|
||||
WHERE
|
||||
role.`code` = @roleCode
|
||||
GROUP BY
|
||||
userRole.userId
|
||||
""").setParam("roleCode", RoleConstant.APPEAL_COMMITTEE_MEMBER.name());
|
||||
sql.setCallback(Sqls.callback.strList());
|
||||
dao.execute(sql);
|
||||
List<String> userIds = sql.getList(String.class);
|
||||
if (Lang.isEmpty(userIds)) {
|
||||
throw new BaseException("申诉处理委员会成员没有设置,请联系管理员!");
|
||||
}
|
||||
return userIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "申诉处理委员会成员";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.budwk.app.flow.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.exception.BaseException;
|
||||
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 org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.lang.Lang;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 获取被申诉单位分工会管理员
|
||||
*/
|
||||
public class FlowAppealDefendantUnitAssignmentHandler implements AssignmentHandler {
|
||||
|
||||
@Override
|
||||
public List<String> assign(TaskModel model, Execution execution) {
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class);
|
||||
|
||||
String unitId = StrUtil.blankToDefault(execution.getArgs().getStr("appealDefendantUnitId"), execution.getArgs().getStr("defendantUnitId"));
|
||||
if (StrUtil.isBlank(unitId)) {
|
||||
throw new BaseException("被申诉单位不能为空!");
|
||||
}
|
||||
|
||||
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.BRANCH_UNION_ADMIN);
|
||||
List<Sys_user_role> userRoles = dao.query(Sys_user_role.class, Cnd.where("roleId", "=", sysRole.getId()).and("unitId", "=", unitId));
|
||||
if (Lang.isEmpty(userRoles)) {
|
||||
userRoles = dao.query(Sys_user_role.class, Cnd.where("roleId", "=", sysRole.getId()).and("unionId", "=", unitId));
|
||||
}
|
||||
if (Lang.isEmpty(userRoles)) {
|
||||
throw new BaseException("被申诉单位分工会管理员没有设置,请联系管理员!", sysRole.getCode());
|
||||
}
|
||||
return userRoles.stream().map(Sys_user_role::getUserId).distinct().toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "被申诉单位分工会管理员";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
@@ -114,9 +114,9 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
|
||||
user.setMenus(allMenus);
|
||||
|
||||
//pc端菜单
|
||||
List<Sys_menu> pcMenus = allMenus.stream().filter(menu -> menu.getPlatform().equals("PC")).toList();
|
||||
List<Sys_menu> pcMenus = allMenus.stream().filter(menu -> StrUtil.equals(menu.getPlatform(), "PC")).toList();
|
||||
//h5端菜单
|
||||
List<Sys_menu> h5Menus = allMenus.stream().filter(menu -> menu.getPlatform().equals("H5")).toList();
|
||||
List<Sys_menu> h5Menus = allMenus.stream().filter(menu -> StrUtil.equals(menu.getPlatform(), "H5")).toList();
|
||||
|
||||
//所有的模块
|
||||
Set<String> allModuleIds = allMenus.stream().map(Sys_menu::getModuleId).collect(Collectors.toSet());
|
||||
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
package com.budwk.app.zhgh.democratic.appeal.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.appeal.models.AppealInfo;
|
||||
import com.budwk.app.zhgh.democratic.appeal.service.AppealInfoService;
|
||||
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.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;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/appeal/accept")
|
||||
@Ok("json:full")
|
||||
@Api("申诉管理-受理")
|
||||
public class AppealAcceptController {
|
||||
|
||||
@Inject
|
||||
private AppealInfoService appealInfoService;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/appeal/accept/index.html")
|
||||
@SaCheckPermission("appeal.accept")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.accept")
|
||||
public Result pageData(Integer pageNumber, Integer pageSize, String searchKeyword, String appealTypeId,
|
||||
Integer year, boolean approval) {
|
||||
Sql sql = listSql();
|
||||
Cnd cnd = taskCondition("appealAccept", "受理", approval);
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
cnd.and("info.title", "like", "%" + searchKeyword + "%");
|
||||
}
|
||||
cnd.andEX("info.appealTypeId", "=", appealTypeId);
|
||||
cnd.andEX("YEAR(info.applyDate)", "=", year);
|
||||
cnd.desc("info.applyDate");
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = appealInfoService.listPageMap(pageNumber, pageSize, sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.accept")
|
||||
@ApiOperation("查询受理任务")
|
||||
public Result queryTask(@Param("taskId") Long taskId) {
|
||||
Sql sql = listSql();
|
||||
sql.setCondition(Cnd.where("t.id", "=", taskId));
|
||||
return Result.success(appealInfoService.fetchMap(sql));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.accept")
|
||||
@ApiOperation("受理申诉")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "申诉管理-受理", msg = "受理申诉")
|
||||
public Result accept(@Param("data") AppealInfo appealInfo, @Param("taskId") Long taskId,
|
||||
@Param("submitType") Integer submitType) {
|
||||
AppealInfo old = appealInfoService.fetch(appealInfo.getId());
|
||||
BeanUtil.copyProperties(appealInfo, old, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
|
||||
old.setAcceptUserId(SecurityUtil.getUserId());
|
||||
old.setAcceptUserName(SecurityUtil.getUserUsername());
|
||||
old.setAcceptTime(new Date());
|
||||
if (ProcessSubmitTypeEnum.AGREE.getCode().equals(submitType)) {
|
||||
old.setState("待执行");
|
||||
} else if (ProcessSubmitTypeEnum.ROLLBACK_TO_OPERATOR.getCode().equals(submitType)) {
|
||||
old.setState("退回修改");
|
||||
} else if (ProcessSubmitTypeEnum.REJECT.getCode().equals(submitType)) {
|
||||
old.setState("已办结");
|
||||
}
|
||||
appealInfoService.updateIgnoreNull(old);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, submitType);
|
||||
dict.set(FlowConst.FORM_DATA, old);
|
||||
dict.set("appealDefendantUnitId", old.getDefendantUnitId());
|
||||
dict.set("defendantUnitId", old.getDefendantUnitId());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
private Sql listSql() {
|
||||
return 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 appeal_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
|
||||
""");
|
||||
}
|
||||
|
||||
private Cnd taskCondition(String taskName, String displayName, boolean approval) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and(Cnd.exps("t.taskName", "=", taskName).or("t.displayName", "=", displayName));
|
||||
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());
|
||||
}
|
||||
return cnd;
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.budwk.app.zhgh.democratic.appeal.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.appeal.service.AppealTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
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.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/appeal/common")
|
||||
@Ok("json:full")
|
||||
@Api("申诉管理-公共接口")
|
||||
public class AppealCommonController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private AppealTypeService appealTypeService;
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result typeOptions() {
|
||||
return Result.success(appealTypeService.query(Cnd.where("enabled", "=", true).asc("sort").desc("createdAt")));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result queryTypeOptions() {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
type_data.*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
atype.id,
|
||||
atype.`name`,
|
||||
atype.enabled,
|
||||
atype.sort
|
||||
FROM
|
||||
appeal_type atype
|
||||
WHERE
|
||||
atype.enabled = 1
|
||||
UNION
|
||||
SELECT
|
||||
info.appealTypeId AS id,
|
||||
COALESCE(MAX(atype.`name`), MAX(info.appealTypeName)) AS `name`,
|
||||
COALESCE(MAX(atype.enabled), 0) AS enabled,
|
||||
COALESCE(MAX(atype.sort), 999999) AS sort
|
||||
FROM
|
||||
appeal_info info
|
||||
LEFT JOIN appeal_type atype ON atype.id = info.appealTypeId
|
||||
WHERE
|
||||
info.appealTypeId IS NOT NULL
|
||||
AND info.appealTypeId != ''
|
||||
GROUP BY
|
||||
info.appealTypeId
|
||||
) type_data
|
||||
ORDER BY
|
||||
type_data.sort ASC,
|
||||
type_data.`name` ASC
|
||||
""");
|
||||
return Result.success(appealTypeService.listMap(sql));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result unitOptions(String unionId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
unit.*,
|
||||
su.`name` AS unionName
|
||||
FROM
|
||||
`sys_unit` unit
|
||||
LEFT JOIN sys_union su ON su.id = unit.unionId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("unit.unionId", "=", unionId);
|
||||
cnd.and("unit.unitLevel", "=", "2");
|
||||
cnd.asc("unit.unitcode");
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(appealTypeService.listMap(sql));
|
||||
}
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
package com.budwk.app.zhgh.democratic.appeal.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.appeal.models.AppealInfo;
|
||||
import com.budwk.app.zhgh.democratic.appeal.service.AppealInfoService;
|
||||
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.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;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/appeal/execute")
|
||||
@Ok("json:full")
|
||||
@Api("申诉管理-执行")
|
||||
public class AppealExecuteController {
|
||||
|
||||
@Inject
|
||||
private AppealInfoService appealInfoService;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/appeal/execute/index.html")
|
||||
@SaCheckPermission("appeal.execute")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.execute")
|
||||
public Result pageData(Integer pageNumber, Integer pageSize, String searchKeyword, String appealTypeId,
|
||||
Integer year, boolean approval) {
|
||||
Sql sql = listSql();
|
||||
Cnd cnd = taskCondition("appealExecute", "执行", approval);
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
cnd.and("info.title", "like", "%" + searchKeyword + "%");
|
||||
}
|
||||
cnd.andEX("info.appealTypeId", "=", appealTypeId);
|
||||
cnd.andEX("YEAR(info.applyDate)", "=", year);
|
||||
cnd.desc("info.applyDate");
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = appealInfoService.listPageMap(pageNumber, pageSize, sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.execute")
|
||||
@ApiOperation("查询执行任务")
|
||||
public Result queryTask(@Param("taskId") Long taskId) {
|
||||
Sql sql = listSql();
|
||||
sql.setCondition(Cnd.where("t.id", "=", taskId));
|
||||
return Result.success(appealInfoService.fetchMap(sql));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.execute")
|
||||
@ApiOperation("提交执行情况")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "申诉管理-执行", msg = "提交执行情况")
|
||||
public Result execute(@Param("data") AppealInfo appealInfo, @Param("taskId") Long taskId) {
|
||||
AppealInfo old = appealInfoService.fetch(appealInfo.getId());
|
||||
BeanUtil.copyProperties(appealInfo, old, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
|
||||
old.setExecuteUserId(SecurityUtil.getUserId());
|
||||
old.setExecuteUserName(SecurityUtil.getUserUsername());
|
||||
old.setExecuteTime(new Date());
|
||||
old.setState("已办结");
|
||||
appealInfoService.updateIgnoreNull(old);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.AGREE.getCode());
|
||||
dict.set(FlowConst.FORM_DATA, old);
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
private Sql listSql() {
|
||||
return 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 appeal_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
|
||||
""");
|
||||
}
|
||||
|
||||
private Cnd taskCondition(String taskName, String displayName, boolean approval) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and(Cnd.exps("t.taskName", "=", taskName).or("t.displayName", "=", displayName));
|
||||
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());
|
||||
}
|
||||
return cnd;
|
||||
}
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.budwk.app.zhgh.democratic.appeal.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.result.Result;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.appeal.service.AppealInfoService;
|
||||
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.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/appeal/mine")
|
||||
@Ok("json:full")
|
||||
@Api("申诉管理-我的申诉")
|
||||
public class AppealMineController {
|
||||
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private AppealInfoService appealInfoService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/appeal/mine/index.html")
|
||||
@SaCheckPermission("appeal.mine")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.mine")
|
||||
public Result pageData(Integer pageNumber, Integer pageSize, String searchKeyword, String appealTypeId, Integer year) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ins.state instanceState,
|
||||
t.id startTaskId,
|
||||
t.taskName AS taskKey,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') taskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
appeal_info 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.taskName = 'startTask'
|
||||
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.where("info.userId", "=", SecurityUtil.getUserId());
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
cnd.and("info.title", "like", "%" + searchKeyword + "%");
|
||||
}
|
||||
cnd.andEX("info.appealTypeId", "=", appealTypeId);
|
||||
cnd.andEX("YEAR(info.applyDate)", "=", year);
|
||||
cnd.groupBy("info.id");
|
||||
cnd.desc("info.applyDate");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = appealInfoService.listPageMap(pageNumber, pageSize, sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.mine")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("删除申诉")
|
||||
public Result delete(@Param("id") String id) {
|
||||
appealInfoService.delete(id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
package com.budwk.app.zhgh.democratic.appeal.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.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.appeal.service.AppealInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/appeal/query")
|
||||
@Ok("json:full")
|
||||
@Api("申诉管理-查询统计")
|
||||
public class AppealQueryController {
|
||||
|
||||
@Inject
|
||||
private AppealInfoService appealInfoService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/appeal/query/index.html")
|
||||
@SaCheckPermission("appeal.query")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.query")
|
||||
public Result pageData(Integer pageNumber, Integer pageSize, String searchKeyword, String appealTypeId, String state,
|
||||
String unitId, String defendantUnitId, Integer year) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ins.state instanceState
|
||||
FROM
|
||||
appeal_info info
|
||||
LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = buildCondition(searchKeyword, appealTypeId, state, unitId, defendantUnitId, year);
|
||||
cnd.desc("info.applyDate");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = appealInfoService.listPageMap(pageNumber, pageSize, sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.query")
|
||||
@ApiOperation("申诉统计")
|
||||
public Result statistics(String searchKeyword, String appealTypeId, String state, String unitId,
|
||||
String defendantUnitId, Integer year) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
COUNT(1) totalCount,
|
||||
SUM(CASE WHEN info.state = '待受理' THEN 1 ELSE 0 END) waitAcceptCount,
|
||||
SUM(CASE WHEN info.state = '待执行' THEN 1 ELSE 0 END) waitExecuteCount,
|
||||
SUM(CASE WHEN info.state = '已办结' THEN 1 ELSE 0 END) finishCount
|
||||
FROM
|
||||
appeal_info info
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(buildCondition(searchKeyword, appealTypeId, state, unitId, defendantUnitId, year));
|
||||
NutMap data = appealInfoService.fetchMap(sql);
|
||||
return Result.success(data);
|
||||
}
|
||||
|
||||
private Cnd buildCondition(String searchKeyword, String appealTypeId, String state, String unitId,
|
||||
String defendantUnitId, Integer year) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
cnd.and("info.title", "like", "%" + searchKeyword + "%");
|
||||
}
|
||||
cnd.andEX("info.appealTypeId", "=", appealTypeId);
|
||||
cnd.andEX("info.state", "=", state);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
cnd.andEX("info.defendantUnitId", "=", defendantUnitId);
|
||||
cnd.andEX("YEAR(info.applyDate)", "=", year);
|
||||
return cnd;
|
||||
}
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package com.budwk.app.zhgh.democratic.appeal.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;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.appeal.models.AppealInfo;
|
||||
import com.budwk.app.zhgh.democratic.appeal.models.AppealType;
|
||||
import com.budwk.app.zhgh.democratic.appeal.service.AppealTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
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;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/appeal/type")
|
||||
@Ok("json:full")
|
||||
@Api("申诉管理-类型维护")
|
||||
public class AppealTypeController {
|
||||
|
||||
@Inject
|
||||
private AppealTypeService appealTypeService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/appeal/type/index.html")
|
||||
@SaCheckPermission("appeal.type")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.type")
|
||||
public Result pageData(Integer pageNumber, Integer pageSize, String name) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(name)) {
|
||||
cnd.and("name", "like", "%" + name + "%");
|
||||
}
|
||||
cnd.asc("sort").desc("createdAt");
|
||||
Pagination page = appealTypeService.listPage(pageNumber, pageSize, cnd);
|
||||
return Result.success(page);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.type")
|
||||
@ApiOperation("保存申诉类型")
|
||||
@SLog(tag = "申诉管理-类型维护", msg = "保存申诉类型")
|
||||
public Result save(@Param("data") AppealType appealType) {
|
||||
if (appealType.getEnabled() == null) {
|
||||
appealType.setEnabled(true);
|
||||
}
|
||||
if (appealType.getSort() == null) {
|
||||
appealType.setSort(0);
|
||||
}
|
||||
appealTypeService.insertOrUpdate(appealType);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.type")
|
||||
@ApiOperation("修改申诉类型启用状态")
|
||||
@SLog(tag = "申诉管理-类型维护", msg = "修改申诉类型启用状态")
|
||||
public Result statusChange(String id, Boolean enabled) {
|
||||
appealTypeService.update(Chain.make("enabled", enabled), Cnd.where("id", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.type")
|
||||
@ApiOperation("删除申诉类型")
|
||||
@SLog(tag = "申诉管理-类型维护", msg = "删除申诉类型")
|
||||
public Result delete(@Param("id") String id) {
|
||||
int count = appealTypeService.dao().count(AppealInfo.class, Cnd.where("appealTypeId", "=", id));
|
||||
if (count > 0) {
|
||||
return Result.error("该类型有关联的申诉,无法删除!");
|
||||
}
|
||||
appealTypeService.delete(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("申诉类型下拉")
|
||||
public Result options() {
|
||||
return Result.success(appealTypeService.query(Cnd.where("enabled", "=", true).asc("sort").desc("createdAt")));
|
||||
}
|
||||
}
|
||||
+161
@@ -0,0 +1,161 @@
|
||||
package com.budwk.app.zhgh.democratic.appeal.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.appeal.models.AppealInfo;
|
||||
import com.budwk.app.zhgh.democratic.appeal.models.AppealType;
|
||||
import com.budwk.app.zhgh.democratic.appeal.service.AppealInfoService;
|
||||
import com.budwk.app.zhgh.democratic.appeal.service.AppealTypeService;
|
||||
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.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/appeal/write")
|
||||
@Ok("json:full")
|
||||
@Api("申诉管理-提交申诉")
|
||||
public class AppealWriteController {
|
||||
|
||||
private static final String DEFINE_KEY = "SSGL";
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
@Inject
|
||||
private AppealInfoService appealInfoService;
|
||||
@Inject
|
||||
private AppealTypeService appealTypeService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/appeal/write/index.html")
|
||||
@SaCheckPermission("appeal.write")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.write")
|
||||
@ApiOperation("当前用户信息")
|
||||
public Result currentUserInfo() {
|
||||
View_user user = dao.fetch(View_user.class, Cnd.where("id", "=", SecurityUtil.getUserId()));
|
||||
AppealInfo info = new AppealInfo();
|
||||
if (user != null) {
|
||||
info.setUserId(user.getId());
|
||||
info.setUserName(user.getUsername());
|
||||
info.setLoginName(user.getLoginname());
|
||||
info.setSex(user.getSex());
|
||||
info.setBirthday(user.getBirthday());
|
||||
info.setPolitical(user.getPolitical());
|
||||
info.setUnitId(user.getUnitId());
|
||||
info.setUnitName(user.getUnitName());
|
||||
info.setPositionName(user.getPosition());
|
||||
info.setMobile(user.getMobile());
|
||||
} else {
|
||||
info.setUserId(SecurityUtil.getUserId());
|
||||
info.setUserName(SecurityUtil.getUserUsername());
|
||||
info.setLoginName(SecurityUtil.getUserLoginname());
|
||||
info.setUnitId(SecurityUtil.getUnitId());
|
||||
}
|
||||
info.setApplyDate(new Date());
|
||||
return Result.success(info);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.write")
|
||||
@ApiOperation("获取申诉信息")
|
||||
public Result info(@Param("id") String id) {
|
||||
return Result.success(appealInfoService.fetch(id));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.write")
|
||||
@ApiOperation("保存申诉")
|
||||
@SLog(tag = "申诉管理-提交申诉", msg = "保存申诉")
|
||||
public Result save(@Param("data") AppealInfo appealInfo) {
|
||||
fillTypeName(appealInfo);
|
||||
appealInfoService.insertOrUpdate(appealInfo);
|
||||
return Result.success(appealInfo);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.write")
|
||||
@ApiOperation("提交申诉")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "申诉管理-提交申诉", msg = "提交申诉")
|
||||
public Result submit(@Param("data") AppealInfo appealInfo) {
|
||||
fillTypeName(appealInfo);
|
||||
if (appealInfo.getApplyDate() == null) {
|
||||
appealInfo.setApplyDate(new Date());
|
||||
}
|
||||
appealInfo.setState("待受理");
|
||||
appealInfoService.insertOrUpdate(appealInfo);
|
||||
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, appealInfo);
|
||||
args.set("appealDefendantUnitId", appealInfo.getDefendantUnitId());
|
||||
args.set("defendantUnitId", appealInfo.getDefendantUnitId());
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey(DEFINE_KEY, appealInfo.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(appealInfo);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("appeal.write")
|
||||
@ApiOperation("重新提交申诉")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "申诉管理-提交申诉", msg = "重新提交申诉")
|
||||
public Result submitAgain(@Param("data") AppealInfo appealInfo, @Param("taskId") Long taskId) {
|
||||
fillTypeName(appealInfo);
|
||||
appealInfo.setState("待受理");
|
||||
appealInfoService.insertOrUpdate(appealInfo);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
dict.set(FlowConst.FORM_DATA, appealInfo);
|
||||
dict.set("appealDefendantUnitId", appealInfo.getDefendantUnitId());
|
||||
dict.set("defendantUnitId", appealInfo.getDefendantUnitId());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success(appealInfo);
|
||||
}
|
||||
|
||||
private void fillTypeName(AppealInfo appealInfo) {
|
||||
if (appealInfo == null || StrUtil.isBlank(appealInfo.getAppealTypeId())) {
|
||||
return;
|
||||
}
|
||||
AppealType type = appealTypeService.fetch(appealInfo.getAppealTypeId());
|
||||
if (type != null) {
|
||||
appealInfo.setAppealTypeName(type.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
package com.budwk.app.zhgh.democratic.appeal.models;
|
||||
|
||||
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.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("appeal_info")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("教职工申诉")
|
||||
@Data
|
||||
public class AppealInfo 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 userId;
|
||||
|
||||
@Column
|
||||
@Comment("申诉人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("申诉人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@Comment("出生年月")
|
||||
@ColDefine(type = ColType.DATE)
|
||||
private Date birthday;
|
||||
|
||||
@Column
|
||||
@Comment("政治面貌")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String political;
|
||||
|
||||
@Column
|
||||
@Comment("所在单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("所在单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@Comment("岗位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String positionName;
|
||||
|
||||
@Column
|
||||
@Comment("住址")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 300)
|
||||
private String address;
|
||||
|
||||
@Column
|
||||
@Comment("联系方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("申诉类型ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String appealTypeId;
|
||||
|
||||
@Column
|
||||
@Comment("申诉类型名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String appealTypeName;
|
||||
|
||||
@Column
|
||||
@Comment("被申诉单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String defendantUnitId;
|
||||
|
||||
@Column
|
||||
@Comment("被申诉单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String defendantUnitName;
|
||||
|
||||
@Column
|
||||
@Comment("被申诉单位地址")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 300)
|
||||
private String defendantAddress;
|
||||
|
||||
@Column
|
||||
@Comment("被申诉单位联系方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String defendantContact;
|
||||
|
||||
@Column
|
||||
@Comment("申诉标题")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String title;
|
||||
|
||||
@Column
|
||||
@Comment("申诉事项")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String appealMatter;
|
||||
|
||||
@Column
|
||||
@Comment("申诉理由")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String reason;
|
||||
|
||||
@Column
|
||||
@Comment("申诉要求")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String request;
|
||||
|
||||
@Column
|
||||
@Comment("申请日期")
|
||||
@ColDefine(type = ColType.DATE)
|
||||
private Date applyDate;
|
||||
|
||||
@Column
|
||||
@Comment("申诉人签名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String signature;
|
||||
|
||||
@Column
|
||||
@Comment("附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
|
||||
@Column
|
||||
@Comment("业务状态")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String state;
|
||||
|
||||
@Column
|
||||
@Comment("受理人ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String acceptUserId;
|
||||
|
||||
@Column
|
||||
@Comment("受理人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String acceptUserName;
|
||||
|
||||
@Column
|
||||
@Comment("受理时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date acceptTime;
|
||||
|
||||
@Column
|
||||
@Comment("处理决定")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String decisionContent;
|
||||
|
||||
@Column
|
||||
@Comment("事实理由及适用依据")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String legalBasis;
|
||||
|
||||
@Column
|
||||
@Comment("作出决定日期")
|
||||
@ColDefine(type = ColType.DATE)
|
||||
private Date decisionDate;
|
||||
|
||||
@Column
|
||||
@Comment("决定书附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> decisionFiles;
|
||||
|
||||
@Column
|
||||
@Comment("执行人ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String executeUserId;
|
||||
|
||||
@Column
|
||||
@Comment("执行人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String executeUserName;
|
||||
|
||||
@Column
|
||||
@Comment("执行时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date executeTime;
|
||||
|
||||
@Column
|
||||
@Comment("执行情况")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String executeContent;
|
||||
|
||||
@Column
|
||||
@Comment("执行附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> executeFiles;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.budwk.app.zhgh.democratic.appeal.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;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("appeal_type")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("申诉类型")
|
||||
@Data
|
||||
public class AppealType 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 name;
|
||||
|
||||
@Column
|
||||
@Comment("排序")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("0")
|
||||
private Integer sort;
|
||||
|
||||
@Column
|
||||
@Comment("是否启用")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("1")
|
||||
private Boolean enabled;
|
||||
|
||||
@Column
|
||||
@Comment("备注")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.budwk.app.zhgh.democratic.appeal.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.democratic.appeal.models.AppealInfo;
|
||||
|
||||
public interface AppealInfoService extends BaseService<AppealInfo> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.budwk.app.zhgh.democratic.appeal.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.democratic.appeal.models.AppealType;
|
||||
|
||||
public interface AppealTypeService extends BaseService<AppealType> {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.democratic.appeal.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.democratic.appeal.models.AppealInfo;
|
||||
import com.budwk.app.zhgh.democratic.appeal.service.AppealInfoService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class AppealInfoServiceImpl extends BaseServiceImpl<AppealInfo> implements AppealInfoService {
|
||||
public AppealInfoServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.democratic.appeal.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.democratic.appeal.models.AppealType;
|
||||
import com.budwk.app.zhgh.democratic.appeal.service.AppealTypeService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class AppealTypeServiceImpl extends BaseServiceImpl<AppealType> implements AppealTypeService {
|
||||
public AppealTypeServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+5
-6
@@ -9,8 +9,7 @@ import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import com.budwk.app.zhgh.staffmanage.member.service.MemberInfoService;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
@@ -24,12 +23,12 @@ import javax.validation.Valid;
|
||||
public class MemberApplyCommonController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
private MemberInfoService memberInfoService;
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result findOne(@Valid String id) {
|
||||
View_user user = dao.fetch(View_user.class, Cnd.where("id", "=", id));
|
||||
View_user user = memberInfoService.getMemberInfoDetail(id);
|
||||
if (ObjectUtil.isNull(user)) {
|
||||
return Result.error("用户信息不存在");
|
||||
}
|
||||
@@ -39,8 +38,8 @@ public class MemberApplyCommonController {
|
||||
return Result.success(user);
|
||||
}
|
||||
|
||||
// 分会主席只能查看本分会用户或未分配分会的用户 分工会操作员同主席权限一致
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_OPERATOR.name()) && (user.getUnionId().equals(SecurityUtil.getUnionId()) || StrUtil.isBlank(user.getUnionId()))) {
|
||||
// 分会主席、分工会操作员只能查看本分会用户,无工会人员不再放行,避免空工会人员查看时报错。
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_OPERATOR.name()) && StrUtil.isNotBlank(user.getUnionId()) && user.getUnionId().equals(SecurityUtil.getUnionId())) {
|
||||
user.setIdCard(DesensitizedUtil.idCardNum(user.getIdCard(), 3, 4));
|
||||
user.setMobile(DesensitizedUtil.mobilePhone(user.getMobile()));
|
||||
return Result.success(user);
|
||||
|
||||
+12
-7
@@ -10,6 +10,7 @@ import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.sys.models.Sys_union;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffmanage.member.models.MemberChangeRecord;
|
||||
@@ -73,7 +74,7 @@ public class MemberChangeMineController {
|
||||
info.loginname,
|
||||
info.sex,
|
||||
info.unitName,
|
||||
info.unionName,
|
||||
IFNULL(su.name, info.unionName) AS unionName,
|
||||
info.userState,
|
||||
info.preparedBy,
|
||||
info.personType,
|
||||
@@ -100,16 +101,15 @@ public class MemberChangeMineController {
|
||||
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
|
||||
-- 使用工会表实时名称展示,避免历史变更记录冗余工会名称不一致。
|
||||
LEFT JOIN sys_union su ON su.id = info.unionId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
pageForm.buildSearch(cnd, "info.");
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_MEMBER_ADMIN.name())) {
|
||||
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
|
||||
cnd.and("info.unionId", "=", SecurityUtil.getUnionId());
|
||||
} else {
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
// 除超管和校工会管理员外,其他角色只查看当前所属分工会的变更申请。
|
||||
cnd.and("info.unionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.applyDateTime");
|
||||
@@ -152,6 +152,11 @@ public class MemberChangeMineController {
|
||||
public Result findMemberChangeRecord(String id){
|
||||
MemberChangeRecord record = dao.fetch(MemberChangeRecord.class, id);
|
||||
NutMap nutMap = Lang.obj2nutmap(record);
|
||||
Sys_union union = dao.fetch(Sys_union.class, record.getUnionId());
|
||||
// 查看页所属工会与列表一致,优先使用 unionId 对应的实时工会名称。
|
||||
if (Lang.isNotEmpty(union)) {
|
||||
nutMap.put("unionName", union.getName());
|
||||
}
|
||||
|
||||
List<NutMap> changeInfos = memberCommonService.getChangeInfos(nutMap.getString("id"));
|
||||
nutMap.put("changeInfos", changeInfos);
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package com.budwk.app.zhgh.staffmanage.member.controller.check;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.staffmanage.member.service.MemberCheckTaskService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:MemberCheckConfirmController
|
||||
* @Date 2025/9/26 15:31
|
||||
* @注释 会员核对确认统计
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/member/check/confirm")
|
||||
public class MemberCheckConfirmController {
|
||||
|
||||
@Inject
|
||||
private MemberCheckTaskService memberCheckTaskService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffmanage/member/check/confirm/index.html")
|
||||
@SaCheckPermission("member.check.confirm")
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("工会确认情况分页统计")
|
||||
@SaCheckPermission("member.check.confirm")
|
||||
public Result pageData(PageForm pageForm, Integer year, String checkTaskId, String unionId) {
|
||||
return Result.success(memberCheckTaskService.confirmStatistics(
|
||||
pageForm.getPageNumber(),
|
||||
pageForm.getPageSize(),
|
||||
year,
|
||||
checkTaskId,
|
||||
unionId
|
||||
));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("按年度查询事项")
|
||||
@SaCheckPermission("member.check.confirm")
|
||||
public Result listEnabledTask(Integer year) {
|
||||
return Result.success(memberCheckTaskService.listEnabledTask(year == null ? DateUtil.thisYear() : year));
|
||||
}
|
||||
}
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
package com.budwk.app.zhgh.staffmanage.member.controller.check;
|
||||
|
||||
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 cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.model.ExcelImportRes;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberCheckPageForm;
|
||||
import com.budwk.app.zhgh.staffmanage.member.service.MemberCheckTaskService;
|
||||
import com.budwk.app.zhgh.staffmanage.member.template.MemberCheckTaskUserImportTemp;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.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.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.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:MemberCheckRosterController
|
||||
* @Date 2025/9/24 11:24
|
||||
* @注释 会员核对人员名单
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/member/check/roster")
|
||||
public class MemberCheckRosterController {
|
||||
|
||||
@Inject
|
||||
private MemberCheckTaskService memberCheckTaskService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffmanage/member/check/roster/index.html")
|
||||
@SaCheckPermission("member.check.roster")
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询已发布事项")
|
||||
@SaCheckPermission("member.check.roster")
|
||||
public Result listEnabledTask(Integer year) {
|
||||
return Result.success(memberCheckTaskService.listEnabledTask(year == null ? DateUtil.thisYear() : year));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("人员名单分页查询")
|
||||
@SaCheckPermission("member.check.roster")
|
||||
public Result pageData(@Param("pageForm") MemberCheckPageForm pageForm) {
|
||||
return Result.success(memberCheckTaskService.checkUserPageData(pageForm));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询可添加人员")
|
||||
@SaCheckPermission("member.check.roster")
|
||||
@Ok("json:{dateFormat:'yyyy-MM-dd'}")
|
||||
public Result notCheckUserPageData(@Param("pageForm") MemberCheckPageForm pageForm) {
|
||||
if (StrUtil.isBlank(pageForm.getCheckTaskId())) {
|
||||
return Result.error("请选择事项");
|
||||
}
|
||||
return Result.success(memberCheckTaskService.notCheckUserPageData(pageForm));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("按筛选条件添加人员")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("member.check.roster")
|
||||
public Result addCheckUser(@Param("pageForm") MemberCheckPageForm pageForm) {
|
||||
if (StrUtil.isBlank(pageForm.getCheckTaskId())) {
|
||||
return Result.error("请选择事项");
|
||||
}
|
||||
NutMap result = memberCheckTaskService.addCheckUser(pageForm);
|
||||
if (result.getInt("code") == 0) {
|
||||
return Result.success(result.getString("msg"));
|
||||
}
|
||||
return Result.error(result.getString("msg"));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("按事项和工会确认名单")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("member.check.roster")
|
||||
@SLog(tag = "会员核对名单", msg = "按事项和工会确认名单")
|
||||
public Result doConfirmUser(String checkTaskId, String unionId, Boolean flag) {
|
||||
if (StrUtil.isBlank(checkTaskId)) {
|
||||
return Result.error("请选择事项");
|
||||
}
|
||||
if (StrUtil.isBlank(unionId)) {
|
||||
unionId = SecurityUtil.getUnionId();
|
||||
}
|
||||
if (StrUtil.isBlank(unionId)) {
|
||||
return Result.error("请选择分工会");
|
||||
}
|
||||
NutMap result = memberCheckTaskService.confirmByTaskAndUnion(checkTaskId, unionId, flag);
|
||||
if (result.getInt("code") == 0) {
|
||||
return Result.success(result.getString("msg"));
|
||||
}
|
||||
return Result.error(result.getString("msg"));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("按勾选人员确认名单")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("member.check.roster")
|
||||
@SLog(tag = "会员核对名单", msg = "按勾选人员确认名单")
|
||||
public Result doConfirmSelected(String ids, Boolean flag) {
|
||||
String[] idArray = parseIds(ids);
|
||||
if (idArray.length == 0) {
|
||||
return Result.error("请选择需要操作的人员");
|
||||
}
|
||||
memberCheckTaskService.confirmSelected(idArray, flag);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("按勾选人员删除名单")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("member.check.roster")
|
||||
@SLog(tag = "会员核对名单", msg = "按勾选人员删除名单")
|
||||
public Result deleteSelected(String ids) {
|
||||
String[] idArray = parseIds(ids);
|
||||
if (idArray.length == 0) {
|
||||
return Result.error("请选择需要删除的人员");
|
||||
}
|
||||
memberCheckTaskService.deleteSelected(idArray);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@ApiOperation("下载人员名单导入模板")
|
||||
@SaCheckPermission("member.check.roster")
|
||||
public void downloadTem(HttpServletResponse response) {
|
||||
List<ExcelExportEntity> entities = new ArrayList<>();
|
||||
entities.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
entities.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, Collections.emptyList());
|
||||
CommonDownloadUtil.download("会员核对人员名单导入模板.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("导入人员名单")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("member.check.roster")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Result importCheckUser(TempFile file, String checkTaskId) {
|
||||
if (file == null || file.getFile() == null) {
|
||||
return Result.error("请选择导入文件");
|
||||
}
|
||||
if (StrUtil.isBlank(checkTaskId)) {
|
||||
return Result.error("请选择事项");
|
||||
}
|
||||
ExcelImportRes<MemberCheckTaskUserImportTemp> result = memberCheckTaskService.importCheckUser(file.getFile(), checkTaskId);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@ApiOperation("导出人员名单")
|
||||
@SaCheckPermission("member.check.roster")
|
||||
public void exportCheckUser(@Param("pageForm") MemberCheckPageForm pageForm, HttpServletResponse response) {
|
||||
List<NutMap> list = memberCheckTaskService.checkUserList(pageForm);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
NutMap row = list.get(i);
|
||||
row.put("index", i + 1);
|
||||
row.put("branchUnionCheckedText", Boolean.TRUE.equals(row.getBoolean("branchUnionChecked")) ? "已确认" : "未确认");
|
||||
Object auditTime = row.get("auditTime");
|
||||
if (auditTime instanceof java.util.Date) {
|
||||
row.put("auditTimeText", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((java.util.Date) auditTime));
|
||||
} else if (auditTime != null) {
|
||||
row.put("auditTimeText", auditTime.toString());
|
||||
}
|
||||
}
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
entityList.add(new ExcelExportEntity("序号", "index", 10));
|
||||
entityList.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
entityList.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
entityList.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
entityList.add(new ExcelExportEntity("所属工会", "unionName", 20));
|
||||
entityList.add(new ExcelExportEntity("所属单位", "unitName", 20));
|
||||
entityList.add(new ExcelExportEntity("事项名称", "taskName", 30));
|
||||
entityList.add(new ExcelExportEntity("手机号", "mobile", 20));
|
||||
entityList.add(new ExcelExportEntity("身份证号", "idCard", 25));
|
||||
entityList.add(new ExcelExportEntity("是否确认", "branchUnionCheckedText", 20));
|
||||
entityList.add(new ExcelExportEntity("确认时间", "auditTimeText", 25));
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
exportParams.setTitle("会员核对人员名单");
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, list);
|
||||
CommonDownloadUtil.download("会员核对人员名单.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
private String[] parseIds(String ids) {
|
||||
if (StrUtil.isBlank(ids)) {
|
||||
return new String[0];
|
||||
}
|
||||
String value = ids.trim();
|
||||
if (value.startsWith("[")) {
|
||||
return JSONUtil.parseArray(value).toList(String.class).toArray(new String[0]);
|
||||
}
|
||||
return value.split(",");
|
||||
}
|
||||
}
|
||||
+47
-56
@@ -1,50 +1,30 @@
|
||||
package com.budwk.app.zhgh.staffmanage.member.controller.check;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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.utils.ManyAddOrRenewUtil;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffmanage.member.models.check.MemberCheckTask;
|
||||
import com.budwk.app.zhgh.staffmanage.member.models.check.MemberCheckTaskUser;
|
||||
import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberCheckPageForm;
|
||||
import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberStatisticsPageForm;
|
||||
import com.budwk.app.zhgh.staffmanage.member.service.MemberCheckTaskService;
|
||||
import com.budwk.app.zhgh.staffmanage.member.service.MemberCommonService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
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.dao.util.cri.Static;
|
||||
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.Strings;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.List;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:MemberCheckTaskController
|
||||
* @Date 2025/9/24 9:53
|
||||
* @注释 会员核对任务创建
|
||||
* @注释 会员核对事项管理
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@@ -52,10 +32,6 @@ import java.util.List;
|
||||
@At("/platform/member/check/task")
|
||||
public class MemberCheckTaskController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ManyAddOrRenewUtil renewUtil;
|
||||
@Inject
|
||||
private MemberCheckTaskService memberCheckTaskService;
|
||||
|
||||
@@ -64,44 +40,59 @@ public class MemberCheckTaskController {
|
||||
@SaCheckPermission("member.check.task")
|
||||
public void index() {}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("页面数据")
|
||||
@ApiOperation("事项页面数据")
|
||||
@SaCheckPermission("member.check.task")
|
||||
public Result pageData(MemberCheckPageForm pageForm) {
|
||||
Sql sql = Sqls.create("select * from member_check_task $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("`year`", "=", pageForm.getYear());
|
||||
cnd.andEX("checkTaskId", "=", pageForm.getCheckTaskId());
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = memberCheckTaskService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
return Result.success(memberCheckTaskService.taskPageData(pageForm));
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("添加或修改")
|
||||
@ApiOperation("添加或修改事项")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("member.check.task")
|
||||
@SLog(tag = "会员核对任务创建", msg = "添加或修改会员核对任务创建:${args[0].taskName}")
|
||||
public Result doAddOrModify(MemberCheckTask memberCheckTask) {
|
||||
dao.insertOrUpdate(memberCheckTask);
|
||||
|
||||
dao.clear(MemberCheckTaskUser.class, Cnd.where(MemberCheckTaskUser::getCheckTaskId, "=", memberCheckTask.getId()));
|
||||
|
||||
List<String> userStates = memberCheckTask.getUserStates();
|
||||
|
||||
List<Sys_user> query = dao.query(Sys_user.class, Cnd.where(Sys_user::getUserState, "in", userStates).or(Sys_user::getMember, "=", 1));
|
||||
List<MemberCheckTaskUser> list = query.stream().map(v -> {
|
||||
MemberCheckTaskUser memberCheckTaskUser = new MemberCheckTaskUser();
|
||||
BeanUtil.copyProperties(v, memberCheckTaskUser);
|
||||
memberCheckTaskUser.setId(R.UU32());
|
||||
memberCheckTaskUser.setCheckTaskId(memberCheckTask.getId());
|
||||
memberCheckTaskUser.setUserId(v.getId());
|
||||
return memberCheckTaskUser;
|
||||
}).toList();
|
||||
|
||||
renewUtil.asyncExecuteFastInsert(list, 200);
|
||||
@SLog(tag = "会员核对事项管理", msg = "添加或修改会员核对事项:${args[0].taskName}")
|
||||
public Result doAddOrModify(@Param("data") MemberCheckTask memberCheckTask) {
|
||||
if (StrUtil.isBlank(memberCheckTask.getTaskName())) {
|
||||
return Result.error("请输入事项名称");
|
||||
}
|
||||
if (memberCheckTask.getStartTime() == null || memberCheckTask.getEndTime() == null) {
|
||||
return Result.error("请选择开始时间和结束时间");
|
||||
}
|
||||
if (memberCheckTask.getStartTime().after(memberCheckTask.getEndTime())) {
|
||||
return Result.error("开始时间不能晚于结束时间");
|
||||
}
|
||||
memberCheckTaskService.saveTask(memberCheckTask);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("状态切换")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("member.check.task")
|
||||
public Result switchChange(MemberCheckTask memberCheckTask) {
|
||||
memberCheckTaskService.dao().updateIgnoreNull(memberCheckTask);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除事项")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("member.check.task")
|
||||
public Result delete(@Param("id") String id) {
|
||||
if (StrUtil.isBlank(id)) {
|
||||
return Result.error("请选择需要删除的事项");
|
||||
}
|
||||
memberCheckTaskService.dao().delete(MemberCheckTask.class, id);
|
||||
memberCheckTaskService.dao().update(MemberCheckTaskUser.class,
|
||||
org.nutz.dao.Chain.make("delFlag", true),
|
||||
Cnd.where(MemberCheckTaskUser::getCheckTaskId, "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("member.check.task")
|
||||
public Result findOne(String id) {
|
||||
return Result.success(memberCheckTaskService.dao().fetch(MemberCheckTask.class, id));
|
||||
}
|
||||
}
|
||||
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
package com.budwk.app.zhgh.staffmanage.member.controller.check;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberCheckPageForm;
|
||||
import com.budwk.app.zhgh.staffmanage.member.service.MemberCheckTaskService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:MemberCheckTaskSchoolController
|
||||
* @Date 2025/9/26 15:31
|
||||
* @注释 校工会核对
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/member/checkTask/school")
|
||||
public class MemberCheckTaskSchoolController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private MemberCheckTaskService memberCheckTaskService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffmanage/member/check/school/index.html")
|
||||
@SaCheckPermission("member.checkTask.school")
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("member.checkTask.school")
|
||||
public Result pageData(MemberCheckPageForm pageForm) {
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
-179
@@ -1,179 +0,0 @@
|
||||
package com.budwk.app.zhgh.staffmanage.member.controller.check;
|
||||
|
||||
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.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberCheckPageForm;
|
||||
import com.budwk.app.zhgh.staffmanage.member.service.MemberCheckTaskService;
|
||||
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.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:MemberCheckTaskUnionController
|
||||
* @Date 2025/9/24 11:24
|
||||
* @注释
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/member/checkTask/union")
|
||||
public class MemberCheckTaskUnionController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private MemberCheckTaskService memberCheckTaskService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffmanage/member/check/union/index.html")
|
||||
@SaCheckPermission("member.checkTask.union")
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("页面数据")
|
||||
@SaCheckPermission("member.checkTask.union")
|
||||
public Result pageData(MemberCheckPageForm pageForm){
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.id,
|
||||
u.loginname,
|
||||
u.username,
|
||||
u.sex,
|
||||
u.birthday,
|
||||
u.political,
|
||||
u.joinPartyDate,
|
||||
u.nation,
|
||||
u.nativePlace,
|
||||
u.nationality,
|
||||
u.idCardType,
|
||||
u.mobile,
|
||||
u.education,
|
||||
u.academicDegree,
|
||||
u.position,
|
||||
u.personType,
|
||||
u.preparedBy,
|
||||
u.identityType,
|
||||
u.userState,
|
||||
u.unionName,
|
||||
u.unitName,
|
||||
u.member,
|
||||
u.postDoctoralJoinDate
|
||||
FROM
|
||||
`vw_user` u
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = getCnd(pageForm);
|
||||
if (StrUtil.isNotBlank(pageForm.getIsUnit())) {
|
||||
cnd.and("u.unitId", "true".equals(pageForm.getIsUnit()) ? "is not" : "is", null);
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageForm.getIsUnion())) {
|
||||
cnd.and("u.unionId", "true".equals(pageForm.getIsUnion()) ? "is not" : "is", null);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("u.username", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("u.loginname", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and(Cnd.exps("u.unionId", "=", SecurityUtil.getUnionId())
|
||||
.or("u.unionId", "is", null).or("u.unionId", "=", ""));
|
||||
}
|
||||
cnd.desc("u.unionName,u.id");
|
||||
cnd.groupBy("u.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = memberCheckTaskService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
public Cnd getCnd(MemberCheckPageForm pageForm) {
|
||||
Boolean reverseSelection = pageForm.getReverseSelection();
|
||||
String IN_OR_NIN_OP = reverseSelection ? "NOT IN" : "IN";
|
||||
String EQ_OR_NEQ_OP = reverseSelection ? "!=" : "=";
|
||||
//小于等于
|
||||
String LE_OR_NLE_OP = reverseSelection ? ">=" : "<=";
|
||||
//大于等于
|
||||
String GE_OR_NGE_OP = reverseSelection ? "<=" : ">=";
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isAllNotBlank(pageForm.getPageOrderBy(), pageForm.getPageOrderName())) {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), "ascending".equalsIgnoreCase(pageForm.getPageOrderBy()) ? "ASC" : "DESC");
|
||||
}
|
||||
|
||||
if (Lang.isNotEmpty(pageForm.getUserTypes())) {
|
||||
if (pageForm.getUserTypes().contains("工会会员")) {
|
||||
cnd.and("u.member", EQ_OR_NEQ_OP, true);
|
||||
}
|
||||
if (pageForm.getUserTypes().contains("福利会员")) {
|
||||
cnd.and("u.welfareMember", EQ_OR_NEQ_OP, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (Lang.isNotEmpty(pageForm.getAge()) && !"0".equals(pageForm.getAge().get(1))) {
|
||||
if (reverseSelection) {
|
||||
cnd.andNot("TIMESTAMPDIFF(YEAR, u.birthday, CURDATE())", "between", pageForm.getAge().toArray());
|
||||
} else {
|
||||
cnd.and("TIMESTAMPDIFF(YEAR, u.birthday, CURDATE())", "between", pageForm.getAge().toArray());
|
||||
}
|
||||
}
|
||||
|
||||
if (Strings.isNotBlank(pageForm.getBirthdayStartDate()) && Strings.isNotBlank(pageForm.getBirthdayEndDate())) {
|
||||
if (reverseSelection) {
|
||||
cnd.andNot("DATE(u.birthday)", "between", new String[]{pageForm.getBirthdayStartDate(), pageForm.getBirthdayEndDate()});
|
||||
} else {
|
||||
cnd.and("DATE(u.birthday)", "between", new String[]{pageForm.getBirthdayStartDate(), pageForm.getBirthdayEndDate()});
|
||||
}
|
||||
}
|
||||
|
||||
if (Strings.isNotBlank(pageForm.getBirthdayStartDate()) && Strings.isBlank(pageForm.getBirthdayEndDate())) {
|
||||
cnd.and("DATE(u.birthday)", GE_OR_NGE_OP, pageForm.getBirthdayStartDate());
|
||||
}
|
||||
|
||||
if (Strings.isBlank(pageForm.getBirthdayStartDate()) && Strings.isNotBlank(pageForm.getBirthdayEndDate())) {
|
||||
cnd.and("DATE(u.birthday)", LE_OR_NLE_OP, pageForm.getBirthdayEndDate());
|
||||
}
|
||||
|
||||
try {
|
||||
handleField("id", pageForm.getUserInfos(), reverseSelection, IN_OR_NIN_OP, cnd);
|
||||
handleField("unionId", pageForm.getUnionIds(), reverseSelection, IN_OR_NIN_OP, cnd);
|
||||
handleField("unitId", pageForm.getUnitIds(), reverseSelection, IN_OR_NIN_OP, cnd);
|
||||
handleField("personType", pageForm.getPersonTypes(), reverseSelection, IN_OR_NIN_OP, cnd);
|
||||
handleField("preparedBy", pageForm.getPreparedBys(), reverseSelection, IN_OR_NIN_OP, cnd);
|
||||
handleField("userState", pageForm.getUserStates(), reverseSelection, IN_OR_NIN_OP, cnd);
|
||||
handleField("sex", pageForm.getSexTypes(), reverseSelection, IN_OR_NIN_OP, cnd);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return cnd;
|
||||
}
|
||||
|
||||
void handleField(String fieldName, Object fieldValue, boolean reverseSelection, String IN_OR_NIN_OP, Cnd cnd) {
|
||||
if (reverseSelection && Lang.isNotEmpty(fieldValue)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("u." + fieldName, "is", null);
|
||||
seg.or("u." + fieldName, IN_OR_NIN_OP, fieldValue);
|
||||
cnd.and(seg);
|
||||
} else {
|
||||
cnd.andEX("u." + fieldName, IN_OR_NIN_OP, fieldValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -40,8 +40,8 @@ public class MemberCheckTask extends BaseModel {
|
||||
private String taskName;
|
||||
|
||||
@Column
|
||||
@Comment("说明")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Comment("内容详情")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String description;
|
||||
|
||||
@Column
|
||||
|
||||
+16
-5
@@ -38,7 +38,7 @@ public class MemberCheckPageForm extends PageForm {
|
||||
|
||||
// 单位id
|
||||
@ApiModelProperty("单位id")
|
||||
private String unitIds;
|
||||
private List<String> unitIds;
|
||||
|
||||
@ApiModelProperty("出生日期开始时间")
|
||||
private String birthdayStartDate;
|
||||
@@ -50,10 +50,6 @@ public class MemberCheckPageForm extends PageForm {
|
||||
@ApiModelProperty("在职状态")
|
||||
private List<String> userStates;
|
||||
|
||||
// 在职状态
|
||||
@ApiModelProperty("编制类别")
|
||||
private List<String> preparedBys;
|
||||
|
||||
// 教职工类别
|
||||
@ApiModelProperty("教职工类别")
|
||||
private List<String> personTypes;
|
||||
@@ -75,4 +71,19 @@ public class MemberCheckPageForm extends PageForm {
|
||||
|
||||
@ApiModelProperty("用户信息查询列表")
|
||||
private List<String> userInfos;
|
||||
|
||||
@ApiModelProperty("事项名称")
|
||||
private String taskName;
|
||||
|
||||
@ApiModelProperty("是否发布")
|
||||
private Boolean isEnabled;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("工号")
|
||||
private String loginName;
|
||||
|
||||
@ApiModelProperty("是否会员")
|
||||
private Boolean isMember;
|
||||
}
|
||||
|
||||
+2
-2
@@ -120,8 +120,8 @@ public class MemberInfoPageForm extends PageForm {
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or(prefix + "unionId", "=", SecurityUtil.getUnionId());
|
||||
seg.or(prefix + "unionId", "is", null);
|
||||
seg.or(prefix + "unionId", "=", "");
|
||||
// seg.or(prefix + "unionId", "is", null);
|
||||
// seg.or(prefix + "unionId", "=", "");
|
||||
cnd.and(seg);
|
||||
} else {
|
||||
cnd.andEX(prefix + "unionId", "=", this.getUnionId());
|
||||
|
||||
+70
@@ -1,7 +1,16 @@
|
||||
package com.budwk.app.zhgh.staffmanage.member.service;
|
||||
|
||||
import com.budwk.app.base.model.ExcelImportRes;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffmanage.member.models.check.MemberCheckTask;
|
||||
import com.budwk.app.zhgh.staffmanage.member.models.check.MemberCheckTaskUser;
|
||||
import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberCheckPageForm;
|
||||
import com.budwk.app.zhgh.staffmanage.member.template.MemberCheckTaskUserImportTemp;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
@@ -11,4 +20,65 @@ import com.budwk.app.zhgh.staffmanage.member.models.check.MemberCheckTaskUser;
|
||||
* @注释
|
||||
*/
|
||||
public interface MemberCheckTaskService extends BaseService<MemberCheckTaskUser> {
|
||||
|
||||
/**
|
||||
* 查询会员核对事项。
|
||||
*/
|
||||
Pagination<NutMap> taskPageData(MemberCheckPageForm pageForm);
|
||||
|
||||
/**
|
||||
* 保存会员核对事项,只维护事项本身,不重建名单。
|
||||
*/
|
||||
void saveTask(MemberCheckTask memberCheckTask);
|
||||
|
||||
/**
|
||||
* 查询已发布的会员核对事项。
|
||||
*/
|
||||
List<MemberCheckTask> listEnabledTask(Integer year);
|
||||
|
||||
/**
|
||||
* 查询会员核对名单,统一承载页面列表和导出数据范围。
|
||||
*/
|
||||
Pagination<NutMap> checkUserPageData(MemberCheckPageForm pageForm);
|
||||
|
||||
/**
|
||||
* 查询会员核对名单,不分页,用于按当前筛选条件导出。
|
||||
*/
|
||||
List<NutMap> checkUserList(MemberCheckPageForm pageForm);
|
||||
|
||||
/**
|
||||
* 导入会员核对名单,并按工号从系统用户视图补齐人员基础信息。
|
||||
*/
|
||||
ExcelImportRes<MemberCheckTaskUserImportTemp> importCheckUser(File file, String checkTaskId);
|
||||
|
||||
/**
|
||||
* 分页查询当前筛选条件下尚未加入名单的系统人员。
|
||||
*/
|
||||
Pagination<NutMap> notCheckUserPageData(MemberCheckPageForm pageForm);
|
||||
|
||||
/**
|
||||
* 将当前筛选条件下的系统人员批量加入会员核对名单。
|
||||
*/
|
||||
NutMap addCheckUser(MemberCheckPageForm pageForm);
|
||||
|
||||
/**
|
||||
* 按事项和工会批量确认或取消确认名单。
|
||||
*/
|
||||
NutMap confirmByTaskAndUnion(String checkTaskId, String unionId, Boolean flag);
|
||||
|
||||
/**
|
||||
* 按列表勾选记录批量确认或取消确认名单。
|
||||
*/
|
||||
void confirmSelected(String[] ids, Boolean flag);
|
||||
|
||||
/**
|
||||
* 按列表勾选记录批量删除人员名单,非校工会管理员只能删除本工会数据。
|
||||
*/
|
||||
void deleteSelected(String[] ids);
|
||||
|
||||
/**
|
||||
* 按工会统计会员核对名单确认完成情况。
|
||||
*/
|
||||
Pagination<NutMap> confirmStatistics(Integer pageNumber, Integer pageSize, Integer year,
|
||||
String checkTaskId, String unionId);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.budwk.app.zhgh.staffmanage.member.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberInfoPageForm;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
@@ -27,6 +28,13 @@ public interface MemberInfoService extends BaseService<Sys_user> {
|
||||
*/
|
||||
Sql getSql(MemberInfoPageForm pageForm);
|
||||
|
||||
/**
|
||||
* 获取会员详情,特殊人员优先返回工会关系所属工会,便于详情权限和列表权限保持一致。
|
||||
* @param id 用户id
|
||||
* @return 会员详情
|
||||
*/
|
||||
View_user getMemberInfoDetail(String id);
|
||||
|
||||
/**
|
||||
* 获取会员历史
|
||||
* @param pageForm
|
||||
|
||||
+489
@@ -1,11 +1,38 @@
|
||||
package com.budwk.app.zhgh.staffmanage.member.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.model.ExcelImportRes;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.base.utils.easyexcel.EasyExcelUtil;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffmanage.member.models.check.MemberCheckTask;
|
||||
import com.budwk.app.zhgh.staffmanage.member.models.check.MemberCheckTaskUser;
|
||||
import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberCheckPageForm;
|
||||
import com.budwk.app.zhgh.staffmanage.member.service.MemberCheckTaskService;
|
||||
import com.budwk.app.zhgh.staffmanage.member.template.MemberCheckTaskUserImportTemp;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
@@ -20,4 +47,466 @@ public class MemberCheckTaskServiceImpl extends BaseServiceImpl<MemberCheckTaskU
|
||||
public MemberCheckTaskServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<NutMap> taskPageData(MemberCheckPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
*
|
||||
FROM member_check_task
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("`year`", "=", pageForm.getYear());
|
||||
cnd.and(Cnd.likeEX("taskName", pageForm.getTaskName()));
|
||||
cnd.andEX("isEnabled", "=", pageForm.getIsEnabled());
|
||||
cnd.desc("startTime");
|
||||
sql.setCondition(cnd);
|
||||
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveTask(MemberCheckTask memberCheckTask) {
|
||||
if (memberCheckTask.getStartTime() != null) {
|
||||
memberCheckTask.setYear(DateUtil.year(memberCheckTask.getStartTime()));
|
||||
} else if (memberCheckTask.getYear() == null) {
|
||||
memberCheckTask.setYear(DateUtil.thisYear());
|
||||
}
|
||||
dao().insertOrUpdate(memberCheckTask);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MemberCheckTask> listEnabledTask(Integer year) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("year", "=", year);
|
||||
cnd.and("isEnabled", "=", true);
|
||||
cnd.desc("startTime");
|
||||
return dao().query(MemberCheckTask.class, cnd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<NutMap> checkUserPageData(MemberCheckPageForm pageForm) {
|
||||
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), buildCheckUserSql(pageForm));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> checkUserList(MemberCheckPageForm pageForm) {
|
||||
return listMap(buildCheckUserSql(pageForm));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExcelImportRes<MemberCheckTaskUserImportTemp> importCheckUser(File file, String checkTaskId) {
|
||||
List<T> rows = EasyExcelUtil.syncReadModel(file, MemberCheckTaskUserImportTemp.class, 0, 1);
|
||||
List<MemberCheckTaskUserImportTemp> importRows = JSONUtil.parseArray(JSONUtil.toJsonStr(rows)).toList(MemberCheckTaskUserImportTemp.class);
|
||||
ExcelImportRes<MemberCheckTaskUserImportTemp> result = new ExcelImportRes<>();
|
||||
result.setTotalRecords(importRows.size());
|
||||
|
||||
MemberCheckTask task = validateCheckUserTask(checkTaskId);
|
||||
if (task == null) {
|
||||
markAllFailed(importRows, "事项不存在、未发布或不在时间范围内");
|
||||
fillImportResult(result, importRows, 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
List<String> loginNames = importRows.stream()
|
||||
.map(MemberCheckTaskUserImportTemp::getLoginname)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.map(Strings::trim)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<View_user> users = loginNames.isEmpty()
|
||||
? Collections.emptyList()
|
||||
: dao().query(View_user.class, Cnd.where(View_user::getLoginname, "in", loginNames));
|
||||
|
||||
int successCount = 0;
|
||||
for (int i = 0; i < importRows.size(); i++) {
|
||||
MemberCheckTaskUserImportTemp row = importRows.get(i);
|
||||
String loginName = Strings.trim(row.getLoginname());
|
||||
if (StrUtil.isBlank(loginName)) {
|
||||
row.setErrInfo("工号不能为空", i + 1);
|
||||
continue;
|
||||
}
|
||||
if (importRows.stream().filter(item -> loginName.equals(Strings.trim(item.getLoginname()))).count() > 1) {
|
||||
row.setErrInfo("导入文件中工号重复", i + 1);
|
||||
continue;
|
||||
}
|
||||
View_user user = users.stream()
|
||||
.filter(item -> loginName.equals(item.getLoginname()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (user == null) {
|
||||
row.setErrInfo("工号在系统中不存在", i + 1);
|
||||
continue;
|
||||
}
|
||||
upsertCheckUser(task, user);
|
||||
successCount++;
|
||||
}
|
||||
fillImportResult(result, importRows, successCount);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<NutMap> notCheckUserPageData(MemberCheckPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.id,
|
||||
u.loginname,
|
||||
u.username,
|
||||
u.sex,
|
||||
u.birthday,
|
||||
u.personType,
|
||||
u.userState,
|
||||
u.unitId,
|
||||
u.unitName,
|
||||
u.unionId,
|
||||
u.unionName,
|
||||
u.member
|
||||
FROM vw_user u
|
||||
LEFT JOIN member_check_task_user info ON u.id = info.userId
|
||||
AND info.checkTaskId = @checkTaskId
|
||||
AND info.delFlag = 0
|
||||
$condition
|
||||
""").setParam("checkTaskId", pageForm.getCheckTaskId());
|
||||
Cnd cnd = buildAddUserFilterCnd(pageForm);
|
||||
cnd.and("info.userId", "is", null);
|
||||
sql.setCondition(cnd);
|
||||
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NutMap addCheckUser(MemberCheckPageForm pageForm) {
|
||||
MemberCheckTask task = validateCheckUserTask(pageForm.getCheckTaskId());
|
||||
if (task == null) {
|
||||
return NutMap.NEW().addv("code", 1).addv("msg", "添加失败,请选择已发布且在时间范围内的事项");
|
||||
}
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.id,
|
||||
u.loginname,
|
||||
u.username,
|
||||
u.sex,
|
||||
u.birthday,
|
||||
u.political,
|
||||
u.joinPartyDate,
|
||||
u.nation,
|
||||
u.nativePlace,
|
||||
u.nationality,
|
||||
u.idCardType,
|
||||
u.idCard,
|
||||
u.email,
|
||||
u.mobile,
|
||||
u.education,
|
||||
u.academicDegree,
|
||||
u.position,
|
||||
u.personType,
|
||||
u.identityType,
|
||||
u.userState,
|
||||
u.unitId,
|
||||
u.unitName,
|
||||
u.unionId,
|
||||
u.unionName,
|
||||
u.member,
|
||||
u.welfareMember,
|
||||
u.retireDate,
|
||||
u.personalData,
|
||||
u.postDoctoralJoinDate
|
||||
FROM vw_user u
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = buildAddUserFilterCnd(pageForm);
|
||||
cnd.and("u.id", "not in", Sqls.create("""
|
||||
SELECT userId FROM member_check_task_user
|
||||
WHERE checkTaskId = @checkTaskId AND delFlag = 0
|
||||
""").setParam("checkTaskId", pageForm.getCheckTaskId()));
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> users = listMap(sql);
|
||||
if (users.isEmpty()) {
|
||||
return NutMap.NEW().addv("code", 1).addv("msg", "添加失败,暂无数据");
|
||||
}
|
||||
for (NutMap user : users) {
|
||||
upsertCheckUser(task, user);
|
||||
}
|
||||
return NutMap.NEW().addv("code", 0).addv("msg", "添加成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public NutMap confirmByTaskAndUnion(String checkTaskId, String unionId, Boolean flag) {
|
||||
Cnd cnd = Cnd.NEW().and("checkTaskId", "=", checkTaskId).and("unionId", "=", unionId).and("delFlag", "=", false);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("unionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
// 按工会确认依赖当前事项和工会筛选结果,空数据时明确返回失败,避免页面误认为已确认。
|
||||
if (count(cnd) == 0) {
|
||||
return NutMap.NEW().addv("code", 1).addv("msg", "确认失败,暂无数据");
|
||||
}
|
||||
updateAuditState(cnd, flag);
|
||||
return NutMap.NEW().addv("code", 0).addv("msg", "操作成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void confirmSelected(String[] ids, Boolean flag) {
|
||||
if (ids == null || ids.length == 0) {
|
||||
return;
|
||||
}
|
||||
Cnd cnd = Cnd.where("id", "in", ids).and("delFlag", "=", false);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("unionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
updateAuditState(cnd, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSelected(String[] ids) {
|
||||
if (ids == null || ids.length == 0) {
|
||||
return;
|
||||
}
|
||||
Cnd cnd = Cnd.where("id", "in", ids).and("delFlag", "=", false);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("unionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
// 人员名单删除采用逻辑删除,避免核对名单被物理清除后无法追溯。
|
||||
dao().update(MemberCheckTaskUser.class, Chain.make("delFlag", true), cnd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<NutMap> confirmStatistics(Integer pageNumber, Integer pageSize, Integer year, String checkTaskId, String unionId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
su.id AS unionId,
|
||||
su.name AS unionName,
|
||||
COUNT(CASE WHEN task.id IS NOT NULL THEN info.id END) AS totalCount,
|
||||
SUM(CASE WHEN task.id IS NOT NULL AND info.branchUnionChecked = 1 THEN 1 ELSE 0 END) AS confirmedCount,
|
||||
SUM(CASE WHEN task.id IS NOT NULL AND info.id IS NOT NULL AND (info.branchUnionChecked IS NULL OR info.branchUnionChecked <> 1) THEN 1 ELSE 0 END) AS unconfirmedCount,
|
||||
CASE
|
||||
WHEN COUNT(CASE WHEN task.id IS NOT NULL THEN info.id END) > 0
|
||||
AND COUNT(CASE WHEN task.id IS NOT NULL THEN info.id END) = SUM(CASE WHEN task.id IS NOT NULL AND info.branchUnionChecked = 1 THEN 1 ELSE 0 END) THEN '已完成'
|
||||
ELSE '未完成'
|
||||
END AS completeStatus
|
||||
FROM sys_union su
|
||||
LEFT JOIN member_check_task_user info ON info.unionId = su.id
|
||||
AND info.delFlag = 0
|
||||
AND info.checkTaskId = @checkTaskId
|
||||
LEFT JOIN member_check_task task ON task.id = info.checkTaskId
|
||||
AND task.delFlag = 0
|
||||
AND task.year = @year
|
||||
$condition
|
||||
""").setParam("checkTaskId", checkTaskId).setParam("year", year);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("su.id", "=", unionId);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("su.id", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
cnd.groupBy("su.id,su.name");
|
||||
cnd.asc("completeStatus");
|
||||
cnd.asc("su.unionCode");
|
||||
sql.setCondition(cnd);
|
||||
return listPageMap(pageNumber, pageSize, sql);
|
||||
}
|
||||
|
||||
private Sql buildCheckUserSql(MemberCheckPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
task.taskName,
|
||||
task.year AS taskYear,
|
||||
CASE WHEN info.branchUnionChecked = 1 THEN FROM_UNIXTIME(info.updatedAt / 1000) ELSE NULL END AS auditTime
|
||||
FROM member_check_task_user info
|
||||
LEFT JOIN member_check_task task ON task.id = info.checkTaskId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("info.delFlag", "=", false);
|
||||
cnd.and("task.delFlag", "=", false);
|
||||
cnd.andEX("task.year", "=", pageForm.getYear());
|
||||
cnd.andEX("info.checkTaskId", "=", pageForm.getCheckTaskId());
|
||||
cnd.andEX("info.unionId", "=", pageForm.getUnionIds());
|
||||
cnd.andEX("info.unitId", "in", pageForm.getUnitIds());
|
||||
if (pageForm.getAudit() != null) {
|
||||
cnd.and("info.branchUnionChecked", "=", pageForm.getAudit());
|
||||
}
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.andEX("info.unionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("info.username", pageForm.getSearchKeyword());
|
||||
group.orLike("info.loginname", pageForm.getSearchKeyword());
|
||||
cnd.and(group);
|
||||
}
|
||||
cnd.desc("info.createdAt");
|
||||
cnd.desc("info.updatedAt");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
|
||||
private MemberCheckTask validateCheckUserTask(String checkTaskId) {
|
||||
if (StrUtil.isBlank(checkTaskId)) {
|
||||
return null;
|
||||
}
|
||||
MemberCheckTask task = dao().fetch(MemberCheckTask.class,
|
||||
Cnd.where("id", "=", checkTaskId).and("isEnabled", "=", true).and("delFlag", "=", false));
|
||||
if (task == null) {
|
||||
return null;
|
||||
}
|
||||
Date now = new Date();
|
||||
if ((task.getStartTime() != null && now.before(task.getStartTime()))
|
||||
|| (task.getEndTime() != null && now.after(task.getEndTime()))) {
|
||||
return null;
|
||||
}
|
||||
return task;
|
||||
}
|
||||
|
||||
private Cnd buildAddUserFilterCnd(MemberCheckPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getUserName())) {
|
||||
cnd.and(Cnd.likeEX("u.username", pageForm.getUserName()));
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageForm.getLoginName())) {
|
||||
cnd.and(Cnd.likeEX("u.loginname", pageForm.getLoginName()));
|
||||
}
|
||||
cnd.andEX("u.unionId", "=", pageForm.getUnionIds());
|
||||
cnd.andEX("u.unitId", "in", pageForm.getUnitIds());
|
||||
cnd.andEX("u.personType", "in", pageForm.getPersonTypes());
|
||||
cnd.andEX("u.userState", "in", pageForm.getUserStates());
|
||||
cnd.andEX("u.member", "=", pageForm.getIsMember());
|
||||
if (pageForm.getSexTypes() != null && !pageForm.getSexTypes().isEmpty()) {
|
||||
cnd.andEX("u.sex", "in", pageForm.getSexTypes());
|
||||
}
|
||||
if (Strings.isNotBlank(pageForm.getBirthdayStartDate()) && Strings.isNotBlank(pageForm.getBirthdayEndDate())) {
|
||||
cnd.and("DATE(u.birthday)", "between", new String[]{pageForm.getBirthdayStartDate(), pageForm.getBirthdayEndDate()});
|
||||
}
|
||||
if (Strings.isNotBlank(pageForm.getBirthdayStartDate()) && Strings.isBlank(pageForm.getBirthdayEndDate())) {
|
||||
cnd.and("DATE(u.birthday)", ">=", pageForm.getBirthdayStartDate());
|
||||
}
|
||||
if (Strings.isBlank(pageForm.getBirthdayStartDate()) && Strings.isNotBlank(pageForm.getBirthdayEndDate())) {
|
||||
cnd.and("DATE(u.birthday)", "<=", pageForm.getBirthdayEndDate());
|
||||
}
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("u.unionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.asc("u.unionCode");
|
||||
cnd.asc("u.unitCode");
|
||||
cnd.asc("u.loginname");
|
||||
} else {
|
||||
cnd.orderBy("u." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
return cnd;
|
||||
}
|
||||
|
||||
private void updateAuditState(Cnd cnd, Boolean flag) {
|
||||
Chain chain = Chain.make("branchUnionChecked", Boolean.TRUE.equals(flag));
|
||||
dao().update(MemberCheckTaskUser.class, chain, cnd);
|
||||
}
|
||||
|
||||
private void upsertCheckUser(MemberCheckTask task, View_user user) {
|
||||
MemberCheckTaskUser info = dao().fetch(MemberCheckTaskUser.class,
|
||||
Cnd.where("checkTaskId", "=", task.getId()).and("userId", "=", user.getId()));
|
||||
if (info == null) {
|
||||
info = new MemberCheckTaskUser();
|
||||
info.setCheckTaskId(task.getId());
|
||||
info.setBranchUnionChecked(false);
|
||||
info.setSchoolUnionChecked(false);
|
||||
info.setIsChanged(false);
|
||||
}
|
||||
info.setDelFlag(false);
|
||||
fillCheckUser(info, user);
|
||||
dao().insertOrUpdate(info);
|
||||
}
|
||||
|
||||
private void upsertCheckUser(MemberCheckTask task, NutMap user) {
|
||||
MemberCheckTaskUser info = dao().fetch(MemberCheckTaskUser.class,
|
||||
Cnd.where("checkTaskId", "=", task.getId()).and("userId", "=", user.getString("id")));
|
||||
if (info == null) {
|
||||
info = new MemberCheckTaskUser();
|
||||
info.setCheckTaskId(task.getId());
|
||||
info.setBranchUnionChecked(false);
|
||||
info.setSchoolUnionChecked(false);
|
||||
info.setIsChanged(false);
|
||||
}
|
||||
info.setDelFlag(false);
|
||||
fillCheckUser(info, user);
|
||||
dao().insertOrUpdate(info);
|
||||
}
|
||||
|
||||
private void fillCheckUser(MemberCheckTaskUser info, View_user user) {
|
||||
info.setUserId(user.getId());
|
||||
info.setLoginname(user.getLoginname());
|
||||
info.setUsername(user.getUsername());
|
||||
info.setSex(user.getSex());
|
||||
info.setBirthday(user.getBirthday());
|
||||
info.setPolitical(user.getPolitical());
|
||||
info.setNation(user.getNation());
|
||||
info.setIdCard(user.getIdCard());
|
||||
info.setEmail(user.getEmail());
|
||||
info.setMobile(user.getMobile());
|
||||
info.setEducation(user.getEducation());
|
||||
info.setAcademicDegree(user.getAcademicDegree());
|
||||
info.setPosition(user.getPosition());
|
||||
info.setPersonType(user.getPersonType());
|
||||
info.setUserState(user.getUserState());
|
||||
info.setUnitId(user.getUnitId());
|
||||
info.setUnitName(user.getUnitName());
|
||||
info.setUnionId(user.getUnionId());
|
||||
info.setUnionName(user.getUnionName());
|
||||
info.setMember(user.getMember() != null && user.getMember() == 1);
|
||||
info.setWelfareMember(user.getWelfareMember() != null && user.getWelfareMember() == 1);
|
||||
info.setCampus(user.getCampusName());
|
||||
info.setRetireDate(user.getRetireDate());
|
||||
info.setPersonalData(user.getPersonalData());
|
||||
info.setWelfareStopDate(user.getWelfareStopDate() == null ? null : DateUtil.formatDate(user.getWelfareStopDate()));
|
||||
}
|
||||
|
||||
private void fillCheckUser(MemberCheckTaskUser info, NutMap user) {
|
||||
info.setUserId(user.getString("id"));
|
||||
info.setLoginname(user.getString("loginname"));
|
||||
info.setUsername(user.getString("username"));
|
||||
info.setSex(user.getString("sex"));
|
||||
info.setBirthday(getDate(user, "birthday"));
|
||||
info.setPolitical(user.getString("political"));
|
||||
info.setNation(user.getString("nation"));
|
||||
info.setIdCard(user.getString("idCard"));
|
||||
info.setEmail(user.getString("email"));
|
||||
info.setMobile(user.getString("mobile"));
|
||||
info.setEducation(user.getString("education"));
|
||||
info.setAcademicDegree(user.getString("academicDegree"));
|
||||
info.setPosition(user.getString("position"));
|
||||
info.setPersonType(user.getString("personType"));
|
||||
info.setUserState(user.getString("userState"));
|
||||
info.setUnitId(user.getString("unitId"));
|
||||
info.setUnitName(user.getString("unitName"));
|
||||
info.setUnionId(user.getString("unionId"));
|
||||
info.setUnionName(user.getString("unionName"));
|
||||
info.setMember("1".equals(user.getString("member")) || Boolean.TRUE.equals(user.getBoolean("member")));
|
||||
info.setWelfareMember("1".equals(user.getString("welfareMember")) || Boolean.TRUE.equals(user.getBoolean("welfareMember")));
|
||||
info.setCampus(user.getString("campus"));
|
||||
info.setRetireDate(getDate(user, "retireDate"));
|
||||
info.setPersonalData(user.getString("personalData"));
|
||||
}
|
||||
|
||||
private Date getDate(NutMap user, String key) {
|
||||
Object value = user.get(key);
|
||||
if (value instanceof Date) {
|
||||
return (Date) value;
|
||||
}
|
||||
if (value == null || StrUtil.isBlank(value.toString())) {
|
||||
return null;
|
||||
}
|
||||
return DateUtil.parse(value.toString());
|
||||
}
|
||||
|
||||
private void markAllFailed(List<MemberCheckTaskUserImportTemp> rows, String msg) {
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
rows.get(i).setErrInfo(msg, i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void fillImportResult(ExcelImportRes<MemberCheckTaskUserImportTemp> result,
|
||||
List<MemberCheckTaskUserImportTemp> rows,
|
||||
int successCount) {
|
||||
result.setSuccessCount(successCount);
|
||||
result.setErrorDetails(rows.stream().filter(row -> StrUtil.isNotBlank(row.getErrMsg())).collect(Collectors.toList()));
|
||||
result.setFailedCount(result.getErrorDetails().size());
|
||||
}
|
||||
}
|
||||
|
||||
+77
-1
@@ -15,6 +15,7 @@ import com.budwk.app.base.utils.easyexcel.EasyExcelUtil;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_unit;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
@@ -22,6 +23,7 @@ import com.budwk.app.zhgh.staffmanage.member.models.MemberHistory;
|
||||
import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberInfoPageForm;
|
||||
import com.budwk.app.zhgh.staffmanage.member.service.MemberInfoService;
|
||||
import com.budwk.app.zhgh.staffmanage.member.vo.MemberImportVo;
|
||||
import com.budwk.app.zhgh.staffmanage.specialstaff.model.SpecialStaff;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
@@ -64,9 +66,14 @@ public class MemberInfoServiceImpl extends BaseServiceImpl<Sys_user> implements
|
||||
|
||||
@Override
|
||||
public Sql getSql(MemberInfoPageForm pageForm) {
|
||||
// 特殊人员优先使用工会关系所属工会,普通人员继续使用用户当前所属工会。
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.id,
|
||||
u.unionId,
|
||||
u.unionCode,
|
||||
u.unitId,
|
||||
u.unitCode,
|
||||
u.loginname,
|
||||
u.username,
|
||||
u.sex,
|
||||
@@ -103,7 +110,58 @@ public class MemberInfoServiceImpl extends BaseServiceImpl<Sys_user> implements
|
||||
u.member,
|
||||
DATE_FORMAT(u.postDoctoralJoinDate, '%Y-%m-%d') AS postDoctoralJoinDate
|
||||
FROM
|
||||
vw_user u
|
||||
(
|
||||
SELECT
|
||||
vu.id,
|
||||
CASE
|
||||
WHEN NULLIF(s.unionRelationUnionId, '') IS NOT NULL THEN s.unionRelationUnionId
|
||||
ELSE vu.unionId
|
||||
END AS unionId,
|
||||
vu.unionCode,
|
||||
vu.unitId,
|
||||
vu.unitCode,
|
||||
vu.loginname,
|
||||
vu.username,
|
||||
vu.sex,
|
||||
vu.birthday,
|
||||
vu.political,
|
||||
vu.joinPartyDate,
|
||||
vu.nation,
|
||||
vu.nativePlace,
|
||||
vu.nationality,
|
||||
vu.idCardType,
|
||||
vu.mobile,
|
||||
vu.idCard,
|
||||
vu.marriage,
|
||||
vu.education,
|
||||
vu.academicDegree,
|
||||
vu.position,
|
||||
vu.jobCategory,
|
||||
vu.professionalTitle,
|
||||
vu.professionalLevel,
|
||||
vu.employeeSource,
|
||||
vu.administrativeLevel,
|
||||
vu.positionSeries,
|
||||
vu.positionLevel,
|
||||
vu.administrativePositionLevel,
|
||||
vu.arrivalAtSchoolDate,
|
||||
vu.personType,
|
||||
vu.preparedBy,
|
||||
vu.identityType,
|
||||
vu.userState,
|
||||
CASE
|
||||
WHEN NULLIF(s.unionRelationUnionId, '') IS NOT NULL THEN s.unionRelationUnionName
|
||||
ELSE vu.unionName
|
||||
END AS unionName,
|
||||
vu.unitName,
|
||||
vu.teachingTime,
|
||||
vu.expectedLeaveSchoolDate,
|
||||
vu.member,
|
||||
vu.postDoctoralJoinDate
|
||||
FROM
|
||||
vw_user vu
|
||||
LEFT JOIN special_staff s ON s.userId = vu.id
|
||||
) u
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
@@ -113,6 +171,24 @@ public class MemberInfoServiceImpl extends BaseServiceImpl<Sys_user> implements
|
||||
return sql;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View_user getMemberInfoDetail(String id) {
|
||||
View_user user = dao().fetch(View_user.class, Cnd.where("id", "=", id));
|
||||
if (user == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
SpecialStaff specialStaff = dao().fetch(SpecialStaff.class, Cnd.where("userId", "=", id));
|
||||
// 详情权限和列表权限共用有效工会口径:特殊人员优先使用工会关系,普通人员使用原所属工会。
|
||||
if (specialStaff != null && StrUtil.isNotBlank(specialStaff.getUnionRelationUnionId())) {
|
||||
user.setUnionId(specialStaff.getUnionRelationUnionId());
|
||||
user.setUnionName(specialStaff.getUnionRelationUnionName());
|
||||
user.setUnionGroupId(specialStaff.getUnionRelationUnionGroupId());
|
||||
user.setUnionGroupName(specialStaff.getUnionRelationUnionGroupName());
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Sql getMemberHistorySql(MemberInfoPageForm pageForm) {
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.budwk.app.zhgh.staffmanage.member.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;
|
||||
|
||||
/**
|
||||
* 会员核对名单导入模板。
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ContentRowHeight(20)
|
||||
@HeadRowHeight(20)
|
||||
@ColumnWidth(25)
|
||||
public class MemberCheckTaskUserImportTemp extends ExcelImportError {
|
||||
|
||||
@ExcelProperty("工号")
|
||||
private String loginname;
|
||||
|
||||
@ExcelProperty("姓名")
|
||||
private String username;
|
||||
}
|
||||
+6
-6
@@ -23,8 +23,8 @@ import com.budwk.app.zhgh.welfare.model.WelfareProjectSubjectOption;
|
||||
import com.budwk.app.zhgh.welfare.param.WelfareSelectionSituationPageForm;
|
||||
import com.budwk.app.zhgh.welfare.service.WelfareSelectionSituationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
@@ -255,9 +255,9 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
|
||||
return map;
|
||||
}).toList();
|
||||
|
||||
// 分组
|
||||
// 按工会名称分组,工会名称为空时使用默认 sheet 名称,避免导出时 groupingBy 空 key 报错
|
||||
Map<String, List<Map<String, Object>>> listMap = safeList.stream()
|
||||
.collect(Collectors.groupingBy(n -> (String) n.get("welfareUnionName")));
|
||||
.collect(Collectors.groupingBy(n -> StrUtil.blankToDefault(Objects.toString(n.get("welfareUnionName"), ""), "未设置工会"), LinkedHashMap::new, Collectors.toList()));
|
||||
|
||||
// 构建 Excel 列
|
||||
List<ExcelExportEntity> entities = new ArrayList<>();
|
||||
@@ -272,15 +272,15 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
|
||||
entities.add(userSignEntity);
|
||||
|
||||
// 导出
|
||||
Workbook workbook = new HSSFWorkbook();
|
||||
Workbook workbook = new XSSFWorkbook();
|
||||
listMap.forEach((k, v) -> {
|
||||
ExcelExportService service = new ExcelExportService();
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setSheetName(k);
|
||||
exportParams.setType(ExcelType.HSSF);
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
service.createSheetForMap(workbook, exportParams, entities, v);
|
||||
});
|
||||
|
||||
CommonDownloadUtil.download("领取表.xls", workbook, response);
|
||||
CommonDownloadUtil.download("领取表.xlsx", workbook, response);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -498,11 +498,11 @@ public class WelfareStatisticsServiceImpl extends BaseServiceImpl<WelfareProject
|
||||
|
||||
for (NutMap union : mapUnions) {
|
||||
// 福利人数
|
||||
long teacherSum = welfareSelectionList.stream().filter(v -> v.getString("welfareUnionId").equals(union.getString("id"))).count();
|
||||
long teacherSum = welfareSelectionList.stream().filter(v -> StrUtil.isNotBlank(v.getString("welfareUnionId")) && v.getString("welfareUnionId", "").equals(union.getString("id"))).count();
|
||||
union.put("teacherSum", teacherSum);
|
||||
|
||||
// 已选人数
|
||||
long selectedNum = welfareSelectionList.stream().filter(v -> v.getString("welfareUnionId").equals(union.getString("id")) && v.getBoolean("has_selected")).count();
|
||||
long selectedNum = welfareSelectionList.stream().filter(v -> StrUtil.isNotBlank(v.getString("welfareUnionId")) && v.getString("welfareUnionId", "").equals(union.getString("id")) && v.getBoolean("has_selected")).count();
|
||||
union.put("selectedNum", selectedNum);
|
||||
|
||||
// 未选人数
|
||||
|
||||
Reference in New Issue
Block a user