This commit is contained in:
@jyuhsin
2025-09-09 10:43:30 +08:00
parent 8d19af5e30
commit 5d28aa5f94
64 changed files with 2533 additions and 1544 deletions
@@ -36,6 +36,12 @@ public enum BpmProcessConstant {
CLUB_REGISTER("协会注册"),
CLUB_RULE_UPDATE("协会章程修订"),
CLUB_REFRESH_REPORT("协会换届报告"),
CLUB_MANAGER("协会理事机构"),
PERSON_EVALUATE("评优评先申请"),
ARTICLE("新闻投稿"),
@@ -132,14 +132,12 @@ public class ClubUserJoinApplyController {
}
if (ObjectUtil.isNotEmpty(clubUser)) {
{
return Result.error("请勿重复申请!");
}
return Result.error(99, "请勿重复申请!");
}
BpmProcessInstance processInstance = dao.fetch(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "=", userApply.getId()));
if (!processInstance.getProcessInstanceStatus().equals(BpmProcessInstanceStatusEnum.COMPLETED.name())) {
return Result.error("您有该协会的申请记录尚未完成,请到我的申请里查看!");
return Result.error(99, "您有该协会的申请记录尚未完成,请到我的申请里查看!");
}
return Result.success();
}
@@ -96,10 +96,10 @@ public class ClubUserJoinApprovalController {
}
cnd.andEX("YEAR(info.applyDate)","=",pageForm.getYear());
cnd.and(Cnd.likeEX("info.userName", pageForm.getUserName()));
cnd.and(Cnd.likeEX("info.loginName", pageForm.getLoginName()));
cnd.andEX("info.unionId","=",pageForm.getUnionId());
cnd.andEX("info.unitId","=",pageForm.getUnitId());
cnd.and(Cnd.likeEX("u.userName", pageForm.getUserName()));
cnd.and(Cnd.likeEX("u.loginName", pageForm.getLoginName()));
cnd.andEX("u.unionId","=",pageForm.getUnionId());
cnd.andEX("u.unitId","=",pageForm.getUnitId());
sql.setCondition(cnd);
Pagination<ClubUserJoinPageVo> pageVO = clubUserJoinService.listPageVO(pageForm, sql, ClubUserJoinPageVo.class);
@@ -22,6 +22,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;
@@ -46,7 +47,8 @@ public class ClubUserJoinMineController {
@At
@SaCheckPermission("club.join.mine")
public Result pageData(@Valid PageForm pageForm){
public Result pageData(@Valid PageForm pageForm,
@Param("year") Integer year){
Sql sql = Sqls.create("""
SELECT
info.*,
@@ -78,6 +80,7 @@ public class ClubUserJoinMineController {
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
cnd.and("inst.processInstanceInitiatorLoginName", "=", SecurityUtil.getUserLoginname());
}
cnd.andEX("year(info.applyDate)", "=", year);
cnd.groupBy("info.id");
sql.setCondition(cnd);
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
@@ -99,10 +99,10 @@ public class ClubUserJoinSchoolApprovalController {
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.ACTIVE);
}
cnd.andEX("YEAR(info.applyDate)", "=", pageForm.getYear());
cnd.and(Cnd.likeEX("info.userName", pageForm.getUserName()));
cnd.and(Cnd.likeEX("info.loginName", pageForm.getLoginName()));
cnd.andEX("info.unionId", "=", pageForm.getUnionId());
cnd.andEX("info.unitId", "=", pageForm.getUnitId());
cnd.and(Cnd.likeEX("u.userName", pageForm.getUserName()));
cnd.and(Cnd.likeEX("u.loginName", pageForm.getLoginName()));
cnd.andEX("u.unionId", "=", pageForm.getUnionId());
cnd.andEX("u.unitId", "=", pageForm.getUnitId());
sql.setCondition(cnd);
Pagination<ClubUserJoinPageVo> pageVO = clubUserJoinService.listPageVO(pageForm, sql, ClubUserJoinPageVo.class);
@@ -6,8 +6,9 @@ import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.bpm.service.BpmService;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.club.model.SysClubUser;
import com.budwk.app.zhgh.club.model.ClubUser;
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
import com.budwk.app.zhgh.club.service.SysClubUserService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
@@ -15,6 +16,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;
@@ -32,6 +34,8 @@ public class ClubUserMineClubController {
private BaseService baseService;
@Inject
private BpmService bpmService;
@Inject
private SysClubUserService clubUserService;
@At("")
@SaCheckPermission("club.join.mine.club")
@@ -41,13 +45,13 @@ public class ClubUserMineClubController {
@At
@SaCheckPermission("club.join.mine.club")
public Result pageData(@Valid ClubUserPageForm pageForm) {
List<SysClubUser> query = dao.query(SysClubUser.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).groupBy("clubId"));
List<ClubUser> query = dao.query(ClubUser.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).groupBy("clubId"));
if (Lang.isEmpty(query)) {
return Result.success();
}
List<String> clubIds = query.stream().map(SysClubUser::getClubId).toList();
List<String> clubIds = query.stream().map(ClubUser::getClubId).toList();
Sql sql = Sqls.create("""
SELECT
SELECT
club.*,
COUNT(DISTINCT ( uc.userId )) AS currentPeopleNum,
presidentUser.username AS clubLeader,
@@ -55,11 +59,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 sys_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,32 +75,10 @@ public class ClubUserMineClubController {
return Result.success(pagination);
}
@At
@SaCheckPermission("club.join.mine.club")
public Result getClubUsers(@Valid String clubId) {
Sql sql = Sqls.create("""
SELECT
scu.*,
role.`name` AS roleName,
u.username AS userName,
u.loginname AS loginName,
u.sex,
u.personType AS personType,
u.userState,
u.unitid AS unitId,
u.mobile,
club.clubName,
u.unitname AS unitName
FROM
club_user scu
LEFT JOIN sys_club club ON scu.clubId = club.id
LEFT JOIN `vw_user` u ON scu.userId = u.id
LEFT JOIN sys_role role ON role.`code` = scu.rolecode
WHERE
scu.clubId = @clubId
""").setParam("clubId", clubId);
return Result.success(baseService.listMap(sql));
List<NutMap> clubUser = clubUserService.getClubUser(clubId);
return Result.success(clubUser);
}
}
@@ -9,10 +9,11 @@ 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.bpm.enums.BpmProcessInstanceStatusEnum;
import com.budwk.app.bpm.models.BpmProcessInstance;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.club.model.SysClub;
import com.budwk.app.zhgh.club.model.SysClubUser;
import com.budwk.app.zhgh.club.service.SysClubService;
import com.budwk.app.zhgh.club.service.SysClubUserService;
import com.budwk.app.zhgh.club.vo.ClubRegisterVo;
@@ -85,14 +86,26 @@ public class ClubUserApplyController {
@At
@SaCheckPermission("club.applyJoin.apply")
public Result getCount() {
int hasJoinCount = sysClubService.dao().count(SysClub.class, Cnd.NEW().and("dismiss", "=", false)
//.and("state", "=", ClubRegistAuditState.SCHOOL_PASS)
.and(new Static("id in (SELECT clubId from club_user WHERE userId = '%s')".formatted(SecurityUtil.getUserId()))));
int noJoinCount = sysClubService.dao().count(SysClub.class, Cnd.NEW().and("dismiss", "=", false)
//.and("state", "=", ClubRegistAuditState.SCHOOL_PASS)
.and(new Static("id not in (SELECT clubId from club_user WHERE userid = '%s')".formatted(SecurityUtil.getUserId()))));
NutMap nutMap = new NutMap().setv("hasJoinCount", hasJoinCount).setv("noJoinCount", noJoinCount);
return Result.success(nutMap);
// 获取所有协会
List<SysClub> list = sysClubService.query();
// 获取审核通过的
List<BpmProcessInstance> instanceList = sysClubService.dao().query(
BpmProcessInstance.class,
Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "in", list.stream().map(SysClub::getId).toList())
.and(BpmProcessInstance::getProcessInstanceStatus, "=", BpmProcessInstanceStatusEnum.COMPLETED)
);
// 获取id
List<String> passList = instanceList.stream().map(BpmProcessInstance::getProcessInstanceBusinessId).toList();
int hasJoinCount = sysClubService.count(Cnd.NEW().and("dismiss", "=", false)
.and("id", "in", passList)
.and(new Static("id in (SELECT clubId from club_user WHERE userId = '%s')".formatted(SecurityUtil.getUserId()))));
int noJoinCount = sysClubService.count(Cnd.NEW().and("dismiss", "=", false)
.and("id", "in", passList)
.and(new Static("id not in (SELECT clubId from club_user WHERE userid = '%s')".formatted(SecurityUtil.getUserId()))));
NutMap nutMap = new NutMap().setv("hasJoinCount", hasJoinCount).setv("noJoinCount", noJoinCount);
return Result.success(nutMap);
}
@At
@@ -122,18 +135,7 @@ public class ClubUserApplyController {
@SLog(type = "clubApplyJoin", tag = "提交入会申请", msg = "提交入会申请")
public Result submit(@Valid String id) {
sysClubService.dao().clear(SysClubUser.class, Cnd.where("clubId", "=", id).and("userId", "=", SecurityUtil.getUserId()));
SysClubUser sysClubUser = new SysClubUser();
sysClubUser.setClubId(id);
sysClubUser.setUserId(SecurityUtil.getUserId());
sysClubUser.setJoinTime(DateUtil.now());
sysClubUser.setRoleCode(RoleConstant.CLUB_MEMBER.name());
sysClubUser.setStatus(1);
sysClubUser.setPayed(false);
sysClubUser.setIsNormal(true);
sysClubUser.setGiveMoney(false);
sysClubService.dao().insert(sysClubUser);
return Result.success();
}
@@ -143,7 +145,6 @@ public class ClubUserApplyController {
@SaCheckPermission("club.applyJoin.apply")
@SLog(type = "clubApplyJoin", tag = "撤销入会申请", msg = "撤销入会申请")
public Result revocation(@Valid String id) {
sysClubService.dao().clear(SysClubUser.class, Cnd.where("clubId", "=", id).and("userId", "=", SecurityUtil.getUserId()));
return Result.success();
}
@@ -15,6 +15,7 @@ import com.budwk.app.zhgh.club.model.SysClub;
import com.budwk.app.zhgh.club.model.SysClubEvaluate;
import com.budwk.app.zhgh.club.service.SysClubEvaluateService;
import com.budwk.app.zhgh.club.service.SysClubService;
import com.budwk.app.zhgh.club.vo.ClubEvaluateVo;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
@@ -69,8 +70,25 @@ public class ClubEvaluateApplyController {
@At
@SaCheckPermission("club.evaluate")
public Result info(@Valid String id) {
SysClubEvaluate evaluate = evaluateService.fetch(id);
return Result.success(evaluate);
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
ce.*,
c.clubName,
c.clubCode,
c.createTime,
d.NAME AS typeName,
c.foundTime
FROM
sys_club_evaluate ce
left join sys_club c on ce.clubId = c.id
LEFT JOIN sys_dict d ON d.CODE = c.clubType
$condition
""");
cnd.andEX("ce.id", "=", id);
sql.setCondition(cnd);
ClubEvaluateVo clubEvaluateVo = evaluateService.fetchVO(sql, ClubEvaluateVo.class);
return Result.success(clubEvaluateVo);
}
@At
@@ -34,7 +34,6 @@ public class ClubEvaluateSchoolAuditController {
@Inject
private SysClubEvaluateService sysClubEvaluateService;
@Inject
private BpmService bpmService;
@@ -11,7 +11,6 @@ import com.budwk.app.bpm.service.BpmService;
import com.budwk.app.web.controllers.open.commons.service.CommonService;
import com.budwk.app.zhgh.club.model.SysClub;
import com.budwk.app.zhgh.club.model.SysClubExamineRegister;
import com.budwk.app.zhgh.club.model.SysClubUser;
import com.budwk.app.zhgh.club.service.SysClubExamineService;
import com.budwk.app.zhgh.club.service.SysClubService;
import com.budwk.app.zhgh.club.service.SysClubUserService;
@@ -91,10 +90,8 @@ public class ClubExamineApplyController {
@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);
return Result.success();
}
@At
@@ -0,0 +1,206 @@
package com.budwk.app.zhgh.club.controller.infoManage;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
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.bpm.enums.BpmProcessTaskStatusEnum;
import com.budwk.app.bpm.enums.BpmTaskApprovalTypeEnum;
import com.budwk.app.bpm.models.BpmProcessTask;
import com.budwk.app.bpm.param.BpmTaskApprovalParam;
import com.budwk.app.bpm.service.BpmService;
import com.budwk.app.sys.models.Sys_role;
import com.budwk.app.sys.models.Sys_user_role;
import com.budwk.app.sys.services.SysRoleService;
import com.budwk.app.sys.services.SysUserService;
import com.budwk.app.web.controllers.open.commons.service.CommonService;
import com.budwk.app.zhgh.club.model.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 com.budwk.app.zhgh.club.vo.ClubManagerPageVo;
import com.budwk.app.zhgh.club.vo.ClubRuleUpdatePageVo;
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.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @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;
@Inject
private CommonService commonService;
@Inject
private BpmService bpmService;
@Inject
private Dao dao;
@Inject
private SysUserService sysUserService;
@Inject
private SysRoleService sysRoleService;
@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) {
Sql sql = Sqls.create("""
SELECT
info.*,
club.clubName,
inst.id processInstanceId,
inst.processInstanceNodeId,
inst.processInstanceNodeName,
inst.processInstanceTaskIds,
inst.processInstanceStatus,
task.id processInstanceTaskId,
task.taskStatus processInstanceTaskStatus,
COUNT(nt.id) OVER (PARTITION BY task.id) > 0 AS nextTaskIsComplete
FROM
bpm_process_task task
INNER JOIN bpm_process_node_define nd ON nd.id = task.processTaskNodeId
INNER JOIN bpm_process_instance inst ON inst.id = task.processInstanceId
INNER JOIN sys_club_manager info ON info.id = inst.processInstanceBusinessId
LEFT JOIN bpm_process_task nt ON nt.prevTaskId = task.id AND nt.taskStatus = 'COMPLETE'
LEFT JOIN sys_club club on club.id = info.clubId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("nd.nodeCode","=",50);
cnd.andEX("year(info.creatTime)", "=", pageForm.getYear());
if(pageForm.getAudit()){
cnd.and("task.taskStatus","=", BpmProcessTaskStatusEnum.COMPLETE);
}else{
cnd.and("task.taskStatus","=",BpmProcessTaskStatusEnum.ACTIVE);
}
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("info.id");
sql.setCondition(cnd);
Pagination<ClubManagerPageVo> pagination = infoManageService.listPageVO(pageForm, sql, ClubManagerPageVo.class);
List<ClubManagerPageVo> listMap = pagination.getList(ClubManagerPageVo.class);
for (ClubManagerPageVo nutMap : listMap) {
List<String> oldCodeList = Json.fromJsonAsList(String.class, nutMap.getOldRoleCode());
nutMap.setOldRoleName(SysClubUserServiceImpl.convertRoleName(oldCodeList));
List<String> nowCodeList = Json.fromJsonAsList(String.class, nutMap.getNowRoleCode());
nutMap.setNowRoleName(SysClubUserServiceImpl.convertRoleName(nowCodeList));
}
pagination.setList(listMap);
return Result.success(pagination);
}
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.infoManage.auditManager")
@SLog(type = "auditManager", tag = "校工会审核理事机构变更", msg = "校工会审核理事机构变更")
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) {
approvalParam.getBpmTaskApprovalTypeEnum();
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, null);
if (approvalParam.getBpmTaskApprovalTypeEnum().equals(BpmTaskApprovalTypeEnum.PASS)) {
SysClubManager clubManager = dao.fetch(SysClubManager.class, variables.get("processInstanceBusinessId").toString());
// 审核通过,变更理事机构和角色
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();
}
return Result.success();
}
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.infoManage.auditManager")
@SLog(type = "auditManager", tag = "校工会撤回审核理事机构", msg = "校工会撤回审核理事机构")
public Result revoke(@Valid String taskId) {
bpmService.revokeTask(taskId);
BpmProcessTask task = dao.fetch(BpmProcessTask.class, taskId);
Map<String, Object> variables = BeanUtil.beanToMap(task.getExtVariable());
SysClubManager clubManager = dao.fetch(SysClubManager.class, variables.get("processInstanceBusinessId").toString());
// 撤回,变更理事机构和角色
ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where(ClubUser::getClubId, "=", clubManager.getClubId()).and(ClubUser::getUserId, "=", clubManager.getChangeUserId()));
clubUser.setRoleCode(clubManager.getOldRoleCode());
// 先清除所有的角色
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.getOldRoleCode()) {
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();
return Result.success();
}
}
@@ -0,0 +1,212 @@
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.constant.BpmProcessConstant;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.bpm.enums.BpmProcessInstanceStatusEnum;
import com.budwk.app.bpm.models.BpmProcessInstance;
import com.budwk.app.bpm.service.BpmService;
import com.budwk.app.bpm.vo.BpmTaskApprovalRecordVo;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.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.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.Lang;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.validation.Valid;
import java.util.List;
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 SysClubInfoManageService infoManageService;
@Inject
private CommonService commonService;
@Inject
private BpmService bpmService;
@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,
inst.processInstanceNodeId,
inst.processInstanceNodeCode,
inst.processInstanceNodeName,
inst.processInstanceTaskIds,
inst.processInstanceStatus,
nd.nodeType AS processInstanceTaskNodeType,
(
SELECT
count( 1 ) > 0
FROM
bpm_process_task
WHERE
prevTaskId = ( SELECT id FROM bpm_process_task WHERE processInstanceId = inst.id AND processTaskNodeCode IN ( 10, 40, 70 ) ORDER BY createdAt DESC LIMIT 1 )
AND taskStatus = 'COMPELTE'
) AS nextTaskIsComplete
FROM
sys_club_manager info
LEFT JOIN sys_club club ON club.id = info.clubId
LEFT JOIN bpm_process_instance inst ON inst.processInstanceBusinessId = info.id
LEFT JOIN bpm_process_node_define nd ON nd.id = inst.processInstanceNodeId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("year(info.creatTime)", "=", 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());
}
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("info.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);
}
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.infoManage.change")
@SLog(tag = "协会管理系统-信息管理", msg = "提交变更理事机构")
public Object submit(@Param("data") SysClubManager clubManager) {
List<SysClubManager> list = dao.query(SysClubManager.class, Cnd.NEW());
List<String> idList = list.stream().map(SysClubManager::getId).toList();
int count = dao.count(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "in", idList).and(BpmProcessInstance::getProcessInstanceStatus, "!=", BpmProcessInstanceStatusEnum.COMPLETED));
if (count > 0) {
return Result.error("您有该协会的申请记录尚未完成,请核对!");
}
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);
SysClub club = dao.fetch(SysClub.class, clubManager.getClubId());
//查询校协会管理员审批人工号
String clubPresidentLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.SCHOOL_UNION_CLUB_ADMIN, Cnd.NEW());
if (StrUtil.isBlank(clubPresidentLoginName)) {
return Result.error("校协会管理员未配置审批人,请联系校工会!");
}
bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_MANAGER.name(), club.getClubName() + "的变更理事机构申请", clubManager.getId(), List.of(clubPresidentLoginName), null);
return Result.success();
}
@At
@ApiOperation("删除")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.infoManage.change")
@SLog(tag = "协会管理系统-信息管理", msg = "删除变更理事机构")
public Result delete(@Param("id") String id) {
dao.delete(SysClubManager.class, id);
bpmService.deleteInstance(id);
return Result.success();
}
@At
@SaCheckPermission("club.infoManage.change")
@ApiOperation("撤回")
@Aop(TransAop.READ_COMMITTED)
@SLog(tag = "协会评优", msg = "撤回申请")
public Result revokeApply(@Valid String id) {
bpmService.revokeApply(id);
return Result.success();
}
@At
@SaCheckPermission("club.infoManage.change")
public Result info(@Valid String id) {
SysClubManager clubManager = dao.fetch(SysClubManager.class, id);
NutMap nutMap = Lang.obj2nutmap(clubManager);
List<BpmTaskApprovalRecordVo> nodeTasks = bpmService.getNodeTasks(BpmProcessConstant.CLUB_MANAGER, id);
nutMap.put("nodeTasks", nodeTasks);
SysClub club = dao.fetch(SysClub.class, clubManager.getClubId());
nutMap.put("clubName", club.getClubName());
nutMap.put("oldRoleName", SysClubUserServiceImpl.convertRoleName(clubManager.getOldRoleCode()));
nutMap.put("nowRoleName", SysClubUserServiceImpl.convertRoleName(clubManager.getNowRoleCode()));
return Result.success(nutMap);
}
@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);
}
}
@@ -20,7 +20,6 @@ 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;
@@ -121,7 +120,6 @@ 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));
return Result.success();
}
@@ -130,7 +128,6 @@ 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));
return Result.success();
}
@@ -139,8 +136,7 @@ public class ClubInfoManageController {
@SaCheckPermission("club.infoManage.manage")
@SLog(type = "infoManage", tag = "撤回变更身份", msg = "撤回变更身份", param = true)
public Result rollbackChange(@Valid String id) {
dao.update(SysClubUser.class, Chain.make("state", null).add("changeRoleCode", null)
.add("roleCodeChangeTime", null), Cnd.where("id", "=", id));
return Result.success();
}
@@ -149,15 +145,7 @@ public class ClubInfoManageController {
@SaCheckPermission("club.infoManage.manage")
@SLog(type = "infoManage", tag = "退会", msg = "退会", param = true)
public Result exitClub(@Valid String id) {
SysClubUser clubUser = dao.fetch(SysClubUser.class, id);
Sys_role sysRole = sysRoleService.getByCode(clubUser.getRoleCode());
dao.update(SysClubUser.class, Chain.make("isNormal", false).add("changeTime", DateUtil.now())
, Cnd.where("id", "=", id));
dao.clear(Sys_user_role.class, Cnd.where("userId", "=", clubUser.getUserId())
.and("roleId", "=", sysRole.getId())
.and("clubId", "=", clubUser.getClubId()));
sysUserService.clearCache();
sysRoleService.clearCache();
return Result.success();
}
@@ -286,7 +274,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)));
}
@@ -302,18 +290,12 @@ 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));
int count = clubInfoManageService.dao().count(ClubUser.class, Cnd.where("clubId", "=", clubId)
.and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(roleCode))));
if (count > 0) {
return Result.error((Objects.equals(roleCode, RoleConstant.CLUB_PRESIDENT.name()) ? "会长" : "秘书长") + "只能有一位");
}
}
int status = 0;
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name()) || Objects.equals(RoleConstant.CLUB_MEMBER.name(), roleCode)) {
status = 5;
} else {
status = 3;
}
Sys_role sysRole = sysRoleService.getByCode(roleCode);
for (String user : users) {
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name()) || !Objects.equals(RoleConstant.CLUB_MEMBER.name(), roleCode)) {
@@ -325,16 +307,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;
}
cUser.setClubId(clubId);
cUser.setUserId(user);
cUser.setRoleCode(List.of(roleCode));
sysClubUserService.insertOrUpdate(cUser);
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));
}
dao.insertOrUpdate(clubUser);
}
return Result.success();
}
@@ -402,7 +390,6 @@ public class ClubInfoManageController {
}
}
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.infoManage.manage")
@@ -414,11 +401,9 @@ public class ClubInfoManageController {
List<View_user> sysUsers = sysClubUserService.dao().query(View_user.class, Cnd.where("loginname", "in", loginNames));
List<ClubUser> clubUsers = sysClubUserService.dao().query(ClubUser.class, Cnd.where("clubId", "=", businessId));
List<ClubUser> clubUserList = new ArrayList<>();
if (isFlag) {
sysClubUserService.clear(Cnd.where("clubId", "=", businessId));
dao.clear(ClubUser.class, Cnd.where("clubId", "=", businessId));
}
//返回错误记录
List<ClubUserImportVo> errorInfos = new ArrayList<>();
@@ -435,7 +420,6 @@ public class ClubInfoManageController {
continue;
}
ClubUser cUser = new ClubUser();
cUser.setClubPosition(v.getClubPosition());
cUser.setUserId(user.getId());
cUser.setClubId(businessId);
cUser.setRoleCode(List.of(RoleConstant.CLUB_MEMBER.name()));
@@ -451,7 +435,7 @@ public class ClubInfoManageController {
role.setClubId(cUser.getClubId());
sysUserRoleList.add(role);
});
sysClubUserService.insert(sysUserRoleList);
sysClubUserService.dao().insert(sysUserRoleList);
//如果有错误数据就返回给前端
if (Lang.isNotEmpty(errorInfos)) {
@@ -466,5 +450,4 @@ public class ClubInfoManageController {
}
return Result.success("导入成功");
}
}
@@ -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();
}
}
@@ -1,23 +1,45 @@
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.StrUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.constant.BpmProcessConstant;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.bpm.enums.BpmProcessInstanceStatusEnum;
import com.budwk.app.bpm.models.BpmProcessInstance;
import com.budwk.app.bpm.service.BpmService;
import com.budwk.app.bpm.vo.BpmTaskApprovalRecordVo;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.web.controllers.open.commons.service.CommonService;
import com.budwk.app.zhgh.club.model.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.lang.Lang;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.validation.Valid;
import java.util.List;
/**
* @Author: JyuHsin
@@ -32,9 +54,14 @@ public class ClubRefreshReportController {
@Inject
private SysClubInfoManageService clubInfoManageService;
@Inject
private SysClubService sysClubService;
@Inject
private Dao dao;
@Inject
private CommonService commonService;
@Inject
private BpmService bpmService;
@At("")
@Ok("beetl:/platform/zhgh/club/infoManage/refreshReport/index.html")
@@ -45,17 +72,110 @@ public class ClubRefreshReportController {
@At
@SaCheckPermission("club.infoManage.refreshReport")
public Result pageData(@Valid ClubUserPageForm pageForm) {
Pagination pagination = clubInfoManageService.reportPageData(pageForm);
return Result.success(pagination);
Sql sql = Sqls.create("""
SELECT
info.*,
club.clubName,
inst.processInstanceNodeId,
inst.processInstanceNodeCode,
inst.processInstanceNodeName,
inst.processInstanceTaskIds,
inst.processInstanceStatus,
nd.nodeType AS processInstanceTaskNodeType,
(
SELECT
count( 1 ) > 0
FROM
bpm_process_task
WHERE
prevTaskId = ( SELECT id FROM bpm_process_task WHERE processInstanceId = inst.id AND processTaskNodeCode IN ( 10, 40, 70 ) ORDER BY createdAt DESC LIMIT 1 )
AND taskStatus = 'COMPELTE'
) AS nextTaskIsComplete
FROM
sys_club_refresh info
LEFT JOIN sys_club club ON club.id = info.clubId
LEFT JOIN bpm_process_instance inst ON inst.processInstanceBusinessId = info.id
LEFT JOIN bpm_process_node_define nd ON nd.id = inst.processInstanceNodeId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("year(info.creatTime)", "=", 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());
}
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("info.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.refreshReport")
@SLog(type = "refreshReport", tag = "提交换届报告", msg = "提交换届报告")
public Object refreshDo(SysClub club) {
@SLog(tag = "协会管理系统-提交换届报告", msg = "提交换届报告")
public Object submit(@Param("data") SysClubRefresh refresh) {
sysClubService.update(Chain.make("replaceReport", club.getReplaceReport()).add("reportState", 1), Cnd.where("id", "=", club.getId()));
return Result.success();
List<SysClubRefresh> list = dao.query(SysClubRefresh.class, Cnd.NEW());
List<String> idList = list.stream().map(SysClubRefresh::getId).toList();
int count = dao.count(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "in", idList).and(BpmProcessInstance::getProcessInstanceStatus, "!=", BpmProcessInstanceStatusEnum.COMPLETED));
if (count > 0) {
return Result.error("您有该协会的申请记录尚未完成,请核对!");
}
SysClub club = clubInfoManageService.dao().fetch(SysClub.class, refresh.getClubId());
refresh.setUserId(SecurityUtil.getUserId());
refresh.setUserName(SecurityUtil.getUserUsername());
refresh.setLastFiles(club.getRulesFile());
if(StrUtil.isBlank(refresh.getId())) refresh.setCreatTime(DateUtil.now());
clubInfoManageService.dao().insertOrUpdate(refresh);
//查询校协会管理员审批人工号
String clubPresidentLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.SCHOOL_UNION_CLUB_ADMIN, Cnd.NEW());
if (StrUtil.isBlank(clubPresidentLoginName)) {
return Result.error("校协会管理员未配置审批人,请联系校工会!");
}
bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_REFRESH_REPORT.name(), club.getClubName() + "的换届报告申请", refresh.getId(), List.of(clubPresidentLoginName), null);
return Result.success();
}
@At
@ApiOperation("删除")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.infoManage.refreshReport")
@SLog(tag = "协会管理系统-信息管理", msg = "删除换届报告")
public Result delete(@Param("id") String id) {
dao.delete(SysClubRefresh.class, id);
bpmService.deleteInstance(id);
return Result.success();
}
@At
@SaCheckPermission("club.infoManage.refreshReport")
@ApiOperation("撤回")
@Aop(TransAop.READ_COMMITTED)
@SLog(tag = "协会评优", msg = "撤回申请")
public Result revokeApply(@Valid String id) {
bpmService.revokeApply(id);
return Result.success();
}
@At
@SaCheckPermission("club.infoManage.refreshReport")
public Result info(@Valid String id) {
SysClubRefresh clubRefresh = dao.fetch(SysClubRefresh.class, id);
NutMap nutMap = Lang.obj2nutmap(clubRefresh);
List<BpmTaskApprovalRecordVo> nodeTasks = bpmService.getNodeTasks(BpmProcessConstant.CLUB_REFRESH_REPORT, id);
nutMap.put("nodeTasks", nodeTasks);
SysClub club = dao.fetch(SysClub.class, clubRefresh.getClubId());
nutMap.put("clubName", club.getClubName());
return Result.success(nutMap);
}
}
@@ -1,23 +1,45 @@
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.constant.BpmProcessConstant;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.bpm.enums.BpmProcessInstanceStatusEnum;
import com.budwk.app.bpm.models.BpmProcessInstance;
import com.budwk.app.bpm.service.BpmService;
import com.budwk.app.bpm.vo.BpmTaskApprovalRecordVo;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.web.controllers.open.commons.service.CommonService;
import com.budwk.app.zhgh.club.model.SysClub;
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.lang.Lang;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.validation.Valid;
import java.util.List;
/**
* @Author: JyuHsin
@@ -32,9 +54,14 @@ public class ClubRuleUpdateController {
@Inject
private SysClubInfoManageService clubInfoManageService;
@Inject
private SysClubService sysClubService;
@Inject
private Dao dao;
@Inject
private CommonService commonService;
@Inject
private BpmService bpmService;
@At("")
@Ok("beetl:/platform/zhgh/club/infoManage/ruleUpdate/index.html")
@@ -45,18 +72,110 @@ public class ClubRuleUpdateController {
@At
@SaCheckPermission("club.infoManage.ruleUpdate")
public Result pageData(@Valid ClubUserPageForm pageForm) {
Pagination pagination = clubInfoManageService.reportPageData(pageForm);
return Result.success(pagination);
Sql sql = Sqls.create("""
SELECT
info.*,
club.clubName,
inst.processInstanceNodeId,
inst.processInstanceNodeCode,
inst.processInstanceNodeName,
inst.processInstanceTaskIds,
inst.processInstanceStatus,
nd.nodeType AS processInstanceTaskNodeType,
(
SELECT
count( 1 ) > 0
FROM
bpm_process_task
WHERE
prevTaskId = ( SELECT id FROM bpm_process_task WHERE processInstanceId = inst.id AND processTaskNodeCode IN ( 10, 40, 70 ) ORDER BY createdAt DESC LIMIT 1 )
AND taskStatus = 'COMPELTE'
) AS nextTaskIsComplete
FROM
sys_club_rule info
LEFT JOIN sys_club club ON club.id = info.clubId
LEFT JOIN bpm_process_instance inst ON inst.processInstanceBusinessId = info.id
LEFT JOIN bpm_process_node_define nd ON nd.id = inst.processInstanceNodeId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("year(info.creatTime)", "=", 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());
}
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("info.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.ruleUpdate")
@SLog(type = "ruleUpdate", tag = "提交章程备案", msg = "提交章程备案")
public Object ruleDo(SysClub club) {
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.infoManage.ruleUpdate")
@SLog(tag = "协会管理系统-信息管理", msg = "提交章程备案")
public Object submit(@Param("data")SysClubRule clubRule) {
sysClubService.update(Chain.make("afterRulesFile", club.getAfterRulesFile())
.add("ruleState", 1), Cnd.where("id", "=", club.getId()));
return Result.success();
}
List<SysClubRule> list = dao.query(SysClubRule.class, Cnd.NEW());
List<String> idList = list.stream().map(SysClubRule::getId).toList();
int count = dao.count(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "in", idList).and(BpmProcessInstance::getProcessInstanceStatus, "!=", BpmProcessInstanceStatusEnum.COMPLETED));
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);
//查询校协会管理员审批人工号
String clubPresidentLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.SCHOOL_UNION_CLUB_ADMIN, Cnd.NEW());
if (StrUtil.isBlank(clubPresidentLoginName)) {
return Result.error("校协会管理员未配置审批人,请联系校工会!");
}
bpmService.startSubmitProcessInstance(BpmProcessConstant.CLUB_RULE_UPDATE.name(), club.getClubName() + "的章程修订申请", clubRule.getId(), List.of(clubPresidentLoginName), null);
return Result.success();
}
@At
@ApiOperation("删除")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.infoManage.ruleUpdate")
@SLog(tag = "协会管理系统-信息管理", msg = "删除章程备案")
public Result delete(@Param("id") String id) {
dao.delete(SysClubRule.class, id);
bpmService.deleteInstance(id);
return Result.success();
}
@At
@SaCheckPermission("club.infoManage.ruleUpdate")
@ApiOperation("撤回")
@Aop(TransAop.READ_COMMITTED)
@SLog(tag = "协会评优", msg = "撤回申请")
public Result revokeApply(@Valid String id) {
bpmService.revokeApply(id);
return Result.success();
}
@At
@SaCheckPermission("club.infoManage.ruleUpdate")
public Result info(@Valid String id) {
SysClubRule rule = dao.fetch(SysClubRule.class, id);
NutMap nutMap = Lang.obj2nutmap(rule);
List<BpmTaskApprovalRecordVo> nodeTasks = bpmService.getNodeTasks(BpmProcessConstant.CLUB_RULE_UPDATE, id);
nutMap.put("nodeTasks", nodeTasks);
SysClub club = dao.fetch(SysClub.class, rule.getClubId());
nutMap.put("clubName", club.getClubName());
return Result.success(nutMap);
}
}
@@ -1,25 +1,41 @@
package com.budwk.app.zhgh.club.controller.infoManage;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
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.bpm.enums.BpmProcessTaskStatusEnum;
import com.budwk.app.bpm.enums.BpmTaskApprovalTypeEnum;
import com.budwk.app.bpm.models.BpmProcessTask;
import com.budwk.app.bpm.param.BpmTaskApprovalParam;
import com.budwk.app.bpm.service.BpmService;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.club.model.SysClub;
import com.budwk.app.zhgh.club.model.SysClubFiles;
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.club.vo.ClubRefreshReportPageVo;
import com.budwk.app.zhgh.club.vo.ClubRuleUpdatePageVo;
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.Map;
/**
* @Author: JyuHsin
@@ -34,9 +50,12 @@ public class ClubSchoolAuditReportController {
@Inject
private SysClubInfoManageService clubInfoManageService;
@Inject
private SysClubService sysClubService;
@Inject
private BpmService bpmService;
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/zhgh/club/infoManage/schoolAuditReport/index.html")
@@ -47,32 +66,85 @@ public class ClubSchoolAuditReportController {
@At
@SaCheckPermission("club.infoManage.schoolAuditReport")
public Result pageData(@Valid ClubUserPageForm pageForm) {
Pagination pagination = clubInfoManageService.schoolAuditReportPageData(pageForm);
return Result.success(pagination);
Sql sql = Sqls.create("""
SELECT
info.*,
club.clubName,
inst.id processInstanceId,
inst.processInstanceNodeId,
inst.processInstanceNodeName,
inst.processInstanceTaskIds,
inst.processInstanceStatus,
task.id processInstanceTaskId,
task.taskStatus processInstanceTaskStatus,
COUNT(nt.id) OVER (PARTITION BY task.id) > 0 AS nextTaskIsComplete
FROM
bpm_process_task task
INNER JOIN bpm_process_node_define nd ON nd.id = task.processTaskNodeId
INNER JOIN bpm_process_instance inst ON inst.id = task.processInstanceId
INNER JOIN sys_club_refresh info ON info.id = inst.processInstanceBusinessId
LEFT JOIN bpm_process_task nt ON nt.prevTaskId = task.id AND nt.taskStatus = 'COMPLETE'
LEFT JOIN sys_club club on club.id = info.clubId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("nd.nodeCode","=",50);
cnd.andEX("year(info.creatTime)", "=", pageForm.getYear());
if(pageForm.getAudit()){
cnd.and("task.taskStatus","=", BpmProcessTaskStatusEnum.COMPLETE);
}else{
cnd.and("task.taskStatus","=",BpmProcessTaskStatusEnum.ACTIVE);
}
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("info.id");
sql.setCondition(cnd);
Pagination<ClubRefreshReportPageVo> pagination = clubInfoManageService.listPageVO(pageForm, sql, ClubRefreshReportPageVo.class);
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) {
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.infoManage.schoolAuditReport")
@SLog(type = "schoolAuditRule", tag = "校工会审核换届报告", msg = "校工会审核换届报告")
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) {
approvalParam.getBpmTaskApprovalTypeEnum();
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, null);
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();
}
if (approvalParam.getBpmTaskApprovalTypeEnum().equals(BpmTaskApprovalTypeEnum.PASS)) {
SysClubRefresh clubRefresh = dao.fetch(SysClubRefresh.class, variables.get("processInstanceBusinessId").toString());
SysClub club = dao.fetch(SysClub.class, clubRefresh.getClubId());
club.setReplaceReport(clubRefresh.getFiles());
dao.update(club);
}
return Result.success();
}
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.infoManage.schoolAuditReport")
@SLog(type = "schoolAuditRule", tag = "校工会撤回换届报告", msg = "校工会撤回换届报告")
public Result revoke(@Valid String taskId) {
bpmService.revokeTask(taskId);
BpmProcessTask task = dao.fetch(BpmProcessTask.class, taskId);
Map<String, Object> variables = BeanUtil.beanToMap(task.getExtVariable());
SysClubRefresh clubRefresh = dao.fetch(SysClubRefresh.class, variables.get("processInstanceBusinessId").toString());
SysClub club = dao.fetch(SysClub.class, clubRefresh.getClubId());
club.setReplaceReport(clubRefresh.getLastFiles());
dao.update(club);
return Result.success();
}
}
@@ -1,25 +1,41 @@
package com.budwk.app.zhgh.club.controller.infoManage;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
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.bpm.enums.BpmProcessTaskStatusEnum;
import com.budwk.app.bpm.enums.BpmTaskApprovalTypeEnum;
import com.budwk.app.bpm.models.BpmProcessTask;
import com.budwk.app.bpm.param.BpmTaskApprovalParam;
import com.budwk.app.bpm.service.BpmService;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.club.model.SysClub;
import com.budwk.app.zhgh.club.model.SysClubFiles;
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.club.vo.ClubEvaluatePageVo;
import com.budwk.app.zhgh.club.vo.ClubRuleUpdatePageVo;
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;
import java.util.Map;
/**
* @Author: JyuHsin
@@ -34,9 +50,12 @@ public class ClubSchoolAuditRuleController {
@Inject
private SysClubInfoManageService clubInfoManageService;
@Inject
private SysClubService sysClubService;
@Inject
private BpmService bpmService;
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/zhgh/club/infoManage/schoolAuditRule/index.html")
@@ -47,32 +66,85 @@ public class ClubSchoolAuditRuleController {
@At
@SaCheckPermission("club.infoManage.schoolAuditRule")
public Result pageData(@Valid ClubUserPageForm pageForm) {
Pagination pagination = clubInfoManageService.schoolAuditRulePageData(pageForm);
return Result.success(pagination);
Sql sql = Sqls.create("""
SELECT
info.*,
club.clubName,
inst.id processInstanceId,
inst.processInstanceNodeId,
inst.processInstanceNodeName,
inst.processInstanceTaskIds,
inst.processInstanceStatus,
task.id processInstanceTaskId,
task.taskStatus processInstanceTaskStatus,
COUNT(nt.id) OVER (PARTITION BY task.id) > 0 AS nextTaskIsComplete
FROM
bpm_process_task task
INNER JOIN bpm_process_node_define nd ON nd.id = task.processTaskNodeId
INNER JOIN bpm_process_instance inst ON inst.id = task.processInstanceId
INNER JOIN sys_club_rule info ON info.id = inst.processInstanceBusinessId
LEFT JOIN bpm_process_task nt ON nt.prevTaskId = task.id AND nt.taskStatus = 'COMPLETE'
LEFT JOIN sys_club club on club.id = info.clubId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("nd.nodeCode","=",50);
cnd.andEX("year(info.creatTime)", "=", pageForm.getYear());
if(pageForm.getAudit()){
cnd.and("task.taskStatus","=", BpmProcessTaskStatusEnum.COMPLETE);
}else{
cnd.and("task.taskStatus","=",BpmProcessTaskStatusEnum.ACTIVE);
}
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("info.id");
sql.setCondition(cnd);
Pagination<ClubRuleUpdatePageVo> pagination = clubInfoManageService.listPageVO(pageForm, sql, ClubRuleUpdatePageVo.class);
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) {
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.infoManage.schoolAuditRule")
@SLog(type = "schoolAuditRule", tag = "校工会审核章程修订", msg = "校工会审核章程修订")
public Result approval(@Valid @Param("approval") BpmTaskApprovalParam approvalParam) {
approvalParam.getBpmTaskApprovalTypeEnum();
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
bpmService.completeTask(approvalParam.getProcessInstanceTaskId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, null);
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();
}
if (approvalParam.getBpmTaskApprovalTypeEnum().equals(BpmTaskApprovalTypeEnum.PASS)) {
SysClubRule rule = dao.fetch(SysClubRule.class, variables.get("processInstanceBusinessId").toString());
SysClub club = dao.fetch(SysClub.class, rule.getClubId());
club.setRulesFile(rule.getFiles());
dao.update(club);
}
return Result.success();
}
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("club.infoManage.schoolAuditRule")
@SLog(type = "schoolAuditRule", tag = "校工会撤回章程修订", msg = "校工会撤回章程修订")
public Result revoke(@Valid String taskId) {
bpmService.revokeTask(taskId);
BpmProcessTask task = dao.fetch(BpmProcessTask.class, taskId);
Map<String, Object> variables = BeanUtil.beanToMap(task.getExtVariable());
SysClubRule rule = dao.fetch(SysClubRule.class, variables.get("processInstanceBusinessId").toString());
SysClub club = dao.fetch(SysClub.class, rule.getClubId());
club.setRulesFile(rule.getLastFiles());
dao.update(club);
return Result.success();
}
}
@@ -150,7 +150,7 @@ public class ClubRegistApplyController {
@At
@SaCheckPermission("club")
public Result createCode() {
int count = sysClubService.count(Cnd.where("createTime", "=", DateUtil.thisYear()));
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);
}
@@ -20,7 +20,7 @@ import com.budwk.app.sys.models.Sys_user_role;
import com.budwk.app.sys.services.SysRoleService;
import com.budwk.app.sys.services.SysUserService;
import com.budwk.app.web.controllers.open.commons.service.CommonService;
import com.budwk.app.zhgh.club.model.SysClubUser;
import com.budwk.app.zhgh.club.model.ClubUser;
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
import com.budwk.app.zhgh.club.service.SysClubService;
import com.budwk.app.zhgh.club.vo.ClubRegisterPageVo;
@@ -89,26 +89,25 @@ public class ClubSchoolReplyController {
//如果审核通过就给角色
//找理事机构
List<SysClubUser> clubUsers = sysClubService.dao().query(SysClubUser.class, Cnd.where("clubId", "=", approvalParam.getProcessInstanceBusinessId())
.and("roleCode", "!=", RoleConstant.CLUB_MEMBER.name())
.and("isNormal", "=", true)
.and("status", "=", 5));
//找会长
List<SysClubUser> clubPresidents = clubUsers.stream().filter(o -> o.getRoleCode().equals(RoleConstant.CLUB_PRESIDENT.name())).toList();
if(Objects.equals(approvalParam.getBpmTaskApprovalType(), BpmTaskApprovalTypeEnum.PASS.name())) {
List<Sys_user_role> userRoles = new ArrayList<>();
clubUsers.forEach(cu -> {
Sys_user_role uRole = new Sys_user_role();
Sys_role sysRole = sysRoleService.getByCode(cu.getRoleCode());
uRole.setRoleId(sysRole.getId());
uRole.setUserId(cu.getUserId());
uRole.setClubId(approvalParam.getProcessInstanceBusinessId());
userRoles.add(uRole);
});
sysClubService.dao().insert(userRoles);
sysUserService.clearCache();
sysRoleService.clearCache();
}
List<ClubUser> clubUsers = sysClubService.dao().query(
ClubUser.class,
Cnd.where("clubId", "=", approvalParam.getProcessInstanceBusinessId())
);
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(approvalParam.getProcessInstanceBusinessId());
list.add(userRole);
}
}
sysClubService.dao().insert(list);
sysUserService.clearCache();
sysRoleService.clearCache();
return Result.success();
}
@@ -24,6 +24,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;
@@ -32,6 +33,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;
@@ -59,7 +61,6 @@ public class ClubStatisticsController {
private static final Logger log = LoggerFactory.getLogger(ClubStatisticsController.class);
@Inject
private SysClubService sysClubService;
@Inject
private SysRoleService sysRoleService;
@@ -112,25 +113,36 @@ 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);
return Result.success(pagination);
sql.setCondition(cnd);
Pagination pagination = sysClubService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
List<NutMap> listMap = pagination.getList(NutMap.class);
for (NutMap nutMap : listMap) {
List<String> list = Json.fromJsonAsList(String.class, nutMap.getString("roleCode"));
String roleName = SysClubUserServiceImpl.convertRoleName(list);
nutMap.put("roleName", roleName);
nutMap.put("roleCode", list);
}
pagination.setList(listMap);
return Result.success(pagination);
}
@At
@@ -143,7 +155,7 @@ public class ClubStatisticsController {
HttpServletResponse response) throws IOException {
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + URLUtil.encode("人员明细.zip"));
Sql sql = Sqls.create("""
Sql sql = Sqls.create("""
SELECT
u.username as userName,
u.loginname as loginName,
@@ -151,14 +163,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())) {
@@ -170,11 +188,14 @@ public class ClubStatisticsController {
cnd.andEX("c.clubId", "=", clubId);
cnd.andEX("u.userState", "=", userState);
cnd.andEX("u.sex", "=", sex);
// cnd.andEX("c.giveMoney", "=", giveMoney);
// cnd.andEX("c.isNormal", "=", true);
// cnd.andEX("c.status", "=", 5);
sql.setCondition(cnd);
List<NutMap> listMap = sysClubService.listMap(sql);
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);
@@ -187,8 +208,6 @@ public class ClubStatisticsController {
exportEntities.add(new ExcelExportEntity("联系方式", "mobile", 20));
exportEntities.add(new ExcelExportEntity("所在单位", "unitName", 20));
exportEntities.add(new ExcelExportEntity("在职状态", "userState", 20));
// exportEntities.add(new ExcelExportEntity("是否拨付", "giveMoney", 20));
// exportEntities.add(new ExcelExportEntity("是否缴费", "payed", 20));
exportEntities.add(new ExcelExportEntity("职务", "roleName", 20));
ZipOutputStream zipOutputStream = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream()));
clubList.forEach(item -> {
@@ -314,11 +333,11 @@ public class ClubStatisticsController {
club.clubCode,
club.clubName,
sum( CASE WHEN cu.userId is not null $myCondition THEN 1 ELSE 0 END ) AS total,
sum( CASE WHEN su.userState = '在职' $myCondition THEN 1 ELSE 0 END ) AS `work`,
sum( CASE WHEN su.userState in ('在职', '在岗') $myCondition THEN 1 ELSE 0 END ) AS `work`,
sum( CASE WHEN su.userState in ('退休') $myCondition THEN 1 ELSE 0 END ) AS retire,
sum( CASE WHEN su.sex = '男' $myCondition THEN 1 ELSE 0 END ) AS man,
sum( CASE WHEN su.sex = '女' $myCondition THEN 1 ELSE 0 END ) AS woman,
sum( CASE WHEN cu.roleCode != 'CLUB_MEMBER' AND 1 = 1 $myCondition THEN 1 ELSE 0 END ) AS governing_body
sum( CASE WHEN su.sex like '%%' $myCondition THEN 1 ELSE 0 END ) AS man,
sum( CASE WHEN su.sex like '%%' $myCondition THEN 1 ELSE 0 END ) AS woman,
sum( CASE WHEN ('CLUB_PRESIDENT' MEMBER OF (cu.roleCode) or 'CLUB_VICE_PRESIDENT' MEMBER OF (cu.roleCode) or 'CLUB_SECRETARY' MEMBER OF (cu.roleCode) or 'CLUB_VICE_SECRETARY' MEMBER OF (cu.roleCode)) AND 1 = 1 $myCondition THEN 1 ELSE 0 END ) AS governing_body
FROM
sys_club club
LEFT JOIN club_user cu ON cu.clubId = club.id
@@ -62,4 +62,5 @@ public class ClubUser extends BaseModel {
@ColDefine(type = ColType.VARCHAR, width = 500)
private String awardsExperience;
private String userName;
}
@@ -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();
@@ -3,7 +3,7 @@ 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;
@@ -17,7 +17,7 @@ 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);
@@ -89,7 +89,7 @@ public class SysClubEvaluateServiceImpl extends BaseServiceImpl<SysClubEvaluate>
@Override
public Pagination<ClubEvaluatePageVo> schoolAuditPageData(ClubUserPageForm pageForm) {
Cnd cnd = Cnd.NEW();
cnd.and("nd.nodeCode","=",20);
cnd.and("nd.nodeCode","=",50);
Sql sql = generateSql(pageForm, cnd);
return listPageVO(pageForm, sql, ClubEvaluatePageVo.class);
}
@@ -90,23 +90,37 @@ public class SysClubExamineServiceImpl extends BaseServiceImpl<SysClubExamineReg
@Override
public List<NutMap> getJgUser(String clubId) {
Sql sql = Sqls.create("""
Sql sql = Sqls.create("""
SELECT
cl.*,
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
@@ -25,8 +25,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;
@@ -36,6 +38,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;
/**
@@ -63,16 +66,15 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
@Override
public Pagination<ClubCommonPageVo> infoManagePageData(ClubUserPageForm pageForm) {
Cnd cnd = Cnd.NEW();
// Sql sql = generateSql(pageForm, cnd);
Sql sql = Sqls.create("""
SELECT
c.*,
d.NAME AS typeName,
(
SELECT
count( DISTINCT scu.userId )
FROM
club_user scu
count( DISTINCT scu.userId )
FROM
club_user scu
WHERE
scu.clubId = c.id
) currentNum,
@@ -80,9 +82,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 bpm_process_instance ins ON ins.processInstanceBusinessId = c.id
@@ -104,7 +106,6 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
cnd.and("c.id", "in", clubIdList);
}
// cnd.asc("c.state").desc("createTime");
cnd.asc("c.clubCode");
sql.setCondition(cnd);
return listPageVO(pageForm, sql, ClubCommonPageVo.class);
@@ -123,125 +124,66 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
u.unitid as unitId,
u.mobile,
club.clubName,
u.unitname as unitName,
r.name as roleName,
GROUP_CONCAT(r.`name`) as roleNames
u.unitname as unitName
FROM
club_user scu
LEFT JOIN sys_club club ON scu.clubId = club.id
LEFT JOIN sys_role r ON JSON_CONTAINS(scu.roleCode, CONCAT('"', r.CODE, '"')) OR r.CODE = JSON_UNQUOTE(JSON_EXTRACT(scu.roleCode, '$[0]'))
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();
cnd.groupBy("scu.id,scu.userId");
cnd.and("scu.clubId", "=", pageForm.getClubId());
// cnd.and("scu.isNormal", "=", true);
// cnd.and("scu.status", "in", Lang.array(1, 3, 5));
if (StrUtil.isNotBlank(pageForm.getPersonType())) {
cnd.and("u.personType", "=", pageForm.getPersonType());
}
if (StrUtil.isNotBlank(pageForm.getUserState())) {
cnd.and("u.userState", "=", pageForm.getUserState());
}
// if (pageForm.getGiveMoney() != null) {
// cnd.and("scu.giveMoney", "=", pageForm.getGiveMoney());
// }
if (Strings.isNotBlank(pageForm.getSearchKeyword())) {
cnd.and(Cnd.exps("loginname", "like", "%" + pageForm.getSearchKeyword() + "%").or("username", "like", "%" + pageForm.getSearchKeyword() + "%"));
}
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().equals("descending") ? "desc" : "asc");
cnd.orderBy(pageForm.getPageOrderName(), "descending".equals(pageForm.getPageOrderBy()) ? "desc" : "asc");
}
//查询理事机构
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);
return sysClubService.listPageVO(pageForm, sql, ClubUserCommonPageVo.class);
}
@Override
public Pagination<ClubCommonPageVo> reportPageData(ClubUserPageForm pageForm) {
Cnd cnd = Cnd.NEW();
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(
RoleConstant.CLUB_PRESIDENT.name(),
RoleConstant.CLUB_VICE_PRESIDENT.name(),
RoleConstant.CLUB_SECRETARY.name(),
RoleConstant.CLUB_VICE_SECRETARY.name()
));
List<Sys_user_role> userRoles = dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId())
.and("roleId", "in", roleList));
List<String> clubIdList = userRoles.stream().map(Sys_user_role::getClubId).collect(Collectors.toList());
cnd.and("c.id", "in", clubIdList);
}
Sql sql = generateSql(pageForm, cnd);
return listPageVO(pageForm, sql, ClubCommonPageVo.class);
}
@Override
public Pagination<ClubCommonPageVo> schoolAuditRulePageData(ClubUserPageForm pageForm) {
Cnd cnd = Cnd.NEW();
cnd.and("ruleState", "=", 1);
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
cnd.and("c.userId", "=", SecurityUtil.getUserId());
}
Sql sql = generateSql(pageForm, cnd);
return listPageVO(pageForm, sql, ClubCommonPageVo.class);
}
@Override
public Pagination<ClubCommonPageVo> schoolAuditReportPageData(ClubUserPageForm pageForm) {
Cnd cnd = Cnd.NEW();
cnd.and("reportState", "=", 1);
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
cnd.and("c.userId", "=", SecurityUtil.getUserId());
}
Sql sql = Sqls.create("""
SELECT
c.*,
d.NAME AS typeName,
(
SELECT count( DISTINCT scu.userId )
FROM club_user scu
WHERE
scu.clubId = c.id
) currentNum,
presidentUser.username AS clubLeader,
secretaryUser.username AS clubSecretary
FROM
sys_club c
LEFT JOIN club_user presidentCu on presidentCu.clubId = c.id AND presidentCu.roleCode = 'CLUB_PRESIDENT'
LEFT JOIN sys_user presidentUser on presidentUser.id = presidentCu.userId
LEFT JOIN club_user secretaryCu on secretaryCu.clubId = c.id AND secretaryCu.roleCode = 'CLUB_SECRETARY'
LEFT JOIN sys_user secretaryUser on secretaryUser.id = secretaryCu.userId
LEFT JOIN sys_dict d ON d.CODE = c.clubType
LEFT JOIN bpm_process_instance ins ON ins.processInstanceBusinessId = c.id
$condition
""");
if (StrUtil.isNotBlank(pageForm.getClubName())) {
cnd.and("c.clubName", "LIKE", "%" + pageForm.getClubName() + "%");
}
cnd.andEX("year(c.createTime)", "=", pageForm.getYear());
cnd.and("c.dismiss", "=", false);
cnd.and("ins.processInstanceStatus", "=", BpmProcessInstanceStatusEnum.COMPLETED);
cnd.asc("c.state").desc("createTime");
sql.setCondition(cnd);
return listPageVO(pageForm, sql, ClubCommonPageVo.class);
Pagination<ClubUserCommonPageVo> listPageVO = sysClubService.listPageVO(pageForm, sql, ClubUserCommonPageVo.class);
List<ClubUserCommonPageVo> listMap = listPageVO.getList(ClubUserCommonPageVo.class);
for (ClubUserCommonPageVo vo : listMap) {
List<String> list = vo.getRoleCode();
List<String> cleanedCodes = list.stream()
.filter(Objects::nonNull)
.map(String::strip)
.map(code -> code.startsWith("\"") && code.endsWith("\"")
? code.substring(1, code.length() - 1)
: code)
.toList();
String roleName = SysClubUserServiceImpl.convertRoleName(cleanedCodes);
vo.setRoleName(roleName);
vo.setRoleCode(cleanedCodes);
}
listPageVO.setList(listMap);
return listPageVO;
}
@Override
@@ -326,10 +268,10 @@ 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
c.id = @clubId
""");
sql.setParam("clubId", clubId);
sql.setCallback(Sqls.callback.map());
@@ -346,16 +288,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);
@@ -368,7 +323,7 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("clubRegis"), config).render(docData).writeAndClose(byteArrayOutputStream);
CommonDownloadUtil.download("南京邮电大学教职工文体协会登记表(" + clubInfo.getString("clubName") + ").docx", byteArrayOutputStream.toByteArray(), response);
CommonDownloadUtil.download("教职工文体协会登记表(" + clubInfo.getString("clubName") + ").docx", byteArrayOutputStream.toByteArray(), response);
} catch (IOException e) {
log.error("协会登记表导出失败,id:{},错误信息:{}", clubId, e.getMessage());
}
@@ -59,14 +59,12 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
@Override
public Pagination<ClubCommonPageVo> getAllClubWithPage(PageForm pageForm, Cnd cnd) {
// (select count(*) from sys_user where userState in ('在职', '在岗') and id in (select userId from sys_club_user where clubId = club.id and `status` = 5 and isNormal = true)) as workNum,
// (select count(*) from sys_user where userState in ('退休') and id in (select userId from sys_club_user where clubId = club.id and `status` = 5 and isNormal = true)) as retireNum,
Sql sql = Sqls.create("""
SELECT
club.*,
u.username as concatPersonName,
(select GROUP_CONCAT(username) from sys_user where id in (select userId from club_user u where u.clubId=club.id and u.roleCode='CLUB_PRESIDENT')) as clubLeader,
(select GROUP_CONCAT(username) from sys_user where id in (select userId from club_user u where u.clubId=club.id and u.roleCode='CLUB_SECRETARY')) as clubSecretary,
(select 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
@@ -187,14 +185,6 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
dao().clear(SysClubSponsor.class, Cnd.where("clubId", "=", club.getId()));
dao().insertLinks(club, "sponsors");
//if (!Objects.equals(club.getState(), ClubRegistAuditState.SCHOOL_PASS)) {
//插入新建社团时填入的理事机构
// List<SysClubUser> users = dao().query(SysClubUser.class, Cnd.NEW().andEX("id", "in", deleteIds));
// List<String> idList = users.stream().map(SysClubUser::getUserId).collect(Collectors.toList());
// List<String> roleList = commonService.findUserRoleByRoleCode(List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name()));
// if (Lang.isNotEmpty(deleteIds)) {
// dao().clear(SysClubUser.class, Cnd.where("id", "in", deleteIds));
// }
dao().clear(Sys_user_role.class, Cnd.where("clubId", "=", club.getId()));
dao().clear(ClubUser.class, Cnd.where(ClubUser::getClubId, "=", club.getId()));
@@ -208,28 +198,6 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
}).toList();
dao().insert(clubUsers);
}
// List<SysClubUser> clubUsers = new ArrayList<>();
// managePerson.forEach(item -> {
// SysClubUser cUser = new SysClubUser();
// SysClubUser fetch = dao().fetch(SysClubUser.class, Cnd.where("clubId", "=", club.getId()).and("userId", "=", item.getString("userId")));
// if (fetch != null) {
// cUser = fetch;
// cUser.setUserId(item.getString("userId"));
// cUser.setRoleCode(item.getString("roleCode"));
// } else {
// cUser.setClubId(club.getId());
// cUser.setUserId(item.getString("userId"));
// cUser.setJoinTime(DateUtil.now());
// cUser.setRoleCode(item.getString("roleCode"));
// cUser.setPayed(true);
// cUser.setStatus(5);
// cUser.setGiveMoney(true);
// cUser.setIsNormal(true);
// }
// clubUsers.add(cUser);
// dao().insertOrUpdate(cUser);
// });
return club;
}
@@ -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,7 +36,7 @@ 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;
@@ -68,9 +67,23 @@ public class SysClubUserServiceImpl extends BaseServiceImpl<SysClubUser> impleme
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);
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
@@ -147,38 +160,7 @@ public class SysClubUserServiceImpl extends BaseServiceImpl<SysClubUser> impleme
@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
@@ -187,4 +169,19 @@ public class SysClubUserServiceImpl extends BaseServiceImpl<SysClubUser> impleme
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(""));
}
}
@@ -0,0 +1,30 @@
package com.budwk.app.zhgh.club.vo;
import com.budwk.app.bpm.vo.BpmTaskApprovalVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @ClassName ClubManagerPageVo
* @Author JyuHsin
* @Date 2025/9/9 9:28
* @Version 1.0
* @Description TODO
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class ClubManagerPageVo extends BpmTaskApprovalVo {
private String id;
private String year;
private String clubId;
private String clubName;
private String creatTime;
private String userName;
private String changeUserId;
private String changeUserName;
private String oldRoleCode;
private String oldRoleName;
private String nowRoleCode;
private String nowRoleName;
}
@@ -0,0 +1,29 @@
package com.budwk.app.zhgh.club.vo;
import cn.hutool.json.JSONObject;
import com.budwk.app.bpm.vo.BpmTaskApprovalVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* @ClassName ClubRuleUpdatePageVo
* @Author JyuHsin
* @Date 2025/9/8 17:58
* @Version 1.0
* @Description TODO
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class ClubRefreshReportPageVo extends BpmTaskApprovalVo {
private String id;
private String year;
private String clubId;
private String clubName;
private String creatTime;
private String userName;
private List<JSONObject> lastFiles;
private List<JSONObject> files;
}
@@ -0,0 +1,30 @@
package com.budwk.app.zhgh.club.vo;
import cn.hutool.json.JSONObject;
import com.budwk.app.bpm.vo.BpmTaskApprovalVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* @ClassName ClubRuleUpdatePageVo
* @Author JyuHsin
* @Date 2025/9/8 17:58
* @Version 1.0
* @Description TODO
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class ClubRuleUpdatePageVo extends BpmTaskApprovalVo {
private String id;
private String year;
private String clubId;
private String clubName;
private String creatTime;
private String userName;
private List<JSONObject> lastFiles;
private List<JSONObject> files;
}
@@ -1,7 +1,7 @@
package com.budwk.app.zhgh.club.vo;
import cn.hutool.json.JSONObject;
import com.budwk.app.zhgh.club.model.SysClubUser;
import com.budwk.app.zhgh.club.model.ClubUser;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -9,7 +9,7 @@ import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
public class ClubUserCommonPageVo extends SysClubUser {
public class ClubUserCommonPageVo extends ClubUser {
private String clubName;
private String clubCode;
@@ -27,11 +27,6 @@ public class ClubUserImportVo {
@ExcelProperty("姓名")
private String username;
@ExcelProperty("协会职务")
private String clubPosition;
@ExcelIgnore
private String errorInfo;
}
@@ -17,7 +17,7 @@ const commonUtil = {
if (response.config.responseType === "blob") {
return response
}
if (response.data && response.data.code !== 0) {
if (response.data && response.data.code !== 0 && response.data.code !== 99) {
if (isMobile) {
vant.Toast(response.data.msg)
} else {
@@ -96,8 +96,8 @@ layout("/layouts/platform.html"){
</template>
<template #view>
<el-descriptions class="margin-top" title="" :column="3" border>
<el-descriptions-item :span="2">
<el-descriptions class="margin-top" title="" :column="2" border>
<el-descriptions-item span="2">
<template slot="label">协会名称</template>
<div v-html="viewData.clubName"></div>
</el-descriptions-item>
@@ -105,18 +105,6 @@ layout("/layouts/platform.html"){
<el-descriptions-item label="协会编码">{{viewData.clubCode}}</el-descriptions-item>
<el-descriptions-item label="协会类型">{{viewData.typeName}}</el-descriptions-item>
<el-descriptions-item label="发起人">{{viewData.sponsorName}}</el-descriptions-item>
<el-descriptions-item>
<template slot="label">报名联系人</template>
{{viewData.concatPersonName}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">联系人电话</template>
{{viewData.concatPersonMobile}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">联系人邮箱</template>
{{viewData.concatPersonEmail}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">会费标准</template>
{{viewData.due}}
@@ -125,35 +113,19 @@ layout("/layouts/platform.html"){
<template slot="label">当前人数</template>
{{viewData.currentPeopleNum}}
</el-descriptions-item>
<el-descriptions-item :span="3">
<el-descriptions-item span="2">
<template slot="label">协会介绍</template>
<div class="text-left" v-html="viewData.introduce"></div>
</el-descriptions-item>
<el-descriptions-item :span="3">
<el-descriptions-item span="2">
<template slot="label">协会宗旨</template>
<div class="text-left" v-html="viewData.purpose"></div>
</el-descriptions-item>
<!--<el-descriptions-item span="1.5">
<template slot="label">QQ群二维码</template>
<file-upload
v-if="viewData.QQGroupCode && viewData.QQGroupCode.length > 0"
:files="JSON.parse(viewData.QQGroupCode)"
:view="true"
></file-upload>
</el-descriptions-item>
<el-descriptions-item span="2">
<template slot="label">微信群二维码</template>
<file-upload
v-if="viewData.wechatGroupCode && viewData.wechatGroupCode.length > 0"
:files="JSON.parse(viewData.wechatGroupCode)"
:view="true"
></file-upload>
</el-descriptions-item>-->
<el-descriptions-item :span="3">
<template slot="label">协会章程</template>
<file-preview :files="viewData.rulesFile" complete_result></file-preview>
</el-descriptions-item>
<el-descriptions-item :span="3">
<el-descriptions-item span="2">
<template slot="label">年度活动计划</template>
<file-preview :files="viewData.yearPlanFile" complete_result></file-preview>
</el-descriptions-item>
@@ -4,7 +4,7 @@ const REGISTER_INFO_COMPONENT = {
<el-tabs tab-position="top" v-model="activeName">
<el-tab-pane name="1" label="基础信息">
<div class="process-title">协会信息</div>
<el-descriptions :column="4" border class="table_fixed">
<el-descriptions :column="3" border class="table_fixed">
<el-descriptions-item label="协会名称">
{{viewData.clubName}}
</el-descriptions-item>
@@ -17,75 +17,54 @@ const REGISTER_INFO_COMPONENT = {
<el-descriptions-item label="发起人">
{{ viewData.sponsorName }}
</el-descriptions-item>
<el-descriptions-item label="协会类型" :span="4">
<el-descriptions-item label="协会类型">
{{ viewData.typeName }}
</el-descriptions-item>
<!-- <el-descriptions-item label="报名联系人">-->
<!-- {{ viewData.concatPersonName }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="联系人电话">-->
<!-- {{ viewData.concatPersonMobile }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="联系人邮箱">-->
<!-- {{ viewData.concatPersonEmail }}-->
<!-- </el-descriptions-item>-->
<el-descriptions-item label="申请时间">
{{viewData.createTime}}
</el-descriptions-item>
<el-descriptions-item :span="3" label="会费标准">
{{viewData.due}}
</el-descriptions-item>
<el-descriptions-item span="4">
<el-descriptions-item :span="4">
<template slot="label">协会介绍</template>
<div class="text-left" v-html="viewData.introduce"></div>
</el-descriptions-item>
<el-descriptions-item span="4">
<el-descriptions-item :span="4">
<template slot="label">活动形式</template>
<div class="text-left" v-html="viewData.purpose"></div>
</el-descriptions-item>
<!--<el-descriptions-item span="2">
<template slot="label">QQ群二维码</template>
<file-preview :files="viewData.QQGroupCode" complete_result></file-preview>
</el-descriptions-item>
<el-descriptions-item span="2">
<template slot="label">微信群二维码</template>
<file-preview :files="viewData.wechatGroupCode" complete_result></file-preview>
</el-descriptions-item>-->
<el-descriptions-item span="4">
<el-descriptions-item :span="2">
<template slot="label">申请成立报告</template>
<file-preview :files="viewData.establishReport" complete_result></file-preview>
</el-descriptions-item>
<el-descriptions-item span="4">
<el-descriptions-item :span="2">
<template slot="label">章程草案</template>
<file-preview :files="viewData.rulesFile" complete_result></file-preview>
</el-descriptions-item>
<el-descriptions-item span="4">
<el-descriptions-item :span="2">
<template slot="label">经费来源及管理办法</template>
<file-preview :files="viewData.manageFile" complete_result></file-preview>
</el-descriptions-item>
<el-descriptions-item span="4">
<el-descriptions-item :span="2">
<template slot="label">年度活动计划</template>
<file-preview :files="viewData.yearPlanFile" complete_result></file-preview>
</el-descriptions-item>
<el-descriptions-item span="2">
<el-descriptions-item :span="2">
<template slot="label">其他附件</template>
<file-preview :files="viewData.files" complete_result></file-preview>
</el-descriptions-item>
<!--<el-descriptions-item span="2">
<template slot="label">校工会批复附件</template>
<file-preview :files="viewData.schoolReplyFile" complete_result></file-preview>
</el-descriptions-item>-->
<el-descriptions-item :span="2">
<template slot="label">换届报告</template>
<file-preview :files="viewData.replaceReport" complete_result></file-preview>
</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane name="2" label="成员信息">
<div class="process-title">成员信息</div>
<el-table :data="viewData.clubUser" size="small" border
:header-cell-style="{background:'#F5F5F5',color:'#606266'}">
<el-table-column label="人员身份" width="150px" prop="roleCode">
<template v-slot="scope">
<span>{{getRoleName(scope.row.roleCode)}}</span>
</template>
</el-table-column>
<el-table-column label="人员身份" width="150px" prop="roleName"></el-table-column>
<el-table-column label="工号" width="150px" prop="loginName"></el-table-column>
<el-table-column label="姓名" width="150px" prop="userName"></el-table-column>
<el-table-column label="性别" width="150px" prop="sex"></el-table-column>
@@ -53,7 +53,7 @@ layout("/layouts/platform.html"){
编辑
</el-button>
<el-button
v-if="[20].includes(row.processInstanceNodeCode) && !row.nextTaskIsComplete"
v-if="[50].includes(row.processInstanceNodeCode) && !row.nextTaskIsComplete"
size="mini"
type="danger"
@click="openRevoke(row)"
@@ -101,7 +101,6 @@ layout("/layouts/platform.html"){
year: this.$moment().format("YYYY"),
audit: false
},
viewData: {},
clubList: [],
showApprovalForm: false
}
@@ -51,7 +51,7 @@ layout("/layouts/platform.html"){
编辑
</el-button>
<el-button
v-if="[20].includes(row.processInstanceNodeCode) && !row.nextTaskIsComplete"
v-if="[50].includes(row.processInstanceNodeCode) && !row.nextTaskIsComplete"
size="mini"
type="danger"
@click="openRevoke(row)"
@@ -0,0 +1,173 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style></style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度:">
<el-date-picker
placeholder="选择年度"
type="year"
style="width: 100%"
v-model="pageForm.year"
value-format="yyyy"
></el-date-picker>
</search-item>
<search-item label="协会名称:">
<el-input
@keyup.enter.native="doSearch"
clearable
placeholder="请输入内容"
clearable
style="width: 100%"
v-model="pageForm.clubName"
></el-input>
</search-item>
</search>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool label="申请列表">
<el-radio-group v-model="pageForm.audit" size="small" @change="doSearch">
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</table-tool>
<el-table :data="tableData">
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
<el-table-column label="协会名称" prop="clubName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="申请人" prop="userName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="申请时间" prop="creatTime" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="变更用户" prop="changeUserName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="旧身份" prop="oldRoleName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="新身份" prop="nowRoleName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="当前节点" prop="processInstanceNodeName" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="200px">
<template scope="{row}">
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.processInstanceTaskStatus==='ACTIVE'" @click="onApproval(row)" size="mini" type="primary">
审核
</el-button>
<el-button
v-if="row.processInstanceTaskStatus==='COMPLETE' && !row.nextTaskIsComplete"
@click="onRevoke(row.processInstanceTaskId)"
size="mini"
type="danger"
>
撤回
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #public>
<info ref="infoRef"></info>
<div v-if="showApprovalForm">
<div class="process-title">{{formData.processInstanceNodeName}}</div>
<el-form :model="formData" ref="approvalFormRef" label-position="left" label-width="80px">
<el-form-item label="审核意见" prop="approvalOpinion" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.approvalOpinion"></user-opinion-textarea>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button plain @click="$refs.guava.index()">取消</el-button>
<el-button type="danger" @click="doApproval('BACK')">退回</el-button>
<el-button type="danger" @click="doApproval('REJECT')">拒绝</el-button>
<el-button type="primary" @click="doApproval('PASS')">同意</el-button>
</el-row>
</div>
</template>
</guava>
</div>
<script>
<!--#include("../change/info.js"){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
components: {
"info": clubManagerInfo,
},
data() {
return {
pageForm: {
clubId: "",
year: this.$moment().format("YYYY"),
audit: false
},
formData: {},
showApprovalForm: false
}
},
methods: {
onView(row) {
this.$refs.guava.public(() => {
this.$refs.infoRef.onOpen(row)
this.showApprovalForm = false
})
},
onApproval(row) {
this.$refs.guava.public(() => {
this.$refs.infoRef.onOpen(row)
this.formData = row.approvalParam
this.showApprovalForm = true
})
},
doApproval(approvalType) {
this.formData.bpmTaskApprovalType = approvalType
this.$refs.approvalFormRef.validate((valid) => {
if (valid) {
this.$axios
.post(loc() + "/approval", {
approval: JSON.stringify(this.formData)
})
.then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
}
})
},
onRevoke(taskId) {
this.$confirm("您确定要撤回吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then(() => {
this.$axios.post(loc() + "/revoke", { taskId }).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
async pageData() {
const resp = await this.$axios.post("/platform/club/infoManage/auditManager/pageData", this.pageForm)
if (resp.code === 0) {
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
} else {
this.$message.warning(resp.msg)
}
}
},
async created() {
await this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,235 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style></style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度:">
<el-date-picker
placeholder="选择年度"
type="year"
style="width: 100%"
v-model="pageForm.year"
value-format="yyyy"
></el-date-picker>
</search-item>
<search-item label="协会名称:">
<el-input
@keyup.enter.native="doSearch"
clearable
placeholder="请输入内容"
clearable
style="width: 100%"
v-model="pageForm.clubName"
></el-input>
</search-item>
</search>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool label="申请列表">
<el-button type="primary" size="small" @click="openAdd">
<i class="ti-plus"></i>
变更成员
</el-button>
</table-tool>
<el-table :data="tableData">
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
<el-table-column label="协会名称" prop="clubName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="申请人" prop="userName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="申请时间" prop="creatTime" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="变更用户" prop="changeUserName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="旧身份" prop="oldRoleName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="新身份" prop="nowRoleName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="当前节点" prop="processInstanceNodeName" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="300">
<template v-slot="{row}">
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="[10,40,70].includes(row.processInstanceNodeCode)" @click="onEdit(row)" size="mini" type="primary">
编辑
</el-button>
<el-button
v-if="[50].includes(row.processInstanceNodeCode) && !row.nextTaskIsComplete"
size="mini"
type="danger"
@click="onRevoke(row)"
>
撤销
</el-button>
<el-button v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])" @click="onDelete(row)" size="mini" type="danger">
删除
</el-button>
<el-button v-else-if="[10].includes(row.processInstanceNodeCode)" @click="onDelete(row)" size="mini" type="danger">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<el-form :model="formData" ref="formRef" size="small" label-width="80px" :rules="formRules">
<el-form-item label="协会名称" prop="clubId">
<el-select v-model="formData.clubId" @change="clubChange" placeholder="请选择协会" filterable clearable style="width: 100%">
<el-option v-for="item in clubList" :key="item.id" :label="item.clubName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="协会成员" prop="userId">
<el-select v-model="formData.userId" @change="userChange" placeholder="请选择协会成员" filterable clearable style="width: 100%">
<el-option v-for="item in userList" :key="item.userId" :label="item.userName" :value="item.userId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="身份" prop="nowRoleCode">
<el-checkbox-group v-model="formData.nowRoleCode">
<el-checkbox label="CLUB_PRESIDENT">协会会长</el-checkbox>
<el-checkbox label="CLUB_VICE_PRESIDENT">协会副会长</el-checkbox>
<el-checkbox label="CLUB_SECRETARY">协会秘书长</el-checkbox>
<el-checkbox label="CLUB_VICE_SECRETARY">协会副秘书长</el-checkbox>
<el-checkbox label="CLUB_OPERATOR">协会操作员</el-checkbox>
<el-checkbox label="CLUB_MEMBER">协会会员</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button @click="$refs.guava.index()">取 消</el-button>
<el-button type="primary" @click="onSubmit">提 交</el-button>
</div>
</template>
<template #view>
<info ref="infoRef"></info>
</template>
</guava>
</div>
<script>
<!--#include("info.js"){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
components: {
"info": clubManagerInfo
},
data() {
return {
clubList: [],
userList: [],
formData: {
nowRoleCode: [],
},
formRules: {
clubId: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
userId: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
nowRoleCode: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
},
}
},
methods: {
clubChange(key) {
if(!key) {
this.$set(this.formData, 'userId', '')
this.$set(this.formData, 'nowRoleCode', '')
}
this.$axios.post("/platform/club/infoManage/change/queryClubUsers", {clubId: this.formData.clubId}).then((res) => {
if (res.code === 0) {
this.userList = res.data
}
})
},
userChange(key) {
const user = this.userList.find(o => o.userId === key)
this.$set(this.formData, 'nowRoleCode', user?.roleCode)
this.$set(this.formData, 'changeUserId', key)
this.$set(this.formData, 'changeUserName', user?.userName)
},
openAdd() {
this.$refs.guava.edit(() => {
this.formData = {nowRoleCode: []}
})
},
onRevoke(row) {
this.$confirm("您确定要撤回吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/platform/club/infoManage/ruleUpdate/revokeApply", { id: row.id }).then((resp) => {
this.$message.success(resp.msg)
this.doSearch()
})
})
},
onEdit(row) {
this.formData = clone(row)
this.$refs.guava.edit(() => {})
},
async onSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post('/platform/club/infoManage/change/submit', {
data: JSON.stringify(this.formData)
}).then(res => {
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
this.$refs.guava.index()
}
})
})
}
})
},
onDelete(row) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/platform/club/infoManage/change/delete", { id: row.id }).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
})
},
onView(row) {
this.$refs.guava.view(() =>{
this.$refs.infoRef.onOpen(row)
})
},
async getMyClub() {
const resp = await this.$axios.post("/platform/club/examine/apply/getClubsByRole")
this.clubList = resp.data
},
async pageData() {
const resp = await this.$axios.post("/platform/club/infoManage/change/pageData", this.pageForm)
if (resp.code === 0) {
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
} else {
this.$message.warning(resp.msg)
}
}
},
async created() {
await this.getMyClub()
await this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,69 @@
const clubManagerInfo = {
template: /*language=HTML*/ `
<div>
<div class="process-title">
申请信息
</div>
<el-descriptions :column="3" border>
<el-descriptions-item label="所属协会">{{ viewData.clubName }}</el-descriptions-item>
<el-descriptions-item label="申请人">{{ viewData.userName }}</el-descriptions-item>
<el-descriptions-item label="申请时间">{{ viewData.creatTime }}</el-descriptions-item>
<el-descriptions-item label="变更用户">{{ viewData.changeUserName }}</el-descriptions-item>
<el-descriptions-item label="旧身份">{{ viewData.oldRoleName }}</el-descriptions-item>
<el-descriptions-item label="新身份">{{ viewData.nowRoleName }}</el-descriptions-item>
</el-descriptions>
<div v-for="nodeTask in viewData.nodeTasks" :key="nodeTask.id">
<div class="process-title">
{{nodeTask.nodeName}}
</div>
<div>
<el-descriptions :column="3" border v-for="task in nodeTask.tasks" :key="task.id">
<el-descriptions-item label="审核人">{{ task.actualOwnerLoginName + '-' +
task.actualOwnerUserName }}
</el-descriptions-item>
<el-descriptions-item label="审核时间">{{ task.endOn }}</el-descriptions-item>
<el-descriptions-item label="审核结果">
<div v-if="task.extVariable">
<el-tag type="success" size="mini"
v-if="task.extVariable.bpmTaskApprovalType === 'PASS'">同意
</el-tag>
<el-tag type="danger" size="mini"
v-if="task.extVariable.bpmTaskApprovalType === 'BACK'">退回重新填写
</el-tag>
<el-tag type="danger" size="mini"
v-if="task.extVariable.bpmTaskApprovalType === 'REJECT'">拒绝
</el-tag>
</div>
</el-descriptions-item>
<el-descriptions-item label="审核意见" :span="3">{{ task.extVariable.approvalOpinion}}
</el-descriptions-item>
</el-descriptions>
</div>
</div>
</div>
`,
data() {
return {
viewData: {},
}
},
methods: {
onOpen(row) {
this.$axios.post("/platform/club/infoManage/change/info", { id: row.id }).then((res) => {
if (res.code === 0) {
this.viewData = res.data
}
})
},
},
style: /*language=CSS*/ `
.el-descriptions-item__label {
width: 200px;
min-width: 200px;
max-width: 200px;
}
.el-tabs__header {
margin: 0;
}
`
}
@@ -1,149 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style></style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<search @search="doSearch">
<search-item label="协会名称:">
<el-select filterable placeholder="请选择协会" style="width: 100%" v-model="pageForm.clubId">
<el-option :label="item.clubName" :value="item.id" v-for="item in clubList"></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool label="理事机构审核">
<el-button @click="doReview(false)" size="small" type="danger">批量不通过</el-button>
<el-button @click="doReview(true)" size="small" type="primary">批量通过</el-button>
</table-tool>
<el-table :data="tableData" @selection-change="handleSelectionChange" ref="table" :row-key="()=>{new Date().getTime()}">
<el-table-column :reserve-selection="true" type="selection" width="40"></el-table-column>
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
<el-table-column label="协会名称" prop="clubName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="协会编码" prop="clubCode" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="协会类型" prop="typeName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="成员" prop="userName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="职务" prop="roleCode" sortable show-overflow-tooltip>
<template slot-scope="scope">
<span>{{getRoleName(scope.row.roleCode)}}</span>
</template>
</el-table-column>
<el-table-column label="职务变更" prop="changeRoleCode" sortable show-overflow-tooltip>
<template slot-scope="scope">
<div v-if="scope.row.changeRoleCode">
<span>{{getRoleName(scope.row.changeRoleCode)}}</span>
</div>
<span v-else>暂无变更</span>
</template>
</el-table-column>
<el-table-column label="变更时间" prop="roleCodeChangeTime" sortable show-overflow-tooltip>
<template slot-scope="{row}">
<span v-if="row.changeRoleCode !== undefined">{{ $moment(row.roleCodeChangeTime).format('YYYY-MM-DD') }}</span>
<span v-else>暂无变更</span>
</template>
</el-table-column>
<el-table-column label="状态" prop="state" sortable show-overflow-tooltip>
<template v-if="row.state === 1 || row.status === 3" slot-scope="{row}">
<span>待校工会审核</span>
</template>
<template v-else slot-scope="scope">暂无状态</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
</div>
<script>
<!--#include("../../common/clubRoleConstant.js"){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
components: {},
data() {
return {
clubList: [],
multipleSelection: []
}
},
methods: {
getRoleName(roleCode) {
return CLUB_ROLE_CONSTANT.getRoleName(roleCode)
},
showFiles(row) {
if (row.replaceReport && row.replaceReport.length > 0) {
let res = row.replaceReport[0]
let fileId = res?.response?.data.substring(res?.response?.data.lastIndexOf("=") + 1)
let fileName = res?.name
window.open(
"/assets/platform/plugins/pdfJs/web/viewer.html?file=" + encodeURIComponent("/platform/sys/file/convertPDF?id=" + fileId),
fileName
)
}
},
getFileName(row) {
if (row.replaceReport && row.replaceReport.length > 0) {
return row.replaceReport[0].name
} else {
return ""
}
},
async doReview(flag) {
if (this.multipleSelection.length === 0) {
this.$message.warning("请先在多选框中选择")
return
}
const str = flag ? "通过" : "不通过"
const confirm = await this.$confirm("您确定要批量审核" + str + "吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
const array = this.multipleSelection.map((o) => o.id)
const resp = await this.$axios.post("/platform/club/infoManage/clubManagePersonAudit/doAudit", {
ids: JSON.stringify(array),
isPass: flag
})
if (resp.code === 0) {
this.$message.success(resp.msg)
this.$refs.table.clearSelection()
await this.pageData()
} else {
this.$message.warning(resp.msg)
}
}
},
handleSelectionChange(val) {
this.multipleSelection = val
},
async pageData() {
const resp = await this.$axios.post("/platform/club/infoManage/clubManagePersonAudit/pageData", this.pageForm)
if (resp.code === 0) {
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
} else {
this.$message.warning(resp.msg)
}
},
async getAllClub() {
const resp = await this.$axios.post("/platform/club/infoManage/clubManagePersonAudit/getAllClub")
if (resp.code === 0) {
this.clubList = resp.data
}
}
},
async created() {
await this.getAllClub()
await this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -19,12 +19,12 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
<el-card shadow="never" class="mt10">
<table-tool label="会员信息">
<el-button size="small" type="primary" icon="el-icon-download" @click="exportRegistrationDoc">
导出登记表
</el-button>
<el-button @click="openImport" size="small" type="primary">入成员</el-button>
<el-button size="small" type="primary" @click="openUserAdd(true)">录入成员</el-button>
<el-button size="small" type="primary" @click="openUserAdd(false)">设置理事机构</el-button>
<template v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])">
<el-button size="small" type="primary" icon="el-icon-download" @click="exportRegistrationDoc">导出登记表</el-button>
<el-button @click="openImport" size="small" type="primary">导入成员</el-button>
<el-button size="small" type="primary" @click="openUserAdd(true)">入成员</el-button>
<el-button size="small" type="primary" @click="openUserAdd(false)">设置理事机构</el-button>
</template>
<el-radio-group @change="doSearch" style="margin-left: 10px" v-model="pageForm.radioType"
size="small">
<el-radio-button label="3">全部</el-radio-button>
@@ -39,24 +39,7 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
<el-table-column label="性别" prop="sex" show-overflow-tooltip sortable></el-table-column>
<el-table-column label="电话" prop="mobile" show-overflow-tooltip></el-table-column>
<el-table-column label="所属单位" prop="unitName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="身份" prop="roleNames" show-overflow-tooltip></el-table-column>
<!-- <el-table-column label="变更状态" prop="state"show-overflow-tooltip sortable>
<template slot-scope="scope">
<span v-if="scope.row.state==1">待校工会审核</span>
<span v-else-if="scope.row.state==2">校工会审核拒绝</span>
<span v-else-if="scope.row.state==3">审核通过</span>
<span v-else-if="scope.row.state === '' || scope.row.state === undefined">暂无变更</span>
</template>
</el-table-column>
<el-table-column label="申请状态" show-overflow-tooltip sortable>
<template slot-scope="scope">
<el-tag v-if="scope.row.status==1" size="mini" type="primary">待协会审核</el-tag>
<el-tag v-if="scope.row.status==2" size="mini" type="danger">协会拒绝</el-tag>
<el-tag v-if="scope.row.status==3" size="mini" type="primary">待校工会审核</el-tag>
<el-tag v-if="scope.row.status==4" size="mini" type="danger">校工会拒绝</el-tag>
<el-tag v-if="scope.row.status==5" size="mini" type="success">审核通过</el-tag>
</template>
</el-table-column>-->
<el-table-column label="身份" prop="roleName" show-overflow-tooltip></el-table-column>
<el-table-column label="操作">
<template slot-scope="{row}">
<el-dropdown>
@@ -66,55 +49,8 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="openAuth(row)">授权</el-dropdown-item>
<!-- <el-dropdown-item @click.native="updatePayed(row)" class="text-primary">-->
<!-- {{row.payed === true ? '设置为未缴费' : '设置为缴费'}}-->
<!-- </el-dropdown-item>-->
<!-- <el-dropdown-item @click.native="updateGive(row)" class="text-primary">-->
<!-- {{row.giveMoney === true ? '设置为不拨付' : '设置为拨付'}}-->
<!-- </el-dropdown-item>-->
<!--v-if="row.changeRoleCode === '' || row.changeRoleCode === undefined || row.state !== 1"-->
<!-- <template>-->
<!-- <el-dropdown-item v-if="row.roleCode !== 'CLUB_PRESIDENT'"-->
<!-- @click.native="updateRoleCode(row, 'CLUB_PRESIDENT', '会长')"-->
<!-- class="text-primary">-->
<!-- 设置会长-->
<!-- </el-dropdown-item>-->
<!-- <el-dropdown-item v-if="row.roleCode !== 'CLUB_VICE_PRESIDENT'"-->
<!-- @click.native="updateRoleCode(row, 'CLUB_VICE_PRESIDENT', '副会长')"-->
<!-- class="text-primary">-->
<!-- 设置副会长-->
<!-- </el-dropdown-item>-->
<!-- <el-dropdown-item v-if="row.roleCode !== 'CLUB_SECRETARY'"-->
<!-- @click.native="updateRoleCode(row, 'CLUB_SECRETARY', '秘书长')"-->
<!-- class="text-primary">-->
<!-- 设置秘书长-->
<!-- </el-dropdown-item>-->
<!-- <el-dropdown-item v-if="row.roleCode !== 'CLUB_VICE_SECRETARY'"-->
<!-- @click.native="updateRoleCode(row, 'CLUB_VICE_SECRETARY', '副秘书长')"-->
<!-- class="text-primary">-->
<!-- 设置副秘书长-->
<!-- </el-dropdown-item>-->
<!-- <el-dropdown-item v-if="row.roleCode !== 'CLUB_OPERATOR'"-->
<!-- @click.native="updateRoleCode(row, 'CLUB_OPERATOR', '操作员')"-->
<!-- class="text-primary">-->
<!-- 设置操作员-->
<!-- </el-dropdown-item>-->
<!-- <el-dropdown-item v-if="row.roleCode !== 'CLUB_MEMBER'"-->
<!-- @click.native="updateRoleCode(row, 'CLUB_MEMBER', '会员')"-->
<!-- class="text-primary">-->
<!-- 设置会员-->
<!-- </el-dropdown-item>-->
<!-- </template>-->
<!-- <template v-else>
<el-dropdown-item @click.native="rollbackChange(row)" class="text-primary">
撤回变更
</el-dropdown-item>
</template>-->
<!--<el-dropdown-item @click.native="viewInfo(row)">查看注册信息</el-dropdown-item>
<el-dropdown-item @click.native="exportInfo(row)">导出登记表</el-dropdown-item>-->
<el-dropdown-item @click.native="userDelete(row)">删除</el-dropdown-item>
<el-dropdown-item @click.native="exitClub(row)">退会</el-dropdown-item>
<!--<el-dropdown-item @click.native="exitClub(row)">退会</el-dropdown-item>-->
</el-dropdown-menu>
</el-dropdown>
</template>
@@ -138,7 +74,7 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
<el-form :model="formData" ref="userForm" :rules="userFormRules" label-width="80px">
<el-form-item label="成员" prop="users">
<el-select v-model="formData.users" style="width: 100%" multiple filterable
remote reserve-keyword :remote-method="selectUser">
placeholder="请根据姓名或工号选择" remote reserve-keyword :remote-method="selectUser">
<el-option
v-for="item in userOptions"
:key="item.id"
@@ -183,10 +119,10 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
<el-dialog title="授权身份" :visible.sync="authDialogVisible" width="50%">
<el-form :model="authFormData" ref="authForm" label-width="80px">
<el-form-item label="姓名">
<el-input v-model="authFormData.userName" disabled></el-input>
<el-input placeholder="请输入姓名" v-model="authFormData.userName" disabled></el-input>
</el-form-item>
<el-form-item label="工号">
<el-input v-model="authFormData.loginName" disabled></el-input>
<el-input placeholder="请输入工号" v-model="authFormData.loginName" disabled></el-input>
</el-form-item>
<el-form-item label="身份" prop="roleCode"
:rules="[{required: true, message: '请选择身份', trigger: 'blur'}]">
@@ -250,7 +186,7 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
userName: row.userName,
loginName: row.loginName,
clubId: row.clubId,
roleCode: row.roleCode ? JSON.parse(row.roleCode) : []
roleCode: row.roleCode
}
console.log(this.authFormData)
},
@@ -27,8 +27,6 @@ const SCHOOL_CLUB_MANAGE_TEMPLATE = {
<el-table-column label="协会名称" prop="clubName" sortable></el-table-column>
<el-table-column label="会长" prop="clubLeader" show-overflow-tooltip></el-table-column>
<el-table-column label="秘书长" prop="clubSecretary" show-overflow-tooltip></el-table-column>
<!-- <el-table-column label="报名联系人" show-overflow-tooltip prop="concatPersonName"></el-table-column> -->
<!-- <el-table-column label="联系人电话" show-overflow-tooltip prop="concatPersonMobile"></el-table-column> -->
<el-table-column label="当前人数" show-overflow-tooltip prop="currentNum"></el-table-column>
<el-table-column label="成立时间" show-overflow-tooltip prop="foundTime"></el-table-column>
<el-table-column label="状态" show-overflow-tooltip prop="dismiss">
@@ -31,41 +31,38 @@ layout("/layouts/platform.html"){
</el-card>
<el-card class="mt10" shadow="never">
<table-tool label="申请列表">
<el-button type="primary" size="small" @click="openAdd">
<i class="ti-plus"></i>
上传报告
</el-button>
</table-tool>
<el-table :data="tableData">
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
<el-table-column label="协会名称" prop="clubName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="协会类型" prop="typeName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="申请时间" prop="createTime" sortable show-overflow-tooltip>
<template slot-scope="{row}">
<span>{{ $moment(row.createTime).format('YYYY-MM-DD') }}</span>
</template>
</el-table-column>
<el-table-column label="成立时间" prop="foundTime" sortable show-overflow-tooltip>
<template slot-scope="{row}">
<span>{{ $moment(row.foundTime).format('YYYY-MM-DD') }}</span>
</template>
</el-table-column>
<el-table-column label="联系人" prop="concatPersonName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="发起人" prop="sponsorName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="换届报告" prop="replaceReport" sortable show-overflow-tooltip>
<template scope="scope">
<span style="color: #0e78c5; text-decoration: underline; cursor: pointer" @click="showFiles(scope.row)">
{{getFileName(scope.row)}}
</span>
</template>
</el-table-column>
<el-table-column label="审核状态" prop="reportState" sortable show-overflow-tooltip>
<template scope="scope">
<span v-if="scope.row.reportState === 1">待校工会审核</span>
<span v-if="scope.row.reportState === 2">校工会审核不通过</span>
<span v-if="scope.row.reportState === 3">审核通过</span>
</template>
</el-table-column>
<el-table-column label="申请人" prop="userName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="申请时间" prop="creatTime" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="当前节点" prop="processInstanceNodeName" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="300px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button @click="uploadRefreshReport(row)" size="mini" type="primary">上传换届报告</el-button>
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="[10,40,70].includes(row.processInstanceNodeCode)" @click="onEdit(row)" size="mini" type="primary">
编辑
</el-button>
<el-button
v-if="[50].includes(row.processInstanceNodeCode) && !row.nextTaskIsComplete"
size="mini"
type="danger"
@click="onRevoke(row)"
>
撤销
</el-button>
<el-button v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])" @click="onDelete(row)" size="mini" type="danger">
删除
</el-button>
<el-button v-else-if="[10].includes(row.processInstanceNodeCode)" @click="onDelete(row)" size="mini" type="danger">
删除
</el-button>
</template>
</el-table-column>
</el-table>
@@ -73,92 +70,121 @@ layout("/layouts/platform.html"){
</el-card>
</template>
<template #edit>
<el-form :model="formData" ref="formRef" size="small" label-width="80px" :rules="formRules">
<el-form-item label="协会名称" prop="clubId">
<el-select v-model="formData.clubId" placeholder="请选择协会" filterable clearable style="width: 100%">
<el-option v-for="item in clubList" :key="item.id" :label="item.clubName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="换届报告" prop="files">
<file-upload
:value.sync="formData.files"
:upload_number="1"
upload_result_category="array"
complete_result
upload_mode="drag"
accept=".doc,.docx,.pdf"
></file-upload>
</el-form-item>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button @click="$refs.guava.index()">取 消</el-button>
<el-button type="primary" @click="onSubmit">提 交</el-button>
</div>
</template>
<template #view>
<club-info ref="info"></club-info>
<info ref="infoRef"></info>
</template>
</guava>
<el-dialog width="40%" :visible.sync="refreshDialogVisible" title="上传换届报告">
<file-upload
:value.sync="replaceReport"
:upload_number="1"
upload_result_category="array"
complete_result
upload_mode="drag"
accept=".doc,.docx,.pdf"
></file-upload>
<span slot="footer" class="dialog-footer">
<el-button @click="refreshDialogVisible = false">取消</el-button>
<el-button type="primary" @click="refreshDo">确定</el-button>
</span>
</el-dialog>
</div>
<script>
<!--#include("../../common/clubInfoComponent.js"){}#-->
<!--#include("info.js"){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
components: {
"club-info": REGISTER_INFO_COMPONENT
"info": clubRefreshInfo
},
data() {
return {
refreshDialogVisible: false,
replaceReport: [],
clickRow: {}
clubList: [],
formData: {},
formRules: {
clubId: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
files: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
},
}
},
methods: {
showFiles(row) {
if (row.replaceReport && row.replaceReport.length > 0) {
let res = row.replaceReport[0]
let fileId = res?.response?.data.substring(res?.response?.data.lastIndexOf("=") + 1)
let fileName = res?.name
window.open(
"/assets/platform/plugins/pdfJs/web/viewer.html?file=" + encodeURIComponent("/platform/sys/file/convertPDF?id=" + fileId),
fileName
)
}
openAdd() {
this.$refs.guava.edit(() => {
this.formData = {}
})
},
getFileName(row) {
if (row.replaceReport && row.replaceReport.length > 0) {
return row.replaceReport[0].name
} else {
return ""
}
},
async refreshDo() {
const confirm = await this.$confirm("您确定要上传换届报告吗?", "提示", {
onRevoke(row) {
this.$confirm("您确定要撤回吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
const resp = await this.$axios.post("/platform/club/infoManage/refreshReport/refreshDo", {
id: this.clickRow.id,
replaceReport: JSON.stringify(this.replaceReport)
})
if (resp.code === 0) {
}).then(() => {
this.$axios.post("/platform/club/infoManage/refreshReport/revokeApply", { id: row.id }).then((resp) => {
this.$message.success(resp.msg)
this.refreshDialogVisible = false
this.doSearch()
} else {
this.$message.warning(resp.msg)
}
}
},
uploadRefreshReport(row) {
this.clickRow = row
this.replaceReport = []
this.refreshDialogVisible = true
},
openView(row) {
this.$refs.guava.view(() => {
this.$refs.info.onOpen(row.id)
})
})
},
onEdit(row) {
this.formData = clone(row)
this.formData.files = JSON.parse(this.formData.files)
this.$refs.guava.edit(() => {})
},
async onSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post('/platform/club/infoManage/refreshReport/submit', {
data: JSON.stringify(this.formData)
}).then(res => {
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
this.$refs.guava.index()
}
})
})
}
})
},
onDelete(row) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/platform/club/infoManage/refreshReport/delete", { id: row.id }).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
})
},
onView(row) {
this.$refs.guava.view(() => {
this.$refs.infoRef.onOpen(row)
})
},
async getMyClub() {
const resp = await this.$axios.post("/platform/club/examine/apply/getClubsByRole")
this.clubList = resp.data
},
async pageData() {
const resp = await this.$axios.post("/platform/club/infoManage/refreshReport/pageData", this.pageForm)
if (resp.code === 0) {
@@ -170,6 +196,7 @@ layout("/layouts/platform.html"){
}
},
async created() {
await this.getMyClub()
await this.pageData()
}
})
@@ -0,0 +1,74 @@
const clubRefreshInfo = {
template: /*language=HTML*/ `
<div>
<div class="process-title">
申请信息
</div>
<el-descriptions :column="3" border>
<el-descriptions-item label="所属协会">{{ viewData.clubName }}</el-descriptions-item>
<el-descriptions-item label="申请人">{{ viewData.userName }}</el-descriptions-item>
<el-descriptions-item label="申请时间">{{ viewData.creatTime }}</el-descriptions-item>
<el-descriptions-item label="上一次换届报告" :span="3">
<file-preview v-if="viewData.lastFiles && viewData.lastFiles.length > 0" :files="viewData.lastFiles" complete_result></file-preview>
<span v-else>暂无附件</span>
</el-descriptions-item>
<el-descriptions-item label="换届报告" :span="3">
<file-preview v-if="viewData.files && viewData.files.length > 0" :files="viewData.files" complete_result></file-preview>
<span v-else>暂无附件</span>
</el-descriptions-item>
</el-descriptions>
<div v-for="nodeTask in viewData.nodeTasks" :key="nodeTask.id">
<div class="process-title">
{{nodeTask.nodeName}}
</div>
<div>
<el-descriptions :column="3" border v-for="task in nodeTask.tasks" :key="task.id">
<el-descriptions-item label="审核人">{{ task.actualOwnerLoginName + '-' +
task.actualOwnerUserName }}
</el-descriptions-item>
<el-descriptions-item label="审核时间">{{ task.endOn }}</el-descriptions-item>
<el-descriptions-item label="审核结果">
<div v-if="task.extVariable">
<el-tag type="success" size="mini"
v-if="task.extVariable.bpmTaskApprovalType === 'PASS'">同意
</el-tag>
<el-tag type="danger" size="mini"
v-if="task.extVariable.bpmTaskApprovalType === 'BACK'">退回重新填写
</el-tag>
<el-tag type="danger" size="mini"
v-if="task.extVariable.bpmTaskApprovalType === 'REJECT'">拒绝
</el-tag>
</div>
</el-descriptions-item>
<el-descriptions-item label="审核意见" :span="3">{{ task.extVariable.approvalOpinion}}
</el-descriptions-item>
</el-descriptions>
</div>
</div>
</div>
`,
data() {
return {
viewData: {},
}
},
methods: {
onOpen(row) {
this.$axios.post("/platform/club/infoManage/refreshReport/info", { id: row.id }).then((res) => {
if (res.code === 0) {
this.viewData = res.data
}
})
},
},
style: /*language=CSS*/ `
.el-descriptions-item__label {
width: 200px;
min-width: 200px;
max-width: 200px;
}
.el-tabs__header {
margin: 0;
}
`
}
@@ -31,42 +31,38 @@ layout("/layouts/platform.html"){
</el-card>
<el-card class="mt10" shadow="never">
<table-tool label="申请列表">
<el-button type="primary" size="small" @click="openAdd">
<i class="ti-plus"></i>
章程修订
</el-button>
</table-tool>
<el-table :data="tableData">
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
<el-table-column label="协会名称" prop="clubName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="协会类型" prop="typeName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="申请时间" prop="createTime" sortable show-overflow-tooltip>
<el-table-column label="申请人" prop="userName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="申请时间" prop="creatTime" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="当前节点" prop="processInstanceNodeName" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="300px">
<template slot-scope="{row}">
<span>{{ $moment(row.createTime).format('YYYY-MM-DD') }}</span>
</template>
</el-table-column>
<el-table-column label="成立时间" prop="foundTime" sortable show-overflow-tooltip>
<template slot-scope="{row}">
<span>{{ $moment(row.foundTime).format('YYYY-MM-DD') }}</span>
</template>
</el-table-column>
<el-table-column label="联系人" prop="concatPersonName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="发起人" prop="sponsorName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="协会章程" prop="afterRulesFile" sortable show-overflow-tooltip>
<template scope="scope">
<span style="color: #0e78c5; text-decoration: underline; cursor: pointer" @click="showFiles(scope.row)">
{{getFileName(scope.row)}}
</span>
</template>
</el-table-column>
<el-table-column label="审核状态" prop="ruleState" sortable show-overflow-tooltip>
<template scope="scope">
<span v-if="scope.row.ruleState === 1">待校工会审核</span>
<span v-if="scope.row.ruleState === 2">校工会审核不通过</span>
<span v-if="scope.row.ruleState === 3">审核通过</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button @click="uploadRule(row)" size="mini" type="primary">章程修订</el-button>
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="[10,40,70].includes(row.processInstanceNodeCode)" @click="onEdit(row)" size="mini" type="primary">
编辑
</el-button>
<el-button
v-if="[50].includes(row.processInstanceNodeCode) && !row.nextTaskIsComplete"
size="mini"
type="danger"
@click="onRevoke(row)"
>
撤销
</el-button>
<el-button v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])" @click="onDelete(row)" size="mini" type="danger">
删除
</el-button>
<el-button v-else-if="[10].includes(row.processInstanceNodeCode)" @click="onDelete(row)" size="mini" type="danger">
删除
</el-button>
</template>
</el-table-column>
</el-table>
@@ -74,96 +70,121 @@ layout("/layouts/platform.html"){
</el-card>
</template>
<template #edit>
<el-form :model="formData" ref="formRef" size="small" label-width="80px" :rules="formRules">
<el-form-item label="协会名称" prop="clubId">
<el-select v-model="formData.clubId" placeholder="请选择协会" filterable clearable style="width: 100%">
<el-option v-for="item in clubList" :key="item.id" :label="item.clubName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="协会章程" prop="files">
<file-upload
:value.sync="formData.files"
:upload_number="1"
upload_result_category="array"
complete_result
upload_mode="drag"
accept=".doc,.docx,.pdf"
></file-upload>
</el-form-item>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button @click="$refs.guava.index()">取 消</el-button>
<el-button type="primary" @click="onSubmit">提 交</el-button>
</div>
</template>
<template #view>
<club-info ref="info"></club-info>
<info ref="infoRef"></info>
</template>
</guava>
<el-dialog width="40%" :visible.sync="ruleDialogVisible" title="章程修订">
<file-upload
:value.sync="ruleReport"
:upload_number="1"
upload_result_category="array"
complete_result
upload_mode="drag"
accept=".doc,.docx,.pdf"
></file-upload>
<span slot="footer" class="dialog-footer">
<el-button @click="ruleDialogVisible = false">取消</el-button>
<el-button type="primary" @click="ruleDo">确定</el-button>
</span>
</el-dialog>
</div>
<script>
<!--#include("../../common/clubInfoComponent.js"){}#-->
<!--#include("info.js"){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
components: {
"club-info": REGISTER_INFO_COMPONENT
"info": clubRuleInfo,
},
data() {
return {
ruleDialogVisible: false,
ruleReport: [],
clickRow: {}
clubList: [],
formData: {},
formRules: {
clubId: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
files: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
},
}
},
methods: {
showFiles(row) {
if (row.afterRulesFile && row.afterRulesFile.length > 0) {
let res = row.afterRulesFile[0]
let fileId = res?.response?.data.substring(res?.response?.data.lastIndexOf("=") + 1)
let fileName = res?.name
window.open(
"/assets/platform/plugins/pdfJs/web/viewer.html?file=" + encodeURIComponent("/platform/sys/file/convertPDF?id=" + fileId),
fileName
)
}
openAdd() {
this.$refs.guava.edit(() => {
this.formData = {}
})
},
getFileName(row) {
if (row.afterRulesFile && row.afterRulesFile.length > 0) {
return row.afterRulesFile[0].name
} else {
return ""
}
},
async ruleDo() {
const confirm = await this.$confirm("您确定要修订章程吗?", "提示", {
onRevoke(row) {
this.$confirm("您确定要撤回吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
const resp = await this.$axios.post("/platform/club/infoManage/ruleUpdate/ruleDo", {
id: this.clickRow.id,
afterRulesFile: JSON.stringify(this.ruleReport)
})
if (resp.code === 0) {
}).then(() => {
this.$axios.post("/platform/club/infoManage/ruleUpdate/revokeApply", { id: row.id }).then((resp) => {
this.$message.success(resp.msg)
this.ruleDialogVisible = false
this.doSearch()
} else {
this.$message.warning(resp.msg)
}
}
},
uploadRule(row) {
/*if(row.afterRulesFile && row.ruleState === 1) {
this.$message.warning('您已上传新的协会章程,待校工会审核')
return
}*/
this.clickRow = row
this.ruleReport = []
this.ruleDialogVisible = true
},
openView(row) {
this.$refs.guava.view(() => {
this.$refs.info.onOpen(row.id)
})
})
},
onEdit(row) {
this.formData = clone(row)
this.formData.files = JSON.parse(this.formData.files)
this.$refs.guava.edit(() => {})
},
async onSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post('/platform/club/infoManage/ruleUpdate/submit', {
data: JSON.stringify(this.formData)
}).then(res => {
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
this.$refs.guava.index()
}
})
})
}
})
},
onDelete(row) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/platform/club/infoManage/ruleUpdate/delete", { id: row.id }).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.pageData()
}
})
})
},
onView(row) {
this.$refs.guava.view(() => {
this.$refs.infoRef.onOpen(row)
})
},
async getMyClub() {
const resp = await this.$axios.post("/platform/club/examine/apply/getClubsByRole")
this.clubList = resp.data
},
async pageData() {
const resp = await this.$axios.post("/platform/club/infoManage/ruleUpdate/pageData", this.pageForm)
if (resp.code === 0) {
@@ -175,6 +196,7 @@ layout("/layouts/platform.html"){
}
},
async created() {
await this.getMyClub()
await this.pageData()
}
})
@@ -0,0 +1,74 @@
const clubRuleInfo = {
template: /*language=HTML*/ `
<div>
<div class="process-title">
申请信息
</div>
<el-descriptions :column="3" border>
<el-descriptions-item label="所属协会">{{ viewData.clubName }}</el-descriptions-item>
<el-descriptions-item label="申请人">{{ viewData.userName }}</el-descriptions-item>
<el-descriptions-item label="申请时间">{{ viewData.creatTime }}</el-descriptions-item>
<el-descriptions-item label="上一次协会章程" :span="3">
<file-preview v-if="viewData.lastFiles && viewData.lastFiles.length > 0" :files="viewData.lastFiles" complete_result></file-preview>
<span v-else>暂无附件</span>
</el-descriptions-item>
<el-descriptions-item label="协会章程" :span="3">
<file-preview v-if="viewData.files && viewData.files.length > 0" :files="viewData.files" complete_result></file-preview>
<span v-else>暂无附件</span>
</el-descriptions-item>
</el-descriptions>
<div v-for="nodeTask in viewData.nodeTasks" :key="nodeTask.id">
<div class="process-title">
{{nodeTask.nodeName}}
</div>
<div>
<el-descriptions :column="3" border v-for="task in nodeTask.tasks" :key="task.id">
<el-descriptions-item label="审核人">{{ task.actualOwnerLoginName + '-' +
task.actualOwnerUserName }}
</el-descriptions-item>
<el-descriptions-item label="审核时间">{{ task.endOn }}</el-descriptions-item>
<el-descriptions-item label="审核结果">
<div v-if="task.extVariable">
<el-tag type="success" size="mini"
v-if="task.extVariable.bpmTaskApprovalType === 'PASS'">同意
</el-tag>
<el-tag type="danger" size="mini"
v-if="task.extVariable.bpmTaskApprovalType === 'BACK'">退回重新填写
</el-tag>
<el-tag type="danger" size="mini"
v-if="task.extVariable.bpmTaskApprovalType === 'REJECT'">拒绝
</el-tag>
</div>
</el-descriptions-item>
<el-descriptions-item label="审核意见" :span="3">{{ task.extVariable.approvalOpinion}}
</el-descriptions-item>
</el-descriptions>
</div>
</div>
</div>
`,
data() {
return {
viewData: {},
}
},
methods: {
onOpen(row) {
this.$axios.post("/platform/club/infoManage/ruleUpdate/info", { id: row.id }).then((res) => {
if (res.code === 0) {
this.viewData = res.data
}
})
},
},
style: /*language=CSS*/ `
.el-descriptions-item__label {
width: 200px;
min-width: 200px;
max-width: 200px;
}
.el-tabs__header {
margin: 0;
}
`
}
@@ -31,40 +31,32 @@ layout("/layouts/platform.html"){
</el-card>
<el-card class="mt10" shadow="never">
<table-tool label="申请列表">
<el-radio-group v-model="pageForm.audit" size="small" @change="doSearch">
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</table-tool>
<el-table :data="tableData">
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
<el-table-column label="协会名称" prop="clubName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="协会类型" prop="typeName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="申请时间" prop="createTime" sortable show-overflow-tooltip>
<template slot-scope="{row}">
<span>{{ $moment(row.createTime).format('YYYY-MM-DD') }}</span>
</template>
</el-table-column>
<el-table-column label="成立时间" prop="foundTime" sortable show-overflow-tooltip>
<template slot-scope="{row}">
<span>{{ $moment(row.foundTime).format('YYYY-MM-DD') }}</span>
</template>
</el-table-column>
<el-table-column label="联系人" prop="concatPersonName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="发起人" prop="sponsorName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="换届报告" prop="replaceReport" sortable show-overflow-tooltip>
<template scope="scope">
<span style="color: #0e78c5; text-decoration: underline; cursor: pointer" @click="showFiles(scope.row)">
{{getFileName(scope.row)}}
</span>
</template>
</el-table-column>
<el-table-column label="审核状态" prop="ruleState" sortable show-overflow-tooltip>
<template scope="scope">
<span v-if="scope.row.reportState === 1">待校工会审核</span>
<span v-if="scope.row.reportState === 2">校工会审核不通过</span>
<span v-if="scope.row.reportState === 3">审核通过</span>
</template>
</el-table-column>
<el-table-column label="申请人" prop="userName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="申请时间" prop="creatTime" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="当前节点" prop="processInstanceNodeName" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="200px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button @click="audit(row)" size="mini" type="primary">审核</el-button>
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.processInstanceTaskStatus==='ACTIVE'" @click="onApproval(row)" size="mini" type="primary">
审核
</el-button>
<el-button
v-if="row.processInstanceTaskStatus==='COMPLETE' && !row.nextTaskIsComplete"
@click="onRevoke(row.processInstanceTaskId)"
size="mini"
type="danger"
>
撤回
</el-button>
</template>
</el-table-column>
</el-table>
@@ -72,88 +64,90 @@ layout("/layouts/platform.html"){
</el-card>
</template>
<template #view>
<club-info ref="info"></club-info>
<template #public>
<info ref="infoRef"></info>
<div v-if="showApprovalForm">
<div class="process-title">{{formData.processInstanceNodeName}}</div>
<el-form :model="formData" ref="approvalFormRef" label-position="left" label-width="80px">
<el-form-item label="审核意见" prop="approvalOpinion" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.approvalOpinion"></user-opinion-textarea>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button plain @click="$refs.guava.index()">取消</el-button>
<el-button type="danger" @click="doApproval('BACK')">退回</el-button>
<el-button type="danger" @click="doApproval('REJECT')">拒绝</el-button>
<el-button type="primary" @click="doApproval('PASS')">同意</el-button>
</el-row>
</div>
</template>
</guava>
<el-dialog width="40%" :visible.sync="dialogVisible" title="校工会审核">
<el-descriptions :column="2" border class="table_fixed">
<el-descriptions-item label="换届报告">
<file-preview :files="clickRow.replaceReport" complete_result></file-preview>
</el-descriptions-item>
</el-descriptions>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button @click="auditDo(false)" type="primary">不通过</el-button>
<el-button type="primary" @click="auditDo(true)">通过</el-button>
</span>
</el-dialog>
</div>
<script>
<!--#include("../../common/clubInfoComponent.js"){}#-->
<!--#include("../refreshReport/info.js"){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
dicts: ["PROCESS_INSTANCE_STATE"],
components: {
"club-info": REGISTER_INFO_COMPONENT
"info": clubRefreshInfo,
},
data() {
return {
dialogVisible: false,
clickRow: {},
clubId: ""
pageForm: {
clubId: "",
year: this.$moment().format("YYYY"),
audit: false
},
formData: {},
showApprovalForm: false
}
},
methods: {
showFiles(row) {
if (row.replaceReport && row.replaceReport.length > 0) {
let res = row.replaceReport[0]
let fileId = res?.response?.data.substring(res?.response?.data.lastIndexOf("=") + 1)
let fileName = res?.name
window.open(
"/assets/platform/plugins/pdfJs/web/viewer.html?file=" + encodeURIComponent("/platform/sys/file/convertPDF?id=" + fileId),
fileName
)
}
onView(row) {
this.$refs.guava.public(() => {
this.$refs.infoRef.onOpen(row)
this.showApprovalForm = false
})
},
getFileName(row) {
if (row.replaceReport && row.replaceReport.length > 0) {
return row.replaceReport[0].name
} else {
return ""
}
onApproval(row) {
this.$refs.guava.public(() => {
this.$refs.infoRef.onOpen(row)
this.formData = row.approvalParam
this.showApprovalForm = true
})
},
async auditDo(pass) {
const str = pass ? "通过" : "不通过"
const confirm = await this.$confirm("您确定要审核" + str + "吗?", "提示", {
doApproval(approvalType) {
this.formData.bpmTaskApprovalType = approvalType
this.$refs.approvalFormRef.validate((valid) => {
if (valid) {
this.$axios
.post(loc() + "/approval", {
approval: JSON.stringify(this.formData)
})
.then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
}
})
},
onRevoke(taskId) {
this.$confirm("您确定要撤回吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
const resp = await this.$axios.post("/platform/club/infoManage/schoolAuditReport/auditDo", {
id: this.clickRow.id,
pass: pass
type: "info"
}).then(() => {
this.$axios.post(loc() + "/revoke", { taskId }).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
if (resp.code === 0) {
this.$message.success(resp.msg)
this.dialogVisible = false
this.doSearch()
} else {
this.$message.warning(resp.msg)
}
}
},
audit(row) {
this.clickRow = clone(row)
this.dialogVisible = true
},
openView(row) {
this.$refs.guava.view(() => {
this.$refs.info.onOpen(row.id)
})
},
async pageData() {
@@ -31,40 +31,32 @@ layout("/layouts/platform.html"){
</el-card>
<el-card class="mt10" shadow="never">
<table-tool label="申请列表">
<el-radio-group v-model="pageForm.audit" size="small" @change="doSearch">
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</table-tool>
<el-table :data="tableData">
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
<el-table-column label="协会名称" prop="clubName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="协会类型" prop="typeName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="申请时间" prop="createTime" sortable show-overflow-tooltip>
<template slot-scope="{row}">
<span>{{ $moment(row.createTime).format('YYYY-MM-DD') }}</span>
</template>
</el-table-column>
<el-table-column label="成立时间" prop="foundTime" sortable show-overflow-tooltip>
<template slot-scope="{row}">
<span>{{ $moment(row.foundTime).format('YYYY-MM-DD') }}</span>
</template>
</el-table-column>
<el-table-column label="联系人" prop="concatPersonName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="发起人" prop="sponsorName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="协会章程" prop="afterRulesFile" sortable show-overflow-tooltip>
<template scope="scope">
<span style="color: #0e78c5; text-decoration: underline; cursor: pointer" @click="showFiles(scope.row)">
{{getFileName(scope.row)}}
</span>
</template>
</el-table-column>
<el-table-column label="审核状态" prop="ruleState" sortable show-overflow-tooltip>
<template scope="scope">
<span v-if="scope.row.ruleState === 1">待校工会审核</span>
<span v-if="scope.row.ruleState === 2">校工会审核不通过</span>
<span v-if="scope.row.ruleState === 3">审核通过</span>
</template>
</el-table-column>
<el-table-column label="申请人" prop="userName" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="申请时间" prop="creatTime" sortable show-overflow-tooltip></el-table-column>
<el-table-column label="当前节点" prop="processInstanceNodeName" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="200px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button @click="audit(row)" size="mini" type="primary">审核</el-button>
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.processInstanceTaskStatus==='ACTIVE'" @click="onApproval(row)" size="mini" type="primary">
审核
</el-button>
<el-button
v-if="row.processInstanceTaskStatus==='COMPLETE' && !row.nextTaskIsComplete"
@click="onRevoke(row.processInstanceTaskId)"
size="mini"
type="danger"
>
撤回
</el-button>
</template>
</el-table-column>
</el-table>
@@ -72,91 +64,90 @@ layout("/layouts/platform.html"){
</el-card>
</template>
<template #view>
<club-info ref="info"></club-info>
<template #public>
<info ref="infoRef"></info>
<div v-if="showApprovalForm">
<div class="process-title">{{formData.processInstanceNodeName}}</div>
<el-form :model="formData" ref="approvalFormRef" label-position="left" label-width="80px">
<el-form-item label="审核意见" prop="approvalOpinion" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.approvalOpinion"></user-opinion-textarea>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button plain @click="$refs.guava.index()">取消</el-button>
<el-button type="danger" @click="doApproval('BACK')">退回</el-button>
<el-button type="danger" @click="doApproval('REJECT')">拒绝</el-button>
<el-button type="primary" @click="doApproval('PASS')">同意</el-button>
</el-row>
</div>
</template>
</guava>
<el-dialog width="40%" :visible.sync="dialogVisible" title="校工会审核">
<el-descriptions :column="2" border class="table_fixed">
<el-descriptions-item :span="2" label="旧协会章程">
<file-preview :files="clickRow.rulesFile" complete_result></file-preview>
</el-descriptions-item>
<el-descriptions-item label="新协会章程">
<file-preview :files="clickRow.afterRulesFile" complete_result></file-preview>
</el-descriptions-item>
</el-descriptions>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button @click="auditDo(false)" type="primary">不通过</el-button>
<el-button type="primary" @click="auditDo(true)">通过</el-button>
</span>
</el-dialog>
</div>
<script>
<!--#include("../../common/clubInfoComponent.js"){}#-->
<!--#include("../ruleUpdate/info.js"){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
dicts: ["PROCESS_INSTANCE_STATE"],
components: {
"club-info": REGISTER_INFO_COMPONENT
"info": clubRuleInfo,
},
data() {
return {
dialogVisible: false,
clickRow: {},
clubId: ""
pageForm: {
clubId: "",
year: this.$moment().format("YYYY"),
audit: false
},
formData: {},
showApprovalForm: false
}
},
methods: {
showFiles(row) {
if (row.afterRulesFile && row.afterRulesFile.length > 0) {
let res = row.afterRulesFile[0]
let fileId = res?.response?.data.substring(res?.response?.data.lastIndexOf("=") + 1)
let fileName = res?.name
window.open(
"/assets/platform/plugins/pdfJs/web/viewer.html?file=" + encodeURIComponent("/platform/sys/file/convertPDF?id=" + fileId),
fileName
)
}
onView(row) {
this.$refs.guava.public(() => {
this.$refs.infoRef.onOpen(row)
this.showApprovalForm = false
})
},
getFileName(row) {
if (row.afterRulesFile && row.afterRulesFile.length > 0) {
return row.afterRulesFile[0].name
} else {
return ""
}
onApproval(row) {
this.$refs.guava.public(() => {
this.$refs.infoRef.onOpen(row)
this.formData = row.approvalParam
this.showApprovalForm = true
})
},
async auditDo(pass) {
const str = pass ? "通过" : "不通过"
const confirm = await this.$confirm("您确定要审核" + str + "吗?", "提示", {
doApproval(approvalType) {
this.formData.bpmTaskApprovalType = approvalType
this.$refs.approvalFormRef.validate((valid) => {
if (valid) {
this.$axios
.post(loc() + "/approval", {
approval: JSON.stringify(this.formData)
})
.then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
}
})
},
onRevoke(taskId) {
this.$confirm("您确定要撤回吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
const resp = await this.$axios.post("/platform/club/infoManage/schoolAuditRule/auditDo", {
id: this.clickRow.id,
pass: pass
type: "info"
}).then(() => {
this.$axios.post(loc() + "/revoke", { taskId }).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
if (resp.code === 0) {
this.$message.success(resp.msg)
this.dialogVisible = false
this.doSearch()
} else {
this.$message.warning(resp.msg)
}
}
},
audit(row) {
this.clickRow = clone(row)
this.dialogVisible = true
},
openView(row) {
this.$refs.guava.view(() => {
this.$refs.info.onOpen(row.id)
})
},
async pageData() {
@@ -174,7 +174,7 @@ layout("/layouts/platform.html"){
},
checkApplyClub(val) {
this.$axios.post("/platform/club/join/apply/checkApplyClub", { clubId: val }).then((res) => {
if (res.code === 0) {
if (res.code !== 0) {
if (res.data) {
this.$message.warning("您已申请加入该协会,请勿重复申请")
this.formData.clubId = ""
@@ -44,60 +44,23 @@ layout("/layouts/platform.html"){
<template #view>
<el-tabs tab-position="top" v-model="activeName">
<el-tab-pane label="协会基础信息" name="1">
<el-descriptions style="margin-top: 20px;" class="margin-top" title="" :column="3" border>
<el-descriptions-item span="2">
<template slot="label">协会名称</template>
<div v-html="viewData.clubName"></div>
</el-descriptions-item>
<el-descriptions style="margin-top: 20px;" class="margin-top" title="" :column="2" border>
<el-descriptions-item label="协会名称">{{viewData.clubName}}</el-descriptions-item>
<el-descriptions-item label="成立时间">{{viewData.foundTime}}</el-descriptions-item>
<el-descriptions-item label="协会编码">{{viewData.clubCode}}</el-descriptions-item>
<el-descriptions-item label="协会类型">{{viewData.typeName}}</el-descriptions-item>
<el-descriptions-item label="发起人">{{viewData.sponsorName}}</el-descriptions-item>
<el-descriptions-item>
<template slot="label">报名联系人</template>
{{viewData.concatPersonName}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">联系人电话</template>
{{viewData.concatPersonMobile}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">联系人邮箱</template>
{{viewData.concatPersonEmail}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">会费标准</template>
{{viewData.due}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">当前人数</template>
{{viewData.currentPeopleNum}}
</el-descriptions-item>
<el-descriptions-item span="3">
<el-descriptions-item label="会费标准">{{viewData.due}}</el-descriptions-item>
<el-descriptions-item label="当前人数">{{viewData.currentPeopleNum}}</el-descriptions-item>
<el-descriptions-item span="2">
<template slot="label">协会介绍</template>
<div class="text-left" v-html="viewData.introduce"></div>
</el-descriptions-item>
<el-descriptions-item span="3">
<el-descriptions-item span="2">
<template slot="label">协会宗旨</template>
<div class="text-left" v-html="viewData.purpose"></div>
</el-descriptions-item>
<!--<el-descriptions-item span="1.5">
<template slot="label">QQ群二维码</template>
<file-upload
v-if="viewData.QQGroupCode && viewData.QQGroupCode.length > 0"
:files="JSON.parse(viewData.QQGroupCode)"
:view="true"
></file-upload>
</el-descriptions-item>
<el-descriptions-item span="2">
<template slot="label">微信群二维码</template>
<file-upload
v-if="viewData.wechatGroupCode && viewData.wechatGroupCode.length > 0"
:files="JSON.parse(viewData.wechatGroupCode)"
:view="true"
></file-upload>
</el-descriptions-item>-->
<el-descriptions-item span="1.5">
<template slot="label">协会章程</template>
<file-preview :files="viewData.rulesFile" complete_result></file-preview>
</el-descriptions-item>
@@ -10,7 +10,7 @@ const CLUB_FORM_TEMPLATE = {
</el-col>
<el-col :span="12">
<el-form-item label="协会编码" prop="clubCode">
<el-input placeholder="请输入协会编码" v-model="formData.clubCode" disabled></el-input>
<el-input placeholder="请输入协会编码" v-model="formData.clubCode"></el-input>
</el-form-item>
</el-col>
</el-row>
@@ -103,12 +103,12 @@ layout("/layouts/platform.html"){
let formData = {}
try {
let hz = this.$refs.clubManagerRef.managePerson.filter((o) => o.roleCode === CLUB_ROLE_CONSTANT.CLUB_PRESIDENT)
if (hz.length > 1) {
if (hz.length !== 1) {
this.$message.warning({ title: "警告", message: "会长只能有1人!" })
return
}
let msz = this.$refs.clubManagerRef.managePerson.filter((o) => o.roleCode === CLUB_ROLE_CONSTANT.CLUB_SECRETARY)
if (msz.length > 1) {
if (msz.length !== 1) {
this.$message.warning({ title: "警告", message: "秘书长只能有1人" })
return
}
@@ -173,6 +173,11 @@ layout("/layouts/platform.html"){
await this.userRemoteMethod(resp.data.concatPerson)
let formData = resp.data
if (resp.data.clubUser.length > 0) {
resp.data.clubUser.forEach(item => {
if(item.roleCode) {
item.roleCode = JSON.parse(item.roleCode)[0]
}
})
resp.data.clubUser = resp.data.clubUser.filter((o) => o.roleCode !== "CLUB_MEMBER")
}
this.$refs.clubManagerRef.managePerson = clone(resp.data.clubUser)
@@ -198,7 +203,7 @@ layout("/layouts/platform.html"){
this.$refs.clubSponsorRef.sponsorData.push(row)
})
this.$refs.clubFormRef.formData = formData
await this.$refs.clubFormRef.concatPersonChange(resp.data.concatPerson)
//await this.$refs.clubFormRef.concatPersonChange(resp.data.concatPerson)
}
} else {
$.post("/platform/club/register/clubRegisterApply/createCode").then((res) => {
@@ -56,7 +56,7 @@ layout("/layouts/platform.html"){
编辑
</el-button>
<el-button
v-if="[20].includes(row.processInstanceNodeCode) && !row.nextTaskIsComplete"
v-if="[50].includes(row.processInstanceNodeCode) && !row.nextTaskIsComplete"
size="mini"
type="danger"
@click="openRevoke(row)"
@@ -7,13 +7,13 @@ layout("/layouts/platform.html"){
<el-row style="padding-right: 10px">
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年审状态:">
<!--<search-item label="年审状态:">
<el-select @change="getClub" v-model="pageForm.auditState" placeholder="请选择年审状态">
<el-option label="全部" :value="null"></el-option>
<el-option label="年审通过" :value="true"></el-option>
<el-option label="年审未通过" :value="false"></el-option>
</el-select>
</search-item>
</search-item>-->
<search-item label="协会名称:">
<el-select v-model="pageForm.clubId" placeholder="请选择协会" clearable filterable>
<el-option v-for="item in clubList" :label="item.clubName" :value="item.id" :key="item.id"></el-option>