人员
This commit is contained in:
@@ -58,46 +58,46 @@ public class MsgApi {
|
||||
*/
|
||||
public void sendMsg(List<String> channels, String loginNameStr, Integer mtype, String title, String content, String imageUrl,String link) {
|
||||
try {
|
||||
// if (!Globals.MyConfig.getBoolean("SendMsg")) {
|
||||
// log.info("发送失败,消息暂未开启!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (Globals.isEnv(Env.dev)) {
|
||||
// log.info("开发模式不允许发送短信!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (StrUtil.isBlank(title)||StrUtil.isBlank(content) ||Lang.isEmpty(channels) || Lang.isEmpty(loginNameStr)) {
|
||||
// log.info("发送失败,缺少需要参数请检查!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// String msgToken = getMsgToken();
|
||||
// NutMap map = new NutMap();
|
||||
// map.put("channel", String.join(",", channels));
|
||||
// //推送范围(1:普通模式;2:全体教师;3:全体学生;4:全体人员)
|
||||
// map.put("objScope", 1);
|
||||
// map.put("objIds", loginNameStr);
|
||||
// map.put("mtype", mtype);
|
||||
// map.put("sendStatus", 1);
|
||||
// map.put("title", title);
|
||||
// map.put("content", content);
|
||||
// map.put("imageUrl", imageUrl);
|
||||
// map.put("link", link);
|
||||
//
|
||||
// HttpRequest request = HttpUtil.createPost(MSG_API)
|
||||
// .header("token", msgToken)
|
||||
// .body(Json.toJson(map));
|
||||
// JSONObject jsonObject = JSON.parseObject(request.execute().body());
|
||||
// int status = jsonObject.getInteger("code");
|
||||
//
|
||||
// if (status == 200) {
|
||||
// log.info("发送成功>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
// } else {
|
||||
// log.info("发送失败>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
// throw new RuntimeException("Message sending failed with status code: " + status + ", Message: " + jsonObject.getString("message"));
|
||||
// }
|
||||
/*if (!Globals.MyConfig.getBoolean("SendMsg")) {
|
||||
log.info("发送失败,消息暂未开启!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Globals.isEnv(Env.dev)) {
|
||||
log.info("开发模式不允许发送短信!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(title)||StrUtil.isBlank(content) ||Lang.isEmpty(channels) || Lang.isEmpty(loginNameStr)) {
|
||||
log.info("发送失败,缺少需要参数请检查!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
String msgToken = getMsgToken();
|
||||
NutMap map = new NutMap();
|
||||
map.put("channel", String.join(",", channels));
|
||||
//推送范围(1:普通模式;2:全体教师;3:全体学生;4:全体人员)
|
||||
map.put("objScope", 1);
|
||||
map.put("objIds", loginNameStr);
|
||||
map.put("mtype", mtype);
|
||||
map.put("sendStatus", 1);
|
||||
map.put("title", title);
|
||||
map.put("content", content);
|
||||
map.put("imageUrl", imageUrl);
|
||||
map.put("link", link);
|
||||
|
||||
HttpRequest request = HttpUtil.createPost(MSG_API)
|
||||
.header("token", msgToken)
|
||||
.body(Json.toJson(map));
|
||||
JSONObject jsonObject = JSON.parseObject(request.execute().body());
|
||||
int status = jsonObject.getInteger("code");
|
||||
|
||||
if (status == 200) {
|
||||
log.info("发送成功>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
} else {
|
||||
log.info("发送失败>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
throw new RuntimeException("Message sending failed with status code: " + status + ", Message: " + jsonObject.getString("message"));
|
||||
}*/
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
+2
-1
@@ -150,7 +150,8 @@ public class ClubApplyInController {
|
||||
if(sysUser.getMember() != 1) {
|
||||
return Result.error("您当前不是会员,无法申请");
|
||||
}
|
||||
int count = dao.count(Sys_club_user.class, Cnd.where("userid", "=", ShiroUtil.getUserId()).and("isNormal", "=", true));
|
||||
int count = dao.count(Sys_club_user.class, Cnd.where("userid", "=", ShiroUtil.getUserId())
|
||||
.and("isNormal", "=", true).and("`status`", "in", List.of(1, 3, 5)));
|
||||
if(count >= 3) {
|
||||
return Result.error("您已参与3个协会,无法申请");
|
||||
}
|
||||
|
||||
+4
-4
@@ -76,9 +76,9 @@ public class ClubRegistApplyController {
|
||||
@Param(value = "isSave", required = false) Boolean isSave,
|
||||
@Param(value = "::managePerson", required = false) List<NutMap> managePerson,
|
||||
@Param(value = "::clubUserList", required = false) List<NutMap> clubUserList) throws IOException {
|
||||
if(!isSave && !sysClubService.getInviteAgree(club)) {
|
||||
/*if(!isSave && !sysClubService.getInviteAgree(club)) {
|
||||
return Result.error("您邀请的会员中确认人数暂未达到20人,<span style='color: red'>暂不能提交,只能保存</span>");
|
||||
}
|
||||
}*/
|
||||
club.setIsjs(false);
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin, A06, xxhgly")) {
|
||||
club.setFoundTime(DateUtil.getDateTime());
|
||||
@@ -190,9 +190,9 @@ public class ClubRegistApplyController {
|
||||
@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)) {
|
||||
/*if(!isSave && Objects.equals(club.getState(), ClubRegistAuditState.NOT_SUBMIT) && !sysClubService.getInviteAgree(club)) {
|
||||
return Result.error("您邀请的会员中确认人数暂未达到20人,<span style='color: red'>暂不能提交,只能保存</span>");
|
||||
}
|
||||
}*/
|
||||
|
||||
//如果不是管理员,并且点的提交按钮
|
||||
if (!isSave && Objects.equals(club.getUserid(), ShiroUtil.getUserId())) {
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ public enum ClubUserApplyToDoHandler {
|
||||
sur.userId
|
||||
""");
|
||||
sqlStr.setCondition(Cnd.NEW().and("sur.roleId", "in", Lang.array(Roles.club01, Roles.club02, Roles.club03, Roles.club04))
|
||||
.and("clubId", "=", clubUser.getClubid()));
|
||||
.and("sur.stid", "=", clubUser.getClubid()));
|
||||
Sql sql = Sqls.queryString(sqlStr.toString());
|
||||
dao.execute(sql);
|
||||
List<String> loginNames = sql.getList(String.class);
|
||||
|
||||
@@ -142,16 +142,21 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
|
||||
@Override
|
||||
public Sys_user fillUnitUnion(Sys_user user) {
|
||||
if (user.getUnit() != null) {
|
||||
if (Strings.isNotBlank(user.getUnit().getUnionid())) {
|
||||
Sys_union union = dao().fetch(Sys_union.class, user.getUnit().getUnionid());
|
||||
User fetch = dao().fetch(User.class, Cnd.where("id", "=", user.getId()));
|
||||
if (StrUtil.isNotBlank(fetch.getUnionid())) {
|
||||
Sys_union union = dao().fetch(Sys_union.class, fetch.getUnionid());
|
||||
user.setUnion(union);
|
||||
} else {
|
||||
User fetch = dao().fetch(User.class, Cnd.where("id", "=", user.getId()));
|
||||
if (StrUtil.isNotBlank(fetch.getUnionid())) {
|
||||
Sys_union union = dao().fetch(Sys_union.class, fetch.getUnionid());
|
||||
user.setUnion(union);
|
||||
}
|
||||
}
|
||||
// if (Strings.isNotBlank(user.getUnit().getUnionid())) {
|
||||
// Sys_union union = dao().fetch(Sys_union.class, user.getUnit().getUnionid());
|
||||
// user.setUnion(union);
|
||||
// } else {
|
||||
// User fetch = dao().fetch(User.class, Cnd.where("id", "=", user.getId()));
|
||||
// if (StrUtil.isNotBlank(fetch.getUnionid())) {
|
||||
// Sys_union union = dao().fetch(Sys_union.class, fetch.getUnionid());
|
||||
// user.setUnion(union);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
@@ -284,6 +284,8 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
sysRoleService.clearCache();
|
||||
|
||||
} else {
|
||||
List<String> loginNameList = middleTables.stream().map(SourceChangeMiddleTable::getLoginname).toList();
|
||||
dao().clear(SourceChangeMiddleTable.class, Cnd.where("loginname", "in", loginNameList).and("isOperate", "=", false));
|
||||
manyAddOrRenewUtil.asyncExecuteFastInsert(middleTables, 200);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -316,48 +318,39 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
boolean shouldAdd = false;
|
||||
boolean shouldRemove = false;
|
||||
|
||||
// 提前检查 userState 条件(如果存在)
|
||||
boolean userStateConditionMet = true;
|
||||
if ("userState".equals(siftName)) {
|
||||
userStateConditionMet = checkListCondition(siftValue, source, "userState");
|
||||
}
|
||||
|
||||
switch (siftName) {
|
||||
case "userState":
|
||||
if (siftValue instanceof List<?> && source != null && source.getUserState() != null) {
|
||||
List<String> userStateList = (List<String>) siftValue;
|
||||
shouldAdd = userStateList.contains(source.getUserState());
|
||||
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
|
||||
}
|
||||
// 如果 userState 不满足条件,则直接设置 shouldRemove
|
||||
shouldAdd = userStateConditionMet;
|
||||
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
|
||||
break;
|
||||
|
||||
case "personType":
|
||||
if (siftValue instanceof List<?> && source != null && source.getPersonType() != null) {
|
||||
List<String> personTypeList = (List<String>) siftValue;
|
||||
shouldAdd = personTypeList.contains(source.getPersonType());
|
||||
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
|
||||
}
|
||||
// 检查 personType 条件
|
||||
// 必须同时满足 userState 和 personType 条件
|
||||
shouldAdd = checkListCondition(siftValue, source, "personType");
|
||||
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
|
||||
break;
|
||||
|
||||
case "loginNameStart":
|
||||
if (siftValue instanceof String && source != null && source.getLoginname() != null) {
|
||||
String loginNameStart = (String) siftValue;
|
||||
shouldAdd = source.getLoginname().startsWith(loginNameStart);
|
||||
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
|
||||
}
|
||||
break;
|
||||
case "loginNameEnd":
|
||||
if (siftValue instanceof String && source != null && source.getLoginname() != null) {
|
||||
String loginNameEnd = (String) siftValue;
|
||||
shouldAdd = source.getLoginname().endsWith(loginNameEnd);
|
||||
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
|
||||
}
|
||||
shouldAdd = checkLoginNameCondition(siftValue, source, siftName);
|
||||
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
|
||||
break;
|
||||
|
||||
case "userQuery":
|
||||
if (siftValue instanceof List<?> && user != null) {
|
||||
List<String> userIds = (List<String>) siftValue;
|
||||
shouldAdd = userIds.contains(user.getId()) && user.getMember() != 1;
|
||||
}
|
||||
shouldAdd = checkUserQueryCondition(siftValue, user);
|
||||
break;
|
||||
}
|
||||
|
||||
if (shouldAdd) {
|
||||
if (user == null) {
|
||||
addMemberUserIds.add(source.getId());
|
||||
} else if (user.getMember() != 1) {
|
||||
addMemberUserIds.add(user.getId());
|
||||
}
|
||||
addUserToMemberList(user, source, addMemberUserIds);
|
||||
source.setMember(1);
|
||||
} else if (shouldRemove) {
|
||||
deleteMemberUserIds.add(user.getId());
|
||||
@@ -365,13 +358,22 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (config.getWelfareMemberSiftList() == null) {
|
||||
return;
|
||||
}
|
||||
config.getWelfareMemberSiftList().forEach(welfareMember -> {
|
||||
String siftName = welfareMember.getSiftName();
|
||||
Object siftValue = welfareMember.getSiftValue();
|
||||
boolean shouldAdd = false;
|
||||
boolean shouldRemove = false;
|
||||
|
||||
// 提前检查 userState 条件(如果存在)
|
||||
boolean userStateConditionMet = true;
|
||||
if ("userState".equals(siftName) && siftValue instanceof List<?>) {
|
||||
List<String> userStateList = (List<String>) siftValue;
|
||||
userStateConditionMet = source != null && source.getUserState() != null && userStateList.contains(source.getUserState());
|
||||
}
|
||||
|
||||
switch (siftName) {
|
||||
case "member":
|
||||
if ((user != null && addMemberUserIds.contains(user.getId())) || addMemberUserIds.contains(source.getId())) {
|
||||
@@ -380,34 +382,36 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
shouldRemove = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case "userState":
|
||||
if (siftValue instanceof List<?> && source != null && source.getUserState() != null) {
|
||||
List<String> userStateList = (List<String>) siftValue;
|
||||
shouldAdd = userStateList.contains(source.getUserState());
|
||||
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
|
||||
}
|
||||
shouldAdd = userStateConditionMet;
|
||||
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
|
||||
break;
|
||||
|
||||
case "personType":
|
||||
if (siftValue instanceof List<?> && source != null && source.getPersonType() != null) {
|
||||
List<String> personTypeList = (List<String>) siftValue;
|
||||
shouldAdd = personTypeList.contains(source.getPersonType());
|
||||
boolean personTypeConditionMet = personTypeList.contains(source.getPersonType());
|
||||
// 必须同时满足 userState 和 personType 条件
|
||||
shouldAdd = userStateConditionMet && personTypeConditionMet;
|
||||
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case "loginNameStart":
|
||||
if (siftValue instanceof String && source != null && source.getLoginname() != null) {
|
||||
String loginNameStart = (String) siftValue;
|
||||
if (siftValue instanceof String loginNameStart && source != null && source.getLoginname() != null) {
|
||||
shouldAdd = source.getLoginname().startsWith(loginNameStart);
|
||||
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case "loginNameEnd":
|
||||
if (siftValue instanceof String && source != null && source.getLoginname() != null) {
|
||||
String loginNameEnd = (String) siftValue;
|
||||
if (siftValue instanceof String loginNameEnd && source != null && source.getLoginname() != null) {
|
||||
shouldAdd = source.getLoginname().endsWith(loginNameEnd);
|
||||
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case "userQuery":
|
||||
if (siftValue instanceof List<?> && user != null) {
|
||||
List<String> userIds = (List<String>) siftValue;
|
||||
@@ -415,6 +419,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (shouldAdd) {
|
||||
if (user == null) {
|
||||
addWelfareMemberUserIds.add(source.getId());
|
||||
@@ -422,7 +427,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
addWelfareMemberUserIds.add(user.getId());
|
||||
}
|
||||
source.setWelfareMember(1);
|
||||
} else if (shouldRemove) {
|
||||
} else if (shouldRemove && user != null) {
|
||||
deleteWelfareMemberUserIds.add(user.getId());
|
||||
source.setWelfareMember(0);
|
||||
}
|
||||
@@ -430,6 +435,41 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
|
||||
}
|
||||
|
||||
// 提取公共方法
|
||||
private boolean checkListCondition(Object siftValue, UserSource source, String siftName) {
|
||||
if (!(siftValue instanceof List) || source == null) {
|
||||
return false;
|
||||
}
|
||||
List<String> list = (List<String>) siftValue;
|
||||
return "userState".equals(siftName) ? list.contains(source.getUserState()) :
|
||||
"personType".equals(siftName) && list.contains(source.getPersonType());
|
||||
}
|
||||
|
||||
private boolean checkLoginNameCondition(Object siftValue, UserSource source, String siftName) {
|
||||
if (!(siftValue instanceof String) || source == null || source.getLoginname() == null) {
|
||||
return false;
|
||||
}
|
||||
String loginName = source.getLoginname();
|
||||
String condition = (String) siftValue;
|
||||
return "loginNameStart".equals(siftName) ? loginName.startsWith(condition) :
|
||||
"loginNameEnd".equals(siftName) && loginName.endsWith(condition);
|
||||
}
|
||||
|
||||
private boolean checkUserQueryCondition(Object siftValue, Sys_user user) {
|
||||
if (!(siftValue instanceof List) || user == null) {
|
||||
return false;
|
||||
}
|
||||
List<String> userIds = (List<String>) siftValue;
|
||||
return userIds.contains(user.getId()) && user.getMember() != 1;
|
||||
}
|
||||
|
||||
private void addUserToMemberList(Sys_user user, UserSource source, List<String> addMemberUserIds) {
|
||||
if (user == null) {
|
||||
addMemberUserIds.add(source.getId());
|
||||
} else if (user.getMember() != 1) {
|
||||
addMemberUserIds.add(user.getId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于人工操作,不自动更新,不改变数据库数据
|
||||
@@ -469,7 +509,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
return null;
|
||||
}
|
||||
String changeInfos = changeList.stream().map(v -> {
|
||||
return "(变更字段:" + v.getString("fieldName") + ",变更前:" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + ",变更后:" + HtmlUtil.cleanHtmlTag(v.getString("newValue")) + ")";
|
||||
return v.getString("fieldName") + ":" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "->" + HtmlUtil.cleanHtmlTag(v.getString("newValue")) + ";";
|
||||
}).collect(Collectors.joining(";"));
|
||||
|
||||
// 比较变更数据
|
||||
@@ -515,7 +555,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
return null;
|
||||
}
|
||||
String changeInfos = changeList.stream().map(v -> {
|
||||
return "(变更字段:" + v.getString("fieldName") + ",变更前:" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + ",变更后:" + HtmlUtil.cleanHtmlTag(v.getString("newValue")) + ")";
|
||||
return v.getString("fieldName") + ":" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "->" + HtmlUtil.cleanHtmlTag(v.getString("newValue")) + ";";
|
||||
}).collect(Collectors.joining(";"));
|
||||
// 比较变更数据
|
||||
commonCompareChange(source, user, changeTypes);
|
||||
|
||||
+24
-10
@@ -29,6 +29,7 @@ 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;
|
||||
@@ -58,6 +59,11 @@ public class MemberApplyBranchUnionAuditController {
|
||||
@RequiresPermissions("member.apply.branchUnion.audit")
|
||||
public void index() {}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/mobile/member/apply/branchUnionAudit/index.html")
|
||||
@RequiresPermissions("member.apply.branchUnion.audit")
|
||||
public void h5() {}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresPermissions("member.apply.branchUnion.audit")
|
||||
@@ -123,18 +129,26 @@ public class MemberApplyBranchUnionAuditController {
|
||||
} else if (audit.getAuditType() == 1) {
|
||||
MemberApplyToDoHandler.COMPLETE_PROCESS.exec(record, null);
|
||||
// 判断是否改变了工会关系
|
||||
|
||||
User user = dao.fetch(User.class, Cnd.where("id", "=", record.getUserId()));
|
||||
if (!ObjectUtil.equals(user.getUnionid(), record.getAllocationUnionId())) {
|
||||
Sys_union union = dao.fetch(Sys_union.class, Cnd.where("id", "=", record.getAllocationUnionId()));
|
||||
SpecialStaff staff = new SpecialStaff();
|
||||
staff.setUserId(record.getUserId());
|
||||
staff.setPersonnelRelationUnitId(user.getUnitid());
|
||||
staff.setPersonnelRelationUnitName(user.getUnitname());
|
||||
staff.setUnionRelationUnionId(union.getId());
|
||||
staff.setUnionRelationUnionName(union.getUnionname());
|
||||
staff.setIsManyUnit(false);
|
||||
staff.setSpecialStaffType("HMC_RELATION");
|
||||
dao.insert(staff);
|
||||
if (dao.count(SpecialStaff.class, Cnd.where("userId", "=", record.getUserId())) > 0) {
|
||||
dao.clear(SpecialStaff.class, Cnd.where("userId", "=", record.getUserId()));
|
||||
user = dao.fetch(User.class, Cnd.where("id", "=", record.getUserId()));
|
||||
}
|
||||
|
||||
if (!ObjectUtil.equals(user.getUnionid(), record.getAllocationUnionId())) {
|
||||
Sys_union union = dao.fetch(Sys_union.class, Cnd.where("id", "=", record.getAllocationUnionId()));
|
||||
SpecialStaff staff = new SpecialStaff();
|
||||
staff.setUserId(record.getUserId());
|
||||
staff.setPersonnelRelationUnitId(user.getUnitid());
|
||||
staff.setPersonnelRelationUnitName(user.getUnitname());
|
||||
staff.setUnionRelationUnionId(union.getId());
|
||||
staff.setUnionRelationUnionName(union.getUnionname());
|
||||
staff.setIsManyUnit(false);
|
||||
staff.setSpecialStaffType("HMC_RELATION");
|
||||
dao.insert(staff);
|
||||
}
|
||||
}
|
||||
|
||||
Sys_user sysUser = new Sys_user();
|
||||
|
||||
+23
-7
@@ -18,6 +18,7 @@ import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
@@ -50,7 +51,7 @@ public class MemberApplyController {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/member/apply/submit/index.html")
|
||||
@Ok("beetl:/mobile/member/apply/submit/index.html")
|
||||
@RequiresPermissions("member.apply.submit")
|
||||
public void h5() {
|
||||
}
|
||||
@@ -86,7 +87,9 @@ public class MemberApplyController {
|
||||
record.setChangeType(MemberChangeType.RESTORE.name());
|
||||
record.setChangeTypes(List.of(MemberChangeType.RESTORE.name()));
|
||||
// 待提交
|
||||
record.setApplyStateId(10);
|
||||
if (record.getApplyStateId() == null) {
|
||||
record.setApplyStateId(10);
|
||||
}
|
||||
dao.insertOrUpdate(record);
|
||||
return null;
|
||||
}
|
||||
@@ -103,6 +106,10 @@ public class MemberApplyController {
|
||||
record.setChangeOrigin(MemberChangeOrigin.PERSONAL.name());
|
||||
record.setChangeType(MemberChangeType.RESTORE.name());
|
||||
record.setChangeTypes(List.of(MemberChangeType.RESTORE.name()));
|
||||
|
||||
if (record.getApplyStateId() != null && List.of(30, 60).contains(record.getApplyStateId())) {
|
||||
MemberApplyToDoHandler.COMPLETE_APPLY_RE_MODIFY_TASK.exec(record, NutMap.NEW().addv("nodeName", "重新修改申请"));
|
||||
}
|
||||
// 待校工会审核
|
||||
record.setApplyStateId(20);
|
||||
dao.insertOrUpdate(record);
|
||||
@@ -111,11 +118,20 @@ public class MemberApplyController {
|
||||
MemberApplyToDoHandler.START_PROCESS.exec(record, null);
|
||||
MemberApplyToDoHandler.CREATE_SCHOOL_TASK.exec(record, null);
|
||||
|
||||
List<String> schoolLoginNameList = commonService.getSchoolOrBranchUnionMemberAdminLoginNames("school", null);
|
||||
String schoolLoginNameListStr = schoolLoginNameList.stream().distinct().collect(Collectors.joining(","));
|
||||
|
||||
String content = "%s老师正申请加入工会,请您点击此条消息或前往智慧工会进行审核";
|
||||
msgApi.sendMsg(List.of("DingTalk"), schoolLoginNameListStr, 2, "协会入会邀请", content, "", "");
|
||||
// 短信通知
|
||||
// List<String> schoolLoginNameList = commonService.getSchoolOrBranchUnionMemberAdminLoginNames("school", null);
|
||||
// String schoolLoginNameListStr = schoolLoginNameList.stream().distinct().collect(Collectors.joining(","));
|
||||
//
|
||||
// String content = "%s老师正申请加入工会,请您点击此条消息或前往智慧工会进行审核";
|
||||
// msgApi.sendMsg(List.of("DingTalk"), schoolLoginNameListStr, 2, "协会入会邀请", content, "", "");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object validateApply(){
|
||||
return dao.count(MemberApplyRecord.class, Cnd.where("userId", "=", ShiroUtil.getUserId()).and("applyStateId", "in", List.of(10, 20, 30, 50, 60)));
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -53,6 +53,11 @@ public class MemberApplyMineController {
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/mobile/member/apply/mine/index.html")
|
||||
@RequiresPermissions("member.apply.mine")
|
||||
public void h5() {
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("member.apply.mine")
|
||||
|
||||
+13
-6
@@ -53,6 +53,10 @@ public class MemberApplySchoolUnionAuditController {
|
||||
@RequiresPermissions("member.apply.schoolUnion.audit")
|
||||
public void index() {}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/mobile/member/apply/schoolUnionAudit/index.html")
|
||||
@RequiresPermissions("member.apply.schoolUnion.audit")
|
||||
public void h5() {}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("member.apply.schoolUnion.audit")
|
||||
@@ -112,7 +116,8 @@ public class MemberApplySchoolUnionAuditController {
|
||||
|
||||
if (audit.getAuditType() == 2) {
|
||||
MemberApplyToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(record, null);
|
||||
String content = "%s老师您好,您的入会申请被校工会退回,您可根据退回原因修改后再次提交,如有疑问请及时联系校工会".formatted(record.getUsername());
|
||||
// 短信通知
|
||||
// String content = "%s老师您好,您的入会申请被校工会退回,您可根据退回原因修改后再次提交,如有疑问请及时联系校工会".formatted(record.getUsername());
|
||||
} else if (audit.getAuditType() == 1) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -131,13 +136,15 @@ public class MemberApplySchoolUnionAuditController {
|
||||
List<String> unionLeaderLoginNames = list.stream().map(v -> v.getString("loginname")).toList();
|
||||
MemberApplyToDoHandler.CREATE_UNION_TASK.exec(record, NutMap.NEW().addv("unionLeaderLoginNames", unionLeaderLoginNames));
|
||||
|
||||
for (NutMap map : list) {
|
||||
String content = "%s老师您好,%s老师的入会申请校工会已通过,现将工会关系划入本工会,请您点击此消息或前往智慧工会进行接收"
|
||||
.formatted(map.getString("username"), record.getUsername());
|
||||
}
|
||||
// 短信通知
|
||||
// for (NutMap map : list) {
|
||||
// String content = "%s老师您好,%s老师的入会申请校工会已通过,现将工会关系划入本工会,请您点击此消息或前往智慧工会进行接收"
|
||||
// .formatted(map.getString("username"), record.getUsername());
|
||||
// }
|
||||
} else {
|
||||
MemberApplyToDoHandler.REFUSE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "校工会审核拒绝"));
|
||||
String content = "%s老师您好,您的入会申请被校工会拒绝,如有疑问请及时联系校工会".formatted(record.getUsername());
|
||||
// 短信通知
|
||||
// String content = "%s老师您好,您的入会申请被校工会拒绝,如有疑问请及时联系校工会".formatted(record.getUsername());
|
||||
}
|
||||
MemberApplyToDoHandler.COMPLETE_SCHOOL_TASK.exec(record, NutMap.NEW().addv("nodeName", "校工会审核完成"));
|
||||
return null;
|
||||
|
||||
+8
-11
@@ -1,19 +1,14 @@
|
||||
package io.v.nutz.zhgh.staffmanage.member.controller.change;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
import io.v.nutz.sys.models.Sys_unit;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.sys.models.User;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.staffmanage.member.constant.MemberChangeOrigin;
|
||||
import io.v.nutz.zhgh.staffmanage.member.constant.MemberChangeType;
|
||||
import io.v.nutz.zhgh.staffmanage.member.handle.MemberChangeToDoHandler;
|
||||
import io.v.nutz.zhgh.staffmanage.member.model.MemberChangeRecord;
|
||||
import io.v.nutz.zhgh.staffmanage.member.service.MemberCommonService;
|
||||
@@ -22,18 +17,13 @@ import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@@ -85,7 +75,9 @@ public class MemberChangeApplyController {
|
||||
// 变更来源 个人
|
||||
record.setChangeOrigin(MemberChangeOrigin.PERSONAL.name());
|
||||
// 待提交
|
||||
record.setApplyStateId(10010);
|
||||
if (record.getApplyStateId() == null) {
|
||||
record.setApplyStateId(10010);
|
||||
}
|
||||
dao.insertOrUpdate(record);
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
@@ -115,6 +107,11 @@ public class MemberChangeApplyController {
|
||||
record.setUserId(ShiroUtil.getUserId());
|
||||
// 变更来源 个人
|
||||
record.setChangeOrigin(MemberChangeOrigin.PERSONAL.name());
|
||||
|
||||
|
||||
if (List.of(10030, 10060).contains(record.getApplyStateId())) {
|
||||
MemberChangeToDoHandler.COMPLETE_APPLY_RE_MODIFY_TASK.exec(record, NutMap.NEW().addv("nodeName", "重新修改申请"));
|
||||
}
|
||||
// 待分工会审核
|
||||
record.setApplyStateId(10020);
|
||||
dao.insertOrUpdate(record);
|
||||
|
||||
+42
-46
@@ -154,9 +154,9 @@ public class MemberChangeManageController {
|
||||
}
|
||||
cnd.and("u.unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
|
||||
} else {
|
||||
cnd.andEX("u.unionid", "=", unionId);
|
||||
}
|
||||
cnd.andEX("u.unionid", "=", unionId);
|
||||
cnd.andEX("u.unitid", "=", unitId);
|
||||
cnd.andEX("u.threeUnitId", "=", threeUnitId);
|
||||
cnd.andEX("u.unionGroupId", "=", unionGroupId);
|
||||
@@ -275,6 +275,7 @@ public class MemberChangeManageController {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@SLog(tag = "会员高级管理-会员变更", msg = "分工会/校工会会员管理员提交变更")
|
||||
@@ -288,54 +289,49 @@ public class MemberChangeManageController {
|
||||
return Result.error("未校验到变更数据,请确认数据是否存在变更");
|
||||
}
|
||||
|
||||
try {
|
||||
// 变更就表明,当前审核人审核通过
|
||||
Audit audit = new Audit();
|
||||
audit.setAuditor(ShiroUtil.getUserId());
|
||||
audit.setLoginname(ShiroUtil.getPlatformLoginname());
|
||||
audit.setUsername(ShiroUtil.getPlatformUsername());
|
||||
audit.setAuditOpinion("通过");
|
||||
audit.setAuditTime(DateUtil.date());
|
||||
dao.insert(audit);
|
||||
// 变更就表明,当前审核人审核通过
|
||||
Audit audit = new Audit();
|
||||
audit.setAuditor(ShiroUtil.getUserId());
|
||||
audit.setLoginname(ShiroUtil.getPlatformLoginname());
|
||||
audit.setUsername(ShiroUtil.getPlatformUsername());
|
||||
audit.setAuditOpinion("通过");
|
||||
audit.setAuditTime(DateUtil.date());
|
||||
dao.insert(audit);
|
||||
|
||||
User user = dao.fetch(User.class, Cnd.where("id", "=", record.getUserId()));
|
||||
// 比较有哪些变更类型
|
||||
List<String> changeTypes = memberService.compareChangeType(record, user);
|
||||
record.setChangeTypes(changeTypes);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin, SchoolUnionMemberAdmin")) {
|
||||
// 分工会变更,分工会审核通过,转为校工会审核
|
||||
record.setChangeOrigin(MemberChangeOrigin.BRANCH_UNION.name());
|
||||
record.setApplyStateId(10050);
|
||||
record.setBranchUnionAuditId(audit.getId());
|
||||
dao.insert(record);
|
||||
User user = dao.fetch(User.class, Cnd.where("id", "=", record.getUserId()));
|
||||
// 比较有哪些变更类型
|
||||
List<String> changeTypes = memberService.compareChangeType(record, user);
|
||||
record.setChangeTypes(changeTypes);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin, SchoolUnionMemberAdmin")) {
|
||||
// 分工会变更,分工会审核通过,转为校工会审核
|
||||
record.setChangeOrigin(MemberChangeOrigin.BRANCH_UNION.name());
|
||||
record.setApplyStateId(10050);
|
||||
record.setBranchUnionAuditId(audit.getId());
|
||||
dao.insert(record);
|
||||
|
||||
// 创建流程任务
|
||||
MemberChangeToDoHandler.START_PROCESS.exec(record, null);
|
||||
MemberChangeToDoHandler.CREATE_UNION_TASK.exec(record, null);
|
||||
MemberChangeToDoHandler.COMPLETE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "分工会审核完成"));
|
||||
MemberChangeToDoHandler.CREATE_SCHOOL_TASK.exec(record, null);
|
||||
} else {
|
||||
// 校工会变更,变更直接完成
|
||||
record.setChangeOrigin(MemberChangeOrigin.SCHOOL_UNION.name());
|
||||
record.setApplyStateId(10080);
|
||||
record.setBranchUnionAuditId(audit.getId());
|
||||
record.setSchoolUnionAuditId(audit.getId());
|
||||
dao.insert(record);
|
||||
// 创建流程任务
|
||||
MemberChangeToDoHandler.START_PROCESS.exec(record, null);
|
||||
MemberChangeToDoHandler.CREATE_UNION_TASK.exec(record, null);
|
||||
MemberChangeToDoHandler.COMPLETE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "分工会审核完成"));
|
||||
MemberChangeToDoHandler.CREATE_SCHOOL_TASK.exec(record, null);
|
||||
} else {
|
||||
// 校工会变更,变更直接完成
|
||||
record.setChangeOrigin(MemberChangeOrigin.SCHOOL_UNION.name());
|
||||
record.setApplyStateId(10080);
|
||||
record.setBranchUnionAuditId(audit.getId());
|
||||
record.setSchoolUnionAuditId(audit.getId());
|
||||
dao.insert(record);
|
||||
|
||||
// 创建流程任务
|
||||
MemberChangeToDoHandler.START_PROCESS.exec(record, null);
|
||||
MemberChangeToDoHandler.CREATE_UNION_TASK.exec(record, null);
|
||||
MemberChangeToDoHandler.COMPLETE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "分工会审核完成"));
|
||||
MemberChangeToDoHandler.CREATE_SCHOOL_TASK.exec(record, null);
|
||||
MemberChangeToDoHandler.COMPLETE_SCHOOL_TASK.exec(record, NutMap.NEW().addv("nodeName", "校工会审核完成"));
|
||||
MemberChangeToDoHandler.COMPLETE_PROCESS.exec(record, null);
|
||||
memberService.compareChangeInfoAndUpdateMember(record.getId());
|
||||
}
|
||||
return Result.success("操作成功");
|
||||
} catch (Exception e) {
|
||||
log.error("分工会/校工会会员管理员提交变更:", e);
|
||||
return Result.error("操作失败");
|
||||
// 创建流程任务
|
||||
MemberChangeToDoHandler.START_PROCESS.exec(record, null);
|
||||
MemberChangeToDoHandler.CREATE_UNION_TASK.exec(record, null);
|
||||
MemberChangeToDoHandler.COMPLETE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "分工会审核完成"));
|
||||
MemberChangeToDoHandler.CREATE_SCHOOL_TASK.exec(record, null);
|
||||
MemberChangeToDoHandler.COMPLETE_SCHOOL_TASK.exec(record, NutMap.NEW().addv("nodeName", "校工会审核完成"));
|
||||
MemberChangeToDoHandler.COMPLETE_PROCESS.exec(record, null);
|
||||
memberService.compareChangeInfoAndUpdateMember(record.getId());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -139,7 +139,7 @@ public class MemberDataBoardController {
|
||||
sys_dict dict
|
||||
LEFT JOIN sys_dict parent ON dict.parentId = parent.id
|
||||
WHERE
|
||||
parent.`code` = 'UserType'
|
||||
parent.`code` = 'PERSON_TYPE'
|
||||
ORDER BY
|
||||
dict.location
|
||||
""");
|
||||
@@ -164,7 +164,7 @@ public class MemberDataBoardController {
|
||||
sys_dict dict
|
||||
LEFT JOIN sys_dict parent ON dict.parentId = parent.id
|
||||
WHERE
|
||||
parent.`code` = 'UserState'
|
||||
parent.`code` = 'USER_STATE'
|
||||
ORDER BY
|
||||
dict.location
|
||||
""");
|
||||
|
||||
+14
-14
@@ -41,8 +41,8 @@ public enum MemberApplyToDoHandler {
|
||||
"MEMBER_APPLY@" + record.getId(),
|
||||
"",
|
||||
record.getUserId(),
|
||||
"/platform/member/apply",
|
||||
"/platform/member/apply/h5"
|
||||
"/platform/member/apply/mine",
|
||||
"/platform/member/apply/mine"
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -64,10 +64,10 @@ public enum MemberApplyToDoHandler {
|
||||
"退回重新修改",
|
||||
ShiroUtil.getUserId(),
|
||||
List.of(loginname),
|
||||
"/platform/member/apply",
|
||||
"/platform/member/apply",
|
||||
"/platform/member/apply",
|
||||
"/platform/member/apply"
|
||||
"/platform/member/apply/mine",
|
||||
"/platform/member/apply/mine",
|
||||
"/platform/member/apply/mine",
|
||||
"/platform/member/apply/mine"
|
||||
);
|
||||
|
||||
localProcessService.updateProcessNodeName("MEMBER_APPLY@" + record.getId(), "退回重新修改");
|
||||
@@ -107,10 +107,10 @@ public enum MemberApplyToDoHandler {
|
||||
"校工会审核",
|
||||
ShiroUtil.getUserId(),
|
||||
schoolLeaderLoginNames,
|
||||
"/platform/member/apply/audit/school",
|
||||
"/platform/member/apply/audit/school",
|
||||
"/platform/member/apply/audit/school",
|
||||
"/platform/member/apply/audit/school"
|
||||
"/platform/member/apply/schoolUnion/audit",
|
||||
"/platform/member/apply/schoolUnion/audit",
|
||||
"/platform/member/apply/schoolUnion/audit",
|
||||
"/platform/member/apply/schoolUnion/audit"
|
||||
);
|
||||
|
||||
localProcessService.updateProcessNodeName("MEMBER_APPLY@" + record.getId(), "校工会审核");
|
||||
@@ -149,10 +149,10 @@ public enum MemberApplyToDoHandler {
|
||||
"分工会审核",
|
||||
ShiroUtil.getUserId(),
|
||||
unionLeaderLoginNames,
|
||||
"/platform/member/apply/audit/union",
|
||||
"/platform/member/apply/audit/union",
|
||||
"/platform/member/apply/audit/union",
|
||||
"/platform/member/apply/audit/union"
|
||||
"/platform/member/apply/branchUnion/audit",
|
||||
"/platform/member/apply/branchUnion/audit",
|
||||
"/platform/member/apply/branchUnion/audit",
|
||||
"/platform/member/apply/branchUnion/audit"
|
||||
);
|
||||
localProcessService.updateProcessNodeName("MEMBER_APPLY@" + record.getId(), "分工会审核");
|
||||
}
|
||||
|
||||
+14
-14
@@ -34,8 +34,8 @@ public enum MemberChangeToDoHandler {
|
||||
"MEMBER_CHANGE@" + record.getId(),
|
||||
"",
|
||||
record.getUserId(),
|
||||
"/platform/member/change/apply",
|
||||
"/platform/member/change/apply"
|
||||
"/platform/member/change/mine",
|
||||
"/platform/member/change/mine"
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -67,10 +67,10 @@ public enum MemberChangeToDoHandler {
|
||||
nodeName,
|
||||
ShiroUtil.getUserId(),
|
||||
List.of(loginname),
|
||||
"/platform/member/change/apply",
|
||||
"/platform/member/change/apply",
|
||||
"/platform/member/change/apply",
|
||||
"/platform/member/change/apply"
|
||||
"/platform/member/change/mine",
|
||||
"/platform/member/change/mine",
|
||||
"/platform/member/change/mine",
|
||||
"/platform/member/change/mine"
|
||||
);
|
||||
|
||||
localProcessService.updateProcessNodeName("MEMBER_CHANGE@" + record.getId(), nodeName);
|
||||
@@ -108,10 +108,10 @@ public enum MemberChangeToDoHandler {
|
||||
"分工会审核",
|
||||
ShiroUtil.getUserId(),
|
||||
branchLeaders,
|
||||
"/platform/member/change/audit/union",
|
||||
"/platform/member/change/audit/union",
|
||||
"/platform/member/change/audit/union",
|
||||
"/platform/member/change/audit/union"
|
||||
"/platform/member/change/branchUnion/audit",
|
||||
"/platform/member/change/branchUnion/audit",
|
||||
"/platform/member/change/branchUnion/audit",
|
||||
"/platform/member/change/branchUnion/audit"
|
||||
);
|
||||
|
||||
localProcessService.updateProcessNodeName("MEMBER_CHANGE@" + record.getId(), "分工会审核");
|
||||
@@ -150,10 +150,10 @@ public enum MemberChangeToDoHandler {
|
||||
"校工会审核",
|
||||
ShiroUtil.getUserId(),
|
||||
schoolLeaders,
|
||||
"/platform/member/change/audit/school",
|
||||
"/platform/member/change/audit/school",
|
||||
"/platform/member/change/audit/school",
|
||||
"/platform/member/change/audit/school"
|
||||
"/platform/member/change/schoolUnion/audit",
|
||||
"/platform/member/change/schoolUnion/audit",
|
||||
"/platform/member/change/schoolUnion/audit",
|
||||
"/platform/member/change/schoolUnion/audit"
|
||||
);
|
||||
|
||||
localProcessService.updateProcessNodeName("MEMBER_CHANGE@" + record.getId(), "校工会审核");
|
||||
|
||||
@@ -163,6 +163,11 @@ public class MemberChangeRecord {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String campus;
|
||||
|
||||
@Column
|
||||
@Comment("退休日期")
|
||||
@ColDefine(type = ColType.DATE)
|
||||
private Date retireDate;
|
||||
|
||||
@Column
|
||||
@Comment("家庭主要成员及其工作单位")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
|
||||
+32
-15
@@ -251,11 +251,7 @@ public class MemberCommonServiceImpl extends ViServiceImpl<Sys_user> implements
|
||||
history.setChangeTime(DateUtil.date());
|
||||
history.setChangeTypes(record.getChangeTypes());
|
||||
history.setChangeOrigin(record.getChangeOrigin());
|
||||
history.setChangeInfos(changeList);
|
||||
String changeInfos = changeList.stream().map(v -> {
|
||||
return "(变更字段:" + v.getString("fieldName") + ",变更前:" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + ",变更后:" + HtmlUtil.cleanHtmlTag(v.getString("newValue")) + ")";
|
||||
}).collect(Collectors.joining(";"));
|
||||
history.setChangeInfosStr(changeInfos);
|
||||
|
||||
|
||||
// 加入会员
|
||||
if (record.getMember()) {
|
||||
@@ -314,18 +310,39 @@ public class MemberCommonServiceImpl extends ViServiceImpl<Sys_user> implements
|
||||
|
||||
// 如果工会发生变更了,就是工会关系变更,记录到特殊人员表中
|
||||
if (record.getChangeTypes().contains(MemberChangeType.UNION_CHANGE.getType())) {
|
||||
Sys_union union = dao().fetch(Sys_union.class, Cnd.where("id", "=", record.getUnionId()));
|
||||
SpecialStaff staff = new SpecialStaff();
|
||||
staff.setUserId(userId);
|
||||
staff.setPersonnelRelationUnitId(user.getUnitid());
|
||||
staff.setPersonnelRelationUnitName(user.getUnitname());
|
||||
staff.setUnionRelationUnionId(union.getId());
|
||||
staff.setUnionRelationUnionName(union.getUnionname());
|
||||
staff.setIsManyUnit(false);
|
||||
staff.setSpecialStaffType("HMC_RELATION");
|
||||
dao().insert(staff);
|
||||
if (dao().count(SpecialStaff.class, Cnd.where("userId", "=", record.getUserId())) > 0) {
|
||||
dao().clear(SpecialStaff.class, Cnd.where("userId", "=", record.getUserId()));
|
||||
user = dao().fetch(User.class, Cnd.where("id", "=", record.getUserId()));
|
||||
}
|
||||
|
||||
if (!ObjectUtil.equals(user.getUnionid(), record.getUnionId())) {
|
||||
Sys_union union = dao().fetch(Sys_union.class, Cnd.where("id", "=", record.getUnionId()));
|
||||
// 记录工会关系变更的数据
|
||||
NutMap map = NutMap.NEW();
|
||||
map.put("field", "unionId");
|
||||
map.put("fieldName", "工会");
|
||||
map.put("sourceValue", record.getUnionName());
|
||||
map.put("newValue", union.getUnionname());
|
||||
changeList.add(map);
|
||||
|
||||
SpecialStaff staff = new SpecialStaff();
|
||||
staff.setUserId(userId);
|
||||
staff.setPersonnelRelationUnitId(user.getUnitid());
|
||||
staff.setPersonnelRelationUnitName(user.getUnitname());
|
||||
staff.setUnionRelationUnionId(union.getId());
|
||||
staff.setUnionRelationUnionName(union.getUnionname());
|
||||
staff.setIsManyUnit(false);
|
||||
staff.setSpecialStaffType("HMC_RELATION");
|
||||
dao().insert(staff);
|
||||
}
|
||||
}
|
||||
|
||||
// 如果有工会关系变更,也需要记录变更了什么工会
|
||||
history.setChangeInfos(changeList);
|
||||
String changeInfos = changeList.stream().map(v -> {
|
||||
return v.getString("fieldName") + ":" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "->" + HtmlUtil.cleanHtmlTag(v.getString("newValue")) + ";";
|
||||
}).collect(Collectors.joining(";"));
|
||||
history.setChangeInfosStr(changeInfos);
|
||||
dao().updateIgnoreNull(info);
|
||||
dao().insert(history);
|
||||
|
||||
|
||||
+1
@@ -79,6 +79,7 @@ public class SourceChangeManageController {
|
||||
scmt.changeTypes,
|
||||
scmt.changeOrigin,
|
||||
scmt.isOperate,
|
||||
scmt.changeInfosStr,
|
||||
u.id AS userId
|
||||
FROM
|
||||
source_change_middle_table scmt
|
||||
|
||||
+39
-19
@@ -60,6 +60,8 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void doSourceChange(SourceChangeMiddleTable middleTable) {
|
||||
User user = dao().fetch(User.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
|
||||
// 当前工会,用于记录记录是工会关系异动的上一个工会
|
||||
String unionname = user.getUnionname();
|
||||
|
||||
//获取可变更字段
|
||||
NutMap map = commonService.getDictAllowChangeFields();
|
||||
@@ -104,11 +106,7 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
if (Lang.isNotEmpty(history)) {
|
||||
history.setChangeTime(DateUtil.date());
|
||||
history.setChangeOrigin(MemberChangeOrigin.HAND_MOVEMENT.name());
|
||||
history.setChangeInfos(changeList);
|
||||
String changeInfos = changeList.stream().map(v -> {
|
||||
return "(变更字段:" + v.getString("fieldName") + ",变更前:" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + ",变更后:" + HtmlUtil.cleanHtmlTag(v.getString("newValue")) + ")";
|
||||
}).collect(Collectors.joining(";"));
|
||||
history.setChangeInfosStr(changeInfos);
|
||||
|
||||
|
||||
// 加入会员
|
||||
if (middleTable.getMember() == 1) {
|
||||
@@ -116,7 +114,7 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
int memberCount = dao().count(Sys_user_role.class, Cnd.where("userId", "=", userId).and("roleId", "=", Roles.MEMBER));
|
||||
if (activityCount <= 0) {
|
||||
// 取消或加入会员组别
|
||||
if (middleTable.getIsJoinActivityMemberScope()) {
|
||||
if (middleTable.getIsJoinActivityMemberScope() != null && middleTable.getIsJoinActivityMemberScope()) {
|
||||
ActivityUserScope scope = new ActivityUserScope();
|
||||
scope.setUserId(userId);
|
||||
scope.setGroupId(1);
|
||||
@@ -133,7 +131,7 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
// 杭医特有,其他学校请删除
|
||||
middleTable.setPreparedBy("会员");
|
||||
} else {
|
||||
if (middleTable.getIsExitActivityMemberScope()) {
|
||||
if (middleTable.getIsExitActivityMemberScope() != null && middleTable.getIsExitActivityMemberScope()) {
|
||||
dao().clear(ActivityUserScope.class, Cnd.where("userId", "=", userId).and("groupId", "=", 1));
|
||||
}
|
||||
dao().clear(Sys_user_role.class, Cnd.where("userId", "=", userId).and("roleId", "=", Roles.MEMBER));
|
||||
@@ -142,7 +140,7 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
}
|
||||
|
||||
// 加入福利会员 是否加入福利项目
|
||||
if (middleTable.getWelfareMember() == 1 && middleTable.getIsJoinWelfareProject()) {
|
||||
if (middleTable.getWelfareMember() == 1 && middleTable.getIsJoinWelfareProject() != null && middleTable.getIsJoinWelfareProject()) {
|
||||
WelfareList welfareList = new WelfareList();
|
||||
welfareList.setId(R.UU32());
|
||||
welfareList.setProjectId(middleTable.getWelfareProjectId());
|
||||
@@ -168,20 +166,42 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
|
||||
// 如果工会发生变更了,就是工会关系变更,记录到特殊人员表中
|
||||
if (!ObjectUtil.equals(user.getUnionid(), middleTable.getUnionid())) {
|
||||
changeTypes.add(MemberChangeType.UNION_CHANGE.getType());
|
||||
Sys_union union = dao().fetch(Sys_union.class, Cnd.where("id", "=", middleTable.getUnionid()));
|
||||
SpecialStaff staff = new SpecialStaff();
|
||||
staff.setUserId(userId);
|
||||
staff.setPersonnelRelationUnitId(user.getUnitid());
|
||||
staff.setPersonnelRelationUnitName(user.getUnitname());
|
||||
staff.setUnionRelationUnionId(union.getId());
|
||||
staff.setUnionRelationUnionName(union.getUnionname());
|
||||
staff.setIsManyUnit(false);
|
||||
staff.setSpecialStaffType("HMC_RELATION");
|
||||
dao().insert(staff);
|
||||
if (dao().count(SpecialStaff.class, Cnd.where("userId", "=", userId)) > 0) {
|
||||
dao().clear(SpecialStaff.class, Cnd.where("userId", "=", userId));
|
||||
user = dao().fetch(User.class, Cnd.where("id", "=", userId));
|
||||
}
|
||||
|
||||
if (!ObjectUtil.equals(user.getUnionid(), middleTable.getUnionid())) {
|
||||
changeTypes.add(MemberChangeType.UNION_CHANGE.getType());
|
||||
Sys_union union = dao().fetch(Sys_union.class, Cnd.where("id", "=", middleTable.getUnionid()));
|
||||
|
||||
// 记录工会关系变更的数据
|
||||
NutMap changeMap = NutMap.NEW();
|
||||
changeMap.put("field", "unionId");
|
||||
changeMap.put("fieldName", "工会");
|
||||
changeMap.put("sourceValue", unionname);
|
||||
changeMap.put("newValue", union.getUnionname());
|
||||
changeList.add(changeMap);
|
||||
|
||||
SpecialStaff staff = new SpecialStaff();
|
||||
staff.setUserId(userId);
|
||||
staff.setPersonnelRelationUnitId(user.getUnitid());
|
||||
staff.setPersonnelRelationUnitName(user.getUnitname());
|
||||
staff.setUnionRelationUnionId(union.getId());
|
||||
staff.setUnionRelationUnionName(union.getUnionname());
|
||||
staff.setIsManyUnit(false);
|
||||
staff.setSpecialStaffType("HMC_RELATION");
|
||||
dao().insert(staff);
|
||||
}
|
||||
}
|
||||
|
||||
dao().updateIgnoreNull(info);
|
||||
|
||||
history.setChangeInfos(changeList);
|
||||
String changeInfos = changeList.stream().map(v -> {
|
||||
return v.getString("fieldName") + ":" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "->" + HtmlUtil.cleanHtmlTag(v.getString("newValue")) + ";";
|
||||
}).collect(Collectors.joining(";"));
|
||||
history.setChangeInfosStr(changeInfos);
|
||||
history.setChangeTypes(changeTypes);
|
||||
dao().insert(history);
|
||||
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ public class SpecialStaffManageController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.where("id", "not in", "(select userId from special_staff)");
|
||||
cnd.and("id", "not in", "(select userId from special_staff)");
|
||||
if (StrUtil.isNotBlank(keyWord)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("username", keyWord);
|
||||
|
||||
Reference in New Issue
Block a user