commit
This commit is contained in:
-1
@@ -9,7 +9,6 @@ import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.activity.planSummary.model.YearSummary;
|
||||
import com.budwk.app.zhgh.activity.planSummary.service.YearSummaryService;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
|
||||
@@ -15,7 +15,6 @@ 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.Dao;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -41,8 +40,6 @@ public class ClubUserClubListController {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
@Inject
|
||||
private SysClubUserService sysClubUserService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/join/list/index.html")
|
||||
|
||||
+33
-1
@@ -1,6 +1,7 @@
|
||||
package com.budwk.app.zhgh.club.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -17,6 +18,7 @@ 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;
|
||||
@@ -24,6 +26,7 @@ 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;
|
||||
@@ -36,6 +39,7 @@ 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;
|
||||
@@ -56,6 +60,8 @@ public class ClubUserJoinApplyController {
|
||||
private SysMsgService sysMsgService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("club.join.apply")
|
||||
@@ -87,11 +93,23 @@ public class ClubUserJoinApplyController {
|
||||
return Result.success(sql.getResult());
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("保存申请")
|
||||
@SaCheckPermission("condolence.apply")
|
||||
@SLog(type = "clubUser", 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("club.join.apply")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(type = "clubUser", tag = "申请协会", msg = "申请协会")
|
||||
@SLog(type = "clubUser", 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())) {
|
||||
@@ -120,6 +138,20 @@ public class ClubUserJoinApplyController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("重新提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.join.apply")
|
||||
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());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("校验是否申请过协会")
|
||||
@SaCheckPermission("club.join.apply")
|
||||
|
||||
+1
-1
@@ -106,7 +106,7 @@ public class ClubUserJoinApprovalController {
|
||||
}
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
+1
-3
@@ -82,9 +82,7 @@ public class ClubUserJoinMineController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
cnd.groupBy("info.id");
|
||||
cnd.desc("info.applyDate");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ public class ClubUserJoinSchoolApprovalController {
|
||||
}
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
+8
-27
@@ -4,11 +4,10 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
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;
|
||||
@@ -16,6 +15,7 @@ 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;
|
||||
|
||||
@@ -31,6 +31,8 @@ public class ClubUserMineClubController {
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private SysClubUserService clubUserService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("club.join.mine.club")
|
||||
@@ -54,9 +56,9 @@ public class ClubUserMineClubController {
|
||||
FROM
|
||||
sys_club club
|
||||
LEFT JOIN club_user uc ON club.id = uc.clubId
|
||||
LEFT JOIN club_user presidentCu ON presidentCu.clubId = club.id AND presidentCu.roleCode = 'CLUB_PRESIDENT'
|
||||
LEFT JOIN 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 secretaryCu.roleCode = 'CLUB_SECRETARY'
|
||||
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
|
||||
""");
|
||||
@@ -73,28 +75,7 @@ public class ClubUserMineClubController {
|
||||
@At
|
||||
@SaCheckPermission("club.join.mine.club")
|
||||
public Result getClubUsers(@Valid String clubId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
scu.*,
|
||||
role.`name` AS roleName,
|
||||
u.username AS userName,
|
||||
u.loginname AS loginName,
|
||||
u.sex,
|
||||
u.personType AS personType,
|
||||
u.userState,
|
||||
u.unitid AS unitId,
|
||||
u.mobile,
|
||||
club.clubName,
|
||||
u.unitname AS unitName
|
||||
FROM
|
||||
club_user scu
|
||||
LEFT JOIN sys_club club ON scu.clubId = club.id
|
||||
LEFT JOIN `vw_user` u ON scu.userId = u.id
|
||||
LEFT JOIN sys_role role ON role.`code` = scu.rolecode
|
||||
WHERE
|
||||
scu.clubId = @clubId
|
||||
ORDER BY FIELD( scu.roleCode, 'CLUB_PRESIDENT', 'CLUB_VICE_PRESIDENT', 'CLUB_SECRETARY', 'CLUB_VICE_SECRETARY','CLUB_OPERATOR', 'CLUB_MEMBER' )
|
||||
""").setParam("clubId", clubId);
|
||||
return Result.success(baseService.listMap(sql));
|
||||
List<NutMap> clubUser = clubUserService.getClubUser(clubId);
|
||||
return Result.success(clubUser);
|
||||
}
|
||||
}
|
||||
|
||||
+23
-2
@@ -1,7 +1,9 @@
|
||||
package com.budwk.app.zhgh.club.controller.evaluate;
|
||||
|
||||
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;
|
||||
@@ -13,6 +15,7 @@ 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;
|
||||
@@ -21,6 +24,8 @@ 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;
|
||||
@@ -52,6 +57,8 @@ public class ClubEvaluateApplyController {
|
||||
private SysClubEvaluateService evaluateService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/evaluate/apply/index.html")
|
||||
@@ -62,7 +69,7 @@ public class ClubEvaluateApplyController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.evaluate.apply")
|
||||
@SLog(type = "evaluateApply", tag = "保存协会评优申请", msg = "保存协会评优申请")
|
||||
public Result doSave(@Param("evaluate") SysClubEvaluate evaluate) {
|
||||
public Result save(@Param("data") SysClubEvaluate evaluate) {
|
||||
evaluateService.dao().insertOrUpdate(evaluate);
|
||||
return Result.success(evaluate);
|
||||
}
|
||||
@@ -71,7 +78,7 @@ public class ClubEvaluateApplyController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.evaluate.apply")
|
||||
@SLog(type = "evaluateApply", tag = "提交协会评优", msg = "提交协会评优")
|
||||
public Result doSubmit(@Valid @Param("evaluate") SysClubEvaluate evaluate) {
|
||||
public Result submit(@Valid @Param("data") SysClubEvaluate evaluate) {
|
||||
evaluateService.dao().insertOrUpdate(evaluate);
|
||||
|
||||
// 开启流程实例
|
||||
@@ -88,6 +95,20 @@ public class ClubEvaluateApplyController {
|
||||
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) {
|
||||
|
||||
+139
-113
@@ -13,12 +13,14 @@ 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.model.SysClubUser;
|
||||
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;
|
||||
@@ -45,132 +47,156 @@ import java.util.List;
|
||||
@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 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("")
|
||||
@Ok("beetl:/platform/zhgh/club/examine/apply/index.html")
|
||||
@SaCheckPermission("club.examine.apply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getCount(@Valid String id,@Valid Integer year) {
|
||||
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
|
||||
@SaCheckPermission("club")
|
||||
public Result getCount(@Valid String id, @Valid Integer year) {
|
||||
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
|
||||
@SaCheckPermission("club")
|
||||
public Result getClubsByRole() {
|
||||
List<SysClub> myManageClub = sysClubService.getMyManageClub();
|
||||
return Result.success(myManageClub);
|
||||
}
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getClubsByRole() {
|
||||
List<SysClub> myManageClub = sysClubService.getMyManageClub();
|
||||
return Result.success(myManageClub);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getClubUserNum(@Valid String clubId) {
|
||||
List<NutMap> result = sysClubExamineService.getClubUserNum(clubId);
|
||||
return Result.success(result);
|
||||
}
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getClubUserNum(@Valid String clubId) {
|
||||
List<NutMap> result = sysClubExamineService.getClubUserNum(clubId);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getJgUser(@Valid String clubId) {
|
||||
List<NutMap> result = sysClubExamineService.getJgUser(clubId);
|
||||
return Result.success(result);
|
||||
}
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getJgUser(@Valid String clubId) {
|
||||
List<NutMap> result = sysClubExamineService.getJgUser(clubId);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getClubMemberMoney(@Valid String clubId) {
|
||||
int count = dao.count(SysClubUser.class, Cnd.where("clubId", "=", clubId).and("status", "=", 5).and("isNormal", "=", true));
|
||||
SysClub club = dao.fetch(SysClub.class, clubId);
|
||||
int money = count * (club.getDue() != null ? Integer.parseInt(club.getDue()) : 0);
|
||||
return Result.success(money);
|
||||
}
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getClubMemberMoney(@Valid String clubId) {
|
||||
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
|
||||
@SaCheckPermission("club")
|
||||
public Result getXghBkMoney(@Valid String clubId) {
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getXghBkMoney(@Valid String clubId) {
|
||||
/*jf_club club = dao().fetch(jf_club.class, Cnd.where("club_id", "=", id));
|
||||
Double total_quota = Double.valueOf(club.getTotal_quota());*/
|
||||
return Result.success(0);
|
||||
}
|
||||
return Result.success(0);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result getLasYearSurplus(@Valid String clubId) {
|
||||
SysClubExamineRegister register = dao.fetch(SysClubExamineRegister.class, Cnd.where("clubId", "=", clubId)
|
||||
.and("YEAR(registerDate)", "=", 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")
|
||||
public Result getLasYearSurplus(@Valid String clubId) {
|
||||
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(@Valid String id) {
|
||||
SysClubExamineRegister examineRegister = sysClubExamineService.fetch(id);
|
||||
sysClubExamineService.fetchLinks(examineRegister, "detailedList");
|
||||
return Result.success(examineRegister);
|
||||
}
|
||||
@At
|
||||
@SaCheckPermission("club.examine")
|
||||
public Result info(@Valid String id) {
|
||||
SysClubExamineRegister examineRegister = sysClubExamineService.fetch(id);
|
||||
sysClubExamineService.fetchLinks(examineRegister, "detailedList");
|
||||
return Result.success(examineRegister);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.examine.apply")
|
||||
@SLog(type = "examineApply", tag = "保存协会年审", msg = "保存协会年审")
|
||||
public Result doSave(@Param("data") SysClubExamineRegister examineRegister,
|
||||
@Param("incomeDetailed") String incomeDetailed,
|
||||
@Param("incomeCensus") String incomeCensus) {
|
||||
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(type = "examineApply", 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(type = "examineApply", tag = "提交协会年审", msg = "提交协会年审")
|
||||
public Result doSubmit(@Param("data") SysClubExamineRegister examineRegister,
|
||||
@Param("incomeDetailed") String incomeDetailed,
|
||||
@Param("incomeCensus") String incomeCensus) {
|
||||
SysClubExamineRegister reg;
|
||||
if(StrUtil.isBlank(examineRegister.getId())) {
|
||||
reg = sysClubExamineService.doAdd(examineRegister, incomeDetailed, incomeCensus);
|
||||
} else {
|
||||
reg = sysClubExamineService.doEdit(examineRegister, incomeDetailed, incomeCensus);
|
||||
}
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.examine.apply")
|
||||
@SLog(type = "examineApply", 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("XHPY", reg.getId(), SecurityUtil.getUserId(), args);
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, reg);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("XHPY", 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);
|
||||
}
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
|
||||
return Result.success(reg);
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
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 instanceVariale,
|
||||
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.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
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(type = "changManager", 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(type = "ruleUpdate", 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);
|
||||
}
|
||||
}
|
||||
+78
-78
@@ -1,7 +1,6 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
@@ -12,6 +11,7 @@ import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.EasyExcelUtil;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
@@ -20,10 +20,8 @@ import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubUserService;
|
||||
import com.budwk.app.zhgh.club.vo.ClubCommonPageVo;
|
||||
import com.budwk.app.zhgh.club.vo.ClubUserImportVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -51,9 +49,7 @@ import org.nutz.mvc.upload.UploadAdaptor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@IocBean
|
||||
@@ -64,8 +60,6 @@ public class ClubInfoManageController {
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
@Inject
|
||||
private SysClubUserService sysClubUserService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
@@ -115,7 +109,7 @@ public class ClubInfoManageController {
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(type = "infoManage", tag = "修改缴费状态", msg = "修改缴费状态", param = true)
|
||||
public Result updatePayed(@Valid Boolean payed, @Valid String id) {
|
||||
clubInfoManageService.dao().update(SysClubUser.class, Chain.make("payed", payed), Cnd.where("id", "=", id));
|
||||
clubInfoManageService.dao().update(ClubUser.class, Chain.make("payed", payed), Cnd.where("id", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@@ -124,7 +118,7 @@ public class ClubInfoManageController {
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(type = "infoManage", tag = "修改拨付状态", msg = "修改拨付状态", param = true)
|
||||
public Result updateGive(@Valid Boolean giveMoney, @Valid String id) {
|
||||
clubInfoManageService.dao().update(SysClubUser.class, Chain.make("giveMoney", giveMoney), Cnd.where("id", "=", id));
|
||||
clubInfoManageService.dao().update(ClubUser.class, Chain.make("giveMoney", giveMoney), Cnd.where("id", "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@@ -134,12 +128,16 @@ public class ClubInfoManageController {
|
||||
@SLog(type = "infoManage", tag = "退会", msg = "退会", param = true)
|
||||
public Result exitClub(@Valid String id) {
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, id);
|
||||
Sys_role sysRole = sysRoleService.getByCode(clubUser.getRoleCode());
|
||||
dao.update(ClubUser.class, Chain.make("isNormal", false).add("changeTime", DateUtil.now())
|
||||
, Cnd.where("id", "=", id));
|
||||
dao.clear(Sys_user_role.class, Cnd.where("userId", "=", clubUser.getUserId())
|
||||
.and("roleId", "=", sysRole.getId())
|
||||
.and("clubId", "=", clubUser.getClubId()));
|
||||
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();
|
||||
@@ -152,11 +150,14 @@ public class ClubInfoManageController {
|
||||
public Result userDelete(@Valid String id) {
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, id);
|
||||
dao.delete(ClubUser.class,id);
|
||||
Sys_role sysRole = sysRoleService.getByCode(clubUser.getRoleCode());
|
||||
if(ObjectUtil.isNotEmpty(sysRole)){
|
||||
dao.clear(Sys_user_role.class, Cnd.NEW().and("userId", "=", clubUser.getUserId())
|
||||
.and("roleId", "=", sysRole.getId())
|
||||
.and("clubId", "=", clubUser.getClubId()));
|
||||
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();
|
||||
@@ -166,45 +167,43 @@ public class ClubInfoManageController {
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(type = "infoManage", tag = "修改身份", msg = "修改身份", param = true)
|
||||
public Result updateRoleCode(@Valid String id, @Valid String roleCode, @Valid String clubId) {
|
||||
@SLog(type = "infoManage", tag = "修改身份", msg = "修改身份")
|
||||
public Result updateRoleCode(@Param("id") String id, @Valid String[] roleCodes, @Valid String clubId) {
|
||||
List<String> roleCodeList = Arrays.asList(roleCodes);
|
||||
//查询社团是否存在会长或者秘书长
|
||||
if (List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name()).contains(roleCode)) {
|
||||
int count = clubInfoManageService.dao().count(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||
.and("roleCode", "=", roleCode));
|
||||
if(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((Objects.equals(roleCode, RoleConstant.CLUB_PRESIDENT.name()) ? "会长" : "秘书长") + "只能有一位");
|
||||
return Result.error("会长只能有一位");
|
||||
}
|
||||
}
|
||||
ClubUser clubUser = clubInfoManageService.dao().fetch(ClubUser.class, id);
|
||||
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(
|
||||
RoleConstant.CLUB_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_VICE_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_SECRETARY.name(),
|
||||
RoleConstant.CLUB_VICE_SECRETARY.name()
|
||||
));
|
||||
|
||||
//如果变更为会员,则直接变更
|
||||
if (Objects.equals(roleCode, RoleConstant.CLUB_MEMBER.name())) {
|
||||
sysClubUserService.dao().update(ClubUser.class,Chain.make("roleCode", roleCode), Cnd.where("id", "=", id));
|
||||
//变更为会员则需要清除社团负责人角色
|
||||
dao.clear(Sys_user_role.class, Cnd.where("clubId", "=", clubId).and("userId", "=", clubUser.getUserId())
|
||||
.and("roleId", "in", roleList));
|
||||
} else {
|
||||
//先清除原始身份的角色
|
||||
dao.clear(Sys_user_role.class, Cnd.where("clubId", "=", clubId).and("userId", "=", clubUser.getUserId())
|
||||
.and("roleId", "in", roleList));
|
||||
//插入新的身份角色
|
||||
Sys_user_role sysUserRole = new Sys_user_role();
|
||||
sysUserRole.setUserId(clubUser.getUserId());
|
||||
Sys_role sysRole = sysRoleService.getByCode(roleCode);
|
||||
sysUserRole.setRoleId(sysRole.getId());
|
||||
sysUserRole.setClubId(clubId);
|
||||
dao.insert(sysUserRole);
|
||||
|
||||
clubUser.setRoleCode(roleCode);
|
||||
dao.update(clubUser);
|
||||
if(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();
|
||||
@@ -233,7 +232,7 @@ public class ClubInfoManageController {
|
||||
group.orLike("t1.username", keyWord).orLike("t1.loginname", keyWord);
|
||||
cnd.and(group);
|
||||
if (addMember != null && !addMember) {
|
||||
cnd.and(new Static("t1.id in (SELECT userId from club_user WHERE clubId = '%s' and roleCode = '%s')".formatted(clubId, RoleConstant.CLUB_MEMBER.name())));
|
||||
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)));
|
||||
}
|
||||
@@ -250,7 +249,7 @@ public class ClubInfoManageController {
|
||||
//查询社团是否存在会长或者秘书长
|
||||
if (List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name()).contains(roleCode)) {
|
||||
int count = clubInfoManageService.dao().count(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||
.and("roleCode", "=", roleCode));
|
||||
.and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(roleCode))));
|
||||
if (count > 0) {
|
||||
return Result.error((Objects.equals(roleCode, RoleConstant.CLUB_PRESIDENT.name()) ? "会长" : "秘书长") + "只能有一位");
|
||||
}
|
||||
@@ -266,16 +265,22 @@ public class ClubInfoManageController {
|
||||
sysUserService.clearCache();
|
||||
sysRoleService.clearCache();
|
||||
}
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||
.and("userId", "=", user).and("roleCode", "=", RoleConstant.CLUB_MEMBER.name()));
|
||||
ClubUser cUser = new ClubUser();
|
||||
if (clubUser != null) {
|
||||
cUser = clubUser;
|
||||
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()).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));
|
||||
}
|
||||
cUser.setClubId(clubId);
|
||||
cUser.setUserId(user);
|
||||
cUser.setRoleCode(roleCode);
|
||||
sysClubUserService.insertOrUpdate(cUser);
|
||||
dao.insertOrUpdate(clubUser);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
@@ -295,13 +300,12 @@ public class ClubInfoManageController {
|
||||
EasyExcel.write(byteArrayOutputStream, ClubUserImportVo.class)
|
||||
.sheet("协会会员导入模版")
|
||||
.doWrite(ArrayList::new);
|
||||
CommonDownloadUtil.download("协会会员导入模版.xlsx",byteArrayOutputStream.toByteArray() ,response);
|
||||
CommonDownloadUtil.download("协会会员导入模版.xlsx", byteArrayOutputStream.toByteArray() ,response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@@ -310,14 +314,12 @@ public class ClubInfoManageController {
|
||||
List<T> ts = EasyExcelUtil.syncReadModel(file.getFile(), ClubUserImportVo.class, 0, 1);
|
||||
List<ClubUserImportVo> mdList = JSONUtil.parseArray(JSONUtil.toJsonStr(ts)).toList(ClubUserImportVo.class);
|
||||
List<String> loginNames = mdList.stream().map(ClubUserImportVo::getLoginname).collect(Collectors.toList());
|
||||
List<View_user> sysUsers = sysClubUserService.dao().query(View_user.class, Cnd.where("loginname", "in", loginNames));
|
||||
List<ClubUser> clubUsers = sysClubUserService.dao().query(ClubUser.class,Cnd.where("clubId", "=", businessId));
|
||||
|
||||
List<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) {
|
||||
sysClubUserService.clear(Cnd.where("clubId", "=", businessId));
|
||||
dao.clear(ClubUser.class, Cnd.where("clubId", "=", businessId));
|
||||
}
|
||||
//返回错误记录
|
||||
List<ClubUserImportVo> errorInfos = new ArrayList<>();
|
||||
@@ -334,13 +336,12 @@ public class ClubInfoManageController {
|
||||
continue;
|
||||
}
|
||||
ClubUser cUser = new ClubUser();
|
||||
cUser.setClubPosition(v.getClubPosition());
|
||||
cUser.setUserId(user.getId());
|
||||
cUser.setClubId(businessId);
|
||||
cUser.setRoleCode(RoleConstant.CLUB_MEMBER.name());
|
||||
cUser.setRoleCode(List.of(RoleConstant.CLUB_MEMBER.name()));
|
||||
clubUserList.add(cUser);
|
||||
}
|
||||
sysClubUserService.insert(clubUserList);
|
||||
dao.insert(clubUserList);
|
||||
|
||||
List<Sys_user_role> sysUserRoleList = new ArrayList<>();
|
||||
clubUserList.forEach(cUser -> {
|
||||
@@ -350,7 +351,7 @@ public class ClubInfoManageController {
|
||||
role.setClubId(cUser.getClubId());
|
||||
sysUserRoleList.add(role);
|
||||
});
|
||||
sysClubUserService.insert(sysUserRoleList);
|
||||
dao.insert(sysUserRoleList);
|
||||
|
||||
//如果有错误数据就返回给前端
|
||||
if (Lang.isNotEmpty(errorInfos)) {
|
||||
@@ -365,5 +366,4 @@ public class ClubInfoManageController {
|
||||
}
|
||||
return Result.success("导入成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-132
@@ -1,132 +0,0 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUserBackHistory;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubUserService;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 11:19
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@At("/platform/club/infoManage/clubManagePersonAudit")
|
||||
public class ClubManagePersonAuditController {
|
||||
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private SysClubUserService sysClubUserService;
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/infoManage/clubManagePersonAudit/index.html")
|
||||
@SaCheckPermission("club.infoManage.clubManagePersonAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.clubManagePersonAudit")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination pagination = clubInfoManageService.clubManagePersonAuditPageData(pageForm);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.clubManagePersonAudit")
|
||||
public Result getAllClub() {
|
||||
//List<SysClub> list = sysClubService.query(Cnd.where("state", "=", ClubRegistAuditState.SCHOOL_PASS).asc("clubCode"));
|
||||
List<SysClub> list = sysClubService.query(Cnd.NEW().asc("clubCode"));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.clubManagePersonAudit")
|
||||
@SLog(type = "clubManagePersonAudit", tag = "校工会审核理事机构", msg = "校工会审核理事机构")
|
||||
public Result doAudit(@Valid String[] ids, @Valid Boolean isPass) {
|
||||
List<SysClubUser> clubUsers = sysClubUserService.query(Cnd.where("id", "in", ids));
|
||||
List<SysClubUserBackHistory> list = new ArrayList<>();
|
||||
clubUsers.forEach(item -> {
|
||||
if (item.getStatus() == 5) {
|
||||
item.setState(isPass ? 3 : 2);
|
||||
if (isPass) {
|
||||
item.setRoleCode(item.getChangeRoleCode());
|
||||
}
|
||||
item.setChangeRoleCode(null);
|
||||
item.setRoleCodeChangeTime(null);
|
||||
} else {
|
||||
item.setStatus(isPass ? 5 : 4);
|
||||
}
|
||||
if (isPass) {
|
||||
|
||||
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(
|
||||
RoleConstant.CLUB_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_VICE_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_SECRETARY.name(),
|
||||
RoleConstant.CLUB_VICE_SECRETARY.name()
|
||||
));
|
||||
|
||||
sysClubService.dao().clear(Sys_user_role.class, Cnd.where("clubId", "=", item.getClubId()).and("userId", "=", item.getUserId())
|
||||
.and("roleId", "in", roleList));
|
||||
Sys_user_role sys_user_role = new Sys_user_role();
|
||||
sys_user_role.setUserId(item.getUserId());
|
||||
Sys_role sysRole = sysRoleService.getByCode(item.getRoleCode());
|
||||
sys_user_role.setRoleId(sysRole.getId());
|
||||
sys_user_role.setClubId(item.getClubId());
|
||||
sysClubService.dao().insert(sys_user_role);
|
||||
|
||||
SysClubUserBackHistory backHistory = new SysClubUserBackHistory();
|
||||
backHistory.setUserId(item.getUserId());
|
||||
backHistory.setClubId(item.getClubId());
|
||||
backHistory.setBTime(cn.hutool.core.date.DateUtil.now());
|
||||
backHistory.setRoleCode(item.getRoleCode());
|
||||
list.add(backHistory);
|
||||
}
|
||||
});
|
||||
sysClubService.dao().update(clubUsers);
|
||||
sysClubService.dao().insert(list);
|
||||
sysUserService.clearCache();
|
||||
sysRoleService.clearCache();
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+118
-7
@@ -1,23 +1,43 @@
|
||||
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
|
||||
@@ -32,20 +52,62 @@ public class ClubRefreshReportController {
|
||||
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
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() {
|
||||
}
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.refreshReport")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination pagination = clubInfoManageService.reportPageData(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);
|
||||
}
|
||||
|
||||
@@ -53,9 +115,58 @@ public class ClubRefreshReportController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.refreshReport")
|
||||
@SLog(type = "refreshReport", tag = "提交换届报告", msg = "提交换届报告")
|
||||
public Object refreshDo(SysClub club) {
|
||||
public Object submit(@Param("data") SysClubRefresh clubRefresh) {
|
||||
|
||||
sysClubService.update(Chain.make("replaceReport", club.getReplaceReport()).add("reportState", 1), Cnd.where("id", "=", club.getId()));
|
||||
List<SysClubRefresh> list = dao.query(SysClubRefresh.class, Cnd.NEW());
|
||||
List<String> idList = list.stream().map(SysClubRefresh::getId).toList();
|
||||
int count = dao.count(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "in", idList).and(ProcessInstance::getState, "!=", ProcessInstanceStateEnum.FINISHED.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(type = "refreshReport", tag = "删除换届报告", msg = "删除换届报告")
|
||||
public Result delete(@Param("id") String id) {
|
||||
clubInfoManageService.dao().delete(SysClubRefresh.class, id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
+119
-8
@@ -1,23 +1,44 @@
|
||||
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
|
||||
@@ -32,20 +53,62 @@ public class ClubRuleUpdateController {
|
||||
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
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() {
|
||||
}
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.ruleUpdate")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination pagination = clubInfoManageService.reportPageData(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);
|
||||
}
|
||||
|
||||
@@ -53,10 +116,58 @@ public class ClubRuleUpdateController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.ruleUpdate")
|
||||
@SLog(type = "ruleUpdate", tag = "提交章程备案", msg = "提交章程备案")
|
||||
public Object ruleDo(SysClub club) {
|
||||
public Object submit(@Param("data")SysClubRule clubRule) {
|
||||
|
||||
sysClubService.update(Chain.make("afterRulesFile", club.getAfterRulesFile())
|
||||
.add("ruleState", 1), Cnd.where("id", "=", club.getId()));
|
||||
List<SysClubRule> list = dao.query(SysClubRule.class, Cnd.NEW());
|
||||
List<String> idList = list.stream().map(SysClubRule::getId).toList();
|
||||
int count = dao.count(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "in", idList).and(ProcessInstance::getState, "!=", ProcessInstanceStateEnum.FINISHED.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(type = "ruleUpdate", tag = "删除章程备案", msg = "删除章程备案")
|
||||
public Result delete(@Param("id") String id) {
|
||||
clubInfoManageService.dao().delete(SysClubRule.class, id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
+65
-39
@@ -1,25 +1,25 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
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.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubFiles;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.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
|
||||
@@ -35,44 +35,70 @@ public class ClubSchoolAuditReportController {
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/infoManage/schoolAuditReport/index.html")
|
||||
@SaCheckPermission("club.infoManage.schoolAuditReport")
|
||||
public void index() {
|
||||
}
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.schoolAuditReport")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination pagination = clubInfoManageService.schoolAuditReportPageData(pageForm);
|
||||
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 instanceVariale,
|
||||
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.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
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);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.schoolAuditReport")
|
||||
@SLog(type = "schoolAuditRule", tag = "校工会审核换届报告", msg = "校工会审核换届报告")
|
||||
public Object auditDo(@Valid String id, @Valid Boolean pass) {
|
||||
|
||||
SysClub sysClub = sysClubService.fetch(id);
|
||||
if (pass) {
|
||||
sysClubService.update(Chain.make("replaceReport", sysClub.getReplaceReport())
|
||||
.add("reportState", 3), Cnd.where("id", "=", id));
|
||||
//文件留痕
|
||||
SysClubFiles clubFiles = new SysClubFiles();
|
||||
clubFiles.setUserId(SecurityUtil.getUserId());
|
||||
clubFiles.setUserName(SecurityUtil.getUserUsername());
|
||||
clubFiles.setClubId(sysClub.getId());
|
||||
clubFiles.setBTime(cn.hutool.core.date.DateUtil.now());
|
||||
clubFiles.setFileType(2);
|
||||
clubFiles.setFiles(sysClub.getReplaceReport());
|
||||
sysClubService.dao().insert(clubFiles);
|
||||
} else {
|
||||
sysClubService.update(Chain.make("reportState", 2), Cnd.where("id", "=", id));
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
+65
-39
@@ -1,25 +1,25 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
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.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubFiles;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.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
|
||||
@@ -35,44 +35,70 @@ public class ClubSchoolAuditRuleController {
|
||||
@Inject
|
||||
private SysClubInfoManageService clubInfoManageService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/club/infoManage/schoolAuditRule/index.html")
|
||||
@SaCheckPermission("club.infoManage.schoolAuditRule")
|
||||
public void index() {
|
||||
}
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club.infoManage.schoolAuditRule")
|
||||
public Result pageData(@Valid ClubUserPageForm pageForm) {
|
||||
Pagination pagination = clubInfoManageService.schoolAuditRulePageData(pageForm);
|
||||
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 instanceVariale,
|
||||
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.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
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);
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.schoolAuditRule")
|
||||
@SLog(type = "schoolAuditRule", tag = "校工会审核章程备案", msg = "校工会审核章程备案")
|
||||
public Object auditDo(@Valid String id, @Valid Boolean pass) {
|
||||
|
||||
SysClub sysClub = sysClubService.fetch(id);
|
||||
if (pass) {
|
||||
sysClubService.update(Chain.make("rulesFile", sysClub.getAfterRulesFile())
|
||||
.add("ruleState", 3), Cnd.where("id", "=", id));
|
||||
//文件留痕
|
||||
SysClubFiles clubFiles = new SysClubFiles();
|
||||
clubFiles.setUserId(SecurityUtil.getUserId());
|
||||
clubFiles.setUserName(SecurityUtil.getUserUsername());
|
||||
clubFiles.setClubId(sysClub.getId());
|
||||
clubFiles.setBTime(cn.hutool.core.date.DateUtil.now());
|
||||
clubFiles.setFileType(1);
|
||||
clubFiles.setFiles(sysClub.getAfterRulesFile());
|
||||
sysClubService.dao().insert(clubFiles);
|
||||
} else {
|
||||
sysClubService.update(Chain.make("ruleState", 2), Cnd.where("id", "=", id));
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
+133
-107
@@ -12,12 +12,15 @@ 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;
|
||||
@@ -44,120 +47,143 @@ import java.util.List;
|
||||
@At("/platform/club/register/clubRegisterApply")
|
||||
public class ClubRegistApplyController {
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@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("")
|
||||
@Ok("beetl:/platform/zhgh/club/register/apply/index.html")
|
||||
@SaCheckPermission("club.register.apply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.apply")
|
||||
@SLog(type = "registerApply", tag = "保存注册协会", msg = "保存注册协会")
|
||||
public Result doSave(@Param("club") SysClub club,
|
||||
@Param("::deleteIds") List<String> deleteIds,
|
||||
@Param("::managePerson") List<NutMap> managePerson) {
|
||||
// 如果用户是保存,则只操作业务表
|
||||
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(type = "registerApply", 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(type = "registerApply", tag = "提交注册协会", msg = "提交注册协会")
|
||||
public Result doSubmit(@Param("club") SysClub club,
|
||||
@Param("::deleteIds") List<String> deleteIds,
|
||||
@Param("::managePerson") List<NutMap> managePerson) {
|
||||
SysClub sysClub;
|
||||
if (StrUtil.isBlank(club.getId())) {
|
||||
sysClub = sysClubService.doAdd(club, managePerson);
|
||||
} else {
|
||||
sysClub = sysClubService.doEdit(club, deleteIds, managePerson);
|
||||
}
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.register.apply")
|
||||
@SLog(type = "registerApply", 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);
|
||||
// 开启流程实例
|
||||
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);
|
||||
}
|
||||
// 自动完成第一个申请任务
|
||||
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
|
||||
@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
|
||||
@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);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result queryUserByIds(@Valid String[] ids) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.id,
|
||||
t1.username AS userName,
|
||||
t1.loginName AS loginName,
|
||||
t2.NAME AS unitName,
|
||||
t1.mobile,
|
||||
t1.email
|
||||
FROM
|
||||
`sys_user` t1
|
||||
LEFT JOIN sys_unit t2 ON t2.id = t1.unitId
|
||||
$condition
|
||||
limit 0, 50
|
||||
""");
|
||||
cnd.and("t1.id", "in", ids);
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(sysUserService.listMap(sql));
|
||||
}
|
||||
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")
|
||||
public Result info(@Valid String id) {
|
||||
ClubRegisterVo clubRegisterVo = sysClubService.findOne(id);
|
||||
return Result.success(clubRegisterVo);
|
||||
}
|
||||
@At
|
||||
@SaCheckPermission("club.register.apply")
|
||||
public Result getUserByKeyWord(@Valid String keyWord) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.id,
|
||||
t1.username AS userName,
|
||||
t1.loginName AS loginName,
|
||||
t2.NAME AS unitName,
|
||||
t1.mobile,
|
||||
t1.email
|
||||
FROM
|
||||
`sys_user` t1
|
||||
LEFT JOIN sys_unit t2 ON t2.id = t1.unitId
|
||||
WHERE
|
||||
(t1.loginname like @keyWord or username like @keyWord)
|
||||
limit 0, 50
|
||||
""");
|
||||
sql.setParam("keyWord", "%" + keyWord + "%");
|
||||
return Result.success(sysUserService.listMap(sql));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result createCode() {
|
||||
int count = sysClubService.count(Cnd.where("createTime", "=", DateUtil.thisYear()));
|
||||
String s = String.format("%02d", count + 1);
|
||||
return Result.success().addData(Convert.toStr(DateUtil.thisYear()) + s);
|
||||
}
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result queryUserByIds(@Valid String[] ids) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.id,
|
||||
t1.username AS userName,
|
||||
t1.loginName AS loginName,
|
||||
t2.NAME AS unitName,
|
||||
t1.mobile,
|
||||
t1.email
|
||||
FROM
|
||||
`sys_user` t1
|
||||
LEFT JOIN sys_unit t2 ON t2.id = t1.unitId
|
||||
$condition
|
||||
limit 0, 50
|
||||
""");
|
||||
cnd.and("t1.id", "in", ids);
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(sysUserService.listMap(sql));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result info(@Valid String id) {
|
||||
ClubRegisterVo clubRegisterVo = sysClubService.findOne(id);
|
||||
return Result.success(clubRegisterVo);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("club")
|
||||
public Result createCode() {
|
||||
int count = sysClubService.count(Cnd.where("year(createTime)", "=", DateUtil.thisYear()));
|
||||
String s = String.format("%02d", count + 1);
|
||||
return Result.success().addData(Convert.toStr(DateUtil.thisYear()) + s);
|
||||
}
|
||||
}
|
||||
|
||||
+36
-12
@@ -28,6 +28,7 @@ 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;
|
||||
@@ -36,6 +37,7 @@ 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;
|
||||
@@ -116,24 +118,35 @@ public class ClubStatisticsController {
|
||||
u.mobile,
|
||||
u.unitname as unitName,
|
||||
u.userState,
|
||||
c.roleCode,
|
||||
r.name AS roleName
|
||||
c.*
|
||||
FROM
|
||||
club_user c
|
||||
LEFT JOIN `vw_user` u ON u.id = c.userId
|
||||
LEFT JOIN sys_role r on r.code = c.roleCode
|
||||
$condition
|
||||
ORDER BY FIELD( c.roleCode, 'CLUB_PRESIDENT', 'CLUB_VICE_PRESIDENT', 'CLUB_SECRETARY', 'CLUB_VICE_SECRETARY', 'CLUB_OPERATOR', 'CLUB_MEMBER' )
|
||||
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);
|
||||
// cnd.andEX("c.giveMoney", "=", giveMoney);
|
||||
// cnd.andEX("c.isNormal", "=", true);
|
||||
// cnd.andEX("c.status", "=", 5);
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = sysClubService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -155,14 +168,20 @@ public class ClubStatisticsController {
|
||||
u.mobile,
|
||||
u.unitname as unitName,
|
||||
u.userstate as userState,
|
||||
r.name AS roleName,
|
||||
c.clubId
|
||||
c.*
|
||||
FROM
|
||||
club_user c
|
||||
LEFT JOIN `vw_user` u ON u.id = c.userId
|
||||
LEFT JOIN sys_role r on r.code = c.roleCode
|
||||
$condition
|
||||
ORDER BY FIELD( c.roleCode, 'CLUB_PRESIDENT', 'CLUB_VICE_PRESIDENT', 'CLUB_SECRETARY', 'CLUB_VICE_SECRETARY', 'CLUB_OPERATOR', 'CLUB_MEMBER' )
|
||||
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())) {
|
||||
@@ -176,6 +195,12 @@ public class ClubStatisticsController {
|
||||
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);
|
||||
@@ -254,7 +279,6 @@ public class ClubStatisticsController {
|
||||
file.addAll(Optional.ofNullable(item.getRulesFile()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getManageFile()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getYearPlanFile()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getSchoolReplyFile()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getReplaceReport()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getRulesFile()).orElseGet(ArrayList::new));
|
||||
fileList.put(item.getId(), file);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -39,17 +40,19 @@ public class ClubRegisterInterceptor implements FlowInterceptor {
|
||||
// 审核通过,就给角色,找理事机构
|
||||
List<ClubUser> clubUsers = dao.query(
|
||||
ClubUser.class,
|
||||
Cnd.where("roleCode", "!=", RoleConstant.CLUB_MEMBER.name())
|
||||
.and("clubId", "=", club.getId())
|
||||
Cnd.where("clubId", "=", club.getId())
|
||||
);
|
||||
List<Sys_user_role> list = clubUsers.stream().map(o -> {
|
||||
Sys_user_role userRole = new Sys_user_role();
|
||||
Sys_role sysRole = sysRoleService.getByCode(o.getRoleCode());
|
||||
userRole.setRoleId(sysRole.getId());
|
||||
userRole.setUserId(o.getUserId());
|
||||
userRole.setClubId(club.getId());
|
||||
return userRole;
|
||||
}).toList();
|
||||
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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,9 @@ 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")
|
||||
@@ -32,7 +35,7 @@ public class ClubUser extends BaseModel {
|
||||
@Column
|
||||
@Comment("身份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String roleCode;
|
||||
private List<String> roleCode = new ArrayList<>();
|
||||
|
||||
@Column
|
||||
@Comment("协会职务")
|
||||
@@ -59,4 +62,5 @@ public class ClubUser extends BaseModel {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String awardsExperience;
|
||||
|
||||
private String userName;
|
||||
}
|
||||
|
||||
@@ -109,11 +109,6 @@ public class SysClub extends BaseModel {
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> rulesFile;
|
||||
|
||||
@Column
|
||||
@Comment("后面修订的章程")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> afterRulesFile;
|
||||
|
||||
@Column
|
||||
@Comment("经费来源及管理办法")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@@ -124,16 +119,6 @@ public class SysClub extends BaseModel {
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> yearPlanFile;
|
||||
|
||||
@Column
|
||||
@Comment("校工会批复文件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> schoolReplyFile;
|
||||
|
||||
@Column
|
||||
@Comment("状态")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private Integer state;
|
||||
|
||||
@Column
|
||||
@Comment("申请人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@@ -156,14 +141,4 @@ public class SysClub extends BaseModel {
|
||||
@Comment("换届报告")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> replaceReport;
|
||||
|
||||
@Column
|
||||
@Comment("修改章程状态(1.待校工会审核 2.校工会审核拒绝 3.审核通过)")
|
||||
@ColDefine(type = ColType.INT, width = 10)
|
||||
private Integer ruleState;
|
||||
|
||||
@Column
|
||||
@Comment("换届报告状态(1.待校工会审核 2.校工会审核拒绝 3.审核通过)")
|
||||
@ColDefine(type = ColType.INT, width = 10)
|
||||
private Integer reportState;
|
||||
}
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.budwk.app.zhgh.club.model;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/8 10:54
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("sys_club_files")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会相关文件")
|
||||
public class SysClubFiles extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("用户")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("用户姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("社团id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String clubId;
|
||||
|
||||
@Column
|
||||
@Comment("备份时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String bTime;
|
||||
|
||||
@Column
|
||||
@Comment("文件类型,1是换届报告,2是章程")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer fileType;
|
||||
|
||||
@Column
|
||||
@Comment("文件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
}
|
||||
@@ -0,0 +1,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;
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
package com.budwk.app.zhgh.club.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/8/7 10:17
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("sys_club_user")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会成员")
|
||||
public class SysClubUser extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("协会id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@NotEmpty(message = "协会不能为空")
|
||||
private String clubId;
|
||||
|
||||
@Column
|
||||
@Comment("用户id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@NotEmpty(message = "用户不能为空")
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("入社时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String joinTime;
|
||||
|
||||
@Column
|
||||
@Comment("身份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String roleCode;
|
||||
|
||||
@Column
|
||||
@Comment("是否缴费")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean payed;
|
||||
|
||||
@Column
|
||||
@Comment("是否拨付")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean giveMoney;
|
||||
|
||||
@Column
|
||||
@Comment("状态(1 待协会审核 2 协会审核不通过 3 待校工会审核 4 校工会审核不通过 5 通过)")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
private Integer status;
|
||||
|
||||
@Column
|
||||
@Comment("退会状态(1 待协会审核 2 协会审核不通过 3 待校工会审核 4 校工会审核不通过 5 通过)")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
private Integer exitStatus;
|
||||
|
||||
@Column
|
||||
@Comment("理事机构成员变更时的审核状态(1 待校工会审核 2 校工会审核拒绝 3 审核成功)")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
private Integer state;
|
||||
|
||||
@Column
|
||||
@Comment("变更之后的身份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String changeRoleCode;
|
||||
|
||||
@Column
|
||||
@Comment("变更时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String roleCodeChangeTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("审核记录")
|
||||
private List<NutMap> auditList;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("退出审核记录")
|
||||
private List<NutMap> exitAuditList;
|
||||
|
||||
@Column
|
||||
@Comment("是否正常,此字段相当于一个标识,删除或者退休,设置为false,不会真正的从数据库删除,目的是为了后面统计年度成员情况")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isNormal;
|
||||
|
||||
@Column
|
||||
@Comment("isNormal变化的时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String changeTime;
|
||||
|
||||
@Column
|
||||
@Comment("职务")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String position;
|
||||
|
||||
@Column
|
||||
@Comment("加入、退出")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean mode;
|
||||
|
||||
@Column
|
||||
@Comment("邮箱")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String email;
|
||||
|
||||
@Column
|
||||
@Comment("头像")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String avatar;
|
||||
|
||||
@Column
|
||||
@Comment("同时参加其他协会情况")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String sameTimeJoinOtherClubSituation;
|
||||
|
||||
@Column
|
||||
@Comment("文化、体育方面的活动经历、获奖情况")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String awardsExperience;
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.budwk.app.zhgh.club.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* @Author: JyuHsin
|
||||
* @Date: 2024/7/5 16:52
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("sys_club_user_back_history")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("协会成员备份表")
|
||||
public class SysClubUserBackHistory extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("用户")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@NotEmpty(message = "用户不能为空")
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("协会id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@NotEmpty(message = "协会不能为空")
|
||||
private String clubId;
|
||||
|
||||
@Column
|
||||
@Comment("备份时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String bTime;
|
||||
|
||||
@Column
|
||||
@Comment("身份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 60)
|
||||
@NotEmpty(message = "身份不能为空")
|
||||
private String roleCode;
|
||||
}
|
||||
@@ -23,12 +23,6 @@ public interface SysClubInfoManageService extends BaseService<ClubCommonPageVo>
|
||||
|
||||
Pagination<ClubUserCommonPageVo> infoManageUserPageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
Pagination<ClubCommonPageVo> reportPageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
Pagination<ClubCommonPageVo> schoolAuditRulePageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
Pagination<ClubCommonPageVo> schoolAuditReportPageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
Pagination<ClubUserCommonPageVo> clubManagePersonAuditPageData(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
List<NutMap> getClubTreeData();
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.budwk.app.zhgh.club.service;
|
||||
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.validation.Valid;
|
||||
@@ -17,26 +15,11 @@ import java.util.List;
|
||||
* @Version: v1.0.0
|
||||
* @Description: TODO
|
||||
**/
|
||||
public interface SysClubUserService extends BaseService<SysClubUser> {
|
||||
public interface SysClubUserService extends BaseService<ClubUser> {
|
||||
|
||||
List<NutMap> getClubUser(@Valid String clubId);
|
||||
|
||||
Pagination pageDataByApplyJoinClubAudit(@Valid ClubUserPageForm pageForm);
|
||||
|
||||
/**
|
||||
* 入会申请审核
|
||||
* @param ids clubUser表中主键id
|
||||
* @param auditResult 审核结果,true or false
|
||||
* @param auditType 审核类型,协会还是校工会,值为1 or 2
|
||||
* @param applyType 申请类型,入会还是退会,值为1 or 2
|
||||
* @param payed 是否缴费,true or false
|
||||
* @return void
|
||||
*/
|
||||
void doAudit(@Valid String[] ids,
|
||||
@Valid Boolean auditResult,
|
||||
@Valid Integer auditType,
|
||||
@Valid Integer applyType,
|
||||
@Valid Boolean payed);
|
||||
|
||||
String getClubLeader(@Valid String clubId);
|
||||
}
|
||||
|
||||
@@ -72,10 +72,8 @@ public class SysClubEvaluateServiceImpl extends BaseServiceImpl<SysClubEvaluate>
|
||||
|
||||
cnd.andEX("info.clubId", "=", pageForm.getClubId());
|
||||
cnd.andEX("year(info.applyTime)", "=", pageForm.getYear());
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
cnd.groupBy("info.id");
|
||||
cnd.desc("applyTime");
|
||||
sql.setCondition(cnd);
|
||||
@@ -142,7 +140,7 @@ public class SysClubEvaluateServiceImpl extends BaseServiceImpl<SysClubEvaluate>
|
||||
cnd.andEX("year(ce.applyTime)", "=", pageForm.getYear());
|
||||
|
||||
if (pageForm.getAudit()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
@@ -99,17 +99,31 @@ public class SysClubExamineServiceImpl extends BaseServiceImpl<SysClubExamineReg
|
||||
u.username as userName,
|
||||
u.loginname as loginName,
|
||||
u.unitname as unitName,
|
||||
u.mobile,
|
||||
r.`name` AS roleName
|
||||
u.mobile
|
||||
FROM
|
||||
club_user cl
|
||||
LEFT JOIN `vw_user` u ON cl.userId = u.id
|
||||
LEFT JOIN sys_role r ON r.code = cl.roleCode
|
||||
WHERE
|
||||
cl.clubId = @clubId
|
||||
ORDER BY FIELD( cl.roleCode, 'CLUB_PRESIDENT', 'CLUB_VICE_PRESIDENT', 'CLUB_SECRETARY', 'CLUB_VICE_SECRETARY','CLUB_OPERATOR', 'CLUB_MEMBER' )
|
||||
""").setParam("clubId", clubId).setParam("roleCode", RoleConstant.CLUB_MEMBER.name());
|
||||
return listMap(sql);
|
||||
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
|
||||
@@ -181,10 +195,8 @@ public class SysClubExamineServiceImpl extends BaseServiceImpl<SysClubExamineReg
|
||||
""");
|
||||
cnd.andEX("YEAR(info.registerDate)", "=", pageForm.getYear());
|
||||
cnd.andEX("sc.id", "=", pageForm.getClubId());
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
cnd.groupBy("info.id");
|
||||
cnd.desc("registerDate");
|
||||
sql.setCondition(cnd);
|
||||
@@ -270,7 +282,7 @@ public class SysClubExamineServiceImpl extends BaseServiceImpl<SysClubExamineReg
|
||||
cnd.andEX("YEAR(info.registerDate)", "=", pageForm.getYear());
|
||||
|
||||
if (pageForm.getAudit()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
+53
-117
@@ -26,8 +26,10 @@ import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.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;
|
||||
|
||||
@@ -37,6 +39,7 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -80,9 +83,9 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
|
||||
secretaryUser.username AS clubSecretary
|
||||
FROM
|
||||
sys_club c
|
||||
LEFT JOIN club_user presidentCu on presidentCu.clubId = c.id AND presidentCu.roleCode = 'CLUB_PRESIDENT'
|
||||
LEFT JOIN 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 secretaryCu.roleCode = 'CLUB_SECRETARY'
|
||||
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
|
||||
@@ -120,14 +123,21 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
|
||||
u.unitid as unitId,
|
||||
u.mobile,
|
||||
club.clubName,
|
||||
u.unitname as unitName,
|
||||
r.name as roleName
|
||||
u.unitname as unitName
|
||||
FROM
|
||||
club_user scu
|
||||
LEFT JOIN sys_club club ON scu.clubId = club.id
|
||||
LEFT JOIN sys_role r on r.code = scu.roleCode
|
||||
RIGHT JOIN `vw_user` u ON scu.userId = u.id
|
||||
$condition
|
||||
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_MEMBER"') THEN 5
|
||||
ELSE 99
|
||||
END
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
@@ -148,89 +158,31 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
|
||||
|
||||
//查询理事机构
|
||||
if (pageForm.getRadioType() != null && 1 == pageForm.getRadioType()) {
|
||||
cnd.and("scu.roleCode", "!=", RoleConstant.CLUB_MEMBER);
|
||||
cnd.and(new Static("NOT JSON_CONTAINS(scu.roleCode, '\"CLUB_MEMBER\"')"));
|
||||
}
|
||||
//查询社团成员
|
||||
if (pageForm.getRadioType() != null && 2 == pageForm.getRadioType()) {
|
||||
cnd.and("scu.roleCode", "=", RoleConstant.CLUB_MEMBER);
|
||||
cnd.and(new Static("JSON_CONTAINS(scu.roleCode, '\"CLUB_MEMBER\"')"));
|
||||
cnd.and(new Static("JSON_LENGTH(scu.roleCode) = 1"));
|
||||
}
|
||||
cnd.asc("field( scu.roleCode, 'CLUB_PRESIDENT', 'CLUB_VICE_PRESIDENT', 'CLUB_SECRETARY', 'CLUB_VICE_SECRETARY','CLUB_OPERATOR', 'CLUB_MEMBER' )");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<ClubUserCommonPageVo> vo = sysClubService.listPageVO(pageForm, sql, ClubUserCommonPageVo.class);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubCommonPageVo> reportPageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
|
||||
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(
|
||||
RoleConstant.CLUB_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_VICE_PRESIDENT.name(),
|
||||
RoleConstant.CLUB_SECRETARY.name(),
|
||||
RoleConstant.CLUB_VICE_SECRETARY.name()
|
||||
));
|
||||
|
||||
List<Sys_user_role> userRoles = dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId())
|
||||
.and("roleId", "in", roleList));
|
||||
List<String> clubIdList = userRoles.stream().map(Sys_user_role::getClubId).collect(Collectors.toList());
|
||||
cnd.and("c.id", "in", clubIdList);
|
||||
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);
|
||||
}
|
||||
Sql sql = generateSql(pageForm, cnd);
|
||||
return listPageVO(pageForm, sql, ClubCommonPageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubCommonPageVo> schoolAuditRulePageData(ClubUserPageForm pageForm) {
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("ruleState", "=", 1);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
cnd.and("c.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
Sql sql = generateSql(pageForm, cnd);
|
||||
return listPageVO(pageForm, sql, ClubCommonPageVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<ClubCommonPageVo> schoolAuditReportPageData(ClubUserPageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("reportState", "=", 1);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
cnd.and("c.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.*,
|
||||
d.NAME AS typeName,
|
||||
(
|
||||
SELECT count( DISTINCT scu.userId )
|
||||
FROM club_user scu
|
||||
WHERE
|
||||
scu.clubId = c.id
|
||||
) currentNum,
|
||||
presidentUser.username AS clubLeader,
|
||||
secretaryUser.username AS clubSecretary
|
||||
FROM
|
||||
sys_club c
|
||||
LEFT JOIN club_user presidentCu on presidentCu.clubId = c.id AND presidentCu.roleCode = 'CLUB_PRESIDENT'
|
||||
LEFT JOIN sys_user presidentUser on presidentUser.id = presidentCu.userId
|
||||
LEFT JOIN club_user secretaryCu on secretaryCu.clubId = c.id AND secretaryCu.roleCode = 'CLUB_SECRETARY'
|
||||
LEFT JOIN sys_user secretaryUser on secretaryUser.id = secretaryCu.userId
|
||||
LEFT JOIN sys_dict d ON d.CODE = c.clubType
|
||||
LEFT JOIN bpm_process_instance ins ON ins.processInstanceBusinessId = c.id
|
||||
$condition
|
||||
""");
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.and("c.clubName", "LIKE", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
cnd.andEX("year(c.createTime)", "=", pageForm.getYear());
|
||||
cnd.and("c.dismiss", "=", false);
|
||||
cnd.and("ins.processInstanceStatus", "=", BpmProcessInstanceStatusEnum.COMPLETED);
|
||||
cnd.asc("c.state").desc("createTime");
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubCommonPageVo.class);
|
||||
listPageVO.setList(listMap);
|
||||
return listPageVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -271,42 +223,13 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
|
||||
return result;
|
||||
}
|
||||
|
||||
private Sql generateSql(ClubUserPageForm pageForm, Cnd cnd) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.*,
|
||||
d.NAME AS typeName,
|
||||
u.username as userName,
|
||||
u1.username AS concatPersonName,
|
||||
(select GROUP_CONCAT(DISTINCT username) from `vw_user` where id in (select sponsorId from sys_club_sponsor where clubId = c.id)) as sponsorName,
|
||||
( SELECT count( DISTINCT scu.userId ) FROM club_user scu WHERE scu.clubId = c.id ) currentNum
|
||||
FROM
|
||||
sys_club c
|
||||
LEFT JOIN sys_dict d ON d.CODE = c.clubType
|
||||
LEFT JOIN `vw_user` u ON u.id = c.userId
|
||||
LEFT JOIN `vw_user` u1 ON u1.id = c.concatPerson
|
||||
LEFT JOIN `vw_user` hzu ON hzu.id = c.userId
|
||||
LEFT JOIN wf_process_instance ins ON ins.businessNo = c.id
|
||||
$condition
|
||||
""");
|
||||
if (StrUtil.isNotBlank(pageForm.getClubName())) {
|
||||
cnd.and("c.clubName", "LIKE", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
cnd.andEX("year(c.createTime)", "=", pageForm.getYear());
|
||||
cnd.and("c.dismiss", "=", false);
|
||||
cnd.and("ins.state", "=", ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
|
||||
cnd.asc("c.state").desc("createTime");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportRegistrationDoc(String clubId, HttpServletResponse response) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.clubName,
|
||||
u.userName,
|
||||
u.username,
|
||||
u.username as userName,
|
||||
u.sex,
|
||||
DATE_FORMAT(u.birthday,'%Y-%m-%d') AS birthday,
|
||||
u.unitName,
|
||||
@@ -316,7 +239,7 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
|
||||
FROM
|
||||
sys_club c
|
||||
LEFT JOIN club_user scu ON scu.clubId = c.id
|
||||
AND scu.roleCode = 'CLUB_PRESIDENT'
|
||||
AND JSON_CONTAINS(scu.roleCode, '"CLUB_PRESIDENT"')
|
||||
LEFT JOIN vw_user u ON u.id = scu.userId
|
||||
WHERE
|
||||
c.id = @clubId
|
||||
@@ -336,16 +259,29 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
|
||||
u.technicalTitle,
|
||||
u.mobile,
|
||||
u.email,
|
||||
IF(scu.roleCode='CLUB_MEMBER',null,r.`name`) AS roleName
|
||||
scu.*
|
||||
FROM
|
||||
club_user scu
|
||||
LEFT JOIN vw_user u ON u.id = scu.userId
|
||||
LEFT JOIN sys_role r ON r.`code` = scu.roleCode
|
||||
WHERE scu.clubId = @clubId
|
||||
ORDER BY FIELD(scu.roleCode,'CLUB_PRESIDENT','CLUB_VICE_PRESIDENT','CLUB_SECRETARY','CLUB_VICE_SECRETARY','CLUB_MEMBER')
|
||||
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_MEMBER"') THEN 5
|
||||
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);
|
||||
|
||||
@@ -16,6 +16,7 @@ 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;
|
||||
@@ -38,6 +39,8 @@ 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
|
||||
@@ -54,10 +57,8 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
|
||||
|
||||
@Inject
|
||||
private SysClubUserService sysClubUserService;
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
|
||||
@@ -67,8 +68,8 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
|
||||
SELECT
|
||||
club.*,
|
||||
u.username as concatPersonName,
|
||||
(select GROUP_CONCAT(username) from sys_user where id in (select userId from club_user u where u.clubId=club.id and u.roleCode='CLUB_PRESIDENT')) as clubLeader,
|
||||
(select GROUP_CONCAT(username) from sys_user where id in (select userId from club_user u where u.clubId=club.id and u.roleCode='CLUB_SECRETARY')) as clubSecretary,
|
||||
(select 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
|
||||
@@ -170,7 +171,7 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
|
||||
List<ClubUser> clubUsers = managePerson.stream().map(person -> {
|
||||
ClubUser clubUser = new ClubUser();
|
||||
clubUser.setClubId(club.getId());
|
||||
clubUser.setRoleCode(person.getString("roleCode"));
|
||||
clubUser.setRoleCode(List.of(person.getString("roleCode")));
|
||||
clubUser.setUserId(person.getString("userId"));
|
||||
return clubUser;
|
||||
}).toList();
|
||||
@@ -195,7 +196,7 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
|
||||
List<ClubUser> clubUsers = managePerson.stream().map(person -> {
|
||||
ClubUser clubUser = new ClubUser();
|
||||
clubUser.setClubId(club.getId());
|
||||
clubUser.setRoleCode(person.getString("roleCode"));
|
||||
clubUser.setRoleCode(List.of(person.getString("roleCode")));
|
||||
clubUser.setUserId(person.getString("userId"));
|
||||
return clubUser;
|
||||
}).toList();
|
||||
@@ -242,9 +243,7 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
|
||||
cnd.andEX("info.clubName", "like", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
cnd.andEX("year(info.createTime)", "=", pageForm.getYear());
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
cnd.desc("createTime");
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubRegisterPageVo.class);
|
||||
@@ -314,7 +313,7 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
|
||||
cnd.andEX("club.clubName", "like", "%" + pageForm.getClubName() + "%");
|
||||
}
|
||||
if (pageForm.getAudit()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
@@ -8,8 +8,7 @@ import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUserBackHistory;
|
||||
import com.budwk.app.zhgh.club.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;
|
||||
@@ -23,11 +22,11 @@ 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 javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -37,154 +36,109 @@ import java.util.stream.Collectors;
|
||||
* @Description: TODO
|
||||
**/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class SysClubUserServiceImpl extends BaseServiceImpl<SysClubUser> implements SysClubUserService {
|
||||
public class SysClubUserServiceImpl extends BaseServiceImpl<ClubUser> implements SysClubUserService {
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
public SysClubUserServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
public SysClubUserServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> getClubUser(String clubId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
scu.*,
|
||||
u.username as userName,
|
||||
u.loginname as loginName,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
u.userState,
|
||||
unit.`name` unitName
|
||||
FROM
|
||||
club_user scu
|
||||
LEFT JOIN sys_user u ON scu.userId = u.id
|
||||
LEFT JOIN sys_unit unit ON u.unitid = unit.id
|
||||
WHERE scu.clubId = @clubId
|
||||
ORDER BY FIELD( scu.roleCode, 'CLUB_PRESIDENT', 'CLUB_VICE_PRESIDENT', 'CLUB_SECRETARY', 'CLUB_VICE_SECRETARY', 'CLUB_MEMBER' )
|
||||
""").setParam("clubId", clubId);
|
||||
return listMap(sql);
|
||||
}
|
||||
@Override
|
||||
public 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_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 = 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());
|
||||
int status = pageForm.getSource() == 1 ? 1 : 3;
|
||||
// if (pageForm.getAuditType() == 1) {
|
||||
// if (AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
// cnd.and(pageForm.getApplyType() == 1 ? "scu.status" : "scu.exitStatus", ">=", status);
|
||||
// } else {
|
||||
// cnd.and(pageForm.getApplyType() == 1 ? "scu.status" : "scu.exitStatus", ">", status).and(new Static("JSON_CONTAINS(%s, JSON_OBJECT('auditUser', '%s'))"
|
||||
// .formatted((pageForm.getApplyType() == 1 ? "auditList" : "exitAuditList"), SecurityUtil.getUserId())));
|
||||
// }
|
||||
// }
|
||||
// if (pageForm.getAuditType() == 2) {
|
||||
// if (AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
// cnd.and(pageForm.getApplyType() == 1 ? "scu.status" : "scu.exitStatus", ">", status);
|
||||
// } else {
|
||||
// cnd.and(pageForm.getApplyType() == 1 ? "scu.status" : "scu.exitStatus", ">", status).and(new Static("JSON_CONTAINS(%s, JSON_OBJECT('auditUser', '%s'))"
|
||||
// .formatted((pageForm.getApplyType() == 1 ? "auditList" : "exitAuditList"), SecurityUtil.getUserId())));
|
||||
// }
|
||||
// }
|
||||
// if (pageForm.getAuditType() == 3) {
|
||||
// cnd.and(pageForm.getApplyType() == 1 ? "scu.status" : "scu.exitStatus", "=", status);
|
||||
// }
|
||||
// if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
// List<SysClub> myManageClub = sysClubService.getMyManageClub();
|
||||
// List<String> clubIdList = myManageClub.stream().map(SysClub::getId).toList();
|
||||
// cnd.and("scu.clubId", "in", clubIdList);
|
||||
// }
|
||||
// if (Strings.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
// cnd.and(Cnd.exps("loginname", "like", "%" + pageForm.getSearchKeyword() + "%").or("username", "like", "%" + pageForm.getSearchKeyword() + "%"));
|
||||
// }
|
||||
// if (Strings.isNotBlank(pageForm.getPageOrderName()) && Strings.isNotBlank(pageForm.getPageOrderBy())) {
|
||||
// cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
// } else {
|
||||
// cnd.asc("club.clubCode");
|
||||
// }
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubUserCommonPageVo.class);
|
||||
}
|
||||
@Override
|
||||
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
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void doAudit(@Valid String[] ids,
|
||||
@Valid Boolean auditResult,
|
||||
@Valid Integer auditType,
|
||||
@Valid Integer applyType,
|
||||
@Valid Boolean payed) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.where().andInStrArray("id", ids);
|
||||
int status = 0;
|
||||
if (auditType == 1) {
|
||||
status = auditResult ? 5 : 2;
|
||||
} else if (auditType == 2) {
|
||||
status = auditResult ? 5 : 4;
|
||||
}
|
||||
List<NutMap> auditList = new ArrayList<>();
|
||||
auditList.add(NutMap.NEW().addv("auditUser", SecurityUtil.getUserId()).addv("auditState", auditResult)
|
||||
.addv("auditTime", DateUtil.now()).addv("auditType", auditType == 1 ? "club" : "school"));
|
||||
if(applyType == 1) {
|
||||
update(Chain.make("status", status).add("payed", payed).add("auditList", auditList), cnd);
|
||||
//备份会员
|
||||
List<SysClubUserBackHistory> list = new ArrayList<>();
|
||||
for (String id : ids) {
|
||||
SysClubUser sysClubUser = fetch(id);
|
||||
SysClubUserBackHistory backHistory = new SysClubUserBackHistory();
|
||||
backHistory.setUserId(sysClubUser.getUserId());
|
||||
backHistory.setClubId(sysClubUser.getClubId());
|
||||
backHistory.setBTime(cn.hutool.core.date.DateUtil.now());
|
||||
backHistory.setRoleCode(sysClubUser.getRoleCode());
|
||||
list.add(backHistory);
|
||||
}
|
||||
dao().insert(list);
|
||||
} else {
|
||||
Chain exitStatus = Chain.make("exitStatus", status).add("exitAuditList", auditList);
|
||||
if(status == 5) {
|
||||
exitStatus.add("isNormal", false);
|
||||
}
|
||||
update(exitStatus, cnd);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getClubLeader(String clubId) {
|
||||
|
||||
@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(","));
|
||||
}
|
||||
|
||||
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(","));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,9 +13,6 @@ import java.util.List;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ClubRegisterVo extends SysClub {
|
||||
|
||||
@ApiModelProperty("节点审批记录")
|
||||
private List<BpmTaskApprovalRecordVo> nodeTasks;
|
||||
|
||||
private List<NutMap> clubUser;
|
||||
private String typeName;
|
||||
private String concatPersonName;
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.budwk.app.zhgh.club.vo;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClubUser;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
||||
@@ -32,6 +32,4 @@ public class ClubUserImportVo {
|
||||
|
||||
@ExcelIgnore
|
||||
private String errorInfo;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package com.budwk.app.zhgh.dayofficework.site.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.site.model.SiteInfo;
|
||||
import com.budwk.app.zhgh.dayofficework.site.model.SiteType;
|
||||
import com.budwk.app.zhgh.dayofficework.site.service.SiteApplyService;
|
||||
import com.budwk.app.zhgh.dayofficework.site.service.SiteInfoService;
|
||||
import com.budwk.app.zhgh.dayofficework.site.service.SiteTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @ClassName SiteApplyController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/27 11:00
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "场地预约")
|
||||
@At("/platform/site/apply")
|
||||
public class SiteApplyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private SiteApplyService applyService;
|
||||
@Inject
|
||||
private SiteInfoService infoService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("site.apply")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/site/apply/index.html")
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("site.type")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param("year") Integer year,
|
||||
@Param("type") String type) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and(SiteInfo::getState, "=", true);
|
||||
cnd.andEX("year(createTime)", "=", year);
|
||||
cnd.andEX(SiteInfo::getTypeId, "=", type);
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or(SiteInfo::getName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or(SiteInfo::getAddress, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.asc("sortNum * 1");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
Pagination pagination = infoService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
List<NutMap> listMap = pagination.getList(NutMap.class);
|
||||
|
||||
List<SiteType> typeList = dao.query(SiteType.class, Cnd.NEW());
|
||||
Map<String, String> typeMap = typeList.stream().collect(Collectors.toMap(SiteType::getId, SiteType::getName));
|
||||
|
||||
for (NutMap map : listMap) {
|
||||
map.put("typeName", typeMap.get(map.getString("typeId")));
|
||||
}
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
package com.budwk.app.zhgh.dayofficework.site.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.site.model.SiteInfo;
|
||||
import com.budwk.app.zhgh.dayofficework.site.model.SiteType;
|
||||
import com.budwk.app.zhgh.dayofficework.site.service.SiteInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @ClassName SiteInfoController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/27 9:36
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "场地管理")
|
||||
@At("/platform/site/manage")
|
||||
public class SiteInfoController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private SiteInfoService infoService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("site.manage")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/site/manage/index.html")
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("site.manage")
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param("year") Integer year,
|
||||
@Param("type") String type) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("year(createTime)", "=", year);
|
||||
cnd.andEX(SiteInfo::getTypeId, "=", type);
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or(SiteInfo::getName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or(SiteInfo::getAddress, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.asc("sortNum * 1");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
Pagination pagination = infoService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
List<NutMap> listMap = pagination.getList(NutMap.class);
|
||||
|
||||
List<SiteType> typeList = dao.query(SiteType.class, Cnd.NEW());
|
||||
Map<String, String> typeMap = typeList.stream().collect(Collectors.toMap(SiteType::getId, SiteType::getName));
|
||||
|
||||
for (NutMap map : listMap) {
|
||||
map.put("typeName", typeMap.get(map.getString("typeId")));
|
||||
}
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("新增/修改场地")
|
||||
@SaCheckPermission("site.manage")
|
||||
@SLog(type = "site", tag = "新增/修改场地", msg = "新增/修改场地")
|
||||
public Object submit(@Param("data") SiteInfo info) {
|
||||
infoService.insertOrUpdate(info);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除场地")
|
||||
@SaCheckPermission("site.manage")
|
||||
@SLog(type = "site", tag = "删除场地", msg = "删除场地")
|
||||
public Object delete(String id) {
|
||||
infoService.delete(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询场地")
|
||||
@SaCheckLogin
|
||||
public Result querySites() {
|
||||
List<SiteInfo> list = infoService.query(Cnd.where(SiteInfo::getState, "=", true).desc(SiteInfo::getSortNum));
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package com.budwk.app.zhgh.dayofficework.site.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.site.model.SiteType;
|
||||
import com.budwk.app.zhgh.dayofficework.site.service.SiteTypeService;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.CondolenceType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName SiteTypeController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/27 8:53
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "场地类型")
|
||||
@At("/platform/site/type")
|
||||
public class SiteTypeController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private SiteTypeService typeService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("site.type")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/site/type/index.html")
|
||||
public void index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission("site.type")
|
||||
public Result pageData(PageForm pageForm) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or(SiteType::getName, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or(SiteType::getCode, "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.asc("code");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
Pagination pagination = typeService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("新增/修改场地类型")
|
||||
@SaCheckPermission("site.type")
|
||||
@SLog(type = "site", tag = "新增/修改场地类型", msg = "新增/修改场地类型")
|
||||
public Object submit(SiteType type) {
|
||||
typeService.insertOrUpdate(type);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除场地类型")
|
||||
@SaCheckPermission("site.type")
|
||||
@SLog(type = "site", tag = "删除场地类型", msg = "删除场地类型")
|
||||
public Object delete(String id) {
|
||||
typeService.delete(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询场地类型")
|
||||
@SaCheckLogin
|
||||
public Result querySiteType() {
|
||||
List<SiteType> list = typeService.query(Cnd.where(SiteType::getEnable, "=", true).asc(SiteType::getCode));
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.budwk.app.zhgh.dayofficework.site.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @ClassName SiteApply
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/27 10:59
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@Comment("场地预约")
|
||||
@Accessors(chain = true)
|
||||
@Table("site_apply")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SiteApply 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 siteId;
|
||||
|
||||
@Column
|
||||
@Comment("预约人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String applyUserId;
|
||||
|
||||
@Column
|
||||
@Comment("预约人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String applyUserName;
|
||||
|
||||
@Column
|
||||
@Comment("预约人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String applyLoginName;
|
||||
|
||||
@Column
|
||||
@Comment("预约人单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 60)
|
||||
private String applyUnitName;
|
||||
|
||||
@Column
|
||||
@Comment("预约人工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 60)
|
||||
private String applyUnionName;
|
||||
|
||||
@Column
|
||||
@Comment("预约人联系方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String applyMobile;
|
||||
|
||||
@Column
|
||||
@Comment("预约事由")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 1000)
|
||||
private String applyCause;
|
||||
|
||||
@Column
|
||||
@Comment("预约日期(天)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String applyDay;
|
||||
|
||||
@Column
|
||||
@Comment("预约开始时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String startTime;
|
||||
|
||||
@Column
|
||||
@Comment("预约结束时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String endTime;
|
||||
|
||||
@Column
|
||||
@Comment("预约人数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer joinCount;
|
||||
|
||||
@Column
|
||||
@Comment("反馈意见")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String backOption;
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.budwk.app.zhgh.dayofficework.site.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName Site
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/27 9:30
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@Comment("场地信息")
|
||||
@Accessors(chain = true)
|
||||
@Table("site_info")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SiteInfo extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("场地名称")
|
||||
private String name;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("场地地址")
|
||||
private String address;
|
||||
|
||||
@Column
|
||||
@Comment("联系人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String contactName;
|
||||
|
||||
@Column
|
||||
@Comment("联系电话")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String contactPhone;
|
||||
|
||||
@Column
|
||||
@Comment("开启状态")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean state;
|
||||
|
||||
@Column
|
||||
@Comment("开放时段")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<NutMap> openHours;
|
||||
|
||||
@Column
|
||||
@Comment("创建人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String createUserId;
|
||||
|
||||
@Column
|
||||
@Comment("创建人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String createUserName;
|
||||
|
||||
@Column
|
||||
@Comment("创建时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String createTime;
|
||||
|
||||
@Column
|
||||
@Comment("活动类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String typeId;
|
||||
|
||||
@Column
|
||||
@Comment("限制男女,0表示不限制,1表示限制男,2表示限制女")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer sexLimit;
|
||||
|
||||
@Column
|
||||
@Comment("场地的禁用时间")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<NutMap> notApplyTimeList;
|
||||
|
||||
@Column
|
||||
@Comment("场地介绍")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String introduce;
|
||||
|
||||
@Column
|
||||
@Comment("可容纳人数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer maxNum;
|
||||
|
||||
@Column
|
||||
@Comment("面向预约对象(1.面向分工会,2.面向个人,3.面向集体)")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer reserveTarget;
|
||||
|
||||
@Column
|
||||
@Comment("排序编号")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer sortNum;
|
||||
|
||||
@Column
|
||||
@Comment("排除节假日")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default(value = "0")
|
||||
private Boolean filterHolidays;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.budwk.app.zhgh.dayofficework.site.model;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @ClassName SiteType
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/27 8:57
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@Comment("场地类型")
|
||||
@Accessors(chain = true)
|
||||
@Table("site_type")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SiteType extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@Comment("类型编码")
|
||||
private String code;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("类型名称")
|
||||
private String name;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Comment("是否启用")
|
||||
@Default("1")
|
||||
private Boolean enable;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("排序编号")
|
||||
private Integer sortNum;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.dayofficework.site.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.dayofficework.site.model.SiteApply;
|
||||
|
||||
/**
|
||||
* @ClassName SiteApplyService
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/27 11:01
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public interface SiteApplyService extends BaseService<SiteApply> {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.dayofficework.site.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.dayofficework.site.model.SiteInfo;
|
||||
|
||||
/**
|
||||
* @ClassName SiteInfoService
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/27 9:37
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public interface SiteInfoService extends BaseService<SiteInfo> {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.dayofficework.site.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.dayofficework.site.model.SiteType;
|
||||
|
||||
/**
|
||||
* @ClassName SiteTypeService
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/27 9:04
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public interface SiteTypeService extends BaseService<SiteType> {
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.budwk.app.zhgh.dayofficework.site.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.dayofficework.site.model.SiteApply;
|
||||
import com.budwk.app.zhgh.dayofficework.site.service.SiteApplyService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @ClassName SiteApplyServiceImpl
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/27 11:01
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class SiteApplyServiceImpl extends BaseServiceImpl<SiteApply> implements SiteApplyService {
|
||||
|
||||
public SiteApplyServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.budwk.app.zhgh.dayofficework.site.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.dayofficework.site.model.SiteInfo;
|
||||
import com.budwk.app.zhgh.dayofficework.site.service.SiteInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @ClassName SiteInfoServiceImpl
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/27 9:37
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class SiteInfoServiceImpl extends BaseServiceImpl<SiteInfo> implements SiteInfoService {
|
||||
|
||||
public SiteInfoServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.budwk.app.zhgh.dayofficework.site.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.dayofficework.site.model.SiteType;
|
||||
import com.budwk.app.zhgh.dayofficework.site.service.SiteTypeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @ClassName SiteTypeServiceImpl
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/8/27 9:04
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class SiteTypeServiceImpl extends BaseServiceImpl<SiteType> implements SiteTypeService {
|
||||
|
||||
public SiteTypeServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+20
@@ -14,18 +14,22 @@ import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.suggestionBox.models.SuggestionBox;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService;
|
||||
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.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
@@ -53,6 +57,8 @@ public class CondolenceApplyController {
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/condolence/apply/index.html")
|
||||
@@ -90,6 +96,20 @@ public class CondolenceApplyController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("重新提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("condolence.apply")
|
||||
public Result submitAgain(@Param("data") Condolence condolence, @Param("taskId") Long taskId) {
|
||||
dao.insertOrUpdate(condolence);
|
||||
|
||||
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("查询用户")
|
||||
@SaCheckPermission("condolence.apply")
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ public class CondolenceBranchUnionApprovalController {
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ public class CondolenceMineController {
|
||||
@At
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("condolence.mine")
|
||||
@SaCheckPermission("condolence")
|
||||
@SLog(type = "condolence", tag = "删除职工慰问", msg = "删除职工慰问")
|
||||
public Result delete(@Param("id") String id) {
|
||||
condolenceService.delete(id);
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ public class CondolenceSchoolUnionApprovalController {
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user