commit
This commit is contained in:
+93
-39
@@ -1,7 +1,9 @@
|
||||
package io.v.nutz.sys.controllers.platform.sys.club.applyIn;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
@@ -11,6 +13,7 @@ import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.sys.constant.club.ClubRegistAuditState;
|
||||
import io.v.nutz.sys.controllers.platform.sys.handler.ClubUserApplyToDoHandler;
|
||||
import io.v.nutz.sys.models.Sys_club;
|
||||
import io.v.nutz.sys.models.Sys_club_user;
|
||||
import io.v.nutz.sys.services.SysClubService;
|
||||
import io.v.nutz.sys.services.SysClubUserService;
|
||||
@@ -25,6 +28,8 @@ import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.sql.SqlCallback;
|
||||
import org.nutz.dao.util.Daos;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -81,35 +86,44 @@ public class ClubApplyInController {
|
||||
@Param(value = "pageOrderName", required = false) String pageOrderName,
|
||||
@Param(value = "pageOrderBy", required = false) String pageOrderBy,
|
||||
@Param(value = "clubType", required = false) String clubType) {
|
||||
Sql sql = Sqls.create("SELECT" +
|
||||
" club.*," +
|
||||
" fzr.username fzrname," +
|
||||
" unit.`name` fzr_unit_name," +
|
||||
" (select yearAuditStatus from sys_club_user where clubid = club.id and userid = @userid and year(yearAudit) = @year and isNormal = true and yearAuditStatus is not null) as yearAuditStatus," +
|
||||
" (select GROUP_CONCAT(username) from sys_user where id in (select userid from sys_club_user u where u.clubid=club.id and u.sf=1 and isNormal = true)) as hz," +
|
||||
" (SELECT count( 1 ) FROM sys_club_user scu WHERE scu.clubid = club.id AND scu.`status` = 5 and isNormal = true ) cynum," +
|
||||
" (SELECT count( 1 ) FROM sys_club_user scu WHERE scu.clubid = club.id AND scu.`status` in (1, 3) and isNormal = true) approvalnum," +
|
||||
" (SELECT status FROM sys_club_user scu WHERE scu.clubid = club.id AND scu.userid = @userid and isNormal = true) status," +
|
||||
" (select count(*) from sys_user where userState='在职' 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='退休' and id in (select userid from sys_club_user where clubid = club.id and `status` = 5 and isNormal = true)) as outnum" +
|
||||
" FROM" +
|
||||
" `sys_club` club" +
|
||||
" LEFT JOIN sys_user fzr ON club.concatPerson = fzr.id" +
|
||||
" LEFT JOIN sys_unit unit ON fzr.unitid = unit.id $condition")
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
club.*,
|
||||
fzr.username fzrname,
|
||||
unit.`name` fzr_unit_name,
|
||||
(select yearAuditStatus from sys_club_user where clubid = club.id and userid = @userid and year(yearAudit) = @year and isNormal = true and yearAuditStatus is not null) as yearAuditStatus,
|
||||
(select GROUP_CONCAT(username) from sys_user where id in (select userid from sys_club_user u where u.clubid=club.id and u.sf=1 and isNormal = true)) as hz,
|
||||
(SELECT count( 1 ) FROM sys_club_user scu WHERE scu.clubid = club.id AND scu.`status` = 5 and isNormal = true ) cynum,
|
||||
(SELECT count( 1 ) FROM sys_club_user scu WHERE scu.clubid = club.id AND scu.`status` in (1, 3) and isNormal = true) approvalnum,
|
||||
(SELECT status FROM sys_club_user scu WHERE scu.clubid = club.id AND scu.userid = @userid and isNormal = true) status,
|
||||
(SELECT invite FROM sys_club_user scu WHERE scu.clubid = club.id AND scu.userid = @userid and isNormal = true) invite,
|
||||
(select count(*) from sys_user where userState='在职' 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='退休' and id in (select userid from sys_club_user where clubid = club.id and `status` = 5 and isNormal = true)) as outnum
|
||||
FROM
|
||||
`sys_club` club
|
||||
LEFT JOIN sys_user fzr ON club.concatPerson = fzr.id
|
||||
LEFT JOIN sys_unit unit ON fzr.unitid = unit.id
|
||||
$condition
|
||||
""")
|
||||
.setParam("userid", ShiroUtil.getPrincipalProperty("id"))
|
||||
.setParam("year", cn.hutool.core.date.DateUtil.thisYear());
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("isjs", "=", false);
|
||||
cnd.and("state", "=", ClubRegistAuditState.SCHOOL_PASS);
|
||||
|
||||
if (StrUtil.isNotBlank(clubType)) {
|
||||
cnd.and("club.type", "=", clubType);
|
||||
}
|
||||
|
||||
if (isjr) {
|
||||
cnd.and("club.id in (SELECT clubid from sys_club_user WHERE isNormal = true and userid = '" + ShiroUtil.getPrincipalProperty("id") + "') and 1", "=", 1);
|
||||
cnd.and("club.id in (SELECT clubid from sys_club_user WHERE isNormal = true and status in (1,3,5) and userid = '" + ShiroUtil.getPrincipalProperty("id") + "') and 1", "=", 1);
|
||||
} else {
|
||||
cnd.and("club.id not in (SELECT clubid from sys_club_user WHERE isNormal = true and userid = '" + ShiroUtil.getPrincipalProperty("id") + "' and status not in (2, 4) ) and 1", "=", 1);
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.and("state", "=", ClubRegistAuditState.SCHOOL_PASS);
|
||||
group.or(new Static("club.id in (select clubid from sys_club_user where userid = '%s' and invite = true and status in (6, 7))"
|
||||
.formatted(ShiroUtil.getPlatformUid())));
|
||||
|
||||
cnd.and(group);
|
||||
cnd.and("club.id not in (SELECT clubid from sys_club_user WHERE isNormal = true and userid = '" + ShiroUtil.getPrincipalProperty("id") + "' and status not in (2, 4, 6, 7) ) and 1", "=", 1);
|
||||
}
|
||||
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
@@ -122,7 +136,6 @@ public class ClubApplyInController {
|
||||
}
|
||||
|
||||
sql.setCondition(cnd);
|
||||
|
||||
return sysClubService.listPage(pageNumber, pageSize, sql);
|
||||
}
|
||||
|
||||
@@ -132,28 +145,34 @@ public class ClubApplyInController {
|
||||
@RequiresPermissions("sys.club.sq")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object submit(Sys_club_user sys_club_user) {
|
||||
Sys_club sysClub = dao.fetch(Sys_club.class, sys_club_user.getClubid());
|
||||
Sys_club_user sysClubUser = dao.fetch(Sys_club_user.class, Cnd.where("clubid", "=", sys_club_user.getClubid()).and("userid", "=", ShiroUtil.getUserId()));
|
||||
sys_club_user.setInvite(sysClubUser.getInvite());
|
||||
|
||||
sysClubUserService.clear(Cnd.where("clubid", "=", sys_club_user.getClubid()).and("userid", "=", ShiroUtil.getPrincipalProperty("id")));
|
||||
boolean isInvite = sys_club_user.getInvite() && Objects.equals(sysClub.getState(), ClubRegistAuditState.NOT_SUBMIT);
|
||||
|
||||
String dateTime = DateUtil.getDateTime();
|
||||
|
||||
sys_club_user.setUserid(ShiroUtil.getPrincipalProperty("id").toString());
|
||||
sys_club_user.setJoin_time(dateTime);
|
||||
sys_club_user.setSf(2);
|
||||
sys_club_user.setStatus(1);
|
||||
sys_club_user.setStatus(isInvite ? 5 : 1);
|
||||
sys_club_user.setIsjf(false);
|
||||
sys_club_user.setIsNormal(true);
|
||||
sys_club_user.setGiveMoney(true);
|
||||
Sys_club_user clubUser = sysClubUserService.insert(sys_club_user);
|
||||
|
||||
//插入后,发起待办流程
|
||||
ClubUserApplyToDoHandler.START_PROCESS.exec(clubUser);
|
||||
//发任务给协会会长
|
||||
ClubUserApplyToDoHandler.CREATE_CLUB_TASK.exec(clubUser);
|
||||
//完成申请人的任务(申请拒绝的情况)
|
||||
ClubUserApplyToDoHandler.COMPLETE_APPLY_TASK.exec(clubUser);
|
||||
if(sys_club_user.getStatus() != 5) {
|
||||
//插入后,发起待办流程
|
||||
ClubUserApplyToDoHandler.START_PROCESS.exec(clubUser);
|
||||
//发任务给协会会长
|
||||
ClubUserApplyToDoHandler.CREATE_CLUB_TASK.exec(clubUser);
|
||||
//完成申请人的任务(申请拒绝的情况)
|
||||
ClubUserApplyToDoHandler.COMPLETE_APPLY_TASK.exec(clubUser);
|
||||
|
||||
//根据协会id查询协会负责人,发短信
|
||||
Sql sql = Sqls.create("""
|
||||
//根据协会id查询协会负责人,发短信
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname as loginName,
|
||||
u.username as userName,
|
||||
@@ -169,19 +188,20 @@ public class ClubApplyInController {
|
||||
sys_club c ON c.id = r.stid
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("stid", "=", sys_club_user.getClubid());
|
||||
cnd.and("roleId", "in", Lang.array(Roles.club01, Roles.club02, Roles.club03, Roles.club04));
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("stid", "=", sys_club_user.getClubid());
|
||||
cnd.and("roleId", "in", Lang.array(Roles.club01, Roles.club02, Roles.club03, Roles.club04));
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
|
||||
String platformUsername = ShiroUtil.getPlatformUsername();
|
||||
String platformUsername = ShiroUtil.getPlatformUsername();
|
||||
|
||||
list.forEach(item -> {
|
||||
String content = "%s老师您好,%s老师于%s申请加入%s,请登陆智慧工会进行审核!".formatted(item.getString("userName")
|
||||
, platformUsername, dateTime, item.getString("name"));
|
||||
//msgApi.sendWxMsg(person, content);
|
||||
});
|
||||
list.forEach(item -> {
|
||||
String content = "%s老师您好,%s老师于%s申请加入%s,请登陆智慧工会进行审核!".formatted(item.getString("userName")
|
||||
, platformUsername, dateTime, item.getString("name"));
|
||||
//msgApi.sendWxMsg(person, content);
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -303,4 +323,38 @@ public class ClubApplyInController {
|
||||
Cnd.where("clubid", "=", id).and("userid", "=", ShiroUtil.getUserId()).and("isNormal", "=", true));
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("sys.club.sq")
|
||||
public Object inviteNotAgree(String clubId) {
|
||||
Sys_club_user clubUser = dao.fetch(Sys_club_user.class, Cnd.where("clubid", "=", clubId).and("userid", "=", ShiroUtil.getUserId()));
|
||||
clubUser.setStatus(7);
|
||||
dao.update(clubUser);
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("sys.club.sq")
|
||||
public Object inviteAgree(String clubId) {
|
||||
//同意直接审核通过
|
||||
Sys_club_user clubUser = dao.fetch(Sys_club_user.class, Cnd.where("clubid", "=", clubId).and("userid", "=", ShiroUtil.getUserId()));
|
||||
clubUser.setStatus(5);
|
||||
dao.update(clubUser);
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("sys.club.sq")
|
||||
public Object rollbackInvite(String clubId) {
|
||||
Sys_club_user clubUser = dao.fetch(Sys_club_user.class, Cnd.where("clubid", "=", clubId).and("userid", "=", ShiroUtil.getUserId()));
|
||||
clubUser.setStatus(6);
|
||||
dao.update(clubUser);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+75
-15
@@ -1,15 +1,17 @@
|
||||
package io.v.nutz.sys.controllers.platform.sys.club.regist;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.page.Pagination;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.sys.models.Sys_club_sponsor;
|
||||
import io.v.nutz.sys.models.Sys_club_user;
|
||||
import io.v.nutz.sys.models.Sys_user_role;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.sys.models.*;
|
||||
import io.v.nutz.sys.services.SysClubService;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
@@ -27,6 +29,10 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
* @Date 2022/4/14
|
||||
@@ -46,6 +52,9 @@ public class ClubMyApplyController {
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private MsgApi msgApi;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/sys/club/regist/clubMyApply.html")
|
||||
@RequiresPermissions("sys.club.clubRegist.clubMyApply")
|
||||
@@ -145,18 +154,69 @@ public class ClubMyApplyController {
|
||||
if (Strings.isNotBlank(result.getString("xldAuditId"))) {
|
||||
result.put("xldAudit", dao.fetch(Audit.class, result.getString("xldAuditId")));
|
||||
}
|
||||
result.setv("clubuser", baseService.listMap(Sqls.create("SELECT\n" +
|
||||
"\tscu.*,\n" +
|
||||
"\tu.username,u.loginname,\n" +
|
||||
"\tu.sex,\n" +
|
||||
"\tu.mobile,\n" +
|
||||
"\tunit.`name` unitname \n" +
|
||||
"FROM\n" +
|
||||
"\tsys_club_user scu\n" +
|
||||
"\tLEFT JOIN sys_user u ON scu.userid = u.id\n" +
|
||||
"\tLEFT JOIN sys_unit unit ON u.unitid = unit.id\n" +
|
||||
"\tWHERE scu.clubid = @clubid and scu.status = 5 and isNormal = true\n" +
|
||||
"\tORDER BY FIELD( scu.sf, 1, 3, 4, 5, 2 ),scu.join_time DESC").setParam("clubid", id)));
|
||||
result.setv("clubuser", baseService.listMap(Sqls.create("""
|
||||
SELECT
|
||||
scu.*,
|
||||
scu.userid as userId,
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
unit.`name` unitname
|
||||
FROM
|
||||
sys_club_user scu
|
||||
LEFT JOIN sys_user u ON scu.userid = u.id
|
||||
LEFT JOIN sys_unit unit ON u.unitid = unit.id
|
||||
WHERE scu.clubid = @clubid and scu.status in (5, 6) and isNormal = true
|
||||
ORDER BY FIELD( scu.sf, 1, 3, 4, 5, 2 ),scu.join_time DESC
|
||||
""").setParam("clubid", id)));
|
||||
return result;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.club.clubRegist.clubMyApply")
|
||||
public Object getInviteUser(String id) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
cu.*,
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.unitname,
|
||||
u.sex,
|
||||
u.mobile
|
||||
FROM
|
||||
sys_club_user cu
|
||||
LEFT JOIN USER u ON cu.userId = u.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("cu.clubid", "=", id);
|
||||
cnd.and("cu.invite", "=", true);
|
||||
cnd.desc("cu.status");
|
||||
sql.setCondition(cnd);
|
||||
return baseService.listMap(sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.club.clubRegist.clubMyApply")
|
||||
public Object sendDingTalkMsg(String id, String[] userList) {
|
||||
if(StrUtil.isBlank(id)) {
|
||||
return Result.error("推送失败,协会信息为空");
|
||||
}
|
||||
if(userList.length == 0) {
|
||||
return Result.error("推送失败,人员信息为空");
|
||||
}
|
||||
Sys_club sysClub = dao.fetch(Sys_club.class, id);
|
||||
List<Sys_user> sysUsers = dao.query(Sys_user.class, Cnd.where("loginname", "in", userList));
|
||||
Map<String, Sys_user> userMap = sysUsers.stream().collect(Collectors.toMap(Sys_user::getLoginname, o -> o));
|
||||
for (String user : userList) {
|
||||
Sys_user sysUser = userMap.get(user);
|
||||
String content = "%s老师您好,欢迎加入%s,请进入入会申请进行确认!".formatted(sysUser.getUsername(), sysClub.getName())
|
||||
+ Globals.AppDomain + "/platform/sys/club/sq/mobile";
|
||||
msgApi.sendMsg(List.of("DingTalk"), user, 1, "协会入会邀请", content, "", "");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+54
-4
@@ -2,6 +2,7 @@ package io.v.nutz.sys.controllers.platform.sys.club.regist;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.result.Result;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.sys.constant.club.ClubRegistAuditState;
|
||||
@@ -27,6 +28,7 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author JyuHsin
|
||||
@@ -71,8 +73,11 @@ public class ClubRegistApplyController {
|
||||
@RequiresPermissions("sys.club.clubRegist.clubRegistApply")
|
||||
public Object doAdd(@Param(value = "club", required = false) Sys_club club,
|
||||
@Param(value = "isSave", required = false) Boolean isSave,
|
||||
@Param(value = "::managePerson", required = false) List<NutMap> managePerson) throws IOException {
|
||||
|
||||
@Param(value = "::managePerson", required = false) List<NutMap> managePerson,
|
||||
@Param(value = "::clubUserList", required = false) List<NutMap> clubUserList) throws IOException {
|
||||
if(!sysClubService.getInviteAgree(club)) {
|
||||
return Result.error("邀请会员中确认人数暂未达到20人");
|
||||
}
|
||||
club.setIsjs(false);
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin, A06, xxhgly")) {
|
||||
club.setFoundTime(DateUtil.getDateTime());
|
||||
@@ -116,6 +121,25 @@ public class ClubRegistApplyController {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//协会成员
|
||||
List<String> manageUserIdList = managePerson.stream().map(o -> o.getString("userId")).toList();
|
||||
clubUserList.forEach(item -> {
|
||||
if (StrUtil.isNotBlank(item.getString("userId")) && !manageUserIdList.contains(item.getString("userId"))) {
|
||||
Sys_club_user cUser = new Sys_club_user();
|
||||
cUser.setClubid(sysClub.getId());
|
||||
cUser.setUserid(item.getString("userId"));
|
||||
cUser.setJoin_time(DateUtil.getDateTime());
|
||||
cUser.setSf(2);
|
||||
cUser.setIsjf(true);
|
||||
cUser.setStatus(6);
|
||||
cUser.setGiveMoney(true);
|
||||
cUser.setIsNormal(true);
|
||||
cUser.setInvite(true);
|
||||
clubUsers.add(cUser);
|
||||
}
|
||||
});
|
||||
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin, A06, xxhgly")) {
|
||||
dao.insert(userRoles);
|
||||
}
|
||||
@@ -145,10 +169,15 @@ public class ClubRegistApplyController {
|
||||
public Object doEdit(@Param(value = "club", required = false) Sys_club club,
|
||||
@Param(value = "isSave", required = false) Boolean isSave,
|
||||
@Param(value = "::deleteIds", required = false) List<String> deleteIds,
|
||||
@Param(value = "::managePerson", required = false) List<NutMap> managePerson) throws IOException {
|
||||
@Param(value = "::managePerson", required = false) List<NutMap> managePerson,
|
||||
@Param(value = "::clubUserList", required = false) List<NutMap> clubUserList) throws IOException {
|
||||
|
||||
if(!isSave && Objects.equals(club.getState(), ClubRegistAuditState.NOT_SUBMIT) && !sysClubService.getInviteAgree(club)) {
|
||||
return Result.error("邀请会员中确认人数暂未达到20人");
|
||||
}
|
||||
|
||||
//如果不是管理员,并且点的提交按钮
|
||||
if (!isSave && !ShiroUtil.hasAnyRoles("sysadmin, A06, xxhgly")) {
|
||||
if (!isSave && Objects.equals(club.getUserid(), ShiroUtil.getUserId())) {
|
||||
club.setState(club.getSponsorType() == 1 ? ClubRegistAuditState.UNIT_PART_READY : ClubRegistAuditState.XT_READY);
|
||||
club.setXtAuditId("");
|
||||
club.setXldAuditId("");
|
||||
@@ -194,6 +223,27 @@ public class ClubRegistApplyController {
|
||||
}
|
||||
});
|
||||
|
||||
List<String> manageUserIdList = managePerson.stream().map(o -> o.getString("userId")).toList();
|
||||
clubUserList.forEach(item -> {
|
||||
if (StrUtil.isNotBlank(item.getString("userId")) && !manageUserIdList.contains(item.getString("userId"))) {
|
||||
int count = dao.count(Sys_club_user.class, Cnd.where("clubid", "=", club.getId())
|
||||
.and("userid", "=", item.getString("userId")));
|
||||
if(count == 0) {
|
||||
Sys_club_user cUser = new Sys_club_user();
|
||||
cUser.setClubid(club.getId());
|
||||
cUser.setUserid(item.getString("userId"));
|
||||
cUser.setJoin_time(DateUtil.getDateTime());
|
||||
cUser.setSf(2);
|
||||
cUser.setIsjf(true);
|
||||
cUser.setStatus(6);
|
||||
cUser.setGiveMoney(true);
|
||||
cUser.setIsNormal(true);
|
||||
cUser.setInvite(true);
|
||||
clubUsers.add(cUser);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(ShiroUtil.hasAnyRoles("sysadmin, A06, xxhgly") && Objects.equals(club.getState(), ClubRegistAuditState.SCHOOL_PASS)) {
|
||||
dao.clear(Sys_user_role.class, Cnd.where("stid", "=", club.getId())
|
||||
.and("roleid", "in", Lang.array(Roles.club01, Roles.club02, Roles.club03, Roles.club04)));
|
||||
|
||||
@@ -72,7 +72,7 @@ public class Sys_club_user extends BaseModel {
|
||||
private Integer yearAuditStatus;
|
||||
|
||||
@Column
|
||||
@Comment("状态(1 待协会审核 2 协会审核不通过 3 待校工会审核 4 校工会审核不通过 5 通过)")
|
||||
@Comment("状态(1 待协会审核 2 协会审核不通过 3 待校工会审核 4 校工会审核不通过 5 通过 6 待邀请确认)")
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
private Integer status;
|
||||
|
||||
@@ -215,4 +215,10 @@ public class Sys_club_user extends BaseModel {
|
||||
@Comment("会长审核id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String clubAuditId;
|
||||
|
||||
@Column
|
||||
@Comment("是否注册时邀请")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean invite;
|
||||
}
|
||||
|
||||
@@ -10,4 +10,6 @@ import org.nutz.dao.Cnd;
|
||||
public interface SysClubService extends BaseService<Sys_club> {
|
||||
|
||||
Pagination pageData(Cnd cnd, PageForm page, Integer year, String name);
|
||||
|
||||
Boolean getInviteAgree(Sys_club club);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package io.v.nutz.sys.services.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.service.BaseServiceImpl;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.sys.models.Sys_club;
|
||||
import io.v.nutz.sys.models.Sys_club_user;
|
||||
import io.v.nutz.sys.services.SysClubService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
@@ -46,4 +48,14 @@ public class SysClubServiceImpl extends BaseServiceImpl<Sys_club> implements Sys
|
||||
sql.setCondition(cnd);
|
||||
return listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getInviteAgree(Sys_club club) {
|
||||
if(StrUtil.isBlank(club.getId())) {
|
||||
return false;
|
||||
}
|
||||
int count = dao().count(Sys_club_user.class, Cnd.where("clubid", "=", club.getId())
|
||||
.and("invite", "=", true).and("status", "=", 5));
|
||||
return count >= 20;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user