first commit
This commit is contained in:
+104
@@ -0,0 +1,104 @@
|
||||
package com.budwk.app.zhgh.club.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
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.dao.Cnd;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.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;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/7 10:14
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/join/list")
|
||||
public class ClubUserClubListController {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/join/list/index.html")
|
||||
@SaCheckPermission("club.join.list")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.join.list")
|
||||
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.join.list")
|
||||
public Result getCount() {
|
||||
// 获取所有协会
|
||||
List<SysClub> list = sysClubService.query();
|
||||
// 获取审核通过的
|
||||
List<ProcessInstance> instanceList = sysClubService.dao().query(
|
||||
ProcessInstance.class,
|
||||
Cnd.where(ProcessInstance::getBusinessNo, "in", list.stream().map(SysClub::getId).toList())
|
||||
.and(ProcessInstance::getState, "=", ProcessInstanceStateEnum.FINISHED.getCode())
|
||||
);
|
||||
// 获取id
|
||||
List<String> passList = instanceList.stream().map(ProcessInstance::getBusinessNo).toList();
|
||||
|
||||
int hasJoinCount = sysClubService.count(Cnd.NEW().and("dismiss", "=", false)
|
||||
.and("id", "in", passList)
|
||||
.and(new Static("id in (SELECT clubId from club_user WHERE userId = '%s')".formatted(SecurityUtil.getUserId()))));
|
||||
|
||||
int noJoinCount = sysClubService.count(Cnd.NEW().and("dismiss", "=", false)
|
||||
.and("id", "in", passList)
|
||||
.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.join.list")
|
||||
public Result findOne(@Valid String id) {
|
||||
ClubRegisterVo clubRegisterVo = sysClubService.findOne(id);
|
||||
return Result.success(clubRegisterVo);
|
||||
}
|
||||
}
|
||||
+185
@@ -0,0 +1,185 @@
|
||||
package com.budwk.app.zhgh.club.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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.enums.BpmProcessInstanceStatusEnum;
|
||||
import com.budwk.app.bpm.models.BpmProcessInstance;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
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 com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
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 org.nutz.mvc.annotation.Param;
|
||||
|
||||
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 SysMsgService sysMsgService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("/")
|
||||
@SaCheckPermission("club.join.apply")
|
||||
@Ok("beetl:/platform/zhgh/club/join/apply/index.html")
|
||||
public void index() {}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.club.join.apply")
|
||||
@Ok("beetl:/platform/zhghh5/club/apply/index.html")
|
||||
public void h5Index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("详情")
|
||||
@SaCheckPermission(value = {"club.join.apply", "h5.club.join.apply"}, mode = SaMode.OR)
|
||||
public Result info(@Valid String id) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
cua.*,
|
||||
club.clubName,
|
||||
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 sys_club club ON club.id = cua.clubId
|
||||
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);
|
||||
return Result.success(sql.getResult());
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("保存申请")
|
||||
@SaCheckPermission(value = {"club.join.apply", "h5.club.join.apply"}, mode = SaMode.OR)
|
||||
@SLog(tag = "协会管理系统-申请入会", msg = "保存协会入会")
|
||||
public Result save(@Param("data") ClubUserApply clubUserApply) {
|
||||
clubUserApply.setRoleCode(RoleConstant.CLUB_MEMBER.name());
|
||||
clubUserApply.setMode(true);
|
||||
clubUserApply.setApplyDate(new Date());
|
||||
dao.insertOrUpdate(clubUserApply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("提交")
|
||||
@SaCheckPermission(value = {"club.join.apply", "h5.club.join.apply"}, mode = SaMode.OR)
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "协会管理系统-申请入会", msg = "申请协会入会")
|
||||
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())) {
|
||||
ProcessInstance processInstance = dao.fetch(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "=", userApply.getId()));
|
||||
if (!List.of(ProcessInstanceStateEnum.REJECT.getCode(),ProcessInstanceStateEnum.FINISHED.getCode()).contains(processInstance.getState())) {
|
||||
return Result.error("您有该协会的申请记录尚未完成,请到我的申请里查看!");
|
||||
}
|
||||
}
|
||||
|
||||
clubUserApply.setRoleCode(RoleConstant.CLUB_MEMBER.name());
|
||||
clubUserApply.setMode(true);
|
||||
clubUserApply.setApplyDate(new Date());
|
||||
dao.insertOrUpdate(clubUserApply);
|
||||
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, clubUserApply);
|
||||
args.set("clubId", clubUserApply.getClubId());
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("XHRH", clubUserApply.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("重新提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission(value = {"club.join.apply", "h5.club.join.apply"}, mode = SaMode.OR)
|
||||
public Result submitAgain(@Param("data") ClubUserApply clubUserApply, @Param("taskId") Long taskId) {
|
||||
dao.insertOrUpdate(clubUserApply);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
dict.set("clubId", clubUserApply.getClubId());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("校验是否申请过协会")
|
||||
@SaCheckPermission(value = {"club.join.apply", "h5.club.join.apply"}, mode = SaMode.OR)
|
||||
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(99, "请勿重复申请!");
|
||||
}
|
||||
|
||||
ProcessInstance processInstance = dao.fetch(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "=", userApply.getId()));
|
||||
if (!List.of(ProcessInstanceStateEnum.REJECT.getCode(),ProcessInstanceStateEnum.FINISHED.getCode()).contains(processInstance.getState())) {
|
||||
return Result.error(99, "您有该协会的申请记录尚未完成,请到我的申请里查看!");
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+132
@@ -0,0 +1,132 @@
|
||||
package com.budwk.app.zhgh.club.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
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.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.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.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.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 ClubUserJoinService clubUserJoinService;
|
||||
|
||||
@At("/")
|
||||
@SaCheckPermission("club.join.clubApproval")
|
||||
@Ok("beetl:/platform/zhgh/club/join/clubApproval/index.html")
|
||||
public void index() {}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.club.join.clubApproval")
|
||||
@Ok("beetl:/platform/zhghh5/club/clubApproval/index.html")
|
||||
public void h5Index() {}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"club.join.clubApproval", "h5.club.join.clubApproval"}, mode = SaMode.OR)
|
||||
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,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN club_user_apply info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
LEFT JOIN sys_club club ON club.id = info.clubId
|
||||
LEFT JOIN vw_user u on u.id = info.userId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
cnd.and("t.taskName", "=", "1625a683-3890-4788-95b7-cab8240f6731");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
cnd.andEX("YEAR(info.applyDate)","=",pageForm.getYear());
|
||||
cnd.andEX("u.unionId","=",pageForm.getUnionId());
|
||||
cnd.andEX("u.unitId","=",pageForm.getUnitId());
|
||||
|
||||
if (StrUtil.isAllNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("u.userName", pageForm.getSearchKeyword());
|
||||
seg.orLike("u.loginName", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.applyDate");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
|
||||
sql.setCondition(cnd);
|
||||
Pagination<ClubUserJoinPageVo> pageVO = clubUserJoinService.listPageVO(pageForm, sql, ClubUserJoinPageVo.class);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
package com.budwk.app.zhgh.club.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.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.flow.engine.FlowEngine;
|
||||
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 com.budwk.app.zhgh.club.service.ClubUserJoinService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubUserJoinVo;
|
||||
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 org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/club/join/mine")
|
||||
@Ok("json:full")
|
||||
public class ClubUserJoinMineController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private ClubUserJoinService clubUserJoinService;
|
||||
|
||||
@At("/")
|
||||
@SaCheckPermission("club.join.mine")
|
||||
@Ok("beetl:/platform/zhgh/club/join/mine/index.html")
|
||||
public void index() {}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.club.join.mine")
|
||||
@Ok("beetl:/platform/zhghh5/club/mine/index.html")
|
||||
public void h5Index() {}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"club.join.mine", "h5.club.join.mine"}, mode = SaMode.OR)
|
||||
public Result pageData(@Valid PageForm pageForm,
|
||||
@Param("year") Integer year){
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
club.clubName,
|
||||
u.loginname as loginName,
|
||||
u.username as userName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask') AS startTaskId
|
||||
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 `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
cnd.andEX("year(info.applyDate)", "=", year);
|
||||
cnd.groupBy("info.id");
|
||||
cnd.desc("info.applyDate");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = clubUserJoinService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"club.join.mine", "h5.club.join.mine"}, mode = SaMode.OR)
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "协会管理系统-申请入会-我的申请", msg = "删除协会入会")
|
||||
public Result delete(@Valid String id) {
|
||||
dao.delete(ClubUserApply.class, id);
|
||||
dao.delete(ClubUser.class, id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("申请详情")
|
||||
@SaCheckLogin
|
||||
public Result info(@Valid String id) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
cua.*,
|
||||
club.clubName,
|
||||
u.loginname AS loginName,
|
||||
u.username AS userName,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
u.unitName,
|
||||
u.unionName,
|
||||
u.technicalTitle,
|
||||
u.education,
|
||||
u.academicDegree,
|
||||
u.position
|
||||
FROM
|
||||
club_user_apply cua
|
||||
LEFT JOIN vw_user u ON u.id = cua.userId
|
||||
LEFT JOIN sys_club club ON club.id = cua.clubId
|
||||
WHERE cua.id = @id
|
||||
""");
|
||||
sql.setParam("id",id);
|
||||
ClubUserJoinVo clubUserJoinVo = clubUserJoinService.fetchVO(sql, ClubUserJoinVo.class);
|
||||
return Result.success(clubUserJoinVo);
|
||||
}
|
||||
}
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
package com.budwk.app.zhgh.club.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
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.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.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.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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/club/join/schoolUnionApproval")
|
||||
@Ok("json:full")
|
||||
public class ClubUserJoinSchoolApprovalController {
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
@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("/h5")
|
||||
@SaCheckPermission("h5.club.join.schoolUnionApproval")
|
||||
@Ok("beetl:/platform/zhghh5/club/schoolUnionApproval/index.html")
|
||||
public void h5Index() {}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"club.join.schoolUnionApproval", "h5.club.join.schoolUnionApproval"}, mode = SaMode.OR)
|
||||
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,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN club_user_apply info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
LEFT JOIN sys_club club ON club.id = info.clubId
|
||||
LEFT JOIN vw_user u on u.id = info.userId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
cnd.and("t.taskName", "=", "6af3b155-60db-47f4-a418-c72e8333f5b4");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
cnd.andEX("YEAR(info.applyDate)", "=", pageForm.getYear());
|
||||
cnd.andEX("u.unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("u.unitId", "=", pageForm.getUnitId());
|
||||
|
||||
if (StrUtil.isAllNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("u.userName", pageForm.getSearchKeyword());
|
||||
seg.orLike("u.loginName", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.applyDate");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
|
||||
sql.setCondition(cnd);
|
||||
Pagination<ClubUserJoinPageVo> pageVO = clubUserJoinService.listPageVO(pageForm, sql, ClubUserJoinPageVo.class);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
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.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubUserService;
|
||||
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.lang.util.NutMap;
|
||||
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 SysClubUserService clubUserService;
|
||||
|
||||
@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<ClubUser> query = dao.query(ClubUser.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).groupBy("clubId"));
|
||||
if (Lang.isEmpty(query)) {
|
||||
return Result.success();
|
||||
}
|
||||
List<String> clubIds = query.stream().map(ClubUser::getClubId).toList();
|
||||
|
||||
List<ProcessInstance> processInstance = dao.query(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "in", clubIds));
|
||||
List<ProcessInstance> instanceList = processInstance.stream().filter(o -> o.getState().equals(ProcessInstanceStateEnum.FINISHED.getCode())).toList();
|
||||
List<String> list = instanceList.stream().map(ProcessInstance::getBusinessNo).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 JSON_CONTAINS(presidentCu.roleCode, '"CLUB_PRESIDENT"')
|
||||
LEFT JOIN sys_user presidentUser ON presidentUser.id = presidentCu.userId
|
||||
LEFT JOIN club_user secretaryCu ON secretaryCu.clubId = club.id AND JSON_CONTAINS(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", list);
|
||||
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) {
|
||||
List<NutMap> clubUser = clubUserService.getClubUser(clubId);
|
||||
return Result.success(clubUser);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.budwk.app.zhgh.club.controller.common;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.bpm.enums.BpmProcessInstanceStatusEnum;
|
||||
import com.budwk.app.bpm.enums.BpmProcessTaskStatusEnum;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
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.service.SysClubService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/club/common")
|
||||
@Ok("json:full")
|
||||
public class ClubCommonController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result listClub() {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.*
|
||||
FROM
|
||||
`sys_club` c
|
||||
LEFT JOIN wf_process_instance inst ON inst.businessNo = c.id
|
||||
WHERE
|
||||
inst.state = @state
|
||||
""").setParam("state", ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
List list = baseService.listVO(sql, SysClub.class);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result listClubByRole() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_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.id", "in", myClubId);
|
||||
}
|
||||
cnd.and("inst.state","=",ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
cnd.asc("c.clubCode");
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.*
|
||||
FROM
|
||||
`sys_club` c
|
||||
LEFT JOIN wf_process_instance inst ON inst.businessNo = c.id
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(cnd);
|
||||
List list = baseService.listVO(sql, SysClub.class);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
package com.budwk.app.zhgh.club.controller.evaluate;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.db.Db;
|
||||
import cn.hutool.db.ds.DSFactory;
|
||||
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.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.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.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 com.budwk.app.zhgh.club.vo.ClubEvaluateVo;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.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 FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@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(tag = "协会管理系统-协会评优", msg = "保存协会评优申请")
|
||||
public Result save(@Param("data") SysClubEvaluate evaluate) {
|
||||
evaluateService.dao().insertOrUpdate(evaluate);
|
||||
return Result.success(evaluate);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.evaluate.apply")
|
||||
@SLog(tag = "协会管理系统-协会评优", msg = "提交协会评优")
|
||||
public Result submit(@Valid @Param("data") SysClubEvaluate evaluate) {
|
||||
evaluateService.dao().insertOrUpdate(evaluate);
|
||||
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, evaluate);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("XHPY", evaluate.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
return Result.success(evaluate);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("重新提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.evaluate.apply")
|
||||
public Result submitAgain(@Param("data") SysClubEvaluate clubEvaluate, @Param("taskId") Long taskId) {
|
||||
evaluateService.dao().insertOrUpdate(clubEvaluate);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.evaluate")
|
||||
public Result info(@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 = evaluateService.fetchVO(sql, ClubEvaluateVo.class);
|
||||
return Result.success(clubEvaluateVo);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result getMyClubAndYearAuditPass(Integer year) {
|
||||
//List<NutMap> list = sysClubService.getMyClubAndYearAuditPass(year);
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.id
|
||||
FROM
|
||||
`sys_club` c
|
||||
LEFT JOIN wf_process_instance inst ON inst.businessNo = c.id
|
||||
WHERE
|
||||
inst.state = 20
|
||||
""");
|
||||
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(tag = "协会管理系统-协会评优", msg = "会长审核评优申请")
|
||||
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(tag = "协会管理系统-协会评优", msg = "会长撤回评优申请")
|
||||
public Result revoke(@Valid String taskId) {
|
||||
bpmService.revokeTask(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
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.flow.engine.FlowEngine;
|
||||
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 FlowEngine flowEngine;
|
||||
|
||||
@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(tag = "协会管理系统-协会评优", msg = "删除协会评优")
|
||||
public Result doDelete(@Valid String id) {
|
||||
sysClubEvaluateService.dao().delete(SysClubEvaluate.class, id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
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;
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.budwk.app.zhgh.club.controller.evaluate;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
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.SysClubEvaluateService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubEvaluatePageVo;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @ClassName ClubEvaluateSchoolLeaderAuditController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/12/9 17:11
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/evaluate/schoolLeaderAudit")
|
||||
public class ClubEvaluateSchoolLeaderAuditController {
|
||||
|
||||
@Inject
|
||||
private SysClubEvaluateService sysClubEvaluateService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/evaluate/schoolLeaderAudit/index.html")
|
||||
@SaCheckPermission("club.evaluate.schoolLeaderAudit")
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.evaluate.schoolLeaderAudit")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination<ClubEvaluatePageVo> pagination = sysClubEvaluateService.schoolLeaderAuditPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
+224
@@ -0,0 +1,224 @@
|
||||
package com.budwk.app.zhgh.club.controller.examine;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubExamineRegister;
|
||||
import com.budwk.app.zhgh.club.service.SysClubExamineService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.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 Dao dao;
|
||||
@Inject
|
||||
private SysClubExamineService sysClubExamineService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/examine/apply/index.html")
|
||||
@SaCheckPermission("club.examine.apply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result getCount(String id, Integer year) {
|
||||
if(StrUtil.isBlank(id)) {
|
||||
return Result.error("协会信息为空,请核查");
|
||||
}
|
||||
if(year == null) {
|
||||
return Result.error("年份信息为空,请核查");
|
||||
}
|
||||
List<SysClubExamineRegister> list = dao.query(SysClubExamineRegister.class, Cnd.where("clubId", "=", id).and("year(registerDate)", "=", year));
|
||||
List<ProcessInstance> instanceList = dao.query(
|
||||
ProcessInstance.class,
|
||||
Cnd.where(ProcessInstance::getBusinessNo, "in", list.stream().map(SysClubExamineRegister::getId).toList())
|
||||
.and(ProcessInstance::getState, "in", List.of(ProcessInstanceStateEnum.DOING.getCode(), ProcessInstanceStateEnum.FINISHED.getCode()))
|
||||
);
|
||||
return Result.success(instanceList.size());
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result getClubsByRole() {
|
||||
List<SysClub> myManageClub = sysClubService.getMyManageClub();
|
||||
return Result.success(myManageClub);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result getClubUserNum(String clubId) {
|
||||
if(StrUtil.isBlank(clubId)) {
|
||||
return Result.error("协会信息为空,请核查");
|
||||
}
|
||||
List<NutMap> result = sysClubExamineService.getClubUserNum(clubId);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result getJgUser(String clubId) {
|
||||
if(StrUtil.isBlank(clubId)) {
|
||||
return Result.error("协会信息为空,请核查");
|
||||
}
|
||||
List<NutMap> result = sysClubExamineService.getJgUser(clubId);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result getClubMemberMoney(String clubId) {
|
||||
if(StrUtil.isBlank(clubId)) {
|
||||
return Result.error("协会信息为空,请核查");
|
||||
}
|
||||
int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId));
|
||||
SysClub club = dao.fetch(SysClub.class, clubId);
|
||||
int money = count * (club.getDue() != null ? Integer.parseInt(club.getDue()) : 0);
|
||||
return Result.success(money);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
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
|
||||
@SaCheckLogin
|
||||
public Result getLasYearSurplus(String clubId) {
|
||||
if(StrUtil.isBlank(clubId)) {
|
||||
return Result.error("协会信息为空,请核查");
|
||||
}
|
||||
SysClubExamineRegister register = dao.fetch(SysClubExamineRegister.class, Cnd.where("clubId", "=", clubId)
|
||||
.and("YEAR(registerDate)", "=", DateUtil.thisYear() - 1));
|
||||
if (Lang.isNotEmpty(register)) {
|
||||
List<JSONObject> list = register.getIncomeCensus();
|
||||
float surplus = list.get(0).getFloat("surplus");
|
||||
return Result.success(surplus);
|
||||
}
|
||||
return Result.success(0);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.examine")
|
||||
public Result info(String id) {
|
||||
if(StrUtil.isBlank(id)) {
|
||||
return Result.error("id信息为空,请核查");
|
||||
}
|
||||
SysClubExamineRegister examineRegister = sysClubExamineService.fetch(id);
|
||||
sysClubExamineService.fetchLinks(examineRegister, "detailedList");
|
||||
return Result.success(examineRegister);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.examine.apply")
|
||||
@SLog(tag = "协会管理系统-协会年审", msg = "保存协会年审")
|
||||
public Result save(@Param("data") SysClubExamineRegister examineRegister,
|
||||
@Param("incomeDetailed") String incomeDetailed,
|
||||
@Param("incomeCensus") String incomeCensus) {
|
||||
if (StrUtil.isBlank(examineRegister.getId())) {
|
||||
sysClubExamineService.doAdd(examineRegister, incomeDetailed, incomeCensus);
|
||||
} else {
|
||||
sysClubExamineService.doEdit(examineRegister, incomeDetailed, incomeCensus);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.examine.apply")
|
||||
@SLog(tag = "协会管理系统-协会年审", msg = "提交协会年审")
|
||||
public Result submit(@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);
|
||||
}
|
||||
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, reg);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("XHNS", reg.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
|
||||
return Result.success(reg);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("重新提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.examine.apply")
|
||||
public Result submitAgain(@Param("data") SysClubExamineRegister examineRegister,
|
||||
@Param("incomeDetailed") String incomeDetailed,
|
||||
@Param("incomeCensus") String incomeCensus,
|
||||
@Param("taskId") Long taskId) {
|
||||
if (StrUtil.isBlank(examineRegister.getId())) {
|
||||
sysClubExamineService.doAdd(examineRegister, incomeDetailed, incomeCensus);
|
||||
} else {
|
||||
sysClubExamineService.doEdit(examineRegister, incomeDetailed, incomeCensus);
|
||||
}
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+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(tag = "协会管理系统-协会年审", msg = "会长审核年度考核")
|
||||
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(tag = "协会管理系统-协会年审", msg = "会长撤回年度考核")
|
||||
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);
|
||||
}
|
||||
}
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
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.flow.engine.FlowEngine;
|
||||
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 FlowEngine flowEngine;
|
||||
|
||||
@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(tag = "协会管理系统-协会年审", msg = "删除协会年审")
|
||||
public Result doDelete(@Valid String id) {
|
||||
sysClubExamineService.delete(id);
|
||||
sysClubExamineService.dao().clear(SysClubExamineRegisterDetailed.class, Cnd.where("registerId", "=", id));
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(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();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
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;
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.budwk.app.zhgh.club.controller.examine;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
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.SysClubExamineService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubExaminePageVo;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @ClassName ClubExamineSchoolLeaderAuditController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/12/9 17:01
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/examine/schoolLeaderAudit")
|
||||
public class ClubExamineSchoolLeaderAuditController {
|
||||
|
||||
@Inject
|
||||
private SysClubExamineService sysClubExamineService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/examine/schoolLeaderAudit/index.html")
|
||||
@SaCheckPermission("club.examine.schoolLeaderAudit")
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.examine.schoolLeaderAudit")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination<ClubExaminePageVo> pagination = sysClubExamineService.schoolLeaderAuditPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
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.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 com.budwk.app.zhgh.club.service.SysClubUserService;
|
||||
import com.budwk.app.zhgh.club.service.impl.SysClubUserServiceImpl;
|
||||
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.json.Json;
|
||||
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 11:19
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/infoManage/auditManager")
|
||||
public class ClubAuditManagerController {
|
||||
|
||||
@Inject
|
||||
private SysClubInfoManageService infoManageService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/infoManage/auditManager/index.html")
|
||||
@SaCheckPermission("club.infoManage.auditManager")
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.auditManager")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm,
|
||||
@Param(value = "approval") Boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
club.clubName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN sys_club_manager info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN sys_club club ON info.clubId = club.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("year(info.creatTime)", "=", pageForm.getYear());
|
||||
|
||||
cnd.and("t.taskName", "=", "ef81777f-22fb-4fe4-9800-909e6c681210");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.and("club.clubName", "LIKE", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.creatTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination pagination = infoManageService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> listMap = pagination.getList(NutMap.class);
|
||||
for (NutMap nutMap : listMap) {
|
||||
List<String> oldCodeList = Json.fromJsonAsList(String.class, nutMap.getString("oldRoleCode"));
|
||||
nutMap.put("oldRoleName", SysClubUserServiceImpl.convertRoleName(oldCodeList));
|
||||
List<String> nowCodeList = Json.fromJsonAsList(String.class, nutMap.getString("nowRoleCode"));
|
||||
nutMap.put("nowRoleName", SysClubUserServiceImpl.convertRoleName(nowCodeList));
|
||||
}
|
||||
pagination.setList(listMap);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
+193
@@ -0,0 +1,193 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubManager;
|
||||
import com.budwk.app.zhgh.club.model.SysClubRule;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
|
||||
import com.budwk.app.zhgh.club.service.impl.SysClubUserServiceImpl;
|
||||
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.json.Json;
|
||||
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;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @ClassName ClubChangeManagerController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/26 19:03
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/infoManage/change")
|
||||
public class ClubChangeManagerController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
@Inject
|
||||
private SysClubInfoManageService infoManageService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/infoManage/change/index.html")
|
||||
@SaCheckPermission("club.infoManage.change")
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.change")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
club.clubName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask') AS startTaskId
|
||||
FROM
|
||||
sys_club_manager info
|
||||
LEFT JOIN sys_club club ON club.id = info.clubId
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
cnd.andEX("year(info.creatTime)", "=", pageForm.getYear());
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.and("club.clubName", "LIKE", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.creatTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = infoManageService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> listMap = pagination.getList(NutMap.class);
|
||||
for (NutMap nutMap : listMap) {
|
||||
List<String> oldCodeList = Json.fromJsonAsList(String.class, nutMap.getString("oldRoleCode"));
|
||||
nutMap.put("oldRoleName", SysClubUserServiceImpl.convertRoleName(oldCodeList));
|
||||
List<String> nowCodeList = Json.fromJsonAsList(String.class, nutMap.getString("nowRoleCode"));
|
||||
nutMap.put("nowRoleName", SysClubUserServiceImpl.convertRoleName(nowCodeList));
|
||||
}
|
||||
pagination.setList(listMap);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.change")
|
||||
@SLog(tag = "协会管理系统-信息管理", msg = "提交变更理事机构")
|
||||
public Object submit(@Param("data") SysClubManager clubManager) {
|
||||
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where(ClubUser::getClubId, "=", clubManager.getClubId()).and(ClubUser::getUserId, "=", clubManager.getUserId()));
|
||||
clubManager.setUserId(SecurityUtil.getUserId());
|
||||
clubManager.setUserName(SecurityUtil.getUserUsername());
|
||||
clubManager.setOldRoleCode(clubUser.getRoleCode());
|
||||
if(StrUtil.isBlank(clubManager.getId())) clubManager.setCreatTime(DateUtil.now());
|
||||
dao.insertOrUpdate(clubManager);
|
||||
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, clubManager);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("XHBGLS", clubManager.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("重新提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.change")
|
||||
public Result submitAgain(@Param("data") SysClubManager clubManager, @Param("taskId") Long taskId) {
|
||||
dao.insertOrUpdate(clubManager);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.change")
|
||||
@SLog(tag = "协会管理系统-信息管理", msg = "删除变更理事机构")
|
||||
public Result delete(@Param("id") String id) {
|
||||
dao.delete(SysClubManager.class, id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.change")
|
||||
public Object queryClubUsers(@Param("clubId") String clubId) {
|
||||
List<ClubUser> listMap = dao.query(ClubUser.class, Cnd.where(ClubUser::getClubId, "=", clubId));
|
||||
List<String> list = listMap.stream().map(ClubUser::getUserId).toList();
|
||||
|
||||
List<Sys_user> userList = dao.query(Sys_user.class, Cnd.where(Sys_user::getId, "in", list));
|
||||
Map<String, String> userMap = userList.stream().collect(Collectors.toMap(Sys_user::getId, Sys_user::getUsername));
|
||||
|
||||
for (ClubUser clubUser : listMap) {
|
||||
clubUser.setUserName(userMap.get(clubUser.getUserId()));
|
||||
}
|
||||
return Result.success(listMap);
|
||||
}
|
||||
}
|
||||
+401
@@ -0,0 +1,401 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
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.easyexcel.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.activity.basic.models.ActivityUserScope;
|
||||
import com.budwk.app.zhgh.activity.trainSignUp.models.TrainSignUpActivity;
|
||||
import com.budwk.app.zhgh.activity.trainSignUp.models.TrainSignUpUser;
|
||||
import com.budwk.app.zhgh.activity.trainSignUp.models.TrainSignUpUserCourse;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
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.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.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/infoManage/manage")
|
||||
public class ClubInfoManageController {
|
||||
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
@Inject
|
||||
private SysClubUserService clubUserService;
|
||||
|
||||
@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(tag = "协会管理系统-信息管理", msg = "修改协会信息")
|
||||
public Result doSubmit(@Param("club") SysClub club) {
|
||||
clubInfoManageService.dao().update(club);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(tag = "协会管理系统-信息管理", msg = "修改缴费状态")
|
||||
public Result updatePayed(@Valid Boolean payed, @Valid String id) {
|
||||
clubInfoManageService.dao().update(ClubUser.class, Chain.make("payed", payed), Cnd.where("id", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(tag = "协会管理系统-信息管理", msg = "修改拨付状态")
|
||||
public Result updateGive(@Valid Boolean giveMoney, @Valid String id) {
|
||||
clubInfoManageService.dao().update(ClubUser.class, Chain.make("giveMoney", giveMoney), Cnd.where("id", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(tag = "协会管理系统-信息管理", msg = "退会")
|
||||
public Result exitClub(@Valid String id) {
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, id);
|
||||
dao.delete(ClubUser.class,id);
|
||||
List<String> roleCodes = clubUser.getRoleCode();
|
||||
for (String roleCode : roleCodes) {
|
||||
Sys_role sysRole = sysRoleService.getByCode(roleCode);
|
||||
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(tag = "协会管理系统-信息管理", msg = "删除协会成员")
|
||||
public Result userDelete(@Valid String id) {
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, id);
|
||||
dao.delete(ClubUser.class,id);
|
||||
List<String> roleCodes = clubUser.getRoleCode();
|
||||
for (String roleCode : roleCodes) {
|
||||
Sys_role sysRole = sysRoleService.getByCode(roleCode);
|
||||
if (ObjectUtil.isNotEmpty(sysRole)) {
|
||||
dao.clear(Sys_user_role.class, Cnd.NEW().and("userId", "=", clubUser.getUserId())
|
||||
.and("roleId", "=", sysRole.getId())
|
||||
.and("clubId", "=", clubUser.getClubId()));
|
||||
}
|
||||
}
|
||||
|
||||
/* 根据品牌活动,操作user_scope表 start */
|
||||
List<TrainSignUpActivity> list = dao.query(TrainSignUpActivity.class, Cnd.NEW());
|
||||
List<TrainSignUpActivity> activityList = new ArrayList<>();
|
||||
for (TrainSignUpActivity activity : list) {
|
||||
boolean host = Lang.isNotEmpty(activity.getHostUnits()) && activity.getHostUnits().contains(clubUser.getClubId());
|
||||
if(host) {
|
||||
activityList.add(activity);
|
||||
}
|
||||
}
|
||||
if(Lang.isNotEmpty(activityList)) {
|
||||
List<Integer> groupList = activityList.stream().map(TrainSignUpActivity::getActivityGroupId).distinct().toList();
|
||||
dao.clear(ActivityUserScope.class, Cnd.where("userId", "=", clubUser.getUserId()).and("groupId", "in", groupList));
|
||||
}
|
||||
/* 根据品牌活动,操作user_scope表 end */
|
||||
List<String> idList = activityList.stream().map(TrainSignUpActivity::getId).toList();
|
||||
dao.clear(TrainSignUpUser.class, Cnd.where("activityId", "in", idList).and("userId", "=", clubUser.getUserId()));
|
||||
dao.clear(TrainSignUpUserCourse.class, Cnd.where("activityId", "in", idList).and("userId", "=", clubUser.getUserId()));
|
||||
|
||||
|
||||
sysUserService.clearCache();
|
||||
sysRoleService.clearCache();
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(tag = "协会管理系统-信息管理", msg = "修改身份")
|
||||
public Result updateRoleCode(@Param("id") String id, @Valid String[] roleCodes, @Valid String clubId) {
|
||||
List<String> roleCodeList = Arrays.asList(roleCodes);
|
||||
//查询社团是否存在会长或者秘书长
|
||||
if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_PRESIDENT.name())) {
|
||||
int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||
.and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(RoleConstant.CLUB_PRESIDENT.name()))));
|
||||
if (count > 0) {
|
||||
// return Result.error("会长只能有一位");
|
||||
}
|
||||
}
|
||||
if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_SECRETARY.name())) {
|
||||
int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||
.and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(RoleConstant.CLUB_SECRETARY.name()))));
|
||||
if (count > 0) {
|
||||
// return Result.error("秘书长只能有一位");
|
||||
}
|
||||
}
|
||||
|
||||
ClubUser clubUser = clubInfoManageService.dao().fetch(ClubUser.class, id);
|
||||
|
||||
// 先清除所有的角色
|
||||
dao.clear(Sys_user_role.class, Cnd.where("userId", "=", clubUser.getUserId()).and("clubId", "=", clubUser.getClubId()));
|
||||
// 再根据传过来的赋值
|
||||
clubUser.setRoleCode(roleCodeList);
|
||||
dao.update(clubUser);
|
||||
// 设置角色
|
||||
List<Sys_user_role> roles = new ArrayList<>();
|
||||
for (String s : roleCodeList) {
|
||||
Sys_user_role ur = new Sys_user_role();
|
||||
ur.setUserId(clubUser.getUserId());
|
||||
ur.setClubId(clubUser.getClubId());
|
||||
Sys_role sRole = sysRoleService.getByCode(s);
|
||||
ur.setRoleId(sRole.getId());
|
||||
roles.add(ur);
|
||||
}
|
||||
dao.insert(roles);
|
||||
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 JSON_LENGTH(roleCode) = 1 AND JSON_CONTAINS(roleCode, '\"CLUB_MEMBER\"'))".formatted(clubId)));
|
||||
} 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(tag = "协会管理系统-信息管理", msg = "添加协会成员")
|
||||
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(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(roleCode))));
|
||||
if (count > 0) {
|
||||
return Result.error((Objects.equals(roleCode, RoleConstant.CLUB_PRESIDENT.name()) ? "会长" : "秘书长") + "只能有一位");
|
||||
}
|
||||
}
|
||||
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 sysUserRole = new Sys_user_role();
|
||||
sysUserRole.setUserId(user);
|
||||
sysUserRole.setRoleId(sysRole.getId());
|
||||
sysUserRole.setClubId(clubId);
|
||||
dao.insert(sysUserRole);
|
||||
sysUserService.clearCache();
|
||||
sysRoleService.clearCache();
|
||||
}
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where("clubId", "=", clubId).and("userId", "=", user));
|
||||
if(clubUser != null) {
|
||||
List<String> roleCodeList = clubUser.getRoleCode();
|
||||
if (List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name(), RoleConstant.CLUB_OPERATOR.name()).contains(roleCode)) {
|
||||
roleCodeList.remove(RoleConstant.CLUB_MEMBER.name());
|
||||
}
|
||||
if(!roleCodeList.contains(roleCode)) {
|
||||
roleCodeList.add(roleCode);
|
||||
}
|
||||
} else {
|
||||
clubUser = new ClubUser();
|
||||
clubUser.setClubId(clubId);
|
||||
clubUser.setUserId(user);
|
||||
clubUser.setRoleCode(List.of(roleCode));
|
||||
}
|
||||
dao.insertOrUpdate(clubUser);
|
||||
}
|
||||
|
||||
clubUserService.clubUser2Scope(clubId, Arrays.asList(users));
|
||||
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 = dao.query(View_user.class, Cnd.where("loginname", "in", loginNames));
|
||||
List<ClubUser> clubUsers = dao.query(ClubUser.class,Cnd.where("clubId", "=", businessId));
|
||||
|
||||
List<ClubUser> clubUserList = new ArrayList<>();
|
||||
if (isFlag) {
|
||||
dao.clear(ClubUser.class, 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.setUserId(user.getId());
|
||||
cUser.setClubId(businessId);
|
||||
cUser.setRoleCode(List.of(RoleConstant.CLUB_MEMBER.name()));
|
||||
clubUserList.add(cUser);
|
||||
}
|
||||
dao.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);
|
||||
});
|
||||
dao.insert(sysUserRoleList);
|
||||
|
||||
if(Lang.isNotEmpty(clubUserList)) {
|
||||
clubUserService.clubUser2Scope(businessId, clubUserList.stream().map(ClubUser::getUserId).toList());
|
||||
}
|
||||
|
||||
//如果有错误数据就返回给前端
|
||||
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("导入成功");
|
||||
}
|
||||
}
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubRefresh;
|
||||
import com.budwk.app.zhgh.club.model.SysClubRule;
|
||||
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 io.swagger.annotations.ApiOperation;
|
||||
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.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 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 FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@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) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
club.clubName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask') AS startTaskId
|
||||
FROM
|
||||
sys_club_refresh info
|
||||
LEFT JOIN sys_club club ON club.id = info.clubId
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
cnd.andEX("year(info.creatTime)", "=", pageForm.getYear());
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.and("club.clubName", "LIKE", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.creatTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = clubInfoManageService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.refreshReport")
|
||||
@SLog(tag = "协会管理系统-信息管理", msg = "提交换届报告")
|
||||
public Object submit(@Param("data") SysClubRefresh clubRefresh) {
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(StrUtil.isNotBlank(clubRefresh.getId())) {
|
||||
cnd.and(SysClubRefresh::getId, "!=", clubRefresh.getId());
|
||||
}
|
||||
List<SysClubRefresh> list = dao.query(SysClubRefresh.class, cnd);
|
||||
List<String> idList = list.stream().map(SysClubRefresh::getId).toList();
|
||||
int count = dao.count(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "in", idList).and(ProcessInstance::getState, "not in", List.of(ProcessInstanceStateEnum.FINISHED.getCode(), ProcessInstanceStateEnum.REJECT.getCode())));
|
||||
if (count > 0) {
|
||||
return Result.error("您有该协会的申请记录尚未完成,请核对!");
|
||||
}
|
||||
|
||||
SysClub club = clubInfoManageService.dao().fetch(SysClub.class, clubRefresh.getClubId());
|
||||
clubRefresh.setUserId(SecurityUtil.getUserId());
|
||||
clubRefresh.setUserName(SecurityUtil.getUserUsername());
|
||||
clubRefresh.setLastFiles(club.getReplaceReport());
|
||||
if(StrUtil.isBlank(clubRefresh.getId())) clubRefresh.setCreatTime(DateUtil.now());
|
||||
clubInfoManageService.dao().insertOrUpdate(clubRefresh);
|
||||
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, clubRefresh);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("XHHJBG", clubRefresh.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("重新提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.refreshReport")
|
||||
public Result submitAgain(@Param("data") SysClubRefresh clubRefresh, @Param("taskId") Long taskId) {
|
||||
clubInfoManageService.dao().insertOrUpdate(clubRefresh);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.refreshReport")
|
||||
@SLog(tag = "协会管理系统-信息管理", msg = "删除换届报告")
|
||||
public Result delete(@Param("id") String id) {
|
||||
clubInfoManageService.dao().delete(SysClubRefresh.class, id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+177
@@ -0,0 +1,177 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubRefresh;
|
||||
import com.budwk.app.zhgh.club.model.SysClubRule;
|
||||
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.staffbenefit.condolence.model.Condolence;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.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 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 FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@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) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
club.clubName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask') AS startTaskId
|
||||
FROM
|
||||
sys_club_rule info
|
||||
LEFT JOIN sys_club club ON club.id = info.clubId
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
cnd.andEX("year(info.creatTime)", "=", pageForm.getYear());
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.and("club.clubName", "LIKE", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.creatTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = clubInfoManageService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.ruleUpdate")
|
||||
@SLog(tag = "协会管理系统-信息管理", msg = "提交章程备案")
|
||||
public Object submit(@Param("data")SysClubRule clubRule) {
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(StrUtil.isNotBlank(clubRule.getId())) {
|
||||
cnd.and(SysClubRule::getId, "!=", clubRule.getId());
|
||||
}
|
||||
List<SysClubRule> list = dao.query(SysClubRule.class, cnd);
|
||||
List<String> idList = list.stream().map(SysClubRule::getId).toList();
|
||||
int count = dao.count(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "in", idList).and(ProcessInstance::getState, "not in", List.of(ProcessInstanceStateEnum.FINISHED.getCode(), ProcessInstanceStateEnum.REJECT.getCode())));
|
||||
if (count > 0) {
|
||||
return Result.error("您有该协会的申请记录尚未完成,请核对!");
|
||||
}
|
||||
|
||||
SysClub club = clubInfoManageService.dao().fetch(SysClub.class, clubRule.getClubId());
|
||||
clubRule.setUserId(SecurityUtil.getUserId());
|
||||
clubRule.setUserName(SecurityUtil.getUserUsername());
|
||||
clubRule.setLastFiles(club.getRulesFile());
|
||||
if(StrUtil.isBlank(clubRule.getId())) clubRule.setCreatTime(DateUtil.now());
|
||||
clubInfoManageService.dao().insertOrUpdate(clubRule);
|
||||
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, clubRule);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("XHZCXD", clubRule.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("重新提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.ruleUpdate")
|
||||
public Result submitAgain(@Param("data") SysClubRule clubRule, @Param("taskId") Long taskId) {
|
||||
clubInfoManageService.dao().insertOrUpdate(clubRule);
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.ruleUpdate")
|
||||
@SLog(tag = "协会管理系统-信息管理", msg = "删除章程备案")
|
||||
public Result delete(@Param("id") String id) {
|
||||
clubInfoManageService.dao().delete(SysClubRule.class, id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
|
||||
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.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 11:07
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/infoManage/schoolAuditReport")
|
||||
public class ClubSchoolAuditReportController {
|
||||
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
|
||||
@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,
|
||||
@Param(value = "approval") Boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
club.clubName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN sys_club_refresh info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN sys_club club ON info.clubId = club.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("year(info.creatTime)", "=", pageForm.getYear());
|
||||
|
||||
cnd.and("t.taskName", "=", "d4323546-8d09-419e-88d4-7b15862ca29d");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.and("club.clubName", "LIKE", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.creatTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination pagination = clubInfoManageService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
|
||||
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.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 10:41
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/infoManage/schoolAuditRule")
|
||||
public class ClubSchoolAuditRuleController {
|
||||
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
|
||||
@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,
|
||||
@Param(value = "approval") Boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
club.clubName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN sys_club_rule info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN sys_club club ON info.clubId = club.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("year(info.creatTime)", "=", pageForm.getYear());
|
||||
|
||||
cnd.and("t.taskName", "=", "4a1f0656-7390-45d1-8018-ea0aff38450b");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.and("club.clubName", "LIKE", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("info.creatTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination pagination = clubInfoManageService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
@@ -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(tag = "协会管理系统-协会注册", msg = "协会确认")
|
||||
public Result doAudit() {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.clubConfirm")
|
||||
@SLog(tag = "协会管理系统-协会注册", msg = "协会确认撤回")
|
||||
public Result withdraw(@Valid Long processTaskId) {
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
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.flow.engine.FlowEngine;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.zhgh.club.model.*;
|
||||
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.Api;
|
||||
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")
|
||||
@Api("协会-我的注册")
|
||||
@At("/platform/club/register/clubMyApply")
|
||||
public class ClubMyApplyController {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/register/mine/index.html")
|
||||
@SaCheckPermission("club.register.myApply")
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("club.register.myApply")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination<ClubRegisterPageVo> pagination = sysClubService.minePageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除协会")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.myApply")
|
||||
@SLog(tag = "协会管理系统-协会注册", msg = "删除协会")
|
||||
public Result doDelete(@Valid String id) {
|
||||
sysClubService.delete(id);
|
||||
sysClubService.dao().clear(SysClubSponsor.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));
|
||||
sysClubService.dao().clear(SysClubEvaluate.class, Cnd.where("clubId", "=", id));
|
||||
sysClubService.dao().clear(SysClubExamineRegister.class, Cnd.where("clubId", "=", id));
|
||||
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+190
@@ -0,0 +1,190 @@
|
||||
package com.budwk.app.zhgh.club.controller.register;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
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.SysClub;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubRegisterVo;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import 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 FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@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(tag = "协会管理系统-协会注册", msg = "保存注册协会")
|
||||
public Result save(@Param("club") SysClub club,
|
||||
@Param("::deleteIds") List<String> deleteIds,
|
||||
@Param("::managePerson") List<NutMap> managePerson) {
|
||||
// 如果用户是保存,则只操作业务表
|
||||
if (StrUtil.isBlank(club.getId())) {
|
||||
sysClubService.doAdd(club, managePerson);
|
||||
} else {
|
||||
sysClubService.doEdit(club, deleteIds, managePerson);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.apply")
|
||||
@SLog(tag = "协会管理系统-协会注册", msg = "提交注册协会")
|
||||
public Result submit(@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);
|
||||
}
|
||||
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, sysClub);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("XHZC", sysClub.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
return Result.success(sysClub);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("重新提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.apply")
|
||||
public Result submitAgain(@Param("club") SysClub club,
|
||||
@Param("::deleteIds") List<String> deleteIds,
|
||||
@Param("::managePerson") List<NutMap> managePerson,
|
||||
@Param("taskId") Long taskId) {
|
||||
if (StrUtil.isBlank(club.getId())) {
|
||||
sysClubService.doAdd(club, managePerson);
|
||||
} else {
|
||||
sysClubService.doEdit(club, deleteIds, managePerson);
|
||||
}
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("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
|
||||
@SaCheckLogin
|
||||
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
|
||||
@SaCheckLogin
|
||||
public Result info(@Valid String id) {
|
||||
ClubRegisterVo clubRegisterVo = sysClubService.findOne(id);
|
||||
return Result.success(clubRegisterVo);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result createCode() {
|
||||
int count = sysClubService.count(Cnd.where("year(createTime)", "=", DateUtil.thisYear()));
|
||||
String s = String.format("%02d", count + 1);
|
||||
return Result.success().addData(Convert.toStr(DateUtil.thisYear()) + s);
|
||||
}
|
||||
}
|
||||
+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(tag = "协会管理系统-协会注册", msg = "分管领导审核注册协会")
|
||||
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(tag = "协会管理系统-协会注册", msg = "分管领导撤回注册协会")
|
||||
public Result revoke(@Valid String taskId) {
|
||||
bpmService.revokeTask(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.budwk.app.zhgh.club.controller.register;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
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 com.budwk.app.zhgh.club.vo.ClubRegisterPageVo;
|
||||
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 10:00
|
||||
* @Version: v1.0.0
|
||||
* @Description: 校工会批复
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/register/schoolReply")
|
||||
public class ClubSchoolReplyController {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
+404
@@ -0,0 +1,404 @@
|
||||
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.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.sys.models.Sys_file;
|
||||
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.utils.SysFileMinIoUtil;
|
||||
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 com.budwk.app.zhgh.club.service.impl.SysClubUserServiceImpl;
|
||||
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.json.Json;
|
||||
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<ProcessInstance> instanceList = sysClubService.dao().query(ProcessInstance.class, Cnd.where(ProcessInstance::getState, "=", ProcessInstanceStateEnum.FINISHED.getCode()).and(ProcessInstance::getBusinessNo, "in", list));
|
||||
List<String> businessNoList = instanceList.stream().map(ProcessInstance::getBusinessNo).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);
|
||||
|
||||
// 获取审核通过的
|
||||
List<ProcessInstance> instanceList = sysClubService.dao().query(
|
||||
ProcessInstance.class,
|
||||
Cnd.where(ProcessInstance::getBusinessNo, "in", list.stream().map(SysClub::getId).toList())
|
||||
.and(ProcessInstance::getState, "=", ProcessInstanceStateEnum.FINISHED.getCode())
|
||||
);
|
||||
// 获取id
|
||||
List<String> passList = instanceList.stream().map(ProcessInstance::getBusinessNo).toList();
|
||||
List<SysClub> clubList = list.stream().filter(o -> passList.contains(o.getId())).toList();
|
||||
|
||||
return Result.success(clubList);
|
||||
}
|
||||
|
||||
@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.*
|
||||
FROM
|
||||
club_user c
|
||||
LEFT JOIN `vw_user` u ON u.id = c.userId
|
||||
$condition
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_PRESIDENT"') THEN 1
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_SECRETARY"') THEN 3
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_MEMBER"') THEN 5
|
||||
ELSE 99
|
||||
END
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("c.clubId", "=", clubId);
|
||||
cnd.andEX("u.userState", "=", userState);
|
||||
cnd.andEX("u.sex", "=", sex);
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = sysClubService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> listMap = pagination.getList(NutMap.class);
|
||||
for (NutMap nutMap : listMap) {
|
||||
List<String> list = Json.fromJsonAsList(String.class, nutMap.getString("roleCode"));
|
||||
String roleName = SysClubUserServiceImpl.convertRoleName(list);
|
||||
nutMap.put("roleName", roleName);
|
||||
nutMap.put("roleCode", list);
|
||||
}
|
||||
pagination.setList(listMap);
|
||||
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,
|
||||
c.*
|
||||
FROM
|
||||
club_user c
|
||||
LEFT JOIN `vw_user` u ON u.id = c.userId
|
||||
$condition
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_PRESIDENT"') THEN 1
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_SECRETARY"') THEN 3
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_MEMBER"') THEN 5
|
||||
ELSE 99
|
||||
END
|
||||
""");
|
||||
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);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> listMap = sysClubService.listMap(sql);
|
||||
|
||||
for (NutMap nutMap : listMap) {
|
||||
List<String> list = Json.fromJsonAsList(String.class, nutMap.getString("roleCode"));
|
||||
String roleName = SysClubUserServiceImpl.convertRoleName(list);
|
||||
nutMap.put("roleName", roleName);
|
||||
nutMap.put("roleCode", list);
|
||||
}
|
||||
//获取所有社团
|
||||
Cnd stCnd = Cnd.NEW();
|
||||
stCnd.andEX("id", "=", clubId);
|
||||
List<SysClub> clubList = sysClubService.query(stCnd);
|
||||
|
||||
// 获取审核通过的
|
||||
List<ProcessInstance> instanceList = sysClubService.dao().query(
|
||||
ProcessInstance.class,
|
||||
Cnd.where(ProcessInstance::getBusinessNo, "in", clubList.stream().map(SysClub::getId).toList())
|
||||
.and(ProcessInstance::getState, "=", ProcessInstanceStateEnum.FINISHED.getCode())
|
||||
);
|
||||
// 获取id
|
||||
List<String> passList = instanceList.stream().map(ProcessInstance::getBusinessNo).toList();
|
||||
clubList = clubList.stream().filter(o -> passList.contains(o.getId())).toList();
|
||||
|
||||
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("职务", "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.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 {
|
||||
String fileName = f.getStr("name");
|
||||
String filepath = f.getStr("url");
|
||||
|
||||
Sys_file file = sysClubService.dao().fetch(Sys_file.class, Cnd.where(Sys_file::getDownloadPath, "=", filepath));
|
||||
byte[] bytes = SysFileMinIoUtil.getFileBytes(file.getBucket(), file.getStoragePath());
|
||||
|
||||
zipOutputStream.putNextEntry(new ZipEntry(item.getClubName() + "/" + System.currentTimeMillis() + fileName));
|
||||
zipOutputStream.write(bytes);
|
||||
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 in ('在职', '在岗') $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 like '%男%' $myCondition THEN 1 ELSE 0 END ) AS man,
|
||||
sum( CASE WHEN su.sex like '%女%' $myCondition THEN 1 ELSE 0 END ) AS woman,
|
||||
sum( CASE WHEN ('CLUB_PRESIDENT' MEMBER OF (cu.roleCode) or 'CLUB_VICE_PRESIDENT' MEMBER OF (cu.roleCode) or 'CLUB_SECRETARY' MEMBER OF (cu.roleCode) or 'CLUB_VICE_SECRETARY' MEMBER OF (cu.roleCode)) 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 wf_process_instance ins ON ins.businessNo = 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.state", "=", ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
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,60 @@
|
||||
package com.budwk.app.zhgh.club.interceptor;
|
||||
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowInterceptor;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
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.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClubManager;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ClubChangeManagerInterceptor
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/26 19:15
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public class ClubChangeManagerInterceptor implements FlowInterceptor {
|
||||
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
SysClubManager clubManager = Json.fromJson(SysClubManager.class, formDataStr);
|
||||
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class);
|
||||
SysUserService sysUserService = ServiceContext.find(SysUserService.class);
|
||||
// 审核通过,变更理事机构和角色
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where(ClubUser::getClubId, "=", clubManager.getClubId()).and(ClubUser::getUserId, "=", clubManager.getChangeUserId()));
|
||||
clubUser.setRoleCode(clubManager.getNowRoleCode());
|
||||
// 先清除所有的角色
|
||||
dao.clear(Sys_user_role.class, Cnd.where("userId", "=", clubUser.getUserId()).and("clubId", "=", clubUser.getClubId()));
|
||||
// 设置角色
|
||||
List<Sys_user_role> roles = new ArrayList<>();
|
||||
for (String s : clubManager.getNowRoleCode()) {
|
||||
Sys_user_role ur = new Sys_user_role();
|
||||
ur.setUserId(clubUser.getUserId());
|
||||
ur.setClubId(clubUser.getClubId());
|
||||
Sys_role sRole = sysRoleService.getByCode(s);
|
||||
ur.setRoleId(sRole.getId());
|
||||
roles.add(ur);
|
||||
}
|
||||
|
||||
dao.update(clubUser);
|
||||
dao.insert(roles);
|
||||
|
||||
sysUserService.clearCache();
|
||||
sysRoleService.clearCache();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.budwk.app.zhgh.club.interceptor;
|
||||
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowInterceptor;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubRefresh;
|
||||
import com.budwk.app.zhgh.club.model.SysClubRule;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
/**
|
||||
* @ClassName ClubRuleUpdateInterceptor
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/26 11:11
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public class ClubRefreshUpdateInterceptor implements FlowInterceptor {
|
||||
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
SysClubRefresh clubRefresh = Json.fromJson(SysClubRefresh.class, formDataStr);
|
||||
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
// 审核通过,将新的附件更新到协会表
|
||||
SysClub club = dao.fetch(SysClub.class, clubRefresh.getClubId());
|
||||
club.setReplaceReport(clubRefresh.getFiles());
|
||||
dao.update(club);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.budwk.app.zhgh.club.interceptor;
|
||||
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowInterceptor;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
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.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ClubRegisterInterceptor
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/21 15:44
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public class ClubRegisterInterceptor implements FlowInterceptor {
|
||||
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
SysClub club = Json.fromJson(SysClub.class, formDataStr);
|
||||
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class);
|
||||
SysUserService sysUserService = ServiceContext.find(SysUserService.class);
|
||||
|
||||
// 审核通过,就给角色,找理事机构
|
||||
List<ClubUser> clubUsers = dao.query(
|
||||
ClubUser.class,
|
||||
Cnd.where("clubId", "=", club.getId())
|
||||
);
|
||||
List<Sys_user_role> list = new ArrayList<>();
|
||||
for (ClubUser clubUser : clubUsers) {
|
||||
for (String role : clubUser.getRoleCode()) {
|
||||
Sys_user_role userRole = new Sys_user_role();
|
||||
Sys_role sysRole = sysRoleService.getByCode(role);
|
||||
userRole.setRoleId(sysRole.getId());
|
||||
userRole.setUserId(clubUser.getUserId());
|
||||
userRole.setClubId(club.getId());
|
||||
list.add(userRole);
|
||||
}
|
||||
}
|
||||
|
||||
dao.insert(list);
|
||||
sysUserService.clearCache();
|
||||
sysRoleService.clearCache();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.budwk.app.zhgh.club.interceptor;
|
||||
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowInterceptor;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubRule;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
/**
|
||||
* @ClassName ClubRuleUpdateInterceptor
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/26 11:11
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public class ClubRuleUpdateInterceptor implements FlowInterceptor {
|
||||
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
SysClubRule clubRule = Json.fromJson(SysClubRule.class, formDataStr);
|
||||
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
// 审核通过,将新的附件更新到协会表
|
||||
SysClub club = dao.fetch(SysClub.class, clubRule.getClubId());
|
||||
club.setRulesFile(clubRule.getFiles());
|
||||
dao.update(club);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.budwk.app.zhgh.club.interceptor;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowInterceptor;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.ClubUserApply;
|
||||
import com.budwk.app.zhgh.club.service.SysClubUserService;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ClubUserJoinInterceptor
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/22 16:07
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public class ClubUserJoinInterceptor implements FlowInterceptor {
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void intercept(Execution execution) {
|
||||
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
ClubUserApply clubUserApply = Json.fromJson(ClubUserApply.class, formDataStr);
|
||||
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
SysClubUserService userService = ServiceContext.find(SysClubUserService.class);
|
||||
|
||||
ClubUser clubUser = BeanUtil.copyProperties(clubUserApply, ClubUser.class);
|
||||
dao.insert(clubUser);
|
||||
|
||||
userService.clubUser2Scope(clubUser.getClubId(), List.of(clubUser.getUserId()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
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.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@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 List<String> roleCode = new ArrayList<>();
|
||||
|
||||
@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;
|
||||
|
||||
private String userName;
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
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
|
||||
@ColDefine(type = ColType.VARCHAR,width = 500)
|
||||
@Comment("签字")
|
||||
private String signature;
|
||||
|
||||
@Column
|
||||
@Comment("申请时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date applyDate;
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
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> manageFile;
|
||||
|
||||
@Column
|
||||
@Comment("年度活动计划")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> yearPlanFile;
|
||||
|
||||
@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;
|
||||
}
|
||||
@@ -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,71 @@
|
||||
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.List;
|
||||
|
||||
/**
|
||||
* @ClassName SysClubManager
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/26 19:09
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("sys_club_manager")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会理事机构")
|
||||
public class SysClubManager 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 changeUserId;
|
||||
|
||||
@Column
|
||||
@Comment("变更人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String changeUserName;
|
||||
|
||||
@Column
|
||||
@Comment("社团id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String clubId;
|
||||
|
||||
@Column
|
||||
@Comment("提交时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String creatTime;
|
||||
|
||||
@Column
|
||||
@Comment("旧身份")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> oldRoleCode;
|
||||
|
||||
@Column
|
||||
@Comment("变更的身份")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> nowRoleCode;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* @ClassName SysClubRefresh
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/26 14:36
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("sys_club_refresh")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会换届报告")
|
||||
public class SysClubRefresh 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 creatTime;
|
||||
|
||||
@Column
|
||||
@Comment("上一次的文件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> lastFiles;
|
||||
|
||||
@Column
|
||||
@Comment("文件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* @ClassName SysClubRule
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/26 10:35
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("sys_club_rule")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会章程修订")
|
||||
public class SysClubRule 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 creatTime;
|
||||
|
||||
@Column
|
||||
@Comment("上一次的文件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> lastFiles;
|
||||
|
||||
@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,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,23 @@
|
||||
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);
|
||||
Pagination<ClubEvaluatePageVo> schoolLeaderAuditPageData(@Valid ClubUserPageForm pageForm);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
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);
|
||||
|
||||
Pagination<ClubExaminePageVo> schoolLeaderAuditPageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
ClubExamineVo findOne(@Valid String id);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
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<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,27 @@
|
||||
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.ClubUser;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
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<ClubUser> {
|
||||
|
||||
List<NutMap> getClubUser(@Valid String clubId);
|
||||
|
||||
Pagination pageDataByApplyJoinClubAudit(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
String getClubLeader(@Valid String clubId);
|
||||
|
||||
void clubUser2Scope(String clubId, List<String> users);
|
||||
}
|
||||
@@ -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,166 @@
|
||||
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.PageUtil;
|
||||
import com.budwk.app.bpm.enums.BpmProcessTaskStatusEnum;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @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
|
||||
info.*,
|
||||
club.foundTime,
|
||||
club.clubName,
|
||||
club.clubCode,
|
||||
dict.name as typeName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask') AS startTaskId
|
||||
FROM
|
||||
sys_club_evaluate info
|
||||
LEFT JOIN sys_club club on club.id = info.clubId
|
||||
LEFT JOIN sys_dict dict ON dict.CODE = club.clubType
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
cnd.andEX("info.clubId", "=", pageForm.getClubId());
|
||||
cnd.andEX("year(info.applyTime)", "=", pageForm.getYear());
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
|
||||
cnd.groupBy("info.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("t.taskName", "=", "ec81591d-da91-412a-90c9-df853dcef478");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
Sql sql = generateSql(pageForm, cnd);
|
||||
return listPageVO(pageForm, sql, ClubEvaluatePageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubEvaluatePageVo> schoolLeaderAuditPageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "ea4048e2-2664-4dcb-a4f7-1f5e413abbb0");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
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,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN sys_club_evaluate ce ON ce.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
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("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("applyTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
package com.budwk.app.zhgh.club.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.base.utils.PageUtil;
|
||||
import com.budwk.app.bpm.enums.BpmProcessTaskStatusEnum;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
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
|
||||
FROM
|
||||
club_user cl
|
||||
LEFT JOIN `vw_user` u ON cl.userId = u.id
|
||||
WHERE
|
||||
cl.clubId = @clubId
|
||||
AND NOT JSON_CONTAINS(cl.roleCode, '"CLUB_MEMBER"')
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN JSON_CONTAINS(cl.roleCode, '"CLUB_PRESIDENT"') THEN 1
|
||||
WHEN JSON_CONTAINS(cl.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
|
||||
WHEN JSON_CONTAINS(cl.roleCode, '"CLUB_SECRETARY"') THEN 3
|
||||
WHEN JSON_CONTAINS(cl.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
|
||||
WHEN JSON_CONTAINS(cl.roleCode, '"CLUB_MEMBER"') THEN 5
|
||||
ELSE 99
|
||||
END
|
||||
""").setParam("clubId", clubId);
|
||||
List<NutMap> listMap = listMap(sql);
|
||||
for (NutMap nutMap : listMap) {
|
||||
List<String> list = Json.fromJsonAsList(String.class, nutMap.getString("roleCode"));
|
||||
String roleName = SysClubUserServiceImpl.convertRoleName(list);
|
||||
nutMap.put("roleName", roleName);
|
||||
nutMap.put("roleCode", list);
|
||||
}
|
||||
return listMap;
|
||||
}
|
||||
|
||||
@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("info.clubId", "in", myManageClub.stream().map(SysClub::getId).toList());
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
u.username as concatPersonName,
|
||||
sc.concatPersonMobile,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask') AS startTaskId
|
||||
FROM
|
||||
`sys_club_examine_register` info
|
||||
LEFT JOIN sys_club sc ON sc.id = info.clubId
|
||||
LEFT JOIN `vw_user` u ON u.id = sc.concatPerson
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
cnd.andEX("YEAR(info.registerDate)", "=", pageForm.getYear());
|
||||
cnd.andEX("sc.id", "=", pageForm.getClubId());
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
|
||||
cnd.groupBy("info.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("t.taskName", "=", "ed4f6e9f-f0ea-4a73-ad57-bfcd8dd4d4bd");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
Sql sql = generateSql(pageForm, cnd);
|
||||
return listPageVO(pageForm, sql, ClubExaminePageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubExaminePageVo> schoolLeaderAuditPageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "e38560b8-bcbd-49c9-959a-58318f01aea1");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
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);
|
||||
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
|
||||
info.*,
|
||||
u.username as concatPersonName,
|
||||
club.concatPersonMobile,
|
||||
dict.name as typeName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN sys_club_examine_register info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
LEFT JOIN sys_club club on club.id = info.clubId
|
||||
LEFT JOIN sys_dict dict ON dict.CODE = club.clubType
|
||||
LEFT JOIN `vw_user` u ON u.id = club.concatPerson
|
||||
$condition
|
||||
""");
|
||||
|
||||
cnd.andEX("info.clubId", "=", pageForm.getClubId());
|
||||
cnd.andEX("YEAR(info.registerDate)", "=", pageForm.getYear());
|
||||
|
||||
if (pageForm.getAudit()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("registerDate");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,324 @@
|
||||
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.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
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.model.ClubUser;
|
||||
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.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
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.Objects;
|
||||
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 = Sqls.create("""
|
||||
SELECT
|
||||
c.*,
|
||||
d.NAME AS typeName,
|
||||
(
|
||||
SELECT
|
||||
count( DISTINCT scu.userId )
|
||||
FROM
|
||||
club_user scu
|
||||
WHERE
|
||||
scu.clubId = c.id
|
||||
) currentNum,
|
||||
GROUP_CONCAT(DISTINCT presidentUser.username) AS clubLeader,
|
||||
GROUP_CONCAT(secretaryUser.username) AS clubSecretary
|
||||
FROM
|
||||
sys_club c
|
||||
LEFT JOIN club_user presidentCu on presidentCu.clubId = c.id AND JSON_CONTAINS(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 JSON_CONTAINS(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 wf_process_instance ins ON ins.businessNo = c.id
|
||||
$condition
|
||||
""");
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.and("c.clubName", "LIKE", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
|
||||
if(StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
Cnd c = Cnd.NEW();
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("userName", pageForm.getSearchKeyword());
|
||||
group.orLike("loginName", pageForm.getSearchKeyword());
|
||||
c.and(group);
|
||||
c.limit(50);
|
||||
List<Sys_user> userList = dao().query(Sys_user.class, c);
|
||||
List<ClubUser> list = dao().query(ClubUser.class, Cnd.where("userId", "in", userList.stream().map(Sys_user::getId).toList()));
|
||||
cnd.and("c.id", "in", list.stream().map(ClubUser::getClubId).toList());
|
||||
}
|
||||
|
||||
cnd.andEX("year(c.createTime)", "=", pageForm.getYear());
|
||||
cnd.and("c.dismiss", "=", false);
|
||||
cnd.and("ins.state", "=", ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
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.groupBy("c.id");
|
||||
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
|
||||
FROM
|
||||
club_user scu
|
||||
LEFT JOIN sys_club club ON scu.clubId = club.id
|
||||
RIGHT JOIN `vw_user` u ON scu.userId = u.id
|
||||
$condition
|
||||
$order
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
cnd.and("scu.clubId", "=", pageForm.getClubId());
|
||||
if (StrUtil.isNotBlank(pageForm.getPersonType())) {
|
||||
cnd.and("u.personType", "=", pageForm.getPersonType());
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageForm.getUserState())) {
|
||||
cnd.and("u.userState", "=", pageForm.getUserState());
|
||||
}
|
||||
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(), "descending".equals(pageForm.getPageOrderBy()) ? "desc" : "asc");
|
||||
} else {
|
||||
sql.setVar("order", """
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_PRESIDENT"') THEN 1
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_OPERATOR"') THEN 5
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 6
|
||||
ELSE 99
|
||||
END
|
||||
""");
|
||||
}
|
||||
|
||||
//查询理事机构
|
||||
if (pageForm.getRadioType() != null && 1 == pageForm.getRadioType()) {
|
||||
cnd.and(new Static("NOT JSON_CONTAINS(scu.roleCode, '\"CLUB_MEMBER\"')"));
|
||||
}
|
||||
//查询社团成员
|
||||
if (pageForm.getRadioType() != null && 2 == pageForm.getRadioType()) {
|
||||
cnd.and(new Static("JSON_CONTAINS(scu.roleCode, '\"CLUB_MEMBER\"')"));
|
||||
//cnd.and(new Static("JSON_LENGTH(scu.roleCode) = 1"));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination<ClubUserCommonPageVo> listPageVO = sysClubService.listPageVO(pageForm, sql, ClubUserCommonPageVo.class);
|
||||
List<ClubUserCommonPageVo> listMap = listPageVO.getList(ClubUserCommonPageVo.class);
|
||||
for (ClubUserCommonPageVo vo : listMap) {
|
||||
List<String> list = vo.getRoleCode();
|
||||
List<String> cleanedCodes = list.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(String::strip)
|
||||
.map(code -> code.startsWith("\"") && code.endsWith("\"")
|
||||
? code.substring(1, code.length() - 1)
|
||||
: code)
|
||||
.toList();
|
||||
String roleName = SysClubUserServiceImpl.convertRoleName(cleanedCodes);
|
||||
vo.setRoleName(roleName);
|
||||
vo.setRoleCode(cleanedCodes);
|
||||
}
|
||||
listPageVO.setList(listMap);
|
||||
return listPageVO;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportRegistrationDoc(String clubId, HttpServletResponse response) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.clubName,
|
||||
u.username,
|
||||
u.username as 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 JSON_CONTAINS(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,
|
||||
scu.*
|
||||
FROM
|
||||
club_user scu
|
||||
LEFT JOIN vw_user u ON u.id = scu.userId
|
||||
WHERE scu.clubId = @clubId
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_PRESIDENT"') THEN 1
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_OPERATOR"') THEN 5
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 6
|
||||
ELSE 99
|
||||
END
|
||||
""");
|
||||
memberSql.setParam("clubId", clubId);
|
||||
List<NutMap> memberList = listMap(memberSql);
|
||||
for (NutMap nutMap : memberList) {
|
||||
List<String> list = Json.fromJsonAsList(String.class, nutMap.getString("roleCode"));
|
||||
String roleName = SysClubUserServiceImpl.convertRoleName(list);
|
||||
nutMap.put("roleName", roleName);
|
||||
nutMap.put("roleCode", list);
|
||||
}
|
||||
|
||||
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,329 @@
|
||||
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.base.utils.PageUtil;
|
||||
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.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
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;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @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) {
|
||||
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 JSON_CONTAINS(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 JSON_CONTAINS(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 wf_process_instance ins ON ins.businessNo = club.id
|
||||
$condition
|
||||
""").setParam("userId", SecurityUtil.getUserId());
|
||||
cnd.and("ins.state", "=", ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
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);
|
||||
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<ProcessInstance> instanceList = dao().query(ProcessInstance.class, Cnd.where("businessNo", "in", list).and("state", "=", ProcessInstanceStateEnum.FINISHED.getCode()));
|
||||
List<String> businessNoList = instanceList.stream().map(ProcessInstance::getBusinessNo).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 wf_process_instance bpi ON bpi.businessNo = club.id
|
||||
LEFT JOIN wf_process_instance instance ON instance.businessNo = ex.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("bpi.state", "=", ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
cnd.and("instance.state", "=", ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
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().filter(o -> StrUtil.isNotBlank(o.getString("userId"))).map(person -> {
|
||||
ClubUser clubUser = new ClubUser();
|
||||
clubUser.setClubId(club.getId());
|
||||
clubUser.setRoleCode(List.of(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");
|
||||
|
||||
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().filter(o -> StrUtil.isNotBlank(o.getString("userId"))).map(person -> {
|
||||
ClubUser clubUser = new ClubUser();
|
||||
clubUser.setClubId(club.getId());
|
||||
clubUser.setRoleCode(List.of(person.getString("roleCode")));
|
||||
clubUser.setUserId(person.getString("userId"));
|
||||
return clubUser;
|
||||
}).toList();
|
||||
dao().insert(clubUsers);
|
||||
}
|
||||
return club;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubRegisterPageVo> minePageData(ClubUserPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
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 = info.id) ) as sponsorName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask') AS startTaskId
|
||||
FROM
|
||||
sys_club info
|
||||
LEFT JOIN sys_dict dict ON dict.CODE = info.clubType
|
||||
LEFT JOIN sys_user u ON u.id = info.concatPerson
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.andEX("info.clubName", "like", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
cnd.andEX("year(info.createTime)", "=", pageForm.getYear());
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
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("t.taskName", "=", "58ac932c-c304-4fbe-b379-dd85e9575001");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
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,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN sys_club club ON club.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
LEFT JOIN sys_dict dict ON dict.CODE = club.clubType
|
||||
LEFT JOIN sys_user u ON u.id = club.concatPerson
|
||||
$condition
|
||||
""");
|
||||
cnd.andEX("year(club.createTime)", "=", pageForm.getYear());
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.andEX("club.clubName", "like", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
if (pageForm.getAudit()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("createTime");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
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.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
|
||||
import com.budwk.app.zhgh.activity.trainSignUp.models.*;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
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.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.*;
|
||||
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<ClubUser> 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
|
||||
CASE
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_PRESIDENT"') THEN 1
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_OPERATOR"') THEN 5
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 6
|
||||
ELSE 99
|
||||
END
|
||||
""").setParam("clubId", clubId);
|
||||
List<NutMap> listMap = listMap(sql);
|
||||
for (NutMap nutMap : listMap) {
|
||||
List<String> list = Json.fromJsonAsList(String.class, nutMap.getString("roleCode"));
|
||||
String roleName = convertRoleName(list);
|
||||
nutMap.put("roleName", roleName);
|
||||
}
|
||||
return listMap;
|
||||
}
|
||||
|
||||
@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());
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubUserCommonPageVo.class);
|
||||
}
|
||||
|
||||
@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(","));
|
||||
}
|
||||
|
||||
public static String convertRoleName(List<String> roleCodes) {
|
||||
if (roleCodes == null || roleCodes.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
Map<String, String> codeToName = Arrays.stream(RoleConstant.values())
|
||||
.collect(Collectors.toMap(
|
||||
Enum::name,
|
||||
role -> role.roleName
|
||||
));
|
||||
return roleCodes.stream()
|
||||
.map(codeToName::get)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.joining(","));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clubUser2Scope(String clubId, List<String> users) {
|
||||
// 添加协会成员,需要增加到品牌活动的组别去,wcnm
|
||||
List<TrainSignUpActivity> list = dao().query(TrainSignUpActivity.class, Cnd.NEW());
|
||||
List<TrainSignUpActivity> activityList = new ArrayList<>();
|
||||
for (TrainSignUpActivity activity : list) {
|
||||
boolean host = Lang.isNotEmpty(activity.getHostUnits()) && activity.getHostUnits().contains(clubId);
|
||||
if(host) {
|
||||
activityList.add(activity);
|
||||
}
|
||||
}
|
||||
if(Lang.isNotEmpty(activityList)) {
|
||||
// 查询所有的组别
|
||||
List<ActivityUserScope> groupAllList = dao().query(ActivityUserScope.class, Cnd.NEW().groupBy("groupId"));
|
||||
Map<Integer, String> groupMap = groupAllList.stream().collect(Collectors.toMap(ActivityUserScope::getGroupId, ActivityUserScope::getGroupName));
|
||||
|
||||
List<Integer> groupList = activityList.stream().map(TrainSignUpActivity::getActivityGroupId).distinct().toList();
|
||||
List<ActivityUserScope> addScopes = new ArrayList<>();
|
||||
for (Integer groupId : groupList) {
|
||||
for (String user : users) {
|
||||
int count = dao().count(ActivityUserScope.class, Cnd.where(ActivityUserScope::getGroupId, "=", groupId).and(ActivityUserScope::getUserId, "=", user));
|
||||
if(count > 0) {
|
||||
continue;
|
||||
}
|
||||
ActivityUserScope scope = new ActivityUserScope();
|
||||
scope.setGroupId(groupId);
|
||||
scope.setGroupName(groupMap.get(groupId));
|
||||
scope.setUserId(user);
|
||||
addScopes.add(scope);
|
||||
}
|
||||
}
|
||||
dao().insert(addScopes);
|
||||
|
||||
// 报名
|
||||
List<TrainSignUpUser> signList = new ArrayList<>();
|
||||
List<TrainSignUpUserCourse> userCourseList = new ArrayList<>();
|
||||
|
||||
List<String> idList = activityList.stream().map(TrainSignUpActivity::getId).toList();
|
||||
|
||||
List<TrainSignUpCourse> courses = dao().query(TrainSignUpCourse.class, Cnd.where("activityId", "in", idList));
|
||||
List<TrainSignUpActivityCourse> activityCourses = dao().query(TrainSignUpActivityCourse.class, Cnd.where("activityId", "in", idList));
|
||||
|
||||
List<View_user> userList = dao().query(View_user.class, Cnd.where("id", "in", users));
|
||||
Map<String, View_user> userMap = userList.stream().collect(Collectors.toMap(View_user::getId, o -> o));
|
||||
|
||||
for (TrainSignUpCourse course : courses) {
|
||||
for (String user : users) {
|
||||
View_user u = userMap.get(user);
|
||||
TrainSignUpUser signUpUser = new TrainSignUpUser();
|
||||
signUpUser.setActivityId(course.getActivityId());
|
||||
signUpUser.setCourseId(course.getId());
|
||||
signUpUser.setUserId(user);
|
||||
signUpUser.setMobile(u.getMobile());
|
||||
signUpUser.setSignUpTime(new Date());
|
||||
signUpUser.setState(1);
|
||||
signUpUser.setUnionId(u.getUnionId());
|
||||
signUpUser.setUnitId(u.getUnitId());
|
||||
signUpUser.setUnionName(u.getUnionName());
|
||||
signUpUser.setUnitName(u.getUnitName());
|
||||
signList.add(signUpUser);
|
||||
}
|
||||
}
|
||||
|
||||
for (TrainSignUpActivityCourse ac : activityCourses) {
|
||||
for (String user : users) {
|
||||
View_user u = userMap.get(user);
|
||||
TrainSignUpUserCourse aCourse = new TrainSignUpUserCourse();
|
||||
aCourse.setActivityId(ac.getActivityId());
|
||||
aCourse.setCourseId(ac.getCourseId());
|
||||
aCourse.setUserId(user);
|
||||
aCourse.setCourseStartTime(ac.getCourseStartTime());
|
||||
aCourse.setCourseEndTime(ac.getCourseEndTime());
|
||||
aCourse.setAttend(false);
|
||||
aCourse.setAttendTime(null);
|
||||
aCourse.setActivityCourseId(ac.getId());
|
||||
userCourseList.add(aCourse);
|
||||
}
|
||||
}
|
||||
if(Lang.isNotEmpty(signList)) {
|
||||
dao().insert(signList);
|
||||
}
|
||||
if(Lang.isNotEmpty(userCourseList)) {
|
||||
dao().insert(userCourseList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,38 @@
|
||||
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
|
||||
public class ClubEvaluatePageVo {
|
||||
|
||||
private String id;
|
||||
private String year;
|
||||
private String clubId;
|
||||
private String clubName;
|
||||
private String clubCode;
|
||||
private String foundTime;
|
||||
private String typeName;
|
||||
private Date applyTime;
|
||||
|
||||
private String instanceId;
|
||||
private String businessNo;
|
||||
private Integer instanceState;
|
||||
private String instanceVariable;
|
||||
private String instanceProcessDefineId;
|
||||
private String taskId;
|
||||
private String taskKey;
|
||||
private String taskName;
|
||||
private Integer taskType;
|
||||
private Integer taskPerformType;
|
||||
private Integer taskState;
|
||||
private Date finishTime;
|
||||
private String taskParentId;
|
||||
private String taskVariable;
|
||||
private String curTaskName;
|
||||
private Boolean canRevoke;
|
||||
private String startTaskId;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
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 {
|
||||
|
||||
private String clubName;
|
||||
private String clubCode;
|
||||
private String createTime;
|
||||
private String typeName;
|
||||
private String foundTime;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ClubExaminePageVo{
|
||||
|
||||
private String id;
|
||||
private String year;
|
||||
private String clubId;
|
||||
private String clubName;
|
||||
private String foundTime;
|
||||
private String registerDate;
|
||||
private String typeName;
|
||||
|
||||
private String instanceId;
|
||||
private String businessNo;
|
||||
private Integer instanceState;
|
||||
private String instanceVariable;
|
||||
private String instanceProcessDefineId;
|
||||
private String taskId;
|
||||
private String taskKey;
|
||||
private String taskName;
|
||||
private Integer taskType;
|
||||
private Integer taskPerformType;
|
||||
private Integer taskState;
|
||||
private Date finishTime;
|
||||
private String taskParentId;
|
||||
private String taskVariable;
|
||||
private String curTaskName;
|
||||
private Boolean canRevoke;
|
||||
private String startTaskId;
|
||||
}
|
||||
@@ -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,47 @@
|
||||
package com.budwk.app.zhgh.club.vo;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.budwk.app.bpm.vo.BpmTaskApprovalVo;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class ClubRegisterPageVo {
|
||||
|
||||
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;
|
||||
|
||||
private String instanceId;
|
||||
private String businessNo;
|
||||
private Integer instanceState;
|
||||
private String instanceVariable;
|
||||
private String instanceProcessDefineId;
|
||||
private String taskId;
|
||||
private String taskKey;
|
||||
private String taskName;
|
||||
private Integer taskType;
|
||||
private Integer taskPerformType;
|
||||
private Integer taskState;
|
||||
private Date finishTime;
|
||||
private String taskParentId;
|
||||
private String taskVariable;
|
||||
private String curTaskName;
|
||||
private Boolean canRevoke;
|
||||
private String startTaskId;
|
||||
}
|
||||
@@ -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.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 {
|
||||
|
||||
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.ClubUser;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ClubUserCommonPageVo extends ClubUser {
|
||||
|
||||
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,32 @@
|
||||
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;
|
||||
|
||||
@ExcelIgnore
|
||||
private String errorInfo;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
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
|
||||
public class ClubUserJoinPageVo{
|
||||
|
||||
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;
|
||||
|
||||
private String instanceId;
|
||||
private String businessNo;
|
||||
private Integer instanceState;
|
||||
private String instanceVariable;
|
||||
private String instanceProcessDefineId;
|
||||
private String taskId;
|
||||
private String taskKey;
|
||||
private String taskName;
|
||||
private Integer taskType;
|
||||
private Integer taskPerformType;
|
||||
private Integer taskState;
|
||||
private Date finishTime;
|
||||
private String taskParentId;
|
||||
private String taskVariable;
|
||||
private String curTaskName;
|
||||
private Integer canRevoke;
|
||||
private String startTaskId;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ClubUserJoinVo extends ClubUserApply {
|
||||
|
||||
private String loginName;
|
||||
private String userName;
|
||||
private String unitName;
|
||||
private String unionName;
|
||||
private String sex;
|
||||
private String mobile;
|
||||
private String technicalTitle;
|
||||
private String education;
|
||||
private String academicDegree;
|
||||
private String position;
|
||||
private String clubName;
|
||||
}
|
||||
Reference in New Issue
Block a user