first commit
This commit is contained in:
+147
@@ -0,0 +1,147 @@
|
||||
package com.budwk.app.zhgh.club.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.BpmProcessConstant;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.enums.BpmProcessInstanceStatusEnum;
|
||||
import com.budwk.app.bpm.models.BpmProcessInstance;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysMsgService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.ClubUserApply;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/club/join/apply")
|
||||
@Api("协会申请入会、退会")
|
||||
@Ok("json:full")
|
||||
public class ClubUserJoinApplyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private SysMsgService sysMsgService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("club.join.apply")
|
||||
@Ok("beetl:/platform/zhgh/club/join/apply/index.html")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("详情")
|
||||
@SaCheckPermission("club.join.apply")
|
||||
public Result info(@Valid String id) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
cua.*,
|
||||
u.loginname AS loginName,
|
||||
u.username AS userName,
|
||||
u.sex,
|
||||
u.unitName,
|
||||
u.unionName,
|
||||
u.technicalTitle,
|
||||
u.education,
|
||||
u.academicDegree
|
||||
FROM
|
||||
club_user_apply cua
|
||||
LEFT JOIN vw_user u ON u.id = cua.userId
|
||||
WHERE cua.id = @id
|
||||
""").setParam("id", id);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao.execute(sql);
|
||||
// ClubUserApply clubUser = dao.fetch(ClubUserApply.class, id);
|
||||
return Result.success(sql.getResult());
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("提交")
|
||||
@SaCheckPermission("club.join.apply")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result submit(ClubUserApply clubUserApply) {
|
||||
ClubUserApply userApply = dao.fetch(ClubUserApply.class, Cnd.where("userId", "=", clubUserApply.getUserId()).and("clubId", "=", clubUserApply.getClubId()).and("mode", "=", 1).desc(ClubUserApply::getApplyDate));
|
||||
if (ObjectUtil.isNotEmpty(userApply) && StrUtil.isBlank(userApply.getId())) {
|
||||
BpmProcessInstance processInstance = dao.fetch(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "=", userApply.getId()));
|
||||
if (!processInstance.getProcessInstanceStatus().equals(BpmProcessInstanceStatusEnum.COMPLETED.name())) {
|
||||
return Result.error("您有该协会的申请记录尚未完成,请到我的申请里查看!");
|
||||
}
|
||||
}
|
||||
|
||||
//查询协会操作员
|
||||
String operatorLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.CLUB_OPERATOR, Cnd.where(Sys_user_role::getClubId, "=", clubUserApply.getClubId()));
|
||||
String presidentLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.CLUB_PRESIDENT, Cnd.where(Sys_user_role::getClubId, "=", clubUserApply.getClubId()));
|
||||
if (StrUtil.isAllBlank(operatorLoginName, presidentLoginName)) {
|
||||
return Result.error("该协会未配置审批人,请联系校工会!");
|
||||
}
|
||||
|
||||
clubUserApply.setRoleCode(RoleConstant.CLUB_MEMBER.name());
|
||||
clubUserApply.setMode(true);
|
||||
clubUserApply.setApplyDate(new Date());
|
||||
dao.insertOrUpdate(clubUserApply);
|
||||
|
||||
Sys_user applyUser = dao.fetch(Sys_user.class, clubUserApply.getUserId());
|
||||
|
||||
if (StrUtil.isNotBlank(operatorLoginName)) {
|
||||
bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_JOIN.name(), applyUser.getUsername() + "的申请", clubUserApply.getId(), List.of(operatorLoginName), null);
|
||||
// 发送消息
|
||||
sysMsgService.sendMsg(operatorLoginName, "协会入会审核", "您有一条新的协会入会申请待处理,请登录暖心工会进行审批。", SecurityUtil.getUserId());
|
||||
}else{
|
||||
bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_JOIN.name(), applyUser.getUsername() + "的申请", clubUserApply.getId(), List.of(presidentLoginName), null);
|
||||
// 发送消息
|
||||
sysMsgService.sendMsg(presidentLoginName, "协会入会审核", "您有一条新的协会入会申请待处理,请登录暖心工会进行审批。", SecurityUtil.getUserId());
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("校验是否申请过协会")
|
||||
@SaCheckPermission("club.join.apply")
|
||||
public Result checkApplyClub(@Valid String clubId) {
|
||||
ClubUserApply userApply = dao.fetch(ClubUserApply.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("clubId", "=", clubId).and("mode", "=", 1).desc(ClubUserApply::getApplyDate));
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("clubId", "=", clubId));
|
||||
if (ObjectUtil.isEmpty(userApply) && ObjectUtil.isEmpty(clubUser)) {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(clubUser)) {
|
||||
{
|
||||
return Result.error("请勿重复申请!");
|
||||
}
|
||||
}
|
||||
|
||||
BpmProcessInstance processInstance = dao.fetch(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "=", userApply.getId()));
|
||||
if (!processInstance.getProcessInstanceStatus().equals(BpmProcessInstanceStatusEnum.COMPLETED.name())) {
|
||||
return Result.error("您有该协会的申请记录尚未完成,请到我的申请里查看!");
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
package com.budwk.app.zhgh.club.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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.bpm.enums.BpmProcessTaskStatusEnum;
|
||||
import com.budwk.app.bpm.enums.BpmTaskApprovalTypeEnum;
|
||||
import com.budwk.app.bpm.param.BpmTaskApprovalParam;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserJoinPageForm;
|
||||
import com.budwk.app.zhgh.club.service.ClubUserJoinService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubUserJoinPageVo;
|
||||
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.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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/club/join/clubApproval")
|
||||
@Ok("json:full")
|
||||
public class ClubUserJoinApprovalController {
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private ClubUserJoinService clubUserJoinService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("club.join.clubApproval")
|
||||
@Ok("beetl:/platform/zhgh/club/join/clubApproval/index.html")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.join.clubApproval")
|
||||
public Result pageData(@Valid ClubUserJoinPageForm pageForm, boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
u.loginname AS loginName,
|
||||
u.username AS userName,
|
||||
u.sex,
|
||||
u.unitName,
|
||||
u.unionName,
|
||||
club.clubName,
|
||||
inst.id processInstanceId,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
task.id processInstanceTaskId,
|
||||
task.taskStatus processInstanceTaskStatus,
|
||||
COUNT( nt.id ) OVER ( PARTITION BY task.id ) > 0 AS nextTaskIsComplete
|
||||
FROM
|
||||
bpm_process_task task
|
||||
INNER JOIN bpm_process_node_define nd ON nd.id = task.processTaskNodeId
|
||||
INNER JOIN bpm_process_instance inst ON inst.id = task.processInstanceId
|
||||
INNER JOIN club_user_apply info ON info.id = inst.processInstanceBusinessId
|
||||
LEFT JOIN sys_club club ON club.id = info.clubId
|
||||
LEFT JOIN vw_user u on u.id = info.userId
|
||||
LEFT JOIN bpm_process_task nt ON nt.prevTaskId = task.id
|
||||
AND nt.taskStatus = 'COMPLETE'
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())){
|
||||
cnd.and(new Static("JSON_CONTAINS( task.assignments, '\"%s\"' )".formatted(SecurityUtil.getUserLoginname())));
|
||||
}
|
||||
|
||||
cnd.and("nd.nodeCode","=",20);
|
||||
if(approval){
|
||||
cnd.and("task.taskStatus","=", BpmProcessTaskStatusEnum.COMPLETE);
|
||||
}else{
|
||||
cnd.and("task.taskStatus","=",BpmProcessTaskStatusEnum.ACTIVE);
|
||||
}
|
||||
|
||||
cnd.andEX("YEAR(info.applyDate)","=",pageForm.getYear());
|
||||
cnd.and(Cnd.likeEX("info.userName", pageForm.getUserName()));
|
||||
cnd.and(Cnd.likeEX("info.loginName", pageForm.getLoginName()));
|
||||
cnd.andEX("info.unionId","=",pageForm.getUnionId());
|
||||
cnd.andEX("info.unitId","=",pageForm.getUnitId());
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination<ClubUserJoinPageVo> pageVO = clubUserJoinService.listPageVO(pageForm, sql, ClubUserJoinPageVo.class);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.join.clubApproval")
|
||||
@ApiOperation("审核")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam){
|
||||
approvalParam.getBpmTaskApprovalTypeEnum();
|
||||
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
List<String> assignments = new ArrayList<>();
|
||||
if(approvalParam.getBpmTaskApprovalTypeEnum().equals(BpmTaskApprovalTypeEnum.PASS)){
|
||||
String approvalLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.SCHOOL_UNION_CLUB_ADMIN);
|
||||
assignments.add(approvalLoginName);
|
||||
}
|
||||
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, assignments);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.join.clubApproval")
|
||||
@ApiOperation("撤回")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result revoke(@Valid String taskId){
|
||||
bpmService.revokeTask(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
package com.budwk.app.zhgh.club.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.constant.BpmProcessConstant;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.zhgh.club.service.ClubUserJoinService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubUserJoinVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/club/join/common")
|
||||
@Ok("json:full")
|
||||
public class ClubUserJoinCommonController {
|
||||
|
||||
@Inject
|
||||
private ClubUserJoinService clubUserJoinService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At
|
||||
@ApiOperation("申请详情")
|
||||
@SaCheckPermission("club")
|
||||
public Result info(@Valid String id) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
cua.*,
|
||||
u.loginname AS loginName,
|
||||
u.username AS userName,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
u.unitName,
|
||||
u.unionName,
|
||||
u.technicalTitle,
|
||||
u.education,
|
||||
u.academicDegree
|
||||
FROM
|
||||
club_user_apply cua
|
||||
LEFT JOIN vw_user u ON u.id = cua.userId
|
||||
WHERE cua.id = @id
|
||||
""");
|
||||
sql.setParam("id",id);
|
||||
ClubUserJoinVo clubUserJoinVo = clubUserJoinService.fetchVO(sql, ClubUserJoinVo.class);
|
||||
clubUserJoinVo.setNodeTasks(bpmService.getNodeTasks(BpmProcessConstant.CLUB_JOIN, id));
|
||||
return Result.success(clubUserJoinVo);
|
||||
}
|
||||
|
||||
}
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
package com.budwk.app.zhgh.club.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.ClubUserApply;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/club/join/mine")
|
||||
@Ok("json:full")
|
||||
public class ClubUserJoinMineController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("club.join.mine")
|
||||
@Ok("beetl:/platform/zhgh/club/join/mine/index.html")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.join.mine")
|
||||
public Result pageData(@Valid PageForm pageForm){
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
club.clubName,
|
||||
u.loginname as loginName,
|
||||
u.username as userName,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeCode,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
(
|
||||
SELECT
|
||||
count( 1 ) > 0
|
||||
FROM
|
||||
bpm_process_task
|
||||
WHERE
|
||||
prevTaskId = ( SELECT id FROM bpm_process_task WHERE processInstanceId = inst.id AND processTaskNodeCode IN ( 10, 40,70 ) ORDER BY createdAt DESC LIMIT 1 )
|
||||
AND taskStatus = 'COMPELTE'
|
||||
) AS nextTaskIsComplete
|
||||
FROM
|
||||
club_user_apply info
|
||||
LEFT JOIN sys_user u on u.id = info.userId
|
||||
LEFT JOIN sys_club club ON club.id = info.clubId
|
||||
LEFT JOIN bpm_process_instance inst ON inst.processInstanceBusinessId = info.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("inst.processInstanceInitiatorLoginName", "=", SecurityUtil.getUserLoginname());
|
||||
}
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.join.apply")
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result delete(@Valid String id) {
|
||||
dao.delete(ClubUserApply.class, id);
|
||||
dao.delete(ClubUser.class, id);
|
||||
bpmService.deleteInstance(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.join.apply")
|
||||
@ApiOperation("撤销")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result revokeApply(@Valid String id) {
|
||||
bpmService.revokeApply(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+149
@@ -0,0 +1,149 @@
|
||||
package com.budwk.app.zhgh.club.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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.bpm.enums.BpmProcessTaskStatusEnum;
|
||||
import com.budwk.app.bpm.enums.BpmTaskApprovalTypeEnum;
|
||||
import com.budwk.app.bpm.models.BpmProcessInstance;
|
||||
import com.budwk.app.bpm.models.BpmProcessTask;
|
||||
import com.budwk.app.bpm.param.BpmTaskApprovalParam;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.ClubUserApply;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserJoinPageForm;
|
||||
import com.budwk.app.zhgh.club.service.ClubUserJoinService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubUserJoinPageVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/club/join/schoolUnionApproval")
|
||||
@Ok("json:full")
|
||||
public class ClubUserJoinSchoolApprovalController {
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private ClubUserJoinService clubUserJoinService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("club.join.schoolUnionApproval")
|
||||
@Ok("beetl:/platform/zhgh/club/join/schoolUnionApproval/index.html")
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.join.schoolUnionApproval")
|
||||
public Result pageData(@Valid ClubUserJoinPageForm pageForm, boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
u.loginname AS loginName,
|
||||
u.username AS userName,
|
||||
u.sex,
|
||||
u.unitName,
|
||||
u.unionName,
|
||||
club.clubName,
|
||||
inst.id processInstanceId,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
task.id processInstanceTaskId,
|
||||
task.taskStatus processInstanceTaskStatus,
|
||||
COUNT( nt.id ) OVER ( PARTITION BY task.id ) > 0 AS nextTaskIsComplete
|
||||
FROM
|
||||
bpm_process_task task
|
||||
INNER JOIN bpm_process_node_define nd ON nd.id = task.processTaskNodeId
|
||||
INNER JOIN bpm_process_instance inst ON inst.id = task.processInstanceId
|
||||
INNER JOIN club_user_apply info ON info.id = inst.processInstanceBusinessId
|
||||
LEFT JOIN sys_club club ON club.id = info.clubId
|
||||
LEFT JOIN vw_user u on u.id = info.userId
|
||||
LEFT JOIN bpm_process_task nt ON nt.prevTaskId = task.id
|
||||
AND nt.taskStatus = 'COMPLETE'
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and(new Static("JSON_CONTAINS( task.assignments, '\"%s\"' )".formatted(SecurityUtil.getUserLoginname())));
|
||||
}
|
||||
cnd.and("nd.nodeCode", "=", 50);
|
||||
if (approval) {
|
||||
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.COMPLETE);
|
||||
} else {
|
||||
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.ACTIVE);
|
||||
}
|
||||
cnd.andEX("YEAR(info.applyDate)", "=", pageForm.getYear());
|
||||
cnd.and(Cnd.likeEX("info.userName", pageForm.getUserName()));
|
||||
cnd.and(Cnd.likeEX("info.loginName", pageForm.getLoginName()));
|
||||
cnd.andEX("info.unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("info.unitId", "=", pageForm.getUnitId());
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination<ClubUserJoinPageVo> pageVO = clubUserJoinService.listPageVO(pageForm, sql, ClubUserJoinPageVo.class);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.join.schoolUnionApproval")
|
||||
@ApiOperation("审核")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) {
|
||||
approvalParam.getBpmTaskApprovalTypeEnum();
|
||||
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, null);
|
||||
|
||||
if (approvalParam.getBpmTaskApprovalTypeEnum() == BpmTaskApprovalTypeEnum.PASS) {
|
||||
String processInstanceBusinessId = approvalParam.getProcessInstanceBusinessId();
|
||||
ClubUserApply clubUserApply = dao.fetch(ClubUserApply.class, processInstanceBusinessId);
|
||||
ClubUser clubUser = BeanUtil.copyProperties(clubUserApply, ClubUser.class);
|
||||
dao.insert(clubUser);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.join.schoolUnionApproval")
|
||||
@ApiOperation("撤回")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result revoke(@Valid String taskId) {
|
||||
bpmService.revokeTask(taskId);
|
||||
|
||||
BpmProcessTask task = dao.fetch(BpmProcessTask.class, taskId);
|
||||
String processInstanceId = task.getProcessInstanceId();
|
||||
BpmProcessInstance processInstance = dao.fetch(BpmProcessInstance.class, processInstanceId);
|
||||
String businessId = processInstance.getProcessInstanceBusinessId();
|
||||
|
||||
ClubUserApply clubUserApply = dao.fetch(ClubUserApply.class, businessId);
|
||||
dao.clear(ClubUser.class, Cnd.where(ClubUser::getUserId, "=", clubUserApply.getUserId())
|
||||
.and(ClubUser::getClubId, "=", clubUserApply.getClubId()));
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
package com.budwk.app.zhgh.club.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
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.lang.Lang;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/club/join/mine/club")
|
||||
@Ok("json:full")
|
||||
public class ClubUserMineClubController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("club.join.mine.club")
|
||||
@Ok("beetl:/platform/zhgh/club/join/mineclub/index.html")
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.join.mine.club")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
List<SysClubUser> query = dao.query(SysClubUser.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).groupBy("clubId"));
|
||||
if (Lang.isEmpty(query)) {
|
||||
return Result.success();
|
||||
}
|
||||
List<String> clubIds = query.stream().map(SysClubUser::getClubId).toList();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
club.*,
|
||||
COUNT(DISTINCT ( uc.userId )) AS currentPeopleNum,
|
||||
presidentUser.username AS clubLeader,
|
||||
secretaryUser.username AS clubSecretary
|
||||
FROM
|
||||
sys_club club
|
||||
LEFT JOIN club_user uc ON club.id = uc.clubId
|
||||
LEFT JOIN club_user presidentCu ON presidentCu.clubId = club.id
|
||||
AND presidentCu.roleCode = 'CLUB_PRESIDENT'
|
||||
LEFT JOIN sys_user presidentUser ON presidentUser.id = presidentCu.userId
|
||||
LEFT JOIN sys_club_user secretaryCu ON secretaryCu.clubId = club.id
|
||||
AND secretaryCu.roleCode = 'CLUB_SECRETARY'
|
||||
LEFT JOIN sys_user secretaryUser ON secretaryUser.id = secretaryCu.userId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("club.clubName", "=", pageForm.getClubName());
|
||||
cnd.and("club.id", "in", clubIds);
|
||||
cnd.groupBy("club.id");
|
||||
cnd.asc("club.clubCode");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.join.mine.club")
|
||||
public Result getClubUsers(@Valid String clubId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
scu.*,
|
||||
role.`name` AS roleName,
|
||||
u.username AS userName,
|
||||
u.loginname AS loginName,
|
||||
u.sex,
|
||||
u.personType AS personType,
|
||||
u.userState,
|
||||
u.unitid AS unitId,
|
||||
u.mobile,
|
||||
club.clubName,
|
||||
u.unitname AS unitName
|
||||
FROM
|
||||
club_user scu
|
||||
LEFT JOIN sys_club club ON scu.clubId = club.id
|
||||
LEFT JOIN `vw_user` u ON scu.userId = u.id
|
||||
LEFT JOIN sys_role role ON role.`code` = scu.rolecode
|
||||
WHERE
|
||||
scu.clubId = @clubId
|
||||
""").setParam("clubId", clubId);
|
||||
return Result.success(baseService.listMap(sql));
|
||||
}
|
||||
}
|
||||
+174
@@ -0,0 +1,174 @@
|
||||
package com.budwk.app.zhgh.club.controller.applyJoin;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubUserService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubRegisterVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
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.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.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/7 10:14
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/applyJoin/apply")
|
||||
public class ClubUserApplyController {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private SysClubUserService sysClubUserService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/applyJoin/apply/index.html")
|
||||
@SaCheckPermission("club.applyJoin.apply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.applyJoin.apply")
|
||||
public Result pageData(@Valid PageForm pageForm, Boolean hasJoin, String clubName, String clubType) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("dismiss", "=", false);
|
||||
cnd.andEX("clubType", "=", clubType);
|
||||
if (StrUtil.isNotBlank(clubName)) {
|
||||
cnd.and("clubName", "like", "%" + clubName + "%");
|
||||
}
|
||||
if (hasJoin) {
|
||||
cnd.and(new Static("club.id in (SELECT clubId from club_user WHERE userId = '%s')".formatted(SecurityUtil.getUserId())));
|
||||
} else {
|
||||
cnd.and(new Static("club.id not in (SELECT clubId from club_user WHERE userId = '%s')".formatted(SecurityUtil.getUserId())));
|
||||
}
|
||||
if (Strings.isNotBlank(pageForm.getPageOrderName()) && Strings.isNotBlank(pageForm.getPageOrderBy())) {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
} else {
|
||||
cnd.asc("club.clubCode");
|
||||
}
|
||||
Pagination allClubWithPage = sysClubService.getAllClubWithPage(pageForm, cnd);
|
||||
return Result.success(allClubWithPage);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.applyJoin.apply")
|
||||
public Result getCount() {
|
||||
int hasJoinCount = sysClubService.dao().count(SysClub.class, Cnd.NEW().and("dismiss", "=", false)
|
||||
//.and("state", "=", ClubRegistAuditState.SCHOOL_PASS)
|
||||
.and(new Static("id in (SELECT clubId from club_user WHERE userId = '%s')".formatted(SecurityUtil.getUserId()))));
|
||||
int noJoinCount = sysClubService.dao().count(SysClub.class, Cnd.NEW().and("dismiss", "=", false)
|
||||
//.and("state", "=", ClubRegistAuditState.SCHOOL_PASS)
|
||||
.and(new Static("id not in (SELECT clubId from club_user WHERE userid = '%s')".formatted(SecurityUtil.getUserId()))));
|
||||
NutMap nutMap = new NutMap().setv("hasJoinCount", hasJoinCount).setv("noJoinCount", noJoinCount);
|
||||
return Result.success(nutMap);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.applyJoin.apply")
|
||||
public Result getInClubByCurUser() {
|
||||
String id = Objects.requireNonNull(SecurityUtil.getUserId());
|
||||
Sys_user sysUser = sysClubService.dao().fetch(Sys_user.class, id);
|
||||
if (sysUser.getUserState() != null && !List.of("在职", "在岗").contains(sysUser.getUserState())) {
|
||||
return Result.error("只支持在职教职工申请加入协会");
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
club.*
|
||||
from sys_club club
|
||||
left join club_user cu on club.id=cu.clubId
|
||||
where
|
||||
cu.userId=@userId
|
||||
group by cu.clubId
|
||||
""").setParam("userId", id);
|
||||
List<NutMap> list = sysClubService.listMap(sql);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.applyJoin.apply")
|
||||
@SLog(type = "clubApplyJoin", tag = "提交入会申请", msg = "提交入会申请")
|
||||
public Result submit(@Valid String id) {
|
||||
|
||||
sysClubService.dao().clear(SysClubUser.class, Cnd.where("clubId", "=", id).and("userId", "=", SecurityUtil.getUserId()));
|
||||
|
||||
SysClubUser sysClubUser = new SysClubUser();
|
||||
sysClubUser.setClubId(id);
|
||||
sysClubUser.setUserId(SecurityUtil.getUserId());
|
||||
sysClubUser.setJoinTime(DateUtil.now());
|
||||
sysClubUser.setRoleCode(RoleConstant.CLUB_MEMBER.name());
|
||||
sysClubUser.setStatus(1);
|
||||
sysClubUser.setPayed(false);
|
||||
sysClubUser.setIsNormal(true);
|
||||
sysClubUser.setGiveMoney(false);
|
||||
sysClubService.dao().insert(sysClubUser);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.applyJoin.apply")
|
||||
@SLog(type = "clubApplyJoin", tag = "撤销入会申请", msg = "撤销入会申请")
|
||||
public Result revocation(@Valid String id) {
|
||||
sysClubService.dao().clear(SysClubUser.class, Cnd.where("clubId", "=", id).and("userId", "=", SecurityUtil.getUserId()));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.applyJoin.apply")
|
||||
public Result findOne(@Valid String id) {
|
||||
ClubRegisterVo clubRegisterVo = sysClubService.findOne(id);
|
||||
return Result.success(clubRegisterVo);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.applyJoin.apply")
|
||||
@SLog(type = "clubApplyJoin", tag = "提交退会申请", msg = "提交退会申请")
|
||||
public Result exitClub(@Valid String id) {
|
||||
sysClubUserService.update(Chain.make("exitStatus", 1)
|
||||
, Cnd.where("clubId", "=", id).and("userId", "=", SecurityUtil.getUserId()));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.applyJoin.apply")
|
||||
@SLog(type = "clubApplyJoin", tag = "撤销退会申请", msg = "撤销退会申请")
|
||||
public Result cancelExitClub(@Valid String id) {
|
||||
sysClubUserService.update(Chain.make("exitStatus", null)
|
||||
, Cnd.where("clubId", "=", id).and("userId", "=", SecurityUtil.getUserId()));
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package com.budwk.app.zhgh.club.controller.applyJoin;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubUserService;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/7 10:14
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/applyJoin/clubAudit")
|
||||
public class ClubUserClubAuditController {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private SysClubUserService sysClubUserService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/applyJoin/clubAudit/index.html")
|
||||
@SaCheckPermission("club.applyJoin.clubAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.applyJoin.clubAudit")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination pagination = sysClubUserService.pageDataByApplyJoinClubAudit(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.applyJoin.clubAudit")
|
||||
public Result getMyMangeClub() {
|
||||
List<SysClub> myManageClub = sysClubService.getMyManageClub();
|
||||
return Result.success(myManageClub);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.applyJoin.clubAudit")
|
||||
@SLog(type = "clubApplyAudit", tag = "协会审核入会申请", msg = "协会审核入会申请")
|
||||
public Result doAudit(@Valid String[] ids,
|
||||
@Valid Boolean auditResult,
|
||||
@Valid Integer auditType,
|
||||
@Valid Integer applyType,
|
||||
@Valid Boolean payed) {
|
||||
sysClubUserService.doAudit(ids, auditResult, auditType, applyType, payed);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.budwk.app.zhgh.club.controller.common;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/club/common")
|
||||
@Ok("json:full")
|
||||
public class ClubCommonController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result listClub() {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.*
|
||||
FROM
|
||||
`sys_club` c
|
||||
LEFT JOIN bpm_process_instance inst ON inst.processInstanceBusinessId = c.id
|
||||
WHERE
|
||||
inst.processInstanceStatus = 'COMPLETED'
|
||||
AND inst.processInstanceNodeCode = 80
|
||||
""");
|
||||
List list = baseService.listVO(sql, SysClub.class);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
package com.budwk.app.zhgh.club.controller.evaluate;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.BpmProcessConstant;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubEvaluate;
|
||||
import com.budwk.app.zhgh.club.service.SysClubEvaluateService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 15:19
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/evaluate/apply")
|
||||
public class ClubEvaluateApplyController {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
@Inject
|
||||
private SysClubEvaluateService evaluateService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/evaluate/apply/index.html")
|
||||
@SaCheckPermission("club.evaluate.apply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.evaluate.apply")
|
||||
@SLog(type = "evaluateApply", tag = "保存协会评优申请", msg = "保存协会评优申请")
|
||||
public Result doSave(@Param("evaluate") SysClubEvaluate evaluate) {
|
||||
evaluateService.dao().insertOrUpdate(evaluate);
|
||||
SysClub club = sysClubService.fetch(evaluate.getClubId());
|
||||
bpmService.startSaveProcessInstance(BpmProcessConstant.CLUB_EVALUATE.name(), club.getClubName() + "的协会评优申请", evaluate.getId(), null);
|
||||
return Result.success(evaluate);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.evaluate")
|
||||
public Result info(@Valid String id) {
|
||||
SysClubEvaluate evaluate = evaluateService.fetch(id);
|
||||
return Result.success(evaluate);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.evaluate.apply")
|
||||
@SLog(type = "evaluateApply", tag = "提交协会评优", msg = "提交协会评优")
|
||||
public Result doSubmit(@Valid @Param("evaluate") SysClubEvaluate evaluate) {
|
||||
evaluateService.dao().insertOrUpdate(evaluate);
|
||||
SysClub club = sysClubService.fetch(evaluate.getClubId());
|
||||
//查询校协会管理员审批人工号
|
||||
String clubPresidentLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.SCHOOL_UNION_CLUB_ADMIN, Cnd.NEW());
|
||||
if (StrUtil.isBlank(clubPresidentLoginName)) {
|
||||
return Result.error("校协会管理员未配置审批人,请联系校工会!");
|
||||
}
|
||||
bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_EVALUATE.name(), club.getClubName() + "的协会评优申请", evaluate.getId(), List.of(clubPresidentLoginName), null);
|
||||
return Result.success(evaluate);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getMyClubAndYearAuditPass(Integer year) {
|
||||
//List<NutMap> list = sysClubService.getMyClubAndYearAuditPass(year);
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.id
|
||||
FROM
|
||||
`sys_club` c
|
||||
LEFT JOIN bpm_process_instance inst ON inst.processInstanceBusinessId = c.id
|
||||
WHERE
|
||||
inst.processInstanceStatus = 'COMPLETED'
|
||||
AND inst.processInstanceNodeCode = 80
|
||||
""");
|
||||
sql.setCallback(Sqls.callback.strList());
|
||||
sysClubService.execute(sql);
|
||||
List<String> clubIds = sql.getList(String.class);
|
||||
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
return Result.success(sysClubService.dao().query(SysClub.class, Cnd.where(SysClub::getId, "in", clubIds)));
|
||||
}
|
||||
|
||||
List<ClubUser> clubUsers = sysClubService.dao().query(ClubUser.class, Cnd.where("userId", "=", SecurityUtil.getUserId()));
|
||||
List<String> clubIdList = clubUsers.stream().map(ClubUser::getClubId).toList();
|
||||
List<String> passClubIdList = clubIdList.stream().filter(clubIds::contains).toList();
|
||||
List<SysClub> clubList = sysClubService.dao().query(SysClub.class, Cnd.where("id", "in", passClubIdList));
|
||||
return Result.success(clubList);
|
||||
}
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
package com.budwk.app.zhgh.club.controller.evaluate;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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.bpm.enums.BpmTaskApprovalTypeEnum;
|
||||
import com.budwk.app.bpm.param.BpmTaskApprovalParam;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubEvaluateService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubEvaluatePageVo;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
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 javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 17:50
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/evaluate/clubAudit")
|
||||
public class ClubEvaluateClubAuditController {
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
@Inject
|
||||
private SysClubEvaluateService sysClubEvaluateService;
|
||||
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/evaluate/clubAudit/index.html")
|
||||
@SaCheckPermission("club.evaluate.clubAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.evaluate.clubAudit")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination<ClubEvaluatePageVo> pagination = sysClubEvaluateService.clubAuditPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.evaluate.clubAudit")
|
||||
@SLog(type = "clubEvaluate", tag = "会长审核评优申请", msg = "会长审核评优申请", param = true)
|
||||
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) {
|
||||
approvalParam.getBpmTaskApprovalTypeEnum();
|
||||
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
|
||||
List<String> assignments = new ArrayList<>();
|
||||
if(approvalParam.getBpmTaskApprovalTypeEnum().equals(BpmTaskApprovalTypeEnum.PASS)){
|
||||
List<String> schoolUnionApprovalLoginName = commonService.findUsersLoginNameByRoleCode(RoleConstant.SCHOOL_UNION_CLUB_ADMIN, Cnd.NEW());
|
||||
assignments.addAll(schoolUnionApprovalLoginName);
|
||||
}
|
||||
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, assignments);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.evaluate.clubAudit")
|
||||
@SLog(type = "clubEvaluate", tag = "会长撤回评优申请", msg = "会长撤回评优申请", param = true)
|
||||
public Result revoke(@Valid String taskId) {
|
||||
bpmService.revokeTask(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package com.budwk.app.zhgh.club.controller.evaluate;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.constant.BpmProcessConstant;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubEvaluateService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubEvaluateVo;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/evaluate/common")
|
||||
public class ClubEvaluateCommonController {
|
||||
|
||||
@Inject
|
||||
private SysClubEvaluateService sysClubEvaluateService;
|
||||
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.evaluate")
|
||||
public Result findOne(@Valid String id) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ce.*,
|
||||
c.clubName,
|
||||
c.clubCode,
|
||||
c.createTime,
|
||||
d.NAME AS typeName,
|
||||
c.foundTime
|
||||
FROM
|
||||
sys_club_evaluate ce
|
||||
left join sys_club c on ce.clubId = c.id
|
||||
LEFT JOIN sys_dict d ON d.CODE = c.clubType
|
||||
$condition
|
||||
""");
|
||||
cnd.andEX("ce.id", "=", id);
|
||||
sql.setCondition(cnd);
|
||||
ClubEvaluateVo clubEvaluateVo = sysClubEvaluateService.fetchVO(sql, ClubEvaluateVo.class);
|
||||
clubEvaluateVo.setNodeTasks(bpmService.getNodeTasks(BpmProcessConstant.CLUB_EVALUATE, id));
|
||||
return Result.success(clubEvaluateVo);
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package com.budwk.app.zhgh.club.controller.evaluate;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.zhgh.club.model.SysClubEvaluate;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubEvaluateService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubEvaluatePageVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 17:26
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/evaluate/mine")
|
||||
public class ClubEvaluateMineController {
|
||||
|
||||
@Inject
|
||||
private SysClubEvaluateService sysClubEvaluateService;
|
||||
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/evaluate/mine/index.html")
|
||||
@SaCheckPermission("club.evaluate.mine")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.evaluate.mine")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination<ClubEvaluatePageVo> pagination = sysClubEvaluateService.minePageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.evaluate.mine")
|
||||
@SLog(type = "evaluateApply", tag = "删除协会评优", msg = "删除协会评优")
|
||||
public Result doDelete(@Valid String id) {
|
||||
sysClubEvaluateService.dao().delete(SysClubEvaluate.class, id);
|
||||
bpmService.deleteInstance(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.evaluate.mine")
|
||||
@ApiOperation("撤回")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "协会评优", msg = "撤回申请")
|
||||
public Result revokeApply(@Valid String id) {
|
||||
bpmService.revokeApply(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package com.budwk.app.zhgh.club.controller.evaluate;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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.bpm.param.BpmTaskApprovalParam;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubEvaluateService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubEvaluatePageVo;
|
||||
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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 17:51
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/evaluate/schoolAudit")
|
||||
public class ClubEvaluateSchoolAuditController {
|
||||
|
||||
@Inject
|
||||
private SysClubEvaluateService sysClubEvaluateService;
|
||||
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/evaluate/schoolAudit/index.html")
|
||||
@SaCheckPermission("club.evaluate.schoolAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.evaluate.schoolAudit")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination<ClubEvaluatePageVo> pagination = sysClubEvaluateService.schoolAuditPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.evaluate.schoolAudit")
|
||||
@SLog(type = "clubEvaluate", tag = "校工会审核评优申请", msg = "校工会审核评优申请", param = true)
|
||||
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) {
|
||||
approvalParam.getBpmTaskApprovalTypeEnum();
|
||||
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, null);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.evaluate.schoolAudit")
|
||||
@SLog(type = "clubEvaluate", tag = "校工会撤回评优申请", msg = "校工会撤回评优申请", param = true)
|
||||
public Result revoke(@Valid String taskId) {
|
||||
bpmService.revokeTask(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
package com.budwk.app.zhgh.club.controller.examine;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.BpmProcessConstant;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubExamineRegister;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import com.budwk.app.zhgh.club.service.SysClubExamineService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubUserService;
|
||||
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.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 18:35
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/examine/apply")
|
||||
public class ClubExamineApplyController {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
@Inject
|
||||
private SysClubUserService sysClubUserService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private SysClubExamineService sysClubExamineService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/examine/apply/index.html")
|
||||
@SaCheckPermission("club.examine.apply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getCount(@Valid String id,@Valid Integer year) {
|
||||
int count = dao.count(SysClubExamineRegister.class, Cnd.where("clubId", "=", id).and("year(registerDate)", "=", year));
|
||||
return Result.success(count);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getClubsByRole() {
|
||||
List<SysClub> myManageClub = sysClubService.getMyManageClub();
|
||||
return Result.success(myManageClub);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getClubUserNum(@Valid String clubId) {
|
||||
List<NutMap> result = sysClubExamineService.getClubUserNum(clubId);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getJgUser(@Valid String clubId) {
|
||||
List<NutMap> result = sysClubExamineService.getJgUser(clubId);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getClubMemberMoney(@Valid String clubId) {
|
||||
int count = dao.count(SysClubUser.class, Cnd.where("clubId", "=", clubId).and("status", "=", 5).and("isNormal", "=", true));
|
||||
SysClub club = dao.fetch(SysClub.class, clubId);
|
||||
int money = count * (club.getDue() != null ? Integer.parseInt(club.getDue()) : 0);
|
||||
return Result.success(money);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getXghBkMoney(@Valid String clubId) {
|
||||
/*jf_club club = dao().fetch(jf_club.class, Cnd.where("club_id", "=", id));
|
||||
Double total_quota = Double.valueOf(club.getTotal_quota());*/
|
||||
return Result.success(0);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getLasYearSurplus(@Valid String clubId) {
|
||||
SysClubExamineRegister register = dao.fetch(SysClubExamineRegister.class, Cnd.where("clubId", "=", clubId)
|
||||
.and("YEAR(registerDate)", "=", cn.hutool.core.date.DateUtil.thisYear() - 1));
|
||||
if (Lang.isNotEmpty(register)) {
|
||||
List<JSONObject> incomeCensuss = register.getIncomeCensus();
|
||||
float surplus = incomeCensuss.get(0).getFloat("surplus");
|
||||
return Result.success(surplus);
|
||||
}
|
||||
return Result.success(0);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.examine")
|
||||
public Result info(@Valid String id) {
|
||||
SysClubExamineRegister examineRegister = sysClubExamineService.fetch(id);
|
||||
sysClubExamineService.fetchLinks(examineRegister, "detailedList");
|
||||
return Result.success(examineRegister);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.examine.apply")
|
||||
@SLog(type = "examineApply", tag = "保存协会年审", msg = "保存协会年审")
|
||||
public Result doSave(@Param("data") SysClubExamineRegister examineRegister,
|
||||
@Param("incomeDetailed") String incomeDetailed,
|
||||
@Param("incomeCensus") String incomeCensus) {
|
||||
SysClubExamineRegister register;
|
||||
if(StrUtil.isBlank(examineRegister.getId())) {
|
||||
register = sysClubExamineService.doAdd(examineRegister, incomeDetailed, incomeCensus);
|
||||
} else {
|
||||
register = sysClubExamineService.doEdit(examineRegister, incomeDetailed, incomeCensus);
|
||||
}
|
||||
bpmService.startSaveProcessInstance(BpmProcessConstant.CLUB_EXAMINE.name(), register.getClubName()+"的协会考核申请", register.getId(), null);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.examine.apply")
|
||||
@SLog(type = "examineApply", tag = "提交协会年审", msg = "提交协会年审")
|
||||
public Result doSubmit(@Param("data") SysClubExamineRegister examineRegister,
|
||||
@Param("incomeDetailed") String incomeDetailed,
|
||||
@Param("incomeCensus") String incomeCensus) {
|
||||
SysClubExamineRegister reg;
|
||||
if(StrUtil.isBlank(examineRegister.getId())) {
|
||||
reg = sysClubExamineService.doAdd(examineRegister, incomeDetailed, incomeCensus);
|
||||
} else {
|
||||
reg = sysClubExamineService.doEdit(examineRegister, incomeDetailed, incomeCensus);
|
||||
}
|
||||
//查询校协会管理员审批人工号
|
||||
String clubPresidentLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.SCHOOL_UNION_CLUB_ADMIN, Cnd.NEW());
|
||||
if(StrUtil.isBlank(clubPresidentLoginName)){
|
||||
return Result.error("校协会管理员未配置审批人,请联系校工会!");
|
||||
}
|
||||
bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_EXAMINE.name(), examineRegister.getClubName()+"的协会考核申请", examineRegister.getId(), List.of(clubPresidentLoginName),null);
|
||||
return Result.success(reg);
|
||||
}
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
package com.budwk.app.zhgh.club.controller.examine;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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.bpm.enums.BpmTaskApprovalTypeEnum;
|
||||
import com.budwk.app.bpm.param.BpmTaskApprovalParam;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubExamineService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubExaminePageVo;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
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 javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/examine/clubAudit")
|
||||
public class ClubExamineClubAuditController {
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
@Inject
|
||||
private SysClubExamineService sysClubExamineService;
|
||||
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/examine/clubAudit/index.html")
|
||||
@SaCheckPermission("club.examine.clubAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.examine.clubAudit")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination<ClubExaminePageVo> pagination = sysClubExamineService.clubAuditPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.examine.clubAudit")
|
||||
@SLog(type = "clubExamine", tag = "会长审核年度考核", msg = "会长审核年度考核", param = true)
|
||||
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) {
|
||||
approvalParam.getBpmTaskApprovalTypeEnum();
|
||||
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
|
||||
List<String> assignments = new ArrayList<>();
|
||||
if(approvalParam.getBpmTaskApprovalTypeEnum().equals(BpmTaskApprovalTypeEnum.PASS)){
|
||||
List<String> schoolUnionApprovalLoginName = commonService.findUsersLoginNameByRoleCode(RoleConstant.SCHOOL_UNION_CLUB_ADMIN, Cnd.NEW());
|
||||
assignments.addAll(schoolUnionApprovalLoginName);
|
||||
}
|
||||
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, assignments);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.examine.clubAudit")
|
||||
@SLog(type = "clubExamine", tag = "会长撤回年度考核", msg = "会长撤回年度考核", param = true)
|
||||
public Result revoke(@Valid String taskId) {
|
||||
bpmService.revokeTask(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.budwk.app.zhgh.club.controller.examine;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.club.service.SysClubExamineService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubExamineVo;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/examine/common")
|
||||
public class ClubExamineCommonController {
|
||||
|
||||
@Inject
|
||||
private SysClubExamineService sysClubExamineService;
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.examine")
|
||||
public Result findOne(@Valid String id) {
|
||||
ClubExamineVo clubExamineVo = sysClubExamineService.findOne(id);
|
||||
return Result.success(clubExamineVo);
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
package com.budwk.app.zhgh.club.controller.examine;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.zhgh.club.model.SysClubExamineRegisterDetailed;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubExamineService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubExaminePageVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/examine/mine")
|
||||
public class ClubExamineMineController {
|
||||
|
||||
@Inject
|
||||
private SysClubExamineService sysClubExamineService;
|
||||
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/examine/mine/index.html")
|
||||
@SaCheckPermission("club.examine.mine")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.examine.mine")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination<ClubExaminePageVo> pagination = sysClubExamineService.minePageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.examine.mine")
|
||||
@SLog(type = "evaluateApply", tag = "删除协会年审", msg = "删除协会年审")
|
||||
public Result doDelete(@Valid String id) {
|
||||
sysClubExamineService.delete(id);
|
||||
sysClubExamineService.dao().clear(SysClubExamineRegisterDetailed.class, Cnd.where("registerId", "=", id));
|
||||
bpmService.deleteInstance(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.examine.mine")
|
||||
@ApiOperation("撤回")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "协会年审", msg = "撤回申请")
|
||||
public Result revokeApply(@Valid String id) {
|
||||
bpmService.revokeApply(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("club.examine.mine")
|
||||
public void exportFiles(String id,
|
||||
HttpServletResponse response) throws IOException {
|
||||
/*NutMap nutMap = sysClubExamineService.findOne(id);
|
||||
|
||||
List<NutMap> detailedList = nutMap.getAsList("detailedList", NutMap.class);
|
||||
SysClubExamineRegister register = nutMap.getAs("register", SysClubExamineRegister.class);
|
||||
List<JSONObject> incomeCensus = register.getIncomeCensus();
|
||||
List<NutMap> jgUser = sysClubExamineService.getJgUser(register.getClubId());
|
||||
List<NutMap> clubUserNum = sysClubExamineService.getClubUserNum(register.getClubId());
|
||||
|
||||
NutMap userNumMap = new NutMap();
|
||||
long yearFirstNum = clubUserNum.stream().mapToInt(v -> v.getInt("yearFirstNum")).sum();
|
||||
long yearAddNum = clubUserNum.stream().mapToInt(v -> v.getInt("yearAddNum")).sum();
|
||||
long yearEditNum = clubUserNum.stream().mapToInt(v -> v.getInt("yearEditNum")).sum();
|
||||
long thisYearNum = clubUserNum.stream().mapToInt(v -> v.getInt("thisYearNum")).sum();
|
||||
userNumMap.setv("userState", "合计");
|
||||
userNumMap.setv("yearFirstNum", yearFirstNum);
|
||||
userNumMap.setv("yearAddNum", yearAddNum);
|
||||
userNumMap.setv("yearEditNum", yearEditNum);
|
||||
userNumMap.setv("thisYearNum", thisYearNum);
|
||||
clubUserNum.add(userNumMap);
|
||||
|
||||
nutMap.setv("activityQk", register.getActivityQk());
|
||||
//TODO 后面要加
|
||||
//nutMap.setv("schoolName", Globals.MyConfig.getString("AppName"));
|
||||
nutMap.setv("clubName", register.getClubName());
|
||||
nutMap.setv("create_time", register.getFoundTime());
|
||||
nutMap.setv("dues_standard", register.getDue());
|
||||
nutMap.setv("year", register.getRegisterDate().substring(0, 4));
|
||||
nutMap.setv("registerDate", register.getRegisterDate());
|
||||
nutMap.setv("incomeCensus", incomeCensus);
|
||||
nutMap.setv("jgUser", jgUser);
|
||||
nutMap.setv("clubUserNum", clubUserNum);
|
||||
nutMap.setv("mszAudit", mszAudit.getAuditOpinion());
|
||||
nutMap.setv("mszAuditTime", DateUtil.format(mszAudit.getAuditTime(), "yyyy-MM-dd"));
|
||||
nutMap.setv("hzAudit", hzAudit.getAuditOpinion());
|
||||
nutMap.setv("hzAuditTime", DateUtil.format(hzAudit.getAuditTime(), "yyyy-MM-dd"));
|
||||
nutMap.setv("xghAudit", xghAudit.getAuditOpinion());
|
||||
nutMap.setv("xghAuditTime", DateUtil.format(xghAudit.getAuditTime(), "yyyy-MM-dd"));
|
||||
|
||||
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
|
||||
HtmlRenderPolicy activityQk = new HtmlRenderPolicy();
|
||||
Configure config = Configure.builder().bind("jgUser", policy)
|
||||
.bind("incomeCensus", policy)
|
||||
.bind("clubUserNum", policy)
|
||||
.bind("activityQk", activityQk).build();
|
||||
|
||||
try {
|
||||
String fileName = Globals.MyConfig.getString("AppName") + "教职工社团年度考核登记表";
|
||||
response.addHeader("Content-Type", "application/octet-stream");
|
||||
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\".docx");
|
||||
XWPFTemplate.compile(officeTemplateUtil.getPath("club_examine_register"), config).render(map).writeAndClose(response.getOutputStream());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package com.budwk.app.zhgh.club.controller.examine;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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.bpm.param.BpmTaskApprovalParam;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubExamineService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubExaminePageVo;
|
||||
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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/examine/schoolAudit")
|
||||
public class ClubExamineSchoolAuditController {
|
||||
|
||||
@Inject
|
||||
private SysClubExamineService sysClubExamineService;
|
||||
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/examine/schoolAudit/index.html")
|
||||
@SaCheckPermission("club.examine.schoolAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.examine.schoolAudit")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination<ClubExaminePageVo> pagination = sysClubExamineService.schoolAuditPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.examine.schoolAudit")
|
||||
@SLog(type = "clubExamine", tag = "校工会审核年度考核", msg = "校工会审核年度考核", param = true)
|
||||
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) {
|
||||
approvalParam.getBpmTaskApprovalTypeEnum();
|
||||
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, null);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.examine.schoolAudit")
|
||||
@SLog(type = "clubExamine", tag = "校工会撤回年度考核", msg = "校工会撤回年度考核", param = true)
|
||||
public Result revoke(@Valid String taskId) {
|
||||
bpmService.revokeTask(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+411
@@ -0,0 +1,411 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
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.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.EasyExcelUtil;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubUserService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubCommonPageVo;
|
||||
import com.budwk.app.zhgh.club.vo.ClubUserImportVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
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.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 javax.validation.Valid;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/infoManage/manage")
|
||||
public class ClubInfoManageController {
|
||||
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
|
||||
@Inject
|
||||
private SysClubUserService sysClubUserService;
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/infoManage/manage/index.html")
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination<ClubCommonPageVo> clubCommonPageVoPagination = clubInfoManageService.infoManagePageData(pageForm);
|
||||
return Result.success(clubCommonPageVoPagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
public Result userPageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination pagination = clubInfoManageService.infoManageUserPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
public Result getClubTreeData() {
|
||||
List<NutMap> clubTreeData = clubInfoManageService.getClubTreeData();
|
||||
return Result.success(clubTreeData);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(type = "infoManage", tag = "修改协会信息", msg = "修改协会信息", param = true)
|
||||
public Result doSubmit(@Param("club") SysClub club) {
|
||||
clubInfoManageService.dao().update(club);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(type = "infoManage", tag = "修改缴费状态", msg = "修改缴费状态", param = true)
|
||||
public Result updatePayed(@Valid Boolean payed, @Valid String id) {
|
||||
clubInfoManageService.dao().update(SysClubUser.class, Chain.make("payed", payed), Cnd.where("id", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(type = "infoManage", tag = "修改拨付状态", msg = "修改拨付状态", param = true)
|
||||
public Result updateGive(@Valid Boolean giveMoney, @Valid String id) {
|
||||
clubInfoManageService.dao().update(SysClubUser.class, Chain.make("giveMoney", giveMoney), Cnd.where("id", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(type = "infoManage", tag = "撤回变更身份", msg = "撤回变更身份", param = true)
|
||||
public Result rollbackChange(@Valid String id) {
|
||||
dao.update(SysClubUser.class, Chain.make("state", null).add("changeRoleCode", null)
|
||||
.add("roleCodeChangeTime", null), Cnd.where("id", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(type = "infoManage", tag = "退会", msg = "退会", param = true)
|
||||
public Result exitClub(@Valid String id) {
|
||||
SysClubUser clubUser = dao.fetch(SysClubUser.class, id);
|
||||
Sys_role sysRole = sysRoleService.getByCode(clubUser.getRoleCode());
|
||||
dao.update(SysClubUser.class, Chain.make("isNormal", false).add("changeTime", DateUtil.now())
|
||||
, Cnd.where("id", "=", id));
|
||||
dao.clear(Sys_user_role.class, Cnd.where("userId", "=", clubUser.getUserId())
|
||||
.and("roleId", "=", sysRole.getId())
|
||||
.and("clubId", "=", clubUser.getClubId()));
|
||||
sysUserService.clearCache();
|
||||
sysRoleService.clearCache();
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(type = "infoManage", tag = "删除协会成员", msg = "删除协会成员", param = true)
|
||||
public Result userDelete(@Valid String id) {
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, id);
|
||||
dao.delete(ClubUser.class,id);
|
||||
// sysClubUserService.clear(Cnd.where("id", "=", id));
|
||||
Sys_role sysRole = sysRoleService.getByCode(clubUser.getRoleCode());
|
||||
if(ObjectUtil.isNotEmpty(sysRole)){
|
||||
dao.clear(Sys_user_role.class, Cnd.NEW().and("userId", "=", clubUser.getUserId())
|
||||
.and("roleId", "=", sysRole.getId())
|
||||
.and("clubId", "=", clubUser.getClubId()));
|
||||
}
|
||||
sysUserService.clearCache();
|
||||
sysRoleService.clearCache();
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(type = "infoManage", tag = "修改身份", msg = "修改身份", param = true)
|
||||
public Result updateRoleCode(@Valid String id, @Valid String roleCode, @Valid String clubId) {
|
||||
//查询社团是否存在会长或者秘书长
|
||||
if (List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name()).contains(roleCode)) {
|
||||
int count = clubInfoManageService.dao().count(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||
.and("roleCode", "=", roleCode));
|
||||
if (count > 0) {
|
||||
return Result.error((Objects.equals(roleCode, RoleConstant.CLUB_PRESIDENT.name()) ? "会长" : "秘书长") + "只能有一位");
|
||||
}
|
||||
}
|
||||
ClubUser clubUser = clubInfoManageService.dao().fetch(ClubUser.class, id);
|
||||
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(
|
||||
RoleConstant.CLUB_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_VICE_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_SECRETARY.name(),
|
||||
RoleConstant.CLUB_VICE_SECRETARY.name()
|
||||
));
|
||||
|
||||
//如果变更为会员,则直接变更
|
||||
if (Objects.equals(roleCode, RoleConstant.CLUB_MEMBER.name())) {
|
||||
sysClubUserService.dao().update(ClubUser.class,Chain.make("roleCode", roleCode), Cnd.where("id", "=", id));
|
||||
//变更为会员则需要清除社团负责人角色
|
||||
dao.clear(Sys_user_role.class, Cnd.where("clubId", "=", clubId).and("userId", "=", clubUser.getUserId())
|
||||
.and("roleId", "in", roleList));
|
||||
} else {
|
||||
//先清除原始身份的角色
|
||||
dao.clear(Sys_user_role.class, Cnd.where("clubId", "=", clubId).and("userId", "=", clubUser.getUserId())
|
||||
.and("roleId", "in", roleList));
|
||||
//插入新的身份角色
|
||||
Sys_user_role sysUserRole = new Sys_user_role();
|
||||
sysUserRole.setUserId(clubUser.getUserId());
|
||||
Sys_role sysRole = sysRoleService.getByCode(roleCode);
|
||||
sysUserRole.setRoleId(sysRole.getId());
|
||||
sysUserRole.setClubId(clubId);
|
||||
dao.insert(sysUserRole);
|
||||
|
||||
clubUser.setRoleCode(roleCode);
|
||||
dao.update(clubUser);
|
||||
/* //变更社团负责人,如果是管理员直接变更完成
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_CLUB_MANAGER.name())) {
|
||||
//先清除原始身份的角色
|
||||
dao.clear(Sys_user_role.class, Cnd.where("clubId", "=", clubId).and("userId", "=", clubUser.getUserId())
|
||||
.and("roleId", "in", roleList));
|
||||
//插入新的身份角色
|
||||
Sys_user_role sysUserRole = new Sys_user_role();
|
||||
sysUserRole.setUserId(clubUser.getUserId());
|
||||
Sys_role sysRole = sysRoleService.getByCode(roleCode);
|
||||
sysUserRole.setRoleId(sysRole.getId());
|
||||
sysUserRole.setClubId(clubId);
|
||||
dao.insert(sysUserRole);
|
||||
|
||||
clubUser.setRoleCode(roleCode);
|
||||
dao.update(clubUser);
|
||||
} else {
|
||||
//社团负责人变更的,则需要校工会审核
|
||||
sysClubUserService.update(Chain.make("changeRoleCode", roleCode).add("state", 1).add("roleCodeChangeTime", DateUtil.now())
|
||||
, Cnd.where("id", "=", id));
|
||||
}*/
|
||||
}
|
||||
sysUserService.clearCache();
|
||||
sysRoleService.clearCache();
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
public Result getUserByKeyWord(@Valid String keyWord, @Valid String clubId, @Valid Boolean addMember) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.id,
|
||||
t1.username AS userName,
|
||||
t1.loginName AS loginName,
|
||||
t2.NAME AS unitName,
|
||||
t1.mobile,
|
||||
t1.email
|
||||
FROM
|
||||
`sys_user` t1
|
||||
LEFT JOIN sys_unit t2 ON t2.id = t1.unitId
|
||||
$condition
|
||||
limit 0, 50
|
||||
""");
|
||||
sql.setParam("keyWord", "%" + keyWord + "%");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("t1.username", keyWord).orLike("t1.loginname", keyWord);
|
||||
cnd.and(group);
|
||||
if (addMember != null && !addMember) {
|
||||
cnd.and(new Static("t1.id in (SELECT userId from club_user WHERE clubId = '%s' and roleCode = '%s')".formatted(clubId, RoleConstant.CLUB_MEMBER.name())));
|
||||
} else {
|
||||
cnd.and(new Static("t1.id not in (SELECT userId from club_user WHERE clubId = '%s')".formatted(clubId)));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(sysUserService.listMap(sql));
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(type = "infoManage", tag = "添加协会成员", msg = "添加协会成员", param = true)
|
||||
public Result userDoAdd(@Valid String clubId, @Valid String[] users, @Valid String roleCode, @Valid Boolean payed) {
|
||||
|
||||
//查询社团是否存在会长或者秘书长
|
||||
if (List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name()).contains(roleCode)) {
|
||||
int count = clubInfoManageService.dao().count(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||
.and("roleCode", "=", roleCode));
|
||||
if (count > 0) {
|
||||
return Result.error((Objects.equals(roleCode, RoleConstant.CLUB_PRESIDENT.name()) ? "会长" : "秘书长") + "只能有一位");
|
||||
}
|
||||
}
|
||||
int status = 0;
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name()) || Objects.equals(RoleConstant.CLUB_MEMBER.name(), roleCode)) {
|
||||
status = 5;
|
||||
} else {
|
||||
status = 3;
|
||||
}
|
||||
Sys_role sysRole = sysRoleService.getByCode(roleCode);
|
||||
for (String user : users) {
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name()) || !Objects.equals(RoleConstant.CLUB_MEMBER.name(), roleCode)) {
|
||||
Sys_user_role sys_user_role = new Sys_user_role();
|
||||
sys_user_role.setUserId(user);
|
||||
sys_user_role.setRoleId(sysRole.getId());
|
||||
sys_user_role.setClubId(clubId);
|
||||
dao.insert(sys_user_role);
|
||||
sysUserService.clearCache();
|
||||
sysRoleService.clearCache();
|
||||
}
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||
.and("userId", "=", user).and("roleCode", "=", RoleConstant.CLUB_MEMBER.name()));
|
||||
ClubUser cUser = new ClubUser();
|
||||
if (clubUser != null) {
|
||||
cUser = clubUser;
|
||||
}
|
||||
cUser.setClubId(clubId);
|
||||
cUser.setUserId(user);
|
||||
cUser.setRoleCode(roleCode);
|
||||
sysClubUserService.insertOrUpdate(cUser);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@ApiOperation("导出登记表")
|
||||
public void exportRegistrationDoc(@Valid String clubId, HttpServletResponse response){
|
||||
clubInfoManageService.exportRegistrationDoc(clubId,response);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
public void downloadUserImport(HttpServletResponse response) {
|
||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();){
|
||||
EasyExcel.write(byteArrayOutputStream, ClubUserImportVo.class)
|
||||
.sheet("协会会员导入模版")
|
||||
.doWrite(ArrayList::new);
|
||||
CommonDownloadUtil.download("协会会员导入模版.xlsx",byteArrayOutputStream.toByteArray() ,response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Result doImportUser(TempFile file, @Valid String businessId, @Valid Boolean isFlag) {
|
||||
List<T> ts = EasyExcelUtil.syncReadModel(file.getFile(), ClubUserImportVo.class, 0, 1);
|
||||
List<ClubUserImportVo> mdList = JSONUtil.parseArray(JSONUtil.toJsonStr(ts)).toList(ClubUserImportVo.class);
|
||||
List<String> loginNames = mdList.stream().map(ClubUserImportVo::getLoginname).collect(Collectors.toList());
|
||||
List<View_user> sysUsers = sysClubUserService.dao().query(View_user.class, Cnd.where("loginname", "in", loginNames));
|
||||
List<ClubUser> clubUsers = sysClubUserService.dao().query(ClubUser.class,Cnd.where("clubId", "=", businessId));
|
||||
|
||||
|
||||
List<ClubUser> clubUserList = new ArrayList<>();
|
||||
|
||||
if (isFlag) {
|
||||
sysClubUserService.clear(Cnd.where("clubId", "=", businessId));
|
||||
}
|
||||
//返回错误记录
|
||||
List<ClubUserImportVo> errorInfos = new ArrayList<>();
|
||||
for (ClubUserImportVo v : mdList) {
|
||||
View_user user = sysUsers.stream().filter(s -> s.getLoginname().equals(v.getLoginname())).findFirst().orElse(null);
|
||||
if (Lang.isEmpty(user)){
|
||||
v.setErrorInfo("数据库暂无此人请检查工号");
|
||||
errorInfos.add(v);
|
||||
continue;
|
||||
}
|
||||
if (clubUsers.stream().anyMatch(s -> s.getUserId().equals(user.getId()))) {
|
||||
v.setErrorInfo("该用户已加入该协会");
|
||||
errorInfos.add(v);
|
||||
continue;
|
||||
}
|
||||
ClubUser cUser = new ClubUser();
|
||||
cUser.setClubPosition(v.getClubPosition());
|
||||
cUser.setUserId(user.getId());
|
||||
cUser.setClubId(businessId);
|
||||
cUser.setRoleCode(RoleConstant.CLUB_MEMBER.name());
|
||||
clubUserList.add(cUser);
|
||||
}
|
||||
sysClubUserService.insert(clubUserList);
|
||||
|
||||
List<Sys_user_role> sysUserRoleList = new ArrayList<>();
|
||||
clubUserList.forEach(cUser -> {
|
||||
Sys_user_role role = new Sys_user_role();
|
||||
role.setUserId(cUser.getUserId());
|
||||
role.setRoleId(sysRoleService.getByCode(RoleConstant.CLUB_MEMBER.name()).getId());
|
||||
role.setClubId(cUser.getClubId());
|
||||
sysUserRoleList.add(role);
|
||||
});
|
||||
sysClubUserService.insert(sysUserRoleList);
|
||||
|
||||
//如果有错误数据就返回给前端
|
||||
if (Lang.isNotEmpty(errorInfos)) {
|
||||
NutMap nutMap = NutMap.NEW();
|
||||
nutMap.setv("totalCount", mdList.size());
|
||||
nutMap.setv("successCount", Math.max(mdList.size() - errorInfos.size(), 0));
|
||||
nutMap.setv("errorCount", errorInfos.size());
|
||||
nutMap.setv("errorList", errorInfos.stream().map(v -> {
|
||||
return NutMap.NEW().addv("工号", v.getLoginname()).addv("姓名", v.getUsername()).addv("错误原因", v.getErrorInfo());
|
||||
}).collect(Collectors.toList()));
|
||||
return Result.success(nutMap);
|
||||
}
|
||||
return Result.success("导入成功");
|
||||
}
|
||||
|
||||
}
|
||||
+132
@@ -0,0 +1,132 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
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.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUserBackHistory;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubUserService;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 11:19
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/infoManage/clubManagePersonAudit")
|
||||
public class ClubManagePersonAuditController {
|
||||
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private SysClubUserService sysClubUserService;
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/infoManage/clubManagePersonAudit/index.html")
|
||||
@SaCheckPermission("club.infoManage.clubManagePersonAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.clubManagePersonAudit")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination pagination = clubInfoManageService.clubManagePersonAuditPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.clubManagePersonAudit")
|
||||
public Result getAllClub() {
|
||||
//List<SysClub> list = sysClubService.query(Cnd.where("state", "=", ClubRegistAuditState.SCHOOL_PASS).asc("clubCode"));
|
||||
List<SysClub> list = sysClubService.query(Cnd.NEW().asc("clubCode"));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.clubManagePersonAudit")
|
||||
@SLog(type = "clubManagePersonAudit", tag = "校工会审核理事机构", msg = "校工会审核理事机构")
|
||||
public Result doAudit(@Valid String[] ids, @Valid Boolean isPass) {
|
||||
List<SysClubUser> clubUsers = sysClubUserService.query(Cnd.where("id", "in", ids));
|
||||
List<SysClubUserBackHistory> list = new ArrayList<>();
|
||||
clubUsers.forEach(item -> {
|
||||
if (item.getStatus() == 5) {
|
||||
item.setState(isPass ? 3 : 2);
|
||||
if (isPass) {
|
||||
item.setRoleCode(item.getChangeRoleCode());
|
||||
}
|
||||
item.setChangeRoleCode(null);
|
||||
item.setRoleCodeChangeTime(null);
|
||||
} else {
|
||||
item.setStatus(isPass ? 5 : 4);
|
||||
}
|
||||
if (isPass) {
|
||||
|
||||
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(
|
||||
RoleConstant.CLUB_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_VICE_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_SECRETARY.name(),
|
||||
RoleConstant.CLUB_VICE_SECRETARY.name()
|
||||
));
|
||||
|
||||
sysClubService.dao().clear(Sys_user_role.class, Cnd.where("clubId", "=", item.getClubId()).and("userId", "=", item.getUserId())
|
||||
.and("roleId", "in", roleList));
|
||||
Sys_user_role sys_user_role = new Sys_user_role();
|
||||
sys_user_role.setUserId(item.getUserId());
|
||||
Sys_role sysRole = sysRoleService.getByCode(item.getRoleCode());
|
||||
sys_user_role.setRoleId(sysRole.getId());
|
||||
sys_user_role.setClubId(item.getClubId());
|
||||
sysClubService.dao().insert(sys_user_role);
|
||||
|
||||
SysClubUserBackHistory backHistory = new SysClubUserBackHistory();
|
||||
backHistory.setUserId(item.getUserId());
|
||||
backHistory.setClubId(item.getClubId());
|
||||
backHistory.setBTime(cn.hutool.core.date.DateUtil.now());
|
||||
backHistory.setRoleCode(item.getRoleCode());
|
||||
list.add(backHistory);
|
||||
}
|
||||
});
|
||||
sysClubService.dao().update(clubUsers);
|
||||
sysClubService.dao().insert(list);
|
||||
sysUserService.clearCache();
|
||||
sysRoleService.clearCache();
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 10:58
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/infoManage/refreshReport")
|
||||
public class ClubRefreshReportController {
|
||||
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/infoManage/refreshReport/index.html")
|
||||
@SaCheckPermission("club.infoManage.refreshReport")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.refreshReport")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination pagination = clubInfoManageService.reportPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.refreshReport")
|
||||
@SLog(type = "refreshReport", tag = "提交换届报告", msg = "提交换届报告")
|
||||
public Object refreshDo(SysClub club) {
|
||||
|
||||
sysClubService.update(Chain.make("replaceReport", club.getReplaceReport()).add("reportState", 1), Cnd.where("id", "=", club.getId()));
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 9:18
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/infoManage/ruleUpdate")
|
||||
public class ClubRuleUpdateController {
|
||||
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/infoManage/ruleUpdate/index.html")
|
||||
@SaCheckPermission("club.infoManage.ruleUpdate")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.ruleUpdate")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination pagination = clubInfoManageService.reportPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.ruleUpdate")
|
||||
@SLog(type = "ruleUpdate", tag = "提交章程备案", msg = "提交章程备案")
|
||||
public Object ruleDo(SysClub club) {
|
||||
|
||||
sysClubService.update(Chain.make("afterRulesFile", club.getAfterRulesFile())
|
||||
.add("ruleState", 1), Cnd.where("id", "=", club.getId()));
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubFiles;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 11:07
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/infoManage/schoolAuditReport")
|
||||
public class ClubSchoolAuditReportController {
|
||||
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/infoManage/schoolAuditReport/index.html")
|
||||
@SaCheckPermission("club.infoManage.schoolAuditReport")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.schoolAuditReport")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination pagination = clubInfoManageService.schoolAuditReportPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.schoolAuditReport")
|
||||
@SLog(type = "schoolAuditRule", tag = "校工会审核换届报告", msg = "校工会审核换届报告")
|
||||
public Object auditDo(@Valid String id, @Valid Boolean pass) {
|
||||
|
||||
SysClub sysClub = sysClubService.fetch(id);
|
||||
if (pass) {
|
||||
sysClubService.update(Chain.make("replaceReport", sysClub.getReplaceReport())
|
||||
.add("reportState", 3), Cnd.where("id", "=", id));
|
||||
//文件留痕
|
||||
SysClubFiles clubFiles = new SysClubFiles();
|
||||
clubFiles.setUserId(SecurityUtil.getUserId());
|
||||
clubFiles.setUserName(SecurityUtil.getUserUsername());
|
||||
clubFiles.setClubId(sysClub.getId());
|
||||
clubFiles.setBTime(cn.hutool.core.date.DateUtil.now());
|
||||
clubFiles.setFileType(2);
|
||||
clubFiles.setFiles(sysClub.getReplaceReport());
|
||||
sysClubService.dao().insert(clubFiles);
|
||||
} else {
|
||||
sysClubService.update(Chain.make("reportState", 2), Cnd.where("id", "=", id));
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubFiles;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 10:41
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/infoManage/schoolAuditRule")
|
||||
public class ClubSchoolAuditRuleController {
|
||||
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/infoManage/schoolAuditRule/index.html")
|
||||
@SaCheckPermission("club.infoManage.schoolAuditRule")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.schoolAuditRule")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination pagination = clubInfoManageService.schoolAuditRulePageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.schoolAuditRule")
|
||||
@SLog(type = "schoolAuditRule", tag = "校工会审核章程备案", msg = "校工会审核章程备案")
|
||||
public Object auditDo(@Valid String id, @Valid Boolean pass) {
|
||||
|
||||
SysClub sysClub = sysClubService.fetch(id);
|
||||
if (pass) {
|
||||
sysClubService.update(Chain.make("rulesFile", sysClub.getAfterRulesFile())
|
||||
.add("ruleState", 3), Cnd.where("id", "=", id));
|
||||
//文件留痕
|
||||
SysClubFiles clubFiles = new SysClubFiles();
|
||||
clubFiles.setUserId(SecurityUtil.getUserId());
|
||||
clubFiles.setUserName(SecurityUtil.getUserUsername());
|
||||
clubFiles.setClubId(sysClub.getId());
|
||||
clubFiles.setBTime(cn.hutool.core.date.DateUtil.now());
|
||||
clubFiles.setFileType(1);
|
||||
clubFiles.setFiles(sysClub.getAfterRulesFile());
|
||||
sysClubService.dao().insert(clubFiles);
|
||||
} else {
|
||||
sysClubService.update(Chain.make("ruleState", 2), Cnd.where("id", "=", id));
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.budwk.app.zhgh.club.controller.register;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
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.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/6 10:02
|
||||
* @Version: v1.0.0
|
||||
* @Description: 协会确认
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/register/clubConfirm")
|
||||
public class ClubConfirmController {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/register/clubConfirm/index.html")
|
||||
@SaCheckPermission("club.register.clubConfirm")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.register.clubConfirm")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination pagination = sysClubService.clubConfirmPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.clubConfirm")
|
||||
@SLog(type = "clubConfirm", tag = "协会确认", msg = "协会确认", param = true)
|
||||
public Result doAudit() {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.clubConfirm")
|
||||
@SLog(type = "clubConfirm", tag = "协会确认撤回", msg = "协会确认撤回", param = true)
|
||||
public Result withdraw(@Valid Long processTaskId) {
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.budwk.app.zhgh.club.controller.register;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.ClubUserApply;
|
||||
import com.budwk.app.zhgh.club.model.SysClubSponsor;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubRegisterPageVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/6 9:57
|
||||
* @Version: v1.0.0
|
||||
* @Description: 我的注册
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/register/clubMyApply")
|
||||
public class ClubMyApplyController {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/register/mine/index.html")
|
||||
@SaCheckPermission("club.register.myApply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.register.myApply")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination<ClubRegisterPageVo> pagination = sysClubService.minePageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.myApply")
|
||||
public Result doDelete(@Valid String id) {
|
||||
sysClubService.delete(id);
|
||||
sysClubService.dao().clear(SysClubSponsor.class, Cnd.where("clubId", "=", id));
|
||||
// sysClubService.dao().clear(SysClubUser.class, Cnd.where("clubId", "=", id));
|
||||
sysClubService.dao().clear(ClubUser.class, Cnd.where("clubId", "=", id));
|
||||
sysClubService.dao().clear(ClubUserApply.class, Cnd.where("clubId", "=", id));
|
||||
sysClubService.dao().clear(Sys_user_role.class, Cnd.where("clubId", "=", id));
|
||||
|
||||
bpmService.deleteInstance(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.register.myApply")
|
||||
@ApiOperation("撤回")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "协会注册", msg = "撤回申请")
|
||||
public Result revokeApply(@Valid String id) {
|
||||
bpmService.revokeApply(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
package com.budwk.app.zhgh.club.controller.register;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.BpmProcessConstant;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubRegisterVo;
|
||||
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 javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/6 9:56
|
||||
* @Version: v1.0.0
|
||||
* @Description: 注册社团
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/register/clubRegisterApply")
|
||||
public class ClubRegistApplyController {
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/register/apply/index.html")
|
||||
@SaCheckPermission("club.register.apply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.apply")
|
||||
@SLog(type = "registerApply", tag = "保存注册协会", msg = "保存注册协会")
|
||||
public Result doSave(@Param("club") SysClub club,
|
||||
@Param("::deleteIds") List<String> deleteIds,
|
||||
@Param("::managePerson") List<NutMap> managePerson) {
|
||||
SysClub sysClub;
|
||||
if (StrUtil.isBlank(club.getId())) {
|
||||
sysClub = sysClubService.doAdd(club, managePerson);
|
||||
} else {
|
||||
sysClub = sysClubService.doEdit(club, deleteIds, managePerson);
|
||||
}
|
||||
bpmService.startSaveProcessInstance(BpmProcessConstant.CLUB_REGISTER.name(), sysClub.getClubName() + "的注册申请", sysClub.getId(), null);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.apply")
|
||||
@SLog(type = "registerApply", tag = "提交注册协会", msg = "提交注册协会")
|
||||
public Result doSubmit(@Param("club") SysClub club,
|
||||
@Param("::deleteIds") List<String> deleteIds,
|
||||
@Param("::managePerson") List<NutMap> managePerson) {
|
||||
SysClub sysClub;
|
||||
if (StrUtil.isBlank(club.getId())) {
|
||||
sysClub = sysClubService.doAdd(club, managePerson);
|
||||
} else {
|
||||
sysClub = sysClubService.doEdit(club, deleteIds, managePerson);
|
||||
}
|
||||
|
||||
//校工会协会管理员
|
||||
String loginName = commonService.findUserLoginNameByRoleCode(RoleConstant.SCHOOL_UNION_CLUB_ADMIN);
|
||||
if (StrUtil.isBlank(loginName)) {
|
||||
return Result.error("未查询到相关审批人,请联系校工会!");
|
||||
}
|
||||
bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_REGISTER.name(), sysClub.getClubName() + "的注册申请", sysClub.getId(), List.of(loginName), null);
|
||||
return Result.success(sysClub);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.register.apply")
|
||||
public Result getUserByKeyWord(@Valid String keyWord) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.id,
|
||||
t1.username AS userName,
|
||||
t1.loginName AS loginName,
|
||||
t2.NAME AS unitName,
|
||||
t1.mobile,
|
||||
t1.email
|
||||
FROM
|
||||
`sys_user` t1
|
||||
LEFT JOIN sys_unit t2 ON t2.id = t1.unitId
|
||||
WHERE
|
||||
(t1.loginname like @keyWord or username like @keyWord)
|
||||
limit 0, 50
|
||||
""");
|
||||
sql.setParam("keyWord", "%" + keyWord + "%");
|
||||
return Result.success(sysUserService.listMap(sql));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result queryUserByIds(@Valid String[] ids) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.id,
|
||||
t1.username AS userName,
|
||||
t1.loginName AS loginName,
|
||||
t2.NAME AS unitName,
|
||||
t1.mobile,
|
||||
t1.email
|
||||
FROM
|
||||
`sys_user` t1
|
||||
LEFT JOIN sys_unit t2 ON t2.id = t1.unitId
|
||||
$condition
|
||||
limit 0, 50
|
||||
""");
|
||||
cnd.and("t1.id", "in", ids);
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(sysUserService.listMap(sql));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result info(@Valid String id) {
|
||||
ClubRegisterVo clubRegisterVo = sysClubService.findOne(id);
|
||||
return Result.success(clubRegisterVo);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result createCode() {
|
||||
int count = sysClubService.count(Cnd.where("createTime", "=", DateUtil.thisYear()));
|
||||
String s = String.format("%02d", count + 1);
|
||||
return Result.success().addData(Convert.toStr(DateUtil.thisYear()) + s);
|
||||
}
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.budwk.app.zhgh.club.controller.register;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubExamineVo;
|
||||
import com.budwk.app.zhgh.club.vo.ClubRegisterVo;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/register/common")
|
||||
public class ClubRegisterCommonController {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.register")
|
||||
public Result findOne(@Valid String id) {
|
||||
ClubRegisterVo clubRegisterVo = sysClubService.findOne(id);
|
||||
return Result.success(clubRegisterVo);
|
||||
}
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
package com.budwk.app.zhgh.club.controller.register;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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.bpm.enums.BpmTaskApprovalTypeEnum;
|
||||
import com.budwk.app.bpm.param.BpmTaskApprovalParam;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubRegisterPageVo;
|
||||
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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/6 9:59
|
||||
* @Version: v1.0.0
|
||||
* @Description: 分管副主席审核
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/register/schoolLeaderAudit")
|
||||
public class ClubSchoolLeaderAuditController {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/register/schoolLeaderAudit/index.html")
|
||||
@SaCheckPermission("club.register.schoolLeaderAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.register.schoolLeaderAudit")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination<ClubRegisterPageVo> pagination = sysClubService.schoolLeaderAuditPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.schoolLeaderAudit")
|
||||
@SLog(type = "schoolLeaderAudit", tag = "分管领导审核注册协会", msg = "分管领导审核注册协会", param = true)
|
||||
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) {
|
||||
approvalParam.getBpmTaskApprovalTypeEnum();
|
||||
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
|
||||
List<String> assignments = new ArrayList<>();
|
||||
if(approvalParam.getBpmTaskApprovalTypeEnum().equals(BpmTaskApprovalTypeEnum.PASS)){
|
||||
List<Sys_user> schoolClubManageUser = commonService.findUserInfoByRoleCode(RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name());
|
||||
assignments.addAll(schoolClubManageUser.stream().map(Sys_user::getLoginname).toList());
|
||||
}
|
||||
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, assignments);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.schoolLeaderAudit")
|
||||
@SLog(type = "schoolLeaderAudit", tag = "分管领导撤回注册协会", msg = "分管领导撤回注册协会", param = true)
|
||||
public Result revoke(@Valid String taskId) {
|
||||
bpmService.revokeTask(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
package com.budwk.app.zhgh.club.controller.register;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.json.JSON;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
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.bpm.enums.BpmTaskApprovalTypeEnum;
|
||||
import com.budwk.app.bpm.models.BpmProcessInstance;
|
||||
import com.budwk.app.bpm.models.BpmProcessTask;
|
||||
import com.budwk.app.bpm.param.BpmTaskApprovalParam;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubRegisterPageVo;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
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 javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/6 10:00
|
||||
* @Version: v1.0.0
|
||||
* @Description: 校工会批复
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/register/schoolReply")
|
||||
public class ClubSchoolReplyController {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/register/schoolReply/index.html")
|
||||
@SaCheckPermission("club.register.schoolReply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.register.schoolReply")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination<ClubRegisterPageVo> pagination = sysClubService.schoolReplyPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.schoolReply")
|
||||
@SLog(type = "schoolReply", tag = "校领导批复注册协会", msg = "校领导批复注册协会", param = true)
|
||||
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) {
|
||||
|
||||
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, null);
|
||||
|
||||
//如果审核通过,就给角色
|
||||
//找理事机构
|
||||
List<SysClubUser> clubUsers = sysClubService.dao().query(SysClubUser.class, Cnd.where("clubId", "=", approvalParam.getProcessInstanceBusinessId())
|
||||
.and("roleCode", "!=", RoleConstant.CLUB_MEMBER.name())
|
||||
.and("isNormal", "=", true)
|
||||
.and("status", "=", 5));
|
||||
//找会长
|
||||
List<SysClubUser> clubPresidents = clubUsers.stream().filter(o -> o.getRoleCode().equals(RoleConstant.CLUB_PRESIDENT.name())).toList();
|
||||
if(Objects.equals(approvalParam.getBpmTaskApprovalType(), BpmTaskApprovalTypeEnum.PASS.name())) {
|
||||
List<Sys_user_role> userRoles = new ArrayList<>();
|
||||
clubUsers.forEach(cu -> {
|
||||
Sys_user_role uRole = new Sys_user_role();
|
||||
Sys_role sysRole = sysRoleService.getByCode(cu.getRoleCode());
|
||||
uRole.setRoleId(sysRole.getId());
|
||||
uRole.setUserId(cu.getUserId());
|
||||
uRole.setClubId(approvalParam.getProcessInstanceBusinessId());
|
||||
userRoles.add(uRole);
|
||||
});
|
||||
sysClubService.dao().insert(userRoles);
|
||||
sysUserService.clearCache();
|
||||
sysRoleService.clearCache();
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.schoolReply")
|
||||
@SLog(type = "schoolReply", tag = "校领导撤回注册协会", msg = "校领导撤回注册协会", param = true)
|
||||
public Result revoke(@Valid String taskId) {
|
||||
//撤回需要删除相关角色
|
||||
BpmProcessTask processTask = sysClubService.dao().fetch(BpmProcessTask.class, taskId);
|
||||
BpmProcessInstance instance = sysClubService.dao().fetch(BpmProcessInstance.class, processTask.getProcessInstanceId());
|
||||
String clubId = instance.getProcessInstanceBusinessId();
|
||||
|
||||
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(
|
||||
RoleConstant.CLUB_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_VICE_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_SECRETARY.name(),
|
||||
RoleConstant.CLUB_VICE_SECRETARY.name()
|
||||
));
|
||||
sysClubService.dao().clear(Sys_user_role.class, Cnd.where("clubId", "=", clubId)
|
||||
.and("roleId", "in", roleList));
|
||||
|
||||
bpmService.revokeTask(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+363
@@ -0,0 +1,363 @@
|
||||
package com.budwk.app.zhgh.club.controller.statistics;
|
||||
|
||||
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.URLUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.bpm.enums.BpmProcessInstanceStatusEnum;
|
||||
import com.budwk.app.bpm.models.BpmProcessInstance;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubEvaluate;
|
||||
import com.budwk.app.zhgh.club.model.SysClubExamineRegister;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.http.Http;
|
||||
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.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/statistics")
|
||||
public class ClubStatisticsController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ClubStatisticsController.class);
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/statistics/index.html")
|
||||
@SaCheckPermission("club.statistics")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.statistics")
|
||||
public Result pageData(@Valid PageForm pageForm, String clubId, Boolean auditState, String userState, String sex, Boolean giveMoney) {
|
||||
Sql sql = generateSql(clubId, auditState, userState, sex, giveMoney);
|
||||
Pagination pagination = sysClubService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.statistics")
|
||||
public Result getClub(Boolean auditState) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (auditState != null) {
|
||||
List<SysClubExamineRegister> examineRegisters = sysClubService.dao().query(SysClubExamineRegister.class, Cnd.where("year(registerDate)", "=", DateUtil.thisYear()));
|
||||
List<String> list = examineRegisters.stream().map(SysClubExamineRegister::getId).toList();
|
||||
|
||||
List<BpmProcessInstance> instanceList = sysClubService.dao().query(BpmProcessInstance.class, Cnd.where("processInstanceStatus", "=", BpmProcessInstanceStatusEnum.COMPLETED).and("processInstanceBusinessId", "in", list));
|
||||
List<String> businessNoList = instanceList.stream().map(BpmProcessInstance::getProcessInstanceBusinessId).toList();
|
||||
|
||||
List<SysClubExamineRegister> registers = examineRegisters.stream().filter(o -> businessNoList.contains(o.getId())).toList();
|
||||
cnd.and("id", auditState ? "in" : "not in", registers.stream().map(SysClubExamineRegister::getClubId).toList());
|
||||
}
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_PRESIDENT);
|
||||
List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId()));
|
||||
List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList();
|
||||
cnd.and("id", "in", myClubId);
|
||||
}
|
||||
List<SysClub> list = sysClubService.query(cnd);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.statistics")
|
||||
public Result userPageData(@Valid PageForm pageForm, String clubId, Boolean auditState, String userState, String sex, Boolean giveMoney) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.username as userName,
|
||||
u.loginname as loginName,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
u.unitname as unitName,
|
||||
u.userState,
|
||||
c.roleCode,
|
||||
r.name AS roleName
|
||||
FROM
|
||||
club_user c
|
||||
LEFT JOIN `vw_user` u ON u.id = c.userId
|
||||
LEFT JOIN sys_role r on r.code = c.roleCode
|
||||
$condition
|
||||
ORDER BY FIELD( c.roleCode, 'CLUB_PRESIDENT', 'CLUB_VICE_PRESIDENT', 'CLUB_SECRETARY', 'CLUB_VICE_SECRETARY', 'CLUB_OPERATOR', 'CLUB_MEMBER' )
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("c.clubId", "=", clubId);
|
||||
cnd.andEX("u.userState", "=", userState);
|
||||
cnd.andEX("u.sex", "=", sex);
|
||||
// cnd.andEX("c.giveMoney", "=", giveMoney);
|
||||
// cnd.andEX("c.isNormal", "=", true);
|
||||
// cnd.andEX("c.status", "=", 5);
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = sysClubService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("club.statistics")
|
||||
public void exportUserData(String clubId,
|
||||
String userState,
|
||||
String sex,
|
||||
Boolean giveMoney,
|
||||
HttpServletResponse response) throws IOException {
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLUtil.encode("人员明细.zip"));
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.username as userName,
|
||||
u.loginname as loginName,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
u.unitname as unitName,
|
||||
u.userstate as userState,
|
||||
r.name AS roleName,
|
||||
c.clubId
|
||||
FROM
|
||||
club_user c
|
||||
LEFT JOIN `vw_user` u ON u.id = c.userId
|
||||
LEFT JOIN sys_role r on r.code = c.roleCode
|
||||
$condition
|
||||
ORDER BY FIELD( c.roleCode, 'CLUB_PRESIDENT', 'CLUB_VICE_PRESIDENT', 'CLUB_SECRETARY', 'CLUB_VICE_SECRETARY', 'CLUB_OPERATOR', 'CLUB_MEMBER' )
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_PRESIDENT);
|
||||
List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId()));
|
||||
List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList();
|
||||
cnd.and("c.clubId", "in", myClubId);
|
||||
}
|
||||
cnd.andEX("c.clubId", "=", clubId);
|
||||
cnd.andEX("u.userState", "=", userState);
|
||||
cnd.andEX("u.sex", "=", sex);
|
||||
// cnd.andEX("c.giveMoney", "=", giveMoney);
|
||||
// cnd.andEX("c.isNormal", "=", true);
|
||||
// cnd.andEX("c.status", "=", 5);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> listMap = sysClubService.listMap(sql);
|
||||
//获取所有社团
|
||||
Cnd stCnd = Cnd.NEW();
|
||||
stCnd.andEX("id", "=", clubId);
|
||||
List<SysClub> clubList = sysClubService.query(stCnd);
|
||||
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
exportEntities.add(new ExcelExportEntity("联系方式", "mobile", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所在单位", "unitName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("在职状态", "userState", 20));
|
||||
// exportEntities.add(new ExcelExportEntity("是否拨付", "giveMoney", 20));
|
||||
// exportEntities.add(new ExcelExportEntity("是否缴费", "payed", 20));
|
||||
exportEntities.add(new ExcelExportEntity("职务", "roleName", 20));
|
||||
ZipOutputStream zipOutputStream = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream()));
|
||||
clubList.forEach(item -> {
|
||||
try {
|
||||
List<NutMap> clubUser = listMap.stream().filter(o -> o.getString("clubId").equals(item.getId())).collect(Collectors.toList());
|
||||
zipOutputStream.putNextEntry(new ZipEntry(item.getClubName() + "人员明细.xls"));
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, clubUser);
|
||||
workbook.write(zipOutputStream);
|
||||
zipOutputStream.closeEntry();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
});
|
||||
zipOutputStream.flush();
|
||||
zipOutputStream.close();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("club.statistics")
|
||||
public void exportData(String clubId,
|
||||
String userState,
|
||||
String sex,
|
||||
Boolean giveMoney,
|
||||
Boolean auditState,
|
||||
HttpServletResponse response) throws IOException {
|
||||
|
||||
Sql sql = generateSql(clubId, auditState, userState, sex, giveMoney);
|
||||
List<NutMap> list = sysClubService.listMap(sql);
|
||||
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("社团名称", "clubName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("编码", "clubCode", 20));
|
||||
exportEntities.add(new ExcelExportEntity("社团总人数", "total", 20));
|
||||
exportEntities.add(new ExcelExportEntity("在职人数", "work", 20));
|
||||
exportEntities.add(new ExcelExportEntity("退休人数", "retire", 20));
|
||||
exportEntities.add(new ExcelExportEntity("男", "man", 20));
|
||||
exportEntities.add(new ExcelExportEntity("女", "woman", 20));
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, list);
|
||||
CommonDownloadUtil.download("协会统计表.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("club.statistics")
|
||||
public void exportFiles(String clubId,
|
||||
HttpServletResponse response) throws IOException {
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLUtil.encode("上传资料数据.zip"));
|
||||
LinkedHashMap<String, List<JSONObject>> fileList = new LinkedHashMap<>();
|
||||
|
||||
//查询社团
|
||||
List<SysClub> clubList = sysClubService.query(Cnd.NEW().andEX("id", "=", clubId));
|
||||
clubList.forEach(item -> {
|
||||
List<JSONObject> file = new ArrayList<>();
|
||||
file.addAll(Optional.ofNullable(item.getFiles()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getEstablishReport()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getRulesFile()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getManageFile()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getYearPlanFile()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getSchoolReplyFile()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getReplaceReport()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getRulesFile()).orElseGet(ArrayList::new));
|
||||
fileList.put(item.getId(), file);
|
||||
});
|
||||
|
||||
//社团年审附件
|
||||
List<SysClubExamineRegister> examineList = sysClubService.dao().query(SysClubExamineRegister.class,
|
||||
Cnd.NEW().andEX("clubId", "=", clubId)
|
||||
.and("year(registerDate)", "=", DateUtil.thisYear()));
|
||||
examineList.forEach(item -> {
|
||||
if (fileList.containsKey(item.getClubId())) {
|
||||
fileList.get(item.getClubId()).addAll(Optional.ofNullable(item.getPlanFiles()).orElseGet(ArrayList::new));
|
||||
fileList.get(item.getClubId()).addAll(Optional.ofNullable(item.getSummaryFiles()).orElseGet(ArrayList::new));
|
||||
fileList.get(item.getClubId()).addAll(Optional.ofNullable(item.getYearActivity()).orElseGet(ArrayList::new));
|
||||
}
|
||||
});
|
||||
|
||||
//社团评优附件
|
||||
List<SysClubEvaluate> evaluateList = sysClubService.dao().query(SysClubEvaluate.class, Cnd.NEW().andEX("clubId", "=", clubId)
|
||||
.and("year(applyTime)", "=", DateUtil.thisYear()));
|
||||
evaluateList.forEach(item -> {
|
||||
if (fileList.containsKey(item.getClubId())) {
|
||||
fileList.get(item.getClubId()).addAll(Optional.ofNullable(item.getFiles()).orElseGet(ArrayList::new));
|
||||
}
|
||||
});
|
||||
|
||||
ZipOutputStream zipOutputStream = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream()));
|
||||
clubList.forEach(item -> {
|
||||
List<JSONObject> sysFiles = fileList.get(item.getId());
|
||||
sysFiles.forEach(f -> {
|
||||
try {
|
||||
System.out.println(1);
|
||||
String fileName = f.getStr("name");
|
||||
|
||||
JSONObject entries = f.getJSONObject("response");
|
||||
String filepath = entries.getStr("data");
|
||||
|
||||
zipOutputStream.putNextEntry(new ZipEntry(item.getClubName() + "/" + System.currentTimeMillis() + fileName));
|
||||
|
||||
InputStream inputStream = Http.get(filepath).getStream();
|
||||
IOUtils.copy(inputStream, zipOutputStream);
|
||||
inputStream.close();
|
||||
zipOutputStream.closeEntry();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
});
|
||||
});
|
||||
zipOutputStream.flush();
|
||||
zipOutputStream.close();
|
||||
}
|
||||
|
||||
private Sql generateSql(String clubId, Boolean auditState, String userState, String sex, Boolean giveMoney) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
club.id,
|
||||
club.clubCode,
|
||||
club.clubName,
|
||||
sum( CASE WHEN cu.userId is not null $myCondition THEN 1 ELSE 0 END ) AS total,
|
||||
sum( CASE WHEN su.userState = '在职' $myCondition THEN 1 ELSE 0 END ) AS `work`,
|
||||
sum( CASE WHEN su.userState in ('退休') $myCondition THEN 1 ELSE 0 END ) AS retire,
|
||||
sum( CASE WHEN su.sex = '男' $myCondition THEN 1 ELSE 0 END ) AS man,
|
||||
sum( CASE WHEN su.sex = '女' $myCondition THEN 1 ELSE 0 END ) AS woman,
|
||||
sum( CASE WHEN cu.roleCode != 'CLUB_MEMBER' AND 1 = 1 $myCondition THEN 1 ELSE 0 END ) AS governing_body
|
||||
FROM
|
||||
sys_club club
|
||||
LEFT JOIN club_user cu ON cu.clubId = club.id
|
||||
LEFT JOIN sys_user su ON cu.userId = su.id
|
||||
LEFT JOIN bpm_process_instance ins ON ins.processInstanceBusinessId = club.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (auditState != null) {
|
||||
List<SysClubExamineRegister> examineRegisters = sysClubService.dao().query(SysClubExamineRegister.class, Cnd.where("year(registerDate)", "=", DateUtil.thisYear()));
|
||||
List<String> list = examineRegisters.stream().map(SysClubExamineRegister::getId).toList();
|
||||
|
||||
List<BpmProcessInstance> instanceList = sysClubService.dao().query(BpmProcessInstance.class, Cnd.where("processInstanceStatus", "=", BpmProcessInstanceStatusEnum.COMPLETED).and("processInstanceBusinessId", "in", list));
|
||||
List<String> businessNoList = instanceList.stream().map(BpmProcessInstance::getProcessInstanceBusinessId).toList();
|
||||
cnd.and("club.id", auditState ? "in" : "not in", businessNoList);
|
||||
}
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_PRESIDENT);
|
||||
List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId()));
|
||||
List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList();
|
||||
cnd.and("club.id", "in", myClubId);
|
||||
}
|
||||
cnd.and("ins.processInstanceStatus", "=", BpmProcessInstanceStatusEnum.COMPLETED);
|
||||
cnd.andEX("club.id", "=", clubId);
|
||||
cnd.and("club.dismiss", "=", false);
|
||||
cnd.groupBy("club.id");
|
||||
cnd.asc("club.clubCode");
|
||||
|
||||
Cnd myCnd = Cnd.NEW();
|
||||
myCnd.where().setTop(false);
|
||||
myCnd.where().andEX("su.userState", "=", userState);
|
||||
myCnd.where().andEX("su.sex", "=", sex);
|
||||
// myCnd.where().andEX("cu.giveMoney", "=", giveMoney);
|
||||
// myCnd.where().andEX("cu.isNormal", "=", true);
|
||||
if (!myCnd.where().isEmpty()) {
|
||||
sql.vars().set("myCondition", "AND " + myCnd.toSql(null));
|
||||
}
|
||||
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.budwk.app.zhgh.club.h5controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/h5/club/apply")
|
||||
@Ok("json:full")
|
||||
@Api("h5申请入会")
|
||||
public class H5ClubApplyController {
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhghh5/club/apply/index.html")
|
||||
@SaCheckPermission("h5.club.apply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.budwk.app.zhgh.club.h5controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/h5/club/audit")
|
||||
@Ok("json:full")
|
||||
@Api("h5入会审核")
|
||||
public class H5ClubAuditController {
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhghh5/club/audit/index.html")
|
||||
@SaCheckPermission("h5.club.audit")
|
||||
public void index() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.budwk.app.zhgh.club.h5controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
/**
|
||||
* @ClassName H5ClubMineController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/7/2 19:19
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/h5/club/mine")
|
||||
@Ok("json:full")
|
||||
@Api("h5申请入会")
|
||||
public class H5ClubMineController {
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhghh5/club/mine/index.html")
|
||||
@SaCheckPermission("h5.club.mine")
|
||||
public void index() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.budwk.app.zhgh.club.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("club_user")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会会员表")
|
||||
public class ClubUser 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 clubId;
|
||||
|
||||
@Column
|
||||
@Comment("用户ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("身份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String roleCode;
|
||||
|
||||
@Column
|
||||
@Comment("协会职务")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String clubPosition;
|
||||
|
||||
@Column
|
||||
@Comment("邮箱")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String email;
|
||||
|
||||
@Column
|
||||
@Comment("头像")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String avatar;
|
||||
|
||||
@Column
|
||||
@Comment("同时参加其他协会情况")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String sameTimeJoinOtherClubSituation;
|
||||
|
||||
@Column
|
||||
@Comment("文化、体育方面的活动经历、获奖情况")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String awardsExperience;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.budwk.app.zhgh.club.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("club_user_apply")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会申请退出申请表")
|
||||
public class ClubUserApply 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 clubId;
|
||||
|
||||
@Column
|
||||
@Comment("用户ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("身份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String roleCode;
|
||||
|
||||
@Column
|
||||
@Comment("加入/退出")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean mode;
|
||||
|
||||
@Column
|
||||
@Comment("协会职务")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String clubPosition;
|
||||
|
||||
@Column
|
||||
@Comment("邮箱")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String email;
|
||||
|
||||
@Column
|
||||
@Comment("联系方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("出生年月")
|
||||
@ColDefine(type = ColType.DATETIME, width = 20)
|
||||
private Date birthday;
|
||||
|
||||
@Column
|
||||
@Comment("头像")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String avatar;
|
||||
|
||||
@Column
|
||||
@Comment("同时参加其他协会情况")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String sameTimeJoinOtherClubSituation;
|
||||
|
||||
@Column
|
||||
@Comment("文化、体育方面的活动经历、获奖情况")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String awardsExperience;
|
||||
|
||||
@Column
|
||||
@Comment("申请时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date applyDate;
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
package com.budwk.app.zhgh.club.model;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import com.budwk.app.sys.models.Sys_file;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/6 10:09
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("sys_club")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会")
|
||||
public class SysClub extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("协会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@NotEmpty(message = "协会名称不能为空")
|
||||
private String clubName;
|
||||
|
||||
@Column
|
||||
@Comment("协会编码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@NotEmpty(message = "协会编码不能为空")
|
||||
private String clubCode;
|
||||
|
||||
@Column
|
||||
@Comment("协会类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@NotEmpty(message = "协会类型不能为空")
|
||||
private String clubType;
|
||||
|
||||
@Column
|
||||
@Comment("联系人id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String concatPerson;
|
||||
|
||||
@Column
|
||||
@Comment("联系人电话")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String concatPersonMobile;
|
||||
|
||||
@Column
|
||||
@Comment("联系人邮箱")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String concatPersonEmail;
|
||||
|
||||
@Column
|
||||
@Comment("协会介绍")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String introduce;
|
||||
|
||||
@Column
|
||||
@Comment("协会宗旨")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String purpose;
|
||||
|
||||
@Column
|
||||
@Comment("申请时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String createTime;
|
||||
|
||||
@Column
|
||||
@Comment("成立时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String foundTime;
|
||||
|
||||
@Column
|
||||
@Comment("是否解散")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private boolean dismiss;
|
||||
|
||||
@Column
|
||||
@Comment("会费标准")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String due;
|
||||
|
||||
@Column
|
||||
@Comment("附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
|
||||
@Column
|
||||
@Comment("申请成立报告")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> establishReport;
|
||||
|
||||
@Column
|
||||
@Comment("章程草案")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> rulesFile;
|
||||
|
||||
@Column
|
||||
@Comment("后面修订的章程")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> afterRulesFile;
|
||||
|
||||
@Column
|
||||
@Comment("经费来源及管理办法")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> manageFile;
|
||||
|
||||
@Column
|
||||
@Comment("年度活动计划")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> yearPlanFile;
|
||||
|
||||
@Column
|
||||
@Comment("校工会批复文件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> schoolReplyFile;
|
||||
|
||||
@Column
|
||||
@Comment("状态")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private Integer state;
|
||||
|
||||
@Column
|
||||
@Comment("申请人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Many(field = "clubId")
|
||||
private List<SysClubSponsor> sponsors;
|
||||
|
||||
@Column
|
||||
@Comment("qq群二维码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String QQGroupCode;
|
||||
|
||||
@Column
|
||||
@Comment("微信群二维码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String wechatGroupCode;
|
||||
|
||||
@Column
|
||||
@Comment("换届报告")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> replaceReport;
|
||||
|
||||
@Column
|
||||
@Comment("修改章程状态(1.待校工会审核 2.校工会审核拒绝 3.审核通过)")
|
||||
@ColDefine(type = ColType.INT, width = 10)
|
||||
private Integer ruleState;
|
||||
|
||||
@Column
|
||||
@Comment("换届报告状态(1.待校工会审核 2.校工会审核拒绝 3.审核通过)")
|
||||
@ColDefine(type = ColType.INT, width = 10)
|
||||
private Integer reportState;
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.budwk.app.zhgh.club.model;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 17:21
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("sys_club_evaluate")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会评优")
|
||||
public class SysClubEvaluate extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("协会id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@NotEmpty(message = "协会id不能为空")
|
||||
private String clubId;
|
||||
|
||||
@Column
|
||||
@Comment("申报人id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(els = @EL("$me.createdByUid()"))
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("申报时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Prev(els = {@EL("$me.nowDate()")})
|
||||
private Date applyTime;
|
||||
|
||||
@Column
|
||||
@Comment("申报开始年份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
@NotEmpty(message = "申报开始年份不能为空")
|
||||
private String applyStartYear;
|
||||
|
||||
@Column
|
||||
@Comment("申报结束年份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
@NotEmpty(message = "申报结束年份不能为空")
|
||||
private String applyEndYear;
|
||||
|
||||
@Column
|
||||
@Comment("两年获得的集体荣誉称号")
|
||||
@ColDefine(customType = "longtext")
|
||||
@NotEmpty(message = "两年获得的集体荣誉称号不能为空")
|
||||
private String evaluateName;
|
||||
|
||||
@Column
|
||||
@Comment("年度组织活动及完成情况")
|
||||
@ColDefine(customType = "longtext")
|
||||
@NotEmpty(message = "年度组织活动及完成情况不能为空")
|
||||
private String yearActivity;
|
||||
|
||||
@Column
|
||||
@Comment("附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
|
||||
public Date nowDate() {
|
||||
return new Date();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.budwk.app.zhgh.club.model;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 15:31
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("sys_club_examine_register")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会年审")
|
||||
public class SysClubExamineRegister extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("申请人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("年度")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private Integer year;
|
||||
|
||||
@Column
|
||||
@Comment("社团id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String clubId;
|
||||
|
||||
@Column
|
||||
@Comment("社团名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String clubName;
|
||||
|
||||
@Column
|
||||
@Comment("成立时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String foundTime;
|
||||
|
||||
@Column
|
||||
@Comment("会费标准")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String due;
|
||||
|
||||
@Column
|
||||
@Comment("年度活动情况")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String activityQk;
|
||||
|
||||
@Column
|
||||
@Comment("登记时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String registerDate;
|
||||
|
||||
@Column
|
||||
@Comment("工作计划")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> planFiles;
|
||||
|
||||
@Column
|
||||
@Comment("工作计划")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> plans;
|
||||
|
||||
@Column
|
||||
@Comment("工作总结")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> summaryFiles;
|
||||
|
||||
@Column
|
||||
@Comment("年度活动情况")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> yearActivity;
|
||||
|
||||
@Column
|
||||
@Comment("年度活动情况")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> yearActivityList;
|
||||
|
||||
@Column
|
||||
@Comment("财务收支情况统计json")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> incomeCensus;
|
||||
|
||||
@Column
|
||||
@Comment("社团成员变化情况json")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> changeUserNum;
|
||||
|
||||
@Many(field = "registerId")
|
||||
private List<SysClubExamineRegisterDetailed> detailedList;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.budwk.app.zhgh.club.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.DB;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("sys_club_examine_register_detailed")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会年审其他信息")
|
||||
public class SysClubExamineRegisterDetailed extends BaseModel {
|
||||
|
||||
@Column
|
||||
@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 registerId;
|
||||
|
||||
@Column
|
||||
@Comment("日期")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String date;
|
||||
|
||||
@Column
|
||||
@Comment("内容")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String content;
|
||||
|
||||
@Column
|
||||
@Comment("收入类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String incomeType;
|
||||
|
||||
@Column
|
||||
@Comment("年初余额")
|
||||
@ColDefine(type = ColType.FLOAT, width = 15, precision = 2)
|
||||
private float qcMoney;
|
||||
|
||||
@Column
|
||||
@Comment("收入")
|
||||
@ColDefine(type = ColType.FLOAT, width = 15, precision = 2)
|
||||
private float income;
|
||||
|
||||
@Column
|
||||
@Comment("支出")
|
||||
@ColDefine(type = ColType.FLOAT, width = 15, precision = 2)
|
||||
private float expend;
|
||||
|
||||
@Column
|
||||
@Comment("年度结余")
|
||||
@ColDefine(type = ColType.FLOAT, width = 15, precision = 2)
|
||||
private float qmMoney;
|
||||
|
||||
@Column
|
||||
@Comment("金额")
|
||||
@ColDefine(type = ColType.FLOAT, width = 15, precision = 2)
|
||||
private Float money;
|
||||
|
||||
@Column
|
||||
@Comment("备注")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String notes;
|
||||
|
||||
@Column
|
||||
@Comment("排序字段")
|
||||
@Prev({
|
||||
@SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM sys_club_examine_register_detailed"),
|
||||
@SQL(db = DB.ORACLE, value = "SELECT COALESCE(MAX(location),0)+1 FROM sys_club_examine_register_detailed")
|
||||
})
|
||||
private Integer location;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.budwk.app.zhgh.club.model;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 10:54
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("sys_club_files")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会相关文件")
|
||||
public class SysClubFiles extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("用户")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("用户姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("社团id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String clubId;
|
||||
|
||||
@Column
|
||||
@Comment("备份时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String bTime;
|
||||
|
||||
@Column
|
||||
@Comment("文件类型,1是换届报告,2是章程")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer fileType;
|
||||
|
||||
@Column
|
||||
@Comment("文件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.budwk.app.zhgh.club.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/6 10:14
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("sys_club_sponsor")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会发起人")
|
||||
public class SysClubSponsor extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("协会id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@NotEmpty(message = "协会不能为空")
|
||||
private String clubId;
|
||||
|
||||
@Column
|
||||
@Comment("发起人id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@NotEmpty(message = "发起人不能为空")
|
||||
private String sponsorId;
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.budwk.app.zhgh.club.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/7 10:17
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("sys_club_user")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会成员")
|
||||
public class SysClubUser extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("协会id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@NotEmpty(message = "协会不能为空")
|
||||
private String clubId;
|
||||
|
||||
@Column
|
||||
@Comment("用户id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@NotEmpty(message = "用户不能为空")
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("入社时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String joinTime;
|
||||
|
||||
@Column
|
||||
@Comment("身份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String roleCode;
|
||||
|
||||
@Column
|
||||
@Comment("是否缴费")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean payed;
|
||||
|
||||
@Column
|
||||
@Comment("是否拨付")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean giveMoney;
|
||||
|
||||
@Column
|
||||
@Comment("状态(1 待协会审核 2 协会审核不通过 3 待校工会审核 4 校工会审核不通过 5 通过)")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
private Integer status;
|
||||
|
||||
@Column
|
||||
@Comment("退会状态(1 待协会审核 2 协会审核不通过 3 待校工会审核 4 校工会审核不通过 5 通过)")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
private Integer exitStatus;
|
||||
|
||||
@Column
|
||||
@Comment("理事机构成员变更时的审核状态(1 待校工会审核 2 校工会审核拒绝 3 审核成功)")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
private Integer state;
|
||||
|
||||
@Column
|
||||
@Comment("变更之后的身份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String changeRoleCode;
|
||||
|
||||
@Column
|
||||
@Comment("变更时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String roleCodeChangeTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("审核记录")
|
||||
private List<NutMap> auditList;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("退出审核记录")
|
||||
private List<NutMap> exitAuditList;
|
||||
|
||||
@Column
|
||||
@Comment("是否正常,此字段相当于一个标识,删除或者退休,设置为false,不会真正的从数据库删除,目的是为了后面统计年度成员情况")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isNormal;
|
||||
|
||||
@Column
|
||||
@Comment("isNormal变化的时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String changeTime;
|
||||
|
||||
@Column
|
||||
@Comment("职务")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String position;
|
||||
|
||||
@Column
|
||||
@Comment("加入、退出")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean mode;
|
||||
|
||||
@Column
|
||||
@Comment("邮箱")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String email;
|
||||
|
||||
@Column
|
||||
@Comment("头像")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String avatar;
|
||||
|
||||
@Column
|
||||
@Comment("同时参加其他协会情况")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String sameTimeJoinOtherClubSituation;
|
||||
|
||||
@Column
|
||||
@Comment("文化、体育方面的活动经历、获奖情况")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String awardsExperience;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.budwk.app.zhgh.club.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/7/5 16:52
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("sys_club_user_back_history")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会成员备份表")
|
||||
public class SysClubUserBackHistory extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("用户")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@NotEmpty(message = "用户不能为空")
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("协会id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@NotEmpty(message = "协会不能为空")
|
||||
private String clubId;
|
||||
|
||||
@Column
|
||||
@Comment("备份时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String bTime;
|
||||
|
||||
@Column
|
||||
@Comment("身份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 60)
|
||||
@NotEmpty(message = "身份不能为空")
|
||||
private String roleCode;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.budwk.app.zhgh.club.param;
|
||||
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ClubUserJoinPageForm extends PageForm {
|
||||
|
||||
private Integer year;
|
||||
private String loginName;
|
||||
private String userName;
|
||||
private String unionId;
|
||||
private String unitId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.budwk.app.zhgh.club.param;
|
||||
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/7 16:41
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ClubUserPageForm extends PageForm {
|
||||
|
||||
private String clubId;
|
||||
private String clubName;
|
||||
private String personType;
|
||||
private String userState;
|
||||
private String unitId;
|
||||
private Integer applyType;
|
||||
private Integer auditType;
|
||||
private Integer source;
|
||||
private Integer year;
|
||||
private Boolean giveMoney;
|
||||
private Integer radioType;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.budwk.app.zhgh.club.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.club.model.ClubUserApply;
|
||||
|
||||
public interface ClubUserJoinService extends BaseService<ClubUserApply> {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.budwk.app.zhgh.club.service;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.club.model.SysClubEvaluate;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.vo.ClubEvaluatePageVo;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/9 17:17
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
public interface SysClubEvaluateService extends BaseService<SysClubEvaluate> {
|
||||
|
||||
Pagination<ClubEvaluatePageVo> minePageData(@Valid ClubUserPageForm pageForm);
|
||||
Pagination<ClubEvaluatePageVo> clubAuditPageData(@Valid ClubUserPageForm pageForm);
|
||||
Pagination<ClubEvaluatePageVo> schoolAuditPageData(@Valid ClubUserPageForm pageForm);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.budwk.app.zhgh.club.service;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.club.model.SysClubExamineRegister;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.vo.ClubExaminePageVo;
|
||||
import com.budwk.app.zhgh.club.vo.ClubExamineVo;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
public interface SysClubExamineService extends BaseService<SysClubExamineRegister> {
|
||||
|
||||
List<NutMap> getClubUserNum(@Valid String clubId);
|
||||
|
||||
List<NutMap> getJgUser(@Valid String clubId);
|
||||
|
||||
SysClubExamineRegister doAdd(SysClubExamineRegister examineRegister, String incomeDetailed, String incomeCensus);
|
||||
|
||||
SysClubExamineRegister doEdit(SysClubExamineRegister examineRegister, String incomeDetailed, String incomeCensus);
|
||||
|
||||
Pagination<ClubExaminePageVo> minePageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
Pagination<ClubExaminePageVo> clubAuditPageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
Pagination<ClubExaminePageVo> schoolAuditPageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
ClubExamineVo findOne(@Valid String id);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.budwk.app.zhgh.club.service;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.vo.ClubCommonPageVo;
|
||||
import com.budwk.app.zhgh.club.vo.ClubUserCommonPageVo;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 9:49
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
public interface SysClubInfoManageService extends BaseService<ClubCommonPageVo> {
|
||||
|
||||
Pagination<ClubCommonPageVo> infoManagePageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
Pagination<ClubUserCommonPageVo> infoManageUserPageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
Pagination<ClubCommonPageVo> reportPageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
Pagination<ClubCommonPageVo> schoolAuditRulePageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
Pagination<ClubCommonPageVo> schoolAuditReportPageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
Pagination<ClubUserCommonPageVo> clubManagePersonAuditPageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
List<NutMap> getClubTreeData();
|
||||
|
||||
/**
|
||||
* 导出登记表
|
||||
* @param clubId
|
||||
* @param response
|
||||
*/
|
||||
void exportRegistrationDoc(String clubId, HttpServletResponse response);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.budwk.app.zhgh.club.service;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.vo.ClubCommonPageVo;
|
||||
import com.budwk.app.zhgh.club.vo.ClubRegisterPageVo;
|
||||
import com.budwk.app.zhgh.club.vo.ClubRegisterVo;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/6 10:17
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
public interface SysClubService extends BaseService<SysClub> {
|
||||
|
||||
Pagination<ClubCommonPageVo> getAllClubWithPage(@Valid PageForm pageForm, Cnd cnd);
|
||||
|
||||
ClubRegisterVo findOne(String clubId);
|
||||
|
||||
List<SysClub> getMyManageClub();
|
||||
|
||||
List<NutMap> getMyClubAndYearAuditPass(Integer year);
|
||||
|
||||
SysClub doAdd(SysClub club, List<NutMap> managePerson);
|
||||
|
||||
SysClub doEdit(SysClub club, List<String> deleteIds, List<NutMap> managePerson);
|
||||
|
||||
Pagination<ClubRegisterPageVo> minePageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
Pagination<ClubRegisterPageVo> schoolLeaderAuditPageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
Pagination<ClubRegisterPageVo> schoolReplyPageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
Pagination<ClubRegisterPageVo> clubConfirmPageData(@Valid ClubUserPageForm pageForm);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.budwk.app.zhgh.club.service;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/7 15:36
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
public interface SysClubUserService extends BaseService<SysClubUser> {
|
||||
|
||||
List<NutMap> getClubUser(@Valid String clubId);
|
||||
|
||||
Pagination pageDataByApplyJoinClubAudit(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
/**
|
||||
* 入会申请审核
|
||||
* @param ids clubUser表中主键id
|
||||
* @param auditResult 审核结果,true or false
|
||||
* @param auditType 审核类型,协会还是校工会,值为1 or 2
|
||||
* @param applyType 申请类型,入会还是退会,值为1 or 2
|
||||
* @param payed 是否缴费,true or false
|
||||
* @return void
|
||||
*/
|
||||
void doAudit(@Valid String[] ids,
|
||||
@Valid Boolean auditResult,
|
||||
@Valid Integer auditType,
|
||||
@Valid Integer applyType,
|
||||
@Valid Boolean payed);
|
||||
|
||||
String getClubLeader(@Valid String clubId);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.club.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.club.model.ClubUserApply;
|
||||
import com.budwk.app.zhgh.club.service.ClubUserJoinService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ClubUserJoinServiceImpl extends BaseServiceImpl<ClubUserApply> implements ClubUserJoinService {
|
||||
public ClubUserJoinServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.budwk.app.zhgh.club.service.impl;
|
||||
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.bpm.enums.BpmProcessTaskStatusEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.SysClubEvaluate;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubEvaluateService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubEvaluatePageVo;
|
||||
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.IocBean;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/9 17:17
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class SysClubEvaluateServiceImpl extends BaseServiceImpl<SysClubEvaluate> implements SysClubEvaluateService {
|
||||
|
||||
public SysClubEvaluateServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubEvaluatePageVo> minePageData(ClubUserPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ce.*,
|
||||
club.foundTime,
|
||||
club.clubName,
|
||||
club.clubCode,
|
||||
dict.name as typeName,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeCode,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
nd.nodeType AS processInstanceTaskNodeType,
|
||||
(
|
||||
SELECT
|
||||
count( 1 ) > 0
|
||||
FROM
|
||||
bpm_process_task
|
||||
WHERE
|
||||
prevTaskId = ( SELECT id FROM bpm_process_task WHERE processInstanceId = inst.id AND processTaskNodeCode IN ( 10, 40, 70 ) ORDER BY createdAt DESC LIMIT 1 )
|
||||
AND taskStatus = 'COMPELTE'
|
||||
) AS nextTaskIsComplete
|
||||
FROM
|
||||
sys_club_evaluate ce
|
||||
LEFT JOIN sys_club club on club.id = ce.clubId
|
||||
LEFT JOIN sys_dict dict ON dict.CODE = club.clubType
|
||||
LEFT JOIN bpm_process_instance inst ON inst.processInstanceBusinessId = ce.id
|
||||
LEFT JOIN bpm_process_node_define nd ON nd.id = inst.processInstanceNodeId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
cnd.andEX("ce.clubId", "=", pageForm.getClubId());
|
||||
cnd.andEX("year(ce.applyTime)", "=", pageForm.getYear());
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
cnd.and("ce.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
cnd.groupBy("ce.id");
|
||||
cnd.desc("applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubEvaluatePageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubEvaluatePageVo> clubAuditPageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("nd.nodeCode","=",20);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
cnd.and("ce.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
Sql sql = generateSql(pageForm, cnd);
|
||||
return listPageVO(pageForm, sql, ClubEvaluatePageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubEvaluatePageVo> schoolAuditPageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("nd.nodeCode","=",20);
|
||||
Sql sql = generateSql(pageForm, cnd);
|
||||
return listPageVO(pageForm, sql, ClubEvaluatePageVo.class);
|
||||
}
|
||||
|
||||
private Sql generateSql(ClubUserPageForm pageForm, Cnd cnd) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ce.*,
|
||||
club.foundTime,
|
||||
club.clubName,
|
||||
club.clubCode,
|
||||
dict.name as typeName,
|
||||
inst.id processInstanceId,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
task.id processInstanceTaskId,
|
||||
task.taskStatus processInstanceTaskStatus,
|
||||
COUNT(nt.id) OVER (PARTITION BY task.id) > 0 AS nextTaskIsComplete
|
||||
FROM
|
||||
bpm_process_task task
|
||||
INNER JOIN bpm_process_node_define nd ON nd.id = task.processTaskNodeId
|
||||
INNER JOIN bpm_process_instance inst ON inst.id = task.processInstanceId
|
||||
INNER JOIN sys_club_evaluate ce ON ce.id = inst.processInstanceBusinessId
|
||||
LEFT JOIN bpm_process_task nt ON nt.prevTaskId = task.id AND nt.taskStatus = 'COMPLETE'
|
||||
LEFT JOIN sys_club club on club.id = ce.clubId
|
||||
LEFT JOIN sys_dict dict ON dict.CODE = club.clubType
|
||||
$condition
|
||||
""");
|
||||
|
||||
cnd.andEX("ce.clubId", "=", pageForm.getClubId());
|
||||
cnd.andEX("year(ce.applyTime)", "=", pageForm.getYear());
|
||||
|
||||
if(pageForm.getAudit()){
|
||||
cnd.and("task.taskStatus","=", BpmProcessTaskStatusEnum.COMPLETE);
|
||||
}else{
|
||||
cnd.and("task.taskStatus","=",BpmProcessTaskStatusEnum.ACTIVE);
|
||||
}
|
||||
|
||||
cnd.groupBy("ce.id");
|
||||
cnd.desc("applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
package com.budwk.app.zhgh.club.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.constant.BpmProcessConstant;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.bpm.enums.BpmProcessTaskStatusEnum;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubExamineRegister;
|
||||
import com.budwk.app.zhgh.club.model.SysClubExamineRegisterDetailed;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubExamineService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubExaminePageVo;
|
||||
import com.budwk.app.zhgh.club.vo.ClubExamineVo;
|
||||
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.json.Json;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class SysClubExamineServiceImpl extends BaseServiceImpl<SysClubExamineRegister> implements SysClubExamineService {
|
||||
|
||||
@Inject
|
||||
private SysDictService sysDictService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
public SysClubExamineServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> getClubUserNum(String clubId) {
|
||||
// List<Sys_dict> userType = sysDictService.getSubListByCode("USER_STATE");
|
||||
// List<Sys_dict> userStateList = userType.stream()
|
||||
// .filter(v -> v.getName().equals("在职") || v.getName().equals("在岗") || v.getName().equals("退休"))
|
||||
// .toList();
|
||||
//
|
||||
// Sql sql = Sqls.create("""
|
||||
// SELECT
|
||||
// cu.*,
|
||||
// u.userState
|
||||
// FROM
|
||||
// club_user cu
|
||||
// LEFT JOIN sys_user u ON cu.userId = u.id
|
||||
// where cu.clubId = @clubId
|
||||
// """).setParam("clubId", clubId);
|
||||
// List<NutMap> userList = listMap(sql);
|
||||
// List<NutMap> result = new ArrayList<>();
|
||||
// userStateList.forEach(v -> {
|
||||
// List<NutMap> personTypeUser = userList.stream().filter(u -> StrUtil.isNotBlank(u.getString("userState")) && u.getString("userState").equals(v.getName())).toList();
|
||||
// NutMap nutMap = new NutMap();
|
||||
// nutMap.addv("userState", v.getName());
|
||||
// //获取今年年初人数
|
||||
// int yearFirst = personTypeUser.stream().filter(u -> !u.getString("joinTime").substring(0, 4).equals(DateUtil.thisYear() + "") && StrUtil.isBlank(u.getString("changeTime"))).toList().size();
|
||||
// nutMap.addv("yearFirstNum", yearFirst);
|
||||
//
|
||||
// //获取今年人数
|
||||
// int thisYear = personTypeUser.stream().filter(u -> u.getString("joinTime").substring(0, 4).equals(DateUtil.thisYear() + "")).toList().size();
|
||||
// nutMap.addv("yearAddNum", thisYear);
|
||||
// //获取今年比去年减少了多少个人
|
||||
// int yearEditNum = personTypeUser.stream().filter(u -> StrUtil.isNotBlank(u.getString("changeTime")) && u.getString("changeTime").substring(0, 4).equals(DateUtil.thisYear() + "") && !u.getBoolean("isNormal")).toList().size();
|
||||
// nutMap.addv("yearEditNum", yearEditNum);
|
||||
//
|
||||
// //总人数
|
||||
// int thisYearNum = personTypeUser.stream().filter(u -> StrUtil.isBlank(u.getString("changeTime"))).toList().size();
|
||||
// nutMap.addv("thisYearNum", thisYearNum);
|
||||
// result.add(nutMap);
|
||||
// });
|
||||
// return result;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> getJgUser(String clubId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
cl.*,
|
||||
u.username as userName,
|
||||
u.loginname as loginName,
|
||||
u.unitname as unitName,
|
||||
u.mobile,
|
||||
r.`name` AS roleName
|
||||
FROM
|
||||
club_user cl
|
||||
LEFT JOIN `vw_user` u ON cl.userId = u.id
|
||||
LEFT JOIN sys_role r ON r.code = cl.roleCode
|
||||
WHERE
|
||||
cl.clubId = @clubId
|
||||
ORDER BY FIELD( cl.roleCode, 'CLUB_PRESIDENT', 'CLUB_VICE_PRESIDENT', 'CLUB_SECRETARY', 'CLUB_VICE_SECRETARY','CLUB_OPERATOR', 'CLUB_MEMBER' )
|
||||
""").setParam("clubId", clubId).setParam("roleCode", RoleConstant.CLUB_MEMBER.name());
|
||||
return listMap(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysClubExamineRegister doAdd(SysClubExamineRegister examineRegister, String incomeDetailed, String incomeCensus) {
|
||||
List<SysClubExamineRegisterDetailed> detailedList = Json.fromJsonAsList(SysClubExamineRegisterDetailed.class, incomeDetailed);
|
||||
List<JSONObject> incomeCensusList = Json.fromJsonAsList(JSONObject.class, incomeCensus);
|
||||
examineRegister.setRegisterDate(DateUtil.now());
|
||||
examineRegister.setUserId(SecurityUtil.getUserId());
|
||||
examineRegister.setIncomeCensus(incomeCensusList);
|
||||
SysClubExamineRegister examineReg = dao().insert(examineRegister);
|
||||
detailedList.forEach(v -> {
|
||||
v.setRegisterId(examineRegister.getId());
|
||||
});
|
||||
dao().insert(detailedList);
|
||||
return examineReg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysClubExamineRegister doEdit(SysClubExamineRegister examineRegister, String incomeDetailed, String incomeCensus) {
|
||||
List<SysClubExamineRegisterDetailed> detailedList = Json.fromJsonAsList(SysClubExamineRegisterDetailed.class, incomeDetailed);
|
||||
List<JSONObject> incomeCensusList = Json.fromJsonAsList(JSONObject.class, incomeCensus);
|
||||
examineRegister.setRegisterDate(DateUtil.now());
|
||||
examineRegister.setIncomeCensus(incomeCensusList);
|
||||
updateIgnoreNull(examineRegister);
|
||||
dao().clear(SysClubExamineRegisterDetailed.class, Cnd.where("registerId", "=", examineRegister.getId()));
|
||||
detailedList.forEach(v -> {
|
||||
v.setRegisterId(examineRegister.getId());
|
||||
});
|
||||
insert(detailedList);
|
||||
return examineRegister;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubExaminePageVo> minePageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
List<SysClub> myManageClub = sysClubService.getMyManageClub();
|
||||
cnd.and("scer.clubId", "in", myManageClub.stream().map(SysClub::getId).toList());
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
scer.*,
|
||||
u.username as concatPersonName,
|
||||
sc.concatPersonMobile,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeCode,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
nd.nodeType AS processInstanceTaskNodeType,
|
||||
(
|
||||
SELECT
|
||||
count( 1 ) > 0
|
||||
FROM
|
||||
bpm_process_task
|
||||
WHERE
|
||||
prevTaskId = ( SELECT id FROM bpm_process_task WHERE processInstanceId = inst.id AND processTaskNodeCode IN ( 10, 40, 70 ) ORDER BY createdAt DESC LIMIT 1 )
|
||||
AND taskStatus = 'COMPELTE'
|
||||
) AS nextTaskIsComplete
|
||||
FROM
|
||||
`sys_club_examine_register` scer
|
||||
LEFT JOIN sys_club sc ON sc.id = scer.clubId
|
||||
LEFT JOIN `vw_user` u ON u.id = sc.concatPerson
|
||||
LEFT JOIN bpm_process_instance inst ON inst.processInstanceBusinessId = scer.id
|
||||
LEFT JOIN bpm_process_node_define nd ON nd.id = inst.processInstanceNodeId
|
||||
$condition
|
||||
""");
|
||||
cnd.andEX("YEAR(scer.registerDate)", "=", pageForm.getYear());
|
||||
cnd.andEX("sc.id", "=", pageForm.getClubId());
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
// cnd.and("scer.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
cnd.groupBy("scer.id");
|
||||
cnd.desc("registerDate");
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubExaminePageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubExaminePageVo> clubAuditPageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("nd.nodeCode","=",20);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
cnd.and("scer.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
Sql sql = generateSql(pageForm, cnd);
|
||||
return listPageVO(pageForm, sql, ClubExaminePageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubExaminePageVo> schoolAuditPageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("nd.nodeCode","=",50);
|
||||
Sql sql = generateSql(pageForm, cnd);
|
||||
return listPageVO(pageForm, sql, ClubExaminePageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClubExamineVo findOne(String id) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
scer.*,
|
||||
u.username as concatPersonName,
|
||||
sc.concatPersonMobile
|
||||
FROM
|
||||
`sys_club_examine_register` scer
|
||||
LEFT JOIN sys_club sc ON sc.id = scer.clubId
|
||||
LEFT JOIN `vw_user` u ON u.id = sc.concatPerson
|
||||
WHERE scer.id = @id
|
||||
""").setParam("id", id);
|
||||
ClubExamineVo clubExamineVo = fetchVO(sql, ClubExamineVo.class);
|
||||
clubExamineVo.setNodeTasks(bpmService.getNodeTasks(BpmProcessConstant.CLUB_EXAMINE, id));
|
||||
|
||||
List<SysClubExamineRegisterDetailed> detailedList = dao().query(SysClubExamineRegisterDetailed.class, Cnd.where("registerId", "=", id).asc("location"));
|
||||
clubExamineVo.setDetailedList(detailedList);
|
||||
return clubExamineVo;
|
||||
}
|
||||
|
||||
private Sql generateSql(ClubUserPageForm pageForm, Cnd cnd) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
scer.*,
|
||||
u.username as concatPersonName,
|
||||
club.concatPersonMobile,
|
||||
dict.name as typeName,
|
||||
inst.id processInstanceId,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
task.id processInstanceTaskId,
|
||||
task.taskStatus processInstanceTaskStatus,
|
||||
COUNT(nt.id) OVER (PARTITION BY task.id) > 0 AS nextTaskIsComplete
|
||||
FROM
|
||||
bpm_process_task task
|
||||
INNER JOIN bpm_process_node_define nd ON nd.id = task.processTaskNodeId
|
||||
INNER JOIN bpm_process_instance inst ON inst.id = task.processInstanceId
|
||||
INNER JOIN sys_club_examine_register scer ON scer.id = inst.processInstanceBusinessId
|
||||
LEFT JOIN bpm_process_task nt ON nt.prevTaskId = task.id AND nt.taskStatus = 'COMPLETE'
|
||||
LEFT JOIN sys_club club on club.id = scer.clubId
|
||||
LEFT JOIN sys_dict dict ON dict.CODE = club.clubType
|
||||
LEFT JOIN `vw_user` u ON u.id = club.concatPerson
|
||||
$condition
|
||||
""");
|
||||
|
||||
cnd.andEX("scer.clubId", "=", pageForm.getClubId());
|
||||
cnd.andEX("YEAR(scer.registerDate)", "=", pageForm.getYear());
|
||||
if(pageForm.getAudit()){
|
||||
cnd.and("task.taskStatus","=", BpmProcessTaskStatusEnum.COMPLETE);
|
||||
}else{
|
||||
cnd.and("task.taskStatus","=",BpmProcessTaskStatusEnum.ACTIVE);
|
||||
}
|
||||
cnd.groupBy("scer.id,task.id");
|
||||
cnd.desc("registerDate");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,377 @@
|
||||
package com.budwk.app.zhgh.club.service.impl;
|
||||
|
||||
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.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
|
||||
import com.budwk.app.bpm.enums.BpmProcessInstanceStatusEnum;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.commons.base.Globals;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubCommonPageVo;
|
||||
import com.budwk.app.zhgh.club.vo.ClubUserCommonPageVo;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
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.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 9:49
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
@Slf4j
|
||||
public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPageVo> implements SysClubInfoManageService {
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
@Inject
|
||||
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
|
||||
|
||||
|
||||
public SysClubInfoManageServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubCommonPageVo> infoManagePageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
// Sql sql = generateSql(pageForm, cnd);
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.*,
|
||||
d.NAME AS typeName,
|
||||
(
|
||||
SELECT
|
||||
count( DISTINCT scu.userId )
|
||||
FROM
|
||||
club_user scu
|
||||
WHERE
|
||||
scu.clubId = c.id
|
||||
) currentNum,
|
||||
presidentUser.username AS clubLeader,
|
||||
secretaryUser.username AS clubSecretary
|
||||
FROM
|
||||
sys_club c
|
||||
LEFT JOIN club_user presidentCu on presidentCu.clubId = c.id AND presidentCu.roleCode = 'CLUB_PRESIDENT'
|
||||
LEFT JOIN sys_user presidentUser on presidentUser.id = presidentCu.userId
|
||||
LEFT JOIN club_user secretaryCu on secretaryCu.clubId = c.id AND secretaryCu.roleCode = 'CLUB_SECRETARY'
|
||||
LEFT JOIN sys_user secretaryUser on secretaryUser.id = secretaryCu.userId
|
||||
LEFT JOIN sys_dict d ON d.CODE = c.clubType
|
||||
LEFT JOIN bpm_process_instance ins ON ins.processInstanceBusinessId = c.id
|
||||
$condition
|
||||
""");
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.and("c.clubName", "LIKE", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
|
||||
cnd.andEX("year(c.createTime)", "=", pageForm.getYear());
|
||||
cnd.and("c.dismiss", "=", false);
|
||||
cnd.and("ins.processInstanceStatus", "=", BpmProcessInstanceStatusEnum.COMPLETED);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name(), RoleConstant.CLUB_OPERATOR.name()));
|
||||
|
||||
List<Sys_user_role> clubList = dao().query(Sys_user_role.class, Cnd.where("roleId", "in", roleList).and("userId", "=", SecurityUtil.getUserId()).and("clubId", "is not", null));
|
||||
|
||||
List<String> clubIdList = clubList.stream().map(Sys_user_role::getClubId).toList();
|
||||
|
||||
cnd.and("c.id", "in", clubIdList);
|
||||
}
|
||||
// cnd.asc("c.state").desc("createTime");
|
||||
cnd.asc("c.clubCode");
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubCommonPageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubUserCommonPageVo> infoManageUserPageData(ClubUserPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
scu.*,
|
||||
u.username as userName,
|
||||
u.loginname as loginName,
|
||||
u.sex,
|
||||
u.personType as personType,
|
||||
u.userState,
|
||||
u.unitid as unitId,
|
||||
u.mobile,
|
||||
club.clubName,
|
||||
u.unitname as unitName,
|
||||
r.name as roleName
|
||||
FROM
|
||||
club_user scu
|
||||
LEFT JOIN sys_club club ON scu.clubId = club.id
|
||||
LEFT JOIN sys_role r on r.code = scu.roleCode
|
||||
RIGHT JOIN `vw_user` u ON scu.userId = u.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
cnd.and("scu.clubId", "=", pageForm.getClubId());
|
||||
// cnd.and("scu.isNormal", "=", true);
|
||||
// cnd.and("scu.status", "in", Lang.array(1, 3, 5));
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getPersonType())) {
|
||||
cnd.and("u.personType", "=", pageForm.getPersonType());
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageForm.getUserState())) {
|
||||
cnd.and("u.userState", "=", pageForm.getUserState());
|
||||
}
|
||||
// if (pageForm.getGiveMoney() != null) {
|
||||
// cnd.and("scu.giveMoney", "=", pageForm.getGiveMoney());
|
||||
// }
|
||||
if (Strings.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
cnd.and(Cnd.exps("loginname", "like", "%" + pageForm.getSearchKeyword() + "%").or("username", "like", "%" + pageForm.getSearchKeyword() + "%"));
|
||||
}
|
||||
|
||||
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().equals("descending") ? "desc" : "asc");
|
||||
}
|
||||
|
||||
|
||||
//查询理事机构
|
||||
if (pageForm.getRadioType() != null && 1 == pageForm.getRadioType()) {
|
||||
cnd.and("scu.roleCode", "!=", RoleConstant.CLUB_MEMBER);
|
||||
}
|
||||
//查询社团成员
|
||||
if (pageForm.getRadioType() != null && 2 == pageForm.getRadioType()) {
|
||||
cnd.and("scu.roleCode", "=", RoleConstant.CLUB_MEMBER);
|
||||
}
|
||||
cnd.asc("field( scu.roleCode, 'CLUB_PRESIDENT', 'CLUB_VICE_PRESIDENT', 'CLUB_SECRETARY', 'CLUB_VICE_SECRETARY','CLUB_OPERATOR', 'CLUB_MEMBER' )");
|
||||
sql.setCondition(cnd);
|
||||
return sysClubService.listPageVO(pageForm, sql, ClubUserCommonPageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubCommonPageVo> reportPageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
|
||||
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(
|
||||
RoleConstant.CLUB_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_VICE_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_SECRETARY.name(),
|
||||
RoleConstant.CLUB_VICE_SECRETARY.name()
|
||||
));
|
||||
|
||||
List<Sys_user_role> userRoles = dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId())
|
||||
.and("roleId", "in", roleList));
|
||||
List<String> clubIdList = userRoles.stream().map(Sys_user_role::getClubId).collect(Collectors.toList());
|
||||
cnd.and("c.id", "in", clubIdList);
|
||||
}
|
||||
Sql sql = generateSql(pageForm, cnd);
|
||||
return listPageVO(pageForm, sql, ClubCommonPageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubCommonPageVo> schoolAuditRulePageData(ClubUserPageForm pageForm) {
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("ruleState", "=", 1);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
cnd.and("c.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
Sql sql = generateSql(pageForm, cnd);
|
||||
return listPageVO(pageForm, sql, ClubCommonPageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubCommonPageVo> schoolAuditReportPageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("reportState", "=", 1);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
cnd.and("c.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.*,
|
||||
d.NAME AS typeName,
|
||||
(
|
||||
SELECT count( DISTINCT scu.userId )
|
||||
FROM club_user scu
|
||||
WHERE
|
||||
scu.clubId = c.id
|
||||
) currentNum,
|
||||
presidentUser.username AS clubLeader,
|
||||
secretaryUser.username AS clubSecretary
|
||||
FROM
|
||||
sys_club c
|
||||
LEFT JOIN club_user presidentCu on presidentCu.clubId = c.id AND presidentCu.roleCode = 'CLUB_PRESIDENT'
|
||||
LEFT JOIN sys_user presidentUser on presidentUser.id = presidentCu.userId
|
||||
LEFT JOIN club_user secretaryCu on secretaryCu.clubId = c.id AND secretaryCu.roleCode = 'CLUB_SECRETARY'
|
||||
LEFT JOIN sys_user secretaryUser on secretaryUser.id = secretaryCu.userId
|
||||
LEFT JOIN sys_dict d ON d.CODE = c.clubType
|
||||
LEFT JOIN bpm_process_instance ins ON ins.processInstanceBusinessId = c.id
|
||||
$condition
|
||||
""");
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.and("c.clubName", "LIKE", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
cnd.andEX("year(c.createTime)", "=", pageForm.getYear());
|
||||
cnd.and("c.dismiss", "=", false);
|
||||
cnd.and("ins.processInstanceStatus", "=", BpmProcessInstanceStatusEnum.COMPLETED);
|
||||
cnd.asc("c.state").desc("createTime");
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubCommonPageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubUserCommonPageVo> clubManagePersonAuditPageData(ClubUserPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
cu.*,
|
||||
club.clubName,
|
||||
club.clubCode,
|
||||
d.NAME AS typeName,
|
||||
u.username as userName,
|
||||
club.replaceReport
|
||||
FROM
|
||||
club_user cu
|
||||
left join `vw_user` u on u.id = cu.userId
|
||||
left join sys_club club on club.id = cu.clubId
|
||||
LEFT JOIN sys_dict d ON d.CODE = club.clubType
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("isNormal", "=", true);
|
||||
cnd.andEX("clubId", "=", pageForm.getClubId());
|
||||
cnd.and("cu.roleCode", "!=", RoleConstant.CLUB_MEMBER);
|
||||
cnd.and(Cnd.exps("cu.state", "=", 1).or("cu.status", "=", 3));
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubUserCommonPageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> getClubTreeData() {
|
||||
List<NutMap> result = new ArrayList<>();
|
||||
|
||||
NutMap nutMap = NutMap.NEW();
|
||||
nutMap.put("id", "0");
|
||||
nutMap.put("clubName", Globals.AppName);
|
||||
nutMap.put("children", sysClubService.getMyManageClub());
|
||||
result.add(nutMap);
|
||||
return result;
|
||||
}
|
||||
|
||||
private Sql generateSql(ClubUserPageForm pageForm, Cnd cnd) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.*,
|
||||
d.NAME AS typeName,
|
||||
u.username as userName,
|
||||
u1.username AS concatPersonName,
|
||||
(select GROUP_CONCAT(DISTINCT username) from `vw_user` where id in (select sponsorId from sys_club_sponsor where clubId = c.id)) as sponsorName,
|
||||
( SELECT count( DISTINCT scu.userId ) FROM club_user scu WHERE scu.clubId = c.id ) currentNum
|
||||
FROM
|
||||
sys_club c
|
||||
LEFT JOIN sys_dict d ON d.CODE = c.clubType
|
||||
LEFT JOIN `vw_user` u ON u.id = c.userId
|
||||
LEFT JOIN `vw_user` u1 ON u1.id = c.concatPerson
|
||||
LEFT JOIN `vw_user` hzu ON hzu.id = c.userId
|
||||
LEFT JOIN bpm_process_instance ins ON ins.processInstanceBusinessId = c.id
|
||||
$condition
|
||||
""");
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.and("c.clubName", "LIKE", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
cnd.andEX("year(c.createTime)", "=", pageForm.getYear());
|
||||
cnd.and("c.dismiss", "=", false);
|
||||
cnd.and("ins.processInstanceStatus", "=", BpmProcessInstanceStatusEnum.COMPLETED);
|
||||
|
||||
cnd.asc("c.state").desc("createTime");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportRegistrationDoc(String clubId, HttpServletResponse response) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.clubName,
|
||||
u.userName,
|
||||
u.sex,
|
||||
DATE_FORMAT(u.birthday,'%Y-%m-%d') AS birthday,
|
||||
u.unitName,
|
||||
u.technicalTitle,
|
||||
u.mobile,
|
||||
u.email
|
||||
FROM
|
||||
sys_club c
|
||||
LEFT JOIN club_user scu ON scu.clubId = c.id
|
||||
AND scu.roleCode = 'CLUB_PRESIDENT'
|
||||
LEFT JOIN vw_user u ON u.id = scu.userId
|
||||
WHERE
|
||||
c.id = @clubId
|
||||
""");
|
||||
sql.setParam("clubId", clubId);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao().execute(sql);
|
||||
NutMap clubInfo = (NutMap) sql.getResult();
|
||||
|
||||
//成员信息
|
||||
Sql memberSql = Sqls.create("""
|
||||
SELECT
|
||||
u.username,
|
||||
u.sex,
|
||||
DATE_FORMAT(u.birthday,'%Y-%m-%d') AS birthday,
|
||||
u.unitName,
|
||||
u.technicalTitle,
|
||||
u.mobile,
|
||||
u.email,
|
||||
IF(scu.roleCode='CLUB_MEMBER',null,r.`name`) AS roleName
|
||||
FROM
|
||||
club_user scu
|
||||
LEFT JOIN vw_user u ON u.id = scu.userId
|
||||
LEFT JOIN sys_role r ON r.`code` = scu.roleCode
|
||||
WHERE scu.clubId = @clubId
|
||||
ORDER BY FIELD(scu.roleCode,'CLUB_PRESIDENT','CLUB_VICE_PRESIDENT','CLUB_SECRETARY','CLUB_VICE_SECRETARY','CLUB_MEMBER')
|
||||
""");
|
||||
memberSql.setParam("clubId", clubId);
|
||||
List<NutMap> memberList = listMap(memberSql);
|
||||
|
||||
HashMap<String, Object> docData = new HashMap<>(clubInfo);
|
||||
docData.put("cys", memberList);
|
||||
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
|
||||
Configure config = Configure.builder()
|
||||
.bind("cys", policy)
|
||||
.build();
|
||||
|
||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
|
||||
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("clubRegis"), config).render(docData).writeAndClose(byteArrayOutputStream);
|
||||
CommonDownloadUtil.download("南京邮电大学教职工文体协会登记表(" + clubInfo.getString("clubName") + ").docx", byteArrayOutputStream.toByteArray(), response);
|
||||
} catch (IOException e) {
|
||||
log.error("协会登记表导出失败,id:{},错误信息:{}", clubId, e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,353 @@
|
||||
package com.budwk.app.zhgh.club.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.BpmProcessConstant;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.bpm.enums.BpmProcessInstanceStatusEnum;
|
||||
import com.budwk.app.bpm.enums.BpmProcessTaskStatusEnum;
|
||||
import com.budwk.app.bpm.models.BpmProcessInstance;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubSponsor;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubUserService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubCommonPageVo;
|
||||
import com.budwk.app.zhgh.club.vo.ClubRegisterPageVo;
|
||||
import com.budwk.app.zhgh.club.vo.ClubRegisterVo;
|
||||
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.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/6 10:18
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysClubService {
|
||||
|
||||
public SysClubServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Inject
|
||||
private SysClubUserService sysClubUserService;
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@Override
|
||||
public Pagination<ClubCommonPageVo> getAllClubWithPage(PageForm pageForm, Cnd cnd) {
|
||||
// (select count(*) from sys_user where userState in ('在职', '在岗') and id in (select userId from sys_club_user where clubId = club.id and `status` = 5 and isNormal = true)) as workNum,
|
||||
// (select count(*) from sys_user where userState in ('退休') and id in (select userId from sys_club_user where clubId = club.id and `status` = 5 and isNormal = true)) as retireNum,
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
club.*,
|
||||
u.username as concatPersonName,
|
||||
(select GROUP_CONCAT(username) from sys_user where id in (select userId from club_user u where u.clubId=club.id and u.roleCode='CLUB_PRESIDENT')) as clubLeader,
|
||||
(select GROUP_CONCAT(username) from sys_user where id in (select userId from club_user u where u.clubId=club.id and u.roleCode='CLUB_SECRETARY')) as clubSecretary,
|
||||
(SELECT count( DISTINCT scu.userId ) FROM club_user scu WHERE scu.clubId = club.id ) currentPeopleNum
|
||||
FROM
|
||||
sys_club club
|
||||
LEFT JOIN sys_user u on club.concatPerson = u.id
|
||||
LEFT JOIN bpm_process_instance ins ON ins.processInstanceBusinessId = club.id
|
||||
$condition
|
||||
""").setParam("userId", SecurityUtil.getUserId());
|
||||
cnd.and("ins.processInstanceStatus", "=", BpmProcessInstanceStatusEnum.COMPLETED);
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubCommonPageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClubRegisterVo findOne(String clubId) {
|
||||
if (StrUtil.isBlank(clubId)) {
|
||||
return new ClubRegisterVo();
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
club.*,
|
||||
d.NAME AS typeName,
|
||||
u.username concatPersonName,
|
||||
( SELECT count( 1 ) FROM club_user scu WHERE scu.clubId = club.id ) currentPeopleNum,
|
||||
(select GROUP_CONCAT(username) from sys_user where id in (select sponsorId from sys_club_sponsor where clubId = club.id)) as sponsorName,
|
||||
(select GROUP_CONCAT(sponsorId) from sys_club_sponsor where clubId = club.id) as sponsor
|
||||
FROM
|
||||
`sys_club` club
|
||||
LEFT JOIN sys_dict d ON d.CODE = club.clubType
|
||||
LEFT JOIN sys_user u ON club.concatPerson = u.id
|
||||
where club.id = @id
|
||||
""");
|
||||
sql.setParam("id", clubId);
|
||||
ClubRegisterVo clubRegisterVo = fetchVO(sql, ClubRegisterVo.class);
|
||||
|
||||
clubRegisterVo.setNodeTasks(bpmService.getNodeTasks(BpmProcessConstant.CLUB_REGISTER, clubId));
|
||||
List<NutMap> clubUser = sysClubUserService.getClubUser(clubId);
|
||||
clubRegisterVo.setClubUser(clubUser);
|
||||
return clubRegisterVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysClub> getMyManageClub() {
|
||||
|
||||
Cnd cnd = Cnd.where("dismiss", "=", false);
|
||||
cnd.asc("createTime");
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name(),RoleConstant.CLUB_OPERATOR.name()));
|
||||
|
||||
List<Sys_user_role> clubList = dao().query(Sys_user_role.class, Cnd.where("roleId", "in", roleList).and("userId", "=", SecurityUtil.getUserId()).and("clubId", "is not", null));
|
||||
|
||||
List<String> clubIdList = clubList.stream().map(Sys_user_role::getClubId).toList();
|
||||
|
||||
cnd.and("id", "in", clubIdList);
|
||||
}
|
||||
|
||||
List<SysClub> clubList = query(cnd);
|
||||
List<String> list = clubList.stream().map(SysClub::getId).toList();
|
||||
|
||||
List<BpmProcessInstance> instanceList = dao().query(BpmProcessInstance.class, Cnd.where("processInstanceBusinessId", "in", list).and("processInstanceStatus", "=", BpmProcessInstanceStatusEnum.COMPLETED));
|
||||
List<String> businessNoList = instanceList.stream().map(BpmProcessInstance::getProcessInstanceBusinessId).toList();
|
||||
|
||||
return clubList.stream().filter(o -> businessNoList.contains(o.getId())).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> getMyClubAndYearAuditPass(Integer year) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
club.*
|
||||
FROM
|
||||
sys_club club
|
||||
LEFT JOIN sys_club_examine_register ex ON club.id = ex.clubId
|
||||
LEFT JOIN sys_user_role ur ON club.id = ur.clubId
|
||||
LEFT JOIN bpm_process_instance bpi ON bpi.processInstanceBusinessId = club.id
|
||||
LEFT JOIN bpm_process_instance instance ON instance.processInstanceBusinessId = ex.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("bpi.processInstanceStatus", "=", BpmProcessInstanceStatusEnum.COMPLETED);
|
||||
cnd.and("instance.processInstanceStatus", "=", BpmProcessInstanceStatusEnum.COMPLETED);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
cnd.and("ur.userId", "=", SecurityUtil.getUserId());
|
||||
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name(), RoleConstant.CLUB_OPERATOR.name()));
|
||||
cnd.and("ur.roleId", "in", roleList);
|
||||
}
|
||||
cnd.and("ex.year", "=", year);
|
||||
cnd.groupBy("club.id");
|
||||
cnd.asc("clubCode");
|
||||
|
||||
sql.setCondition(cnd);
|
||||
return listMap(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysClub doAdd(SysClub club, List<NutMap> managePerson) {
|
||||
club.setDismiss(false);
|
||||
club.setUserId(SecurityUtil.getUserId());
|
||||
club.setCreateTime(DateUtil.now());
|
||||
|
||||
SysClub sysClub = dao().insertWith(club, "sponsors");
|
||||
if(ObjectUtil.isNotEmpty(managePerson)){
|
||||
List<ClubUser> clubUsers = managePerson.stream().map(person -> {
|
||||
ClubUser clubUser = new ClubUser();
|
||||
clubUser.setClubId(club.getId());
|
||||
clubUser.setRoleCode(person.getString("roleCode"));
|
||||
clubUser.setUserId(person.getString("userId"));
|
||||
return clubUser;
|
||||
}).toList();
|
||||
dao().insert(clubUsers);
|
||||
}
|
||||
return sysClub;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysClub doEdit(SysClub club, List<String> deleteIds, List<NutMap> managePerson) {
|
||||
dao().update(club);
|
||||
dao().clear(SysClubSponsor.class, Cnd.where("clubId", "=", club.getId()));
|
||||
dao().insertLinks(club, "sponsors");
|
||||
|
||||
//if (!Objects.equals(club.getState(), ClubRegistAuditState.SCHOOL_PASS)) {
|
||||
//插入新建社团时填入的理事机构
|
||||
// List<SysClubUser> users = dao().query(SysClubUser.class, Cnd.NEW().andEX("id", "in", deleteIds));
|
||||
// List<String> idList = users.stream().map(SysClubUser::getUserId).collect(Collectors.toList());
|
||||
// List<String> roleList = commonService.findUserRoleByRoleCode(List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name()));
|
||||
// if (Lang.isNotEmpty(deleteIds)) {
|
||||
// dao().clear(SysClubUser.class, Cnd.where("id", "in", deleteIds));
|
||||
// }
|
||||
dao().clear(Sys_user_role.class, Cnd.where("clubId", "=", club.getId()));
|
||||
dao().clear(ClubUser.class, Cnd.where(ClubUser::getClubId, "=", club.getId()));
|
||||
|
||||
if (ObjectUtil.isNotEmpty(managePerson)) {
|
||||
List<ClubUser> clubUsers = managePerson.stream().map(person -> {
|
||||
ClubUser clubUser = new ClubUser();
|
||||
clubUser.setClubId(club.getId());
|
||||
clubUser.setRoleCode(person.getString("roleCode"));
|
||||
clubUser.setUserId(person.getString("userId"));
|
||||
return clubUser;
|
||||
}).toList();
|
||||
dao().insert(clubUsers);
|
||||
}
|
||||
|
||||
// List<SysClubUser> clubUsers = new ArrayList<>();
|
||||
// managePerson.forEach(item -> {
|
||||
// SysClubUser cUser = new SysClubUser();
|
||||
// SysClubUser fetch = dao().fetch(SysClubUser.class, Cnd.where("clubId", "=", club.getId()).and("userId", "=", item.getString("userId")));
|
||||
// if (fetch != null) {
|
||||
// cUser = fetch;
|
||||
// cUser.setUserId(item.getString("userId"));
|
||||
// cUser.setRoleCode(item.getString("roleCode"));
|
||||
// } else {
|
||||
// cUser.setClubId(club.getId());
|
||||
// cUser.setUserId(item.getString("userId"));
|
||||
// cUser.setJoinTime(DateUtil.now());
|
||||
// cUser.setRoleCode(item.getString("roleCode"));
|
||||
// cUser.setPayed(true);
|
||||
// cUser.setStatus(5);
|
||||
// cUser.setGiveMoney(true);
|
||||
// cUser.setIsNormal(true);
|
||||
// }
|
||||
// clubUsers.add(cUser);
|
||||
// dao().insertOrUpdate(cUser);
|
||||
// });
|
||||
return club;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubRegisterPageVo> minePageData(ClubUserPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
club.*,
|
||||
u.username AS concatPersonName,
|
||||
dict.name as typeName,
|
||||
( select GROUP_CONCAT(username) from `vw_user` where id in (select sponsorId from sys_club_sponsor where clubId = club.id) ) as sponsorName,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeCode,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
nd.nodeType AS processInstanceTaskNodeType,
|
||||
(
|
||||
SELECT
|
||||
count( 1 ) > 0
|
||||
FROM
|
||||
bpm_process_task
|
||||
WHERE
|
||||
prevTaskId = ( SELECT id FROM bpm_process_task WHERE processInstanceId = inst.id AND processTaskNodeCode IN ( 10, 40, 70 ) ORDER BY createdAt DESC LIMIT 1 )
|
||||
AND taskStatus = 'COMPELTE'
|
||||
) AS nextTaskIsComplete
|
||||
FROM
|
||||
sys_club club
|
||||
LEFT JOIN sys_dict dict ON dict.CODE = club.clubType
|
||||
LEFT JOIN sys_user u ON u.id = club.concatPerson
|
||||
LEFT JOIN bpm_process_instance inst ON inst.processInstanceBusinessId = club.id
|
||||
LEFT JOIN bpm_process_node_define nd ON nd.id = inst.processInstanceNodeId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.andEX("club.clubName", "like", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
cnd.andEX("year(club.createTime)", "=", pageForm.getYear());
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
cnd.and("club.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
cnd.groupBy("club.id");
|
||||
cnd.desc("createTime");
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubRegisterPageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubRegisterPageVo> schoolLeaderAuditPageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("nd.nodeCode", "=", 20);
|
||||
Sql sql = generateSql(pageForm, cnd);
|
||||
return listPageVO(pageForm, sql, ClubRegisterPageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubRegisterPageVo> schoolReplyPageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("nd.nodeCode", "=", 50);
|
||||
Sql sql = generateSql(pageForm, cnd);
|
||||
return listPageVO(pageForm, sql, ClubRegisterPageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubRegisterPageVo> clubConfirmPageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("nd.nodeCode", "=", 80);
|
||||
Sql sql = generateSql(pageForm, cnd);
|
||||
return listPageVO(pageForm, sql, ClubRegisterPageVo.class);
|
||||
}
|
||||
|
||||
private Sql generateSql(ClubUserPageForm pageForm, Cnd cnd) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
club.*,
|
||||
u.username AS concatPersonName,
|
||||
dict.name as typeName,
|
||||
( select GROUP_CONCAT(username) from `vw_user` where id in (select sponsorId from sys_club_sponsor where clubId = club.id) ) as sponsorName,
|
||||
inst.id processInstanceId,
|
||||
inst.processInstanceNodeId,
|
||||
inst.processInstanceNodeName,
|
||||
inst.processInstanceTaskIds,
|
||||
inst.processInstanceStatus,
|
||||
task.id processInstanceTaskId,
|
||||
task.taskStatus processInstanceTaskStatus,
|
||||
COUNT(nt.id) OVER (PARTITION BY task.id) > 0 AS nextTaskIsComplete
|
||||
FROM
|
||||
bpm_process_task task
|
||||
INNER JOIN bpm_process_node_define nd ON nd.id = task.processTaskNodeId
|
||||
INNER JOIN bpm_process_instance inst ON inst.id = task.processInstanceId
|
||||
INNER JOIN sys_club club ON club.id = inst.processInstanceBusinessId
|
||||
LEFT JOIN bpm_process_task nt ON nt.prevTaskId = task.id AND nt.taskStatus = 'COMPLETE'
|
||||
LEFT JOIN sys_dict dict ON dict.CODE = club.clubType
|
||||
LEFT JOIN sys_user u ON u.id = club.concatPerson
|
||||
$condition
|
||||
""");
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.andEX("club.clubName", "like", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
cnd.andEX("year(club.createTime)", "=", pageForm.getYear());
|
||||
|
||||
/*if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("club.userId", "=", SecurityUtil.getUserId());
|
||||
}*/
|
||||
|
||||
if (pageForm.getAudit()) {
|
||||
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.COMPLETE);
|
||||
} else {
|
||||
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.ACTIVE);
|
||||
}
|
||||
|
||||
cnd.groupBy("club.id");
|
||||
cnd.desc("createTime");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
package com.budwk.app.zhgh.club.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUserBackHistory;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubUserService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubUserCommonPageVo;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/7 15:36
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class SysClubUserServiceImpl extends BaseServiceImpl<SysClubUser> implements SysClubUserService {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
public SysClubUserServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> getClubUser(String clubId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
scu.*,
|
||||
u.username as userName,
|
||||
u.loginname as loginName,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
u.userState,
|
||||
unit.`name` unitName
|
||||
FROM
|
||||
club_user scu
|
||||
LEFT JOIN sys_user u ON scu.userId = u.id
|
||||
LEFT JOIN sys_unit unit ON u.unitid = unit.id
|
||||
WHERE scu.clubId = @clubId
|
||||
ORDER BY FIELD( scu.roleCode, 'CLUB_PRESIDENT', 'CLUB_VICE_PRESIDENT', 'CLUB_SECRETARY', 'CLUB_VICE_SECRETARY', 'CLUB_MEMBER' )
|
||||
""").setParam("clubId", clubId);
|
||||
return listMap(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubUserCommonPageVo> pageDataByApplyJoinClubAudit(ClubUserPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
scu.*,
|
||||
u.username as userName,
|
||||
u.loginname as loginName,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
u.userState,
|
||||
u.birthday,
|
||||
u.unionname as unionName,
|
||||
u.unitname as unitName,
|
||||
club.clubName,
|
||||
club.clubCode,
|
||||
u.personType personType
|
||||
FROM
|
||||
club_user scu
|
||||
LEFT JOIN sys_club club ON scu.clubId = club.id
|
||||
LEFT JOIN `vw_user` u ON scu.userId = u.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("u.username", "is not", null);
|
||||
cnd.and("roleCode", "=", RoleConstant.CLUB_MEMBER.name());
|
||||
cnd.and("isNormal", "=", true);
|
||||
cnd.andEX("scu.clubId", "=", pageForm.getClubId());
|
||||
cnd.andEX("u.personType", "=", pageForm.getPersonType());
|
||||
cnd.andEX("u.userState", "=", pageForm.getUserState());
|
||||
cnd.andEX("u.unitId", "=", pageForm.getUnitId());
|
||||
int status = pageForm.getSource() == 1 ? 1 : 3;
|
||||
// if (pageForm.getAuditType() == 1) {
|
||||
// if (AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
// cnd.and(pageForm.getApplyType() == 1 ? "scu.status" : "scu.exitStatus", ">=", status);
|
||||
// } else {
|
||||
// cnd.and(pageForm.getApplyType() == 1 ? "scu.status" : "scu.exitStatus", ">", status).and(new Static("JSON_CONTAINS(%s, JSON_OBJECT('auditUser', '%s'))"
|
||||
// .formatted((pageForm.getApplyType() == 1 ? "auditList" : "exitAuditList"), SecurityUtil.getUserId())));
|
||||
// }
|
||||
// }
|
||||
// if (pageForm.getAuditType() == 2) {
|
||||
// if (AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
// cnd.and(pageForm.getApplyType() == 1 ? "scu.status" : "scu.exitStatus", ">", status);
|
||||
// } else {
|
||||
// cnd.and(pageForm.getApplyType() == 1 ? "scu.status" : "scu.exitStatus", ">", status).and(new Static("JSON_CONTAINS(%s, JSON_OBJECT('auditUser', '%s'))"
|
||||
// .formatted((pageForm.getApplyType() == 1 ? "auditList" : "exitAuditList"), SecurityUtil.getUserId())));
|
||||
// }
|
||||
// }
|
||||
// if (pageForm.getAuditType() == 3) {
|
||||
// cnd.and(pageForm.getApplyType() == 1 ? "scu.status" : "scu.exitStatus", "=", status);
|
||||
// }
|
||||
// if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
// List<SysClub> myManageClub = sysClubService.getMyManageClub();
|
||||
// List<String> clubIdList = myManageClub.stream().map(SysClub::getId).toList();
|
||||
// cnd.and("scu.clubId", "in", clubIdList);
|
||||
// }
|
||||
// if (Strings.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
// cnd.and(Cnd.exps("loginname", "like", "%" + pageForm.getSearchKeyword() + "%").or("username", "like", "%" + pageForm.getSearchKeyword() + "%"));
|
||||
// }
|
||||
// if (Strings.isNotBlank(pageForm.getPageOrderName()) && Strings.isNotBlank(pageForm.getPageOrderBy())) {
|
||||
// cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
// } else {
|
||||
// cnd.asc("club.clubCode");
|
||||
// }
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubUserCommonPageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void doAudit(@Valid String[] ids,
|
||||
@Valid Boolean auditResult,
|
||||
@Valid Integer auditType,
|
||||
@Valid Integer applyType,
|
||||
@Valid Boolean payed) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.where().andInStrArray("id", ids);
|
||||
int status = 0;
|
||||
if (auditType == 1) {
|
||||
status = auditResult ? 5 : 2;
|
||||
} else if (auditType == 2) {
|
||||
status = auditResult ? 5 : 4;
|
||||
}
|
||||
List<NutMap> auditList = new ArrayList<>();
|
||||
auditList.add(NutMap.NEW().addv("auditUser", SecurityUtil.getUserId()).addv("auditState", auditResult)
|
||||
.addv("auditTime", DateUtil.now()).addv("auditType", auditType == 1 ? "club" : "school"));
|
||||
if(applyType == 1) {
|
||||
update(Chain.make("status", status).add("payed", payed).add("auditList", auditList), cnd);
|
||||
//备份会员
|
||||
List<SysClubUserBackHistory> list = new ArrayList<>();
|
||||
for (String id : ids) {
|
||||
SysClubUser sysClubUser = fetch(id);
|
||||
SysClubUserBackHistory backHistory = new SysClubUserBackHistory();
|
||||
backHistory.setUserId(sysClubUser.getUserId());
|
||||
backHistory.setClubId(sysClubUser.getClubId());
|
||||
backHistory.setBTime(cn.hutool.core.date.DateUtil.now());
|
||||
backHistory.setRoleCode(sysClubUser.getRoleCode());
|
||||
list.add(backHistory);
|
||||
}
|
||||
dao().insert(list);
|
||||
} else {
|
||||
Chain exitStatus = Chain.make("exitStatus", status).add("exitAuditList", auditList);
|
||||
if(status == 5) {
|
||||
exitStatus.add("isNormal", false);
|
||||
}
|
||||
update(exitStatus, cnd);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClubLeader(String clubId) {
|
||||
|
||||
List<Sys_user> userList = commonService.findUserInfoByRoleCode("clubId", clubId, RoleConstant.CLUB_PRESIDENT.name());
|
||||
return userList.stream().map(Sys_user::getLoginname).collect(Collectors.joining(","));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.budwk.app.zhgh.club.vo;
|
||||
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ClubCommonPageVo extends SysClub {
|
||||
|
||||
private List<NutMap> clubUser;
|
||||
private String typeName;
|
||||
private String concatPersonName;
|
||||
private String sponsorName;
|
||||
private Integer currentPeopleNum;
|
||||
private String sponsor;
|
||||
private String userName;
|
||||
private Integer currentNum;
|
||||
private Integer workNum;
|
||||
private Integer retireNum;
|
||||
private Integer status;
|
||||
private Integer exitStatus;
|
||||
private String clubLeader;
|
||||
|
||||
@ApiModelProperty("秘书长")
|
||||
private String clubSecretary;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.budwk.app.zhgh.club.vo;
|
||||
|
||||
import com.budwk.app.bpm.vo.BpmTaskApprovalVo;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ClubEvaluatePageVo extends BpmTaskApprovalVo {
|
||||
|
||||
private String id;
|
||||
private String year;
|
||||
private String clubId;
|
||||
private String clubName;
|
||||
private String clubCode;
|
||||
private String foundTime;
|
||||
private String typeName;
|
||||
private Date applyTime;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.budwk.app.zhgh.club.vo;
|
||||
|
||||
import com.budwk.app.bpm.vo.BpmTaskApprovalRecordVo;
|
||||
import com.budwk.app.zhgh.club.model.SysClubEvaluate;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ClubEvaluateVo extends SysClubEvaluate {
|
||||
|
||||
@ApiModelProperty("节点审批记录")
|
||||
private List<BpmTaskApprovalRecordVo> nodeTasks;
|
||||
private String clubName;
|
||||
private String clubCode;
|
||||
private String createTime;
|
||||
private String typeName;
|
||||
private String foundTime;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.budwk.app.zhgh.club.vo;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.bpm.vo.BpmTaskApprovalVo;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ClubExaminePageVo extends BpmTaskApprovalVo {
|
||||
|
||||
private String id;
|
||||
private String year;
|
||||
private String clubId;
|
||||
private String clubName;
|
||||
private String foundTime;
|
||||
private String registerDate;
|
||||
private String typeName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.budwk.app.zhgh.club.vo;
|
||||
|
||||
import com.budwk.app.bpm.vo.BpmTaskApprovalRecordVo;
|
||||
import com.budwk.app.zhgh.club.model.SysClubExamineRegister;
|
||||
import com.budwk.app.zhgh.club.model.SysClubExamineRegisterDetailed;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ClubExamineVo extends SysClubExamineRegister {
|
||||
|
||||
private String concatPersonName;
|
||||
private String concatPersonMobile;
|
||||
private String typeName;
|
||||
@ApiModelProperty("节点审批记录")
|
||||
private List<BpmTaskApprovalRecordVo> nodeTasks;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.budwk.app.zhgh.club.vo;
|
||||
|
||||
import com.budwk.app.bpm.vo.BpmTaskApprovalVo;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ClubRegisterPageVo extends BpmTaskApprovalVo {
|
||||
|
||||
private String id;
|
||||
private String clubCode;
|
||||
private String clubName;
|
||||
private String clubType;
|
||||
private String concatPerson;
|
||||
private String concatPersonMobile;
|
||||
private String concatPersonName;
|
||||
private String createTime;
|
||||
private String createdAt;
|
||||
private String createdBy;
|
||||
private String dismiss;
|
||||
private String foundTime;
|
||||
private String sponsorName;
|
||||
private String typeName;
|
||||
private String userId;
|
||||
private String sponsor;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.budwk.app.zhgh.club.vo;
|
||||
|
||||
import com.budwk.app.bpm.vo.BpmTaskApprovalRecordVo;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ClubRegisterVo extends SysClub {
|
||||
|
||||
@ApiModelProperty("节点审批记录")
|
||||
private List<BpmTaskApprovalRecordVo> nodeTasks;
|
||||
|
||||
private List<NutMap> clubUser;
|
||||
private String typeName;
|
||||
private String concatPersonName;
|
||||
private String sponsorName;
|
||||
private Integer currentPeopleNum;
|
||||
private String sponsor;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.budwk.app.zhgh.club.vo;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ClubUserCommonPageVo extends SysClubUser {
|
||||
|
||||
private String clubName;
|
||||
private String clubCode;
|
||||
private String typeName;
|
||||
private String userName;
|
||||
private List<JSONObject> replaceReport;
|
||||
private List<JSONObject> rulesFile;
|
||||
private List<JSONObject> afterRulesFile;
|
||||
private List<JSONObject> establishReport;
|
||||
private String loginName;
|
||||
private String sex;
|
||||
private String personType;
|
||||
private String userState;
|
||||
private String unitId;
|
||||
private String mobile;
|
||||
private String unitName;
|
||||
private String unionName;
|
||||
private String birthday;
|
||||
private String unionId;
|
||||
|
||||
private String roleName;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.budwk.app.zhgh.club.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @ClassName ClubUserImportVo
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2024/12/31 下午5:01
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode
|
||||
@ContentRowHeight(20) // 内容行高
|
||||
@HeadRowHeight(20) // 表头行高
|
||||
@ColumnWidth(25) //列宽
|
||||
public class ClubUserImportVo {
|
||||
|
||||
@ExcelProperty("工号")
|
||||
private String loginname;
|
||||
|
||||
@ExcelProperty("姓名")
|
||||
private String username;
|
||||
|
||||
@ExcelProperty("协会职务")
|
||||
private String clubPosition;
|
||||
|
||||
@ExcelIgnore
|
||||
private String errorInfo;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.budwk.app.zhgh.club.vo;
|
||||
|
||||
import com.budwk.app.bpm.vo.BpmTaskApprovalVo;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ClubUserJoinPageVo extends BpmTaskApprovalVo {
|
||||
|
||||
private String id;
|
||||
|
||||
private String clubId;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String roleCode;
|
||||
|
||||
private Boolean mode;
|
||||
|
||||
private String clubPosition;
|
||||
|
||||
private String email;
|
||||
|
||||
private String avatar;
|
||||
|
||||
private String sameTimeJoinOtherClubSituation;
|
||||
|
||||
private String awardsExperience;
|
||||
|
||||
private Date applyDate;
|
||||
|
||||
private String clubName;
|
||||
|
||||
private String loginName;
|
||||
|
||||
private String userName;
|
||||
|
||||
private String unitName;
|
||||
|
||||
private String unionName;
|
||||
|
||||
private String sex;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.budwk.app.zhgh.club.vo;
|
||||
|
||||
import com.budwk.app.bpm.vo.BpmTaskApprovalRecordVo;
|
||||
import com.budwk.app.zhgh.club.model.ClubUserApply;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ClubUserJoinVo extends ClubUserApply {
|
||||
|
||||
private String loginName;
|
||||
|
||||
private String userName;
|
||||
|
||||
private String unitName;
|
||||
|
||||
private String unionName;
|
||||
|
||||
private String sex;
|
||||
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("节点审批记录")
|
||||
private List<BpmTaskApprovalRecordVo> nodeTasks;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user