This commit is contained in:
Paidax
2025-03-14 11:04:13 +08:00
parent ac92981557
commit b113c89f19
22 changed files with 459 additions and 192 deletions
+14 -26
View File
@@ -27,20 +27,7 @@ import java.util.List;
@Slf4j @Slf4j
public class MsgApi { public class MsgApi {
/**
* token -redis - name
*/
private static final String MSG_TOKEN_NAME = "msg_token";
private static final String APP_KEY = "10c51794-45b8-4de5-ba6f-b1ed843c20f3";
private static final String APP_SECRET = "4acbf17e-4b17-4c47-b4bb-1576a066250a";
/**
* 发送消息api
*/
private static final String MSG_API = "https://xxdb.hmc.edu.cn/msgInfo/pushMsgInfo";
private static final String TOKEN_API = "https://xxdb.hmc.edu.cn/accessSystem/getAccessToken";
@Inject @Inject
private RedisService redisService; private RedisService redisService;
@@ -110,19 +97,20 @@ public class MsgApi {
* @return * @return
*/ */
private String getMsgToken() { private String getMsgToken() {
String token = redisService.get(MSG_TOKEN_NAME); // String token = redisService.get(MSG_TOKEN_NAME);
if (StrUtil.isBlank(token)) { // if (StrUtil.isBlank(token)) {
String body = HttpRequest.post(TOKEN_API + "?appKey=" + APP_KEY + "&appSecret=" + APP_SECRET).execute().body(); // String body = HttpRequest.post(TOKEN_API + "?appKey=" + APP_KEY + "&appSecret=" + APP_SECRET).execute().body();
NutMap map = Json.fromJson(NutMap.class, body); // NutMap map = Json.fromJson(NutMap.class, body);
if (map.getInt("code") == 200) { // if (map.getInt("code") == 200) {
NutMap data = Json.fromJson(NutMap.class, map.getString("data")); // NutMap data = Json.fromJson(NutMap.class, map.getString("data"));
token = data.getString("accessToken"); // token = data.getString("accessToken");
redisService.setex(MSG_TOKEN_NAME, 3600, token); // redisService.setex(MSG_TOKEN_NAME, 3600, token);
} else { // } else {
token = ""; // token = "";
} // }
} // }
return token; // return token;
return null;
} }
@@ -105,26 +105,28 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
source.setLoginname(o.getString("ZGH")); source.setLoginname(o.getString("ZGH"));
source.setUsername(o.getString("XM")); source.setUsername(o.getString("XM"));
source.setSex(o.getString("XB")); source.setSex(o.getString("XB"));
source.setBirthday(o.getString("CSRQ")); source.setBirthday(StrUtil.isNotBlank(o.getString("CSRQ")) ? o.getString("CSRQ").substring(0, 10) : null);
source.setSchoolTime(o.getString("JBXNY")); source.setSchoolTime(StrUtil.isNotBlank(o.getString("JBXNY")) ? o.getString("JBXNY").substring(0, 10) : null);
source.setUnitid(o.getString("DWDM")); source.setUnitid(o.getString("DWDM"));
source.setNation(o.getString("MZ")); source.setNation(o.getString("MZ"));
source.setJobTitle(o.getString("DZZW")); source.setJobTitle(o.getString("DZZW"));
source.setEducation(o.getString("XL")); source.setEducation(o.getString("XL"));
source.setPullTime(new DateTime()); source.setPullTime(new DateTime());
source.setMobile(o.getString("SJH")); source.setMobile(o.getString("SJH"));
source.setUserState(o.getString("LXLX")); source.setUserState(o.getString("DQZT"));
source.setPolitical(o.getString("ZZMM")); source.setPolitical(o.getString("ZZMM"));
source.setIdcard(o.getString("SFZJH")); // source.setIdcard(o.getString("SFZJH"));
source.setUserCategory(o.getString("JZGRYLB")); source.setPreparedBy(o.getString("JZGRYLB"));
source.setPersonType(o.getString("DQZT")); source.setPersonType(o.getString("LXLX"));
return source; return source;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
asyncService.exe2(users, (user) -> { asyncService.exe2(users, (user) -> {
UserMode.initUser(user); UserMode.initUser(user);
}); });
dao().insert(users);
manyAddOrRenewUtil.asyncExecuteFastInsert(users, 200);
// dao().insert(users);
} }
@Override @Override
@@ -158,8 +160,6 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
List<Sys_user> needDoUpdateList = new CopyOnWriteArrayList<>(); List<Sys_user> needDoUpdateList = new CopyOnWriteArrayList<>();
// 新增的用户 // 新增的用户
List<Sys_user> needInitUserList = new CopyOnWriteArrayList<>(); List<Sys_user> needInitUserList = new CopyOnWriteArrayList<>();
// 添加角色的用户
List<Sys_user_role> userRoles = new CopyOnWriteArrayList<>();
// 人员更新配置的对象 // 人员更新配置的对象
SourceChangeConfig changeConfig = dao().fetch(SourceChangeConfig.class, Cnd.NEW()); SourceChangeConfig changeConfig = dao().fetch(SourceChangeConfig.class, Cnd.NEW());
@@ -172,15 +172,9 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
List<SourceChangeMiddleTable> middleTables = new CopyOnWriteArrayList<>(); List<SourceChangeMiddleTable> middleTables = new CopyOnWriteArrayList<>();
// 获取人员变更字段,用于存储记录 // 获取人员变更字段,用于存储记录
List<Sys_dict> dictList = sysDictService.getSubListByCode("ALLOW_CHANGE_FIELDS"); NutMap map = memberCommonService.getDictAllowChangeFields();
Set<String> allowChangeFieldNames = dictList.stream().map(Sys_dict::getCode).collect(Collectors.toSet()); Set<String> allowChangeFieldNames = map.getAs("allowChangeFieldNames", Set.class);
allowChangeFieldNames.add("member"); Map<String, String> dictMap = map.getAs("dictMap", Map.class);
allowChangeFieldNames.add("welfareMember");
allowChangeFieldNames.add("unitid");
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName));
dictMap.put("member", "会员状态");
dictMap.put("welfareMember", "福利会员状态");
dictMap.put("unitid", "单位");
// 添加会员角色 // 添加会员角色
List<String> addMemberUserIds = new CopyOnWriteArrayList<>(); List<String> addMemberUserIds = new CopyOnWriteArrayList<>();
@@ -275,9 +269,13 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
//如果有新用户,增加到用户表同时增加角色 //如果有新用户,增加到用户表同时增加角色
if (Lang.isNotEmpty(needInitUserList)) { if (Lang.isNotEmpty(needInitUserList)) {
sysUserService.fastInsert(needInitUserList); sysUserService.fastInsert(needInitUserList);
List<String> userIdList = userRoles.stream().map(Sys_user_role::getUserId).collect(Collectors.toList()); List<Sys_user_role> roleList = needInitUserList.stream().map(item -> {
sysUserRoleService.dao().clear(Sys_user_role.class, Cnd.where("userId", "in", userIdList)); Sys_user_role userRole = new Sys_user_role();
sysUserRoleService.insert(userRoles); userRole.setRoleId(Roles.PUBLIC);
userRole.setUserId(item.getId());
return userRole;
}).toList();
manyAddOrRenewUtil.asyncExecuteFastInsert(roleList, 200);
} }
// 添加会员 // 添加会员
@@ -7,11 +7,14 @@ import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.model.Audit; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_union; import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.models.User; import io.v.nutz.sys.models.User;
import io.v.nutz.sys.services.SysLocalProcessService; import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.slog.annotation.SLog; import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.staffmanage.member.handle.MemberApplyToDoHandler; import io.v.nutz.zhgh.staffmanage.member.handle.MemberApplyToDoHandler;
@@ -35,6 +38,8 @@ import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import java.util.List;
/** /**
* @version 1.0 * @version 1.0
* @Author zzr * @Author zzr
@@ -50,6 +55,10 @@ public class MemberApplyBranchUnionAuditController {
@Inject @Inject
private Dao dao; private Dao dao;
@Inject @Inject
private MsgApi msgApi;
@Inject
private SysUserService sysUserService;
@Inject
private MemberCommonService memberCommonService; private MemberCommonService memberCommonService;
@Inject @Inject
private SysLocalProcessService localProcessService; private SysLocalProcessService localProcessService;
@@ -124,13 +133,15 @@ public class MemberApplyBranchUnionAuditController {
record.setBranchUnionAuditId(audit.getId()); record.setBranchUnionAuditId(audit.getId());
dao.updateIgnoreNull(record); dao.updateIgnoreNull(record);
MemberApplyToDoHandler.COMPLETE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "分工会审核完成"));
// 获取分配工会信息
Sys_union union = dao.fetch(Sys_union.class, Cnd.where("id", "=", record.getAllocationUnionId()));
if (audit.getAuditType() == 2) { if (audit.getAuditType() == 2) {
MemberApplyToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(record, null); MemberApplyToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(record, null);
} else if (audit.getAuditType() == 1) { } else if (audit.getAuditType() == 1) {
MemberApplyToDoHandler.COMPLETE_PROCESS.exec(record, null);
// 判断是否改变了工会关系 // 判断是否改变了工会关系
User user = dao.fetch(User.class, Cnd.where("id", "=", record.getUserId())); User user = dao.fetch(User.class, Cnd.where("id", "=", record.getUserId()));
if (!ObjectUtil.equals(user.getUnionid(), record.getAllocationUnionId())) { if (!ObjectUtil.equals(user.getUnionid(), record.getAllocationUnionId())) {
if (dao.count(SpecialStaff.class, Cnd.where("userId", "=", record.getUserId())) > 0) { if (dao.count(SpecialStaff.class, Cnd.where("userId", "=", record.getUserId())) > 0) {
dao.clear(SpecialStaff.class, Cnd.where("userId", "=", record.getUserId())); dao.clear(SpecialStaff.class, Cnd.where("userId", "=", record.getUserId()));
@@ -138,7 +149,6 @@ public class MemberApplyBranchUnionAuditController {
} }
if (!ObjectUtil.equals(user.getUnionid(), record.getAllocationUnionId())) { if (!ObjectUtil.equals(user.getUnionid(), record.getAllocationUnionId())) {
Sys_union union = dao.fetch(Sys_union.class, Cnd.where("id", "=", record.getAllocationUnionId()));
SpecialStaff staff = new SpecialStaff(); SpecialStaff staff = new SpecialStaff();
staff.setUserId(record.getUserId()); staff.setUserId(record.getUserId());
staff.setPersonnelRelationUnitId(user.getUnitid()); staff.setPersonnelRelationUnitId(user.getUnitid());
@@ -155,10 +165,23 @@ public class MemberApplyBranchUnionAuditController {
BeanUtil.copyProperties(record, sysUser); BeanUtil.copyProperties(record, sysUser);
sysUser.setId(user.getId()); sysUser.setId(user.getId());
dao.updateIgnoreNull(sysUser); dao.updateIgnoreNull(sysUser);
MemberApplyToDoHandler.COMPLETE_PROCESS.exec(record, null);
String content = "尊敬的%s老师,您已正式成为杭医工会会员,会员关系在%s,欢迎您的加入!"
.formatted(user.getUsername(), union.getUnionname());
System.out.println(content);
sysUserService.deleteCacheAndUpdate(record.getUserId());
msgApi.sendMsg(List.of("DingTalk"), record.getLoginname(), 1, "入会结果通知", content, "", "");
} else { } else {
MemberApplyToDoHandler.REFUSE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "分工会审核拒绝")); // 杭州医学院,分工会拒绝接收,还要去创建校工会的审核任务
MemberApplyToDoHandler.REFUSE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "分工会拒绝接收"));
MemberApplyToDoHandler.CREATE_SCHOOL_TASK.exec(record, NutMap.NEW().addv("nodeName", "校工会审核"));
String content = "工会主管您好,%s分拒绝接收%s老师,拒绝原因:%s,请您及时联系该分工会负责人或将工会关系划入其他工会。点击此消息或登录“智慧工会”可重新分配工会关系"
.formatted(union.getUnionname(), record.getUsername(), audit.getAuditOpinion());
String linkUrl = Globals.AppDomain + "/platform/member/apply/schoolUnion/audit/h5";
System.out.println(content);
msgApi.sendMsg(List.of("DingTalk"), record.getLoginname(), 2, "入会结果通知", content, "", linkUrl);
} }
MemberApplyToDoHandler.COMPLETE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "分工会审核完成"));
return null; return null;
} }
@@ -170,11 +193,11 @@ public class MemberApplyBranchUnionAuditController {
@SLog(type = "memberApply", tag = "会员入会申请", msg = "分工会撤回") @SLog(type = "memberApply", tag = "会员入会申请", msg = "分工会撤回")
public Object doRevoke(String id){ public Object doRevoke(String id){
MemberApplyRecord record = dao.fetch(MemberApplyRecord.class, id); MemberApplyRecord record = dao.fetch(MemberApplyRecord.class, id);
dao.update(MemberApplyRecord.class, Chain.make("applyStateId", 20) dao.update(MemberApplyRecord.class, Chain.make("applyStateId", 50)
.add("branchUnionAuditId", null), Cnd.where("id", "=", id)); .add("branchUnionAuditId", null), Cnd.where("id", "=", id));
dao.clear(Audit.class, Cnd.where("id", "=", record.getBranchUnionAuditId())); dao.clear(Audit.class, Cnd.where("id", "=", record.getBranchUnionAuditId()));
// 待办撤回 // 待办撤回
localProcessService.revokeTask("MEMBER_APPLY@" + id, "分工会审核"); localProcessService.revokeTask("MEMBER_APPLY@" + id, "分工会接收");
return null; return null;
} }
} }
@@ -3,7 +3,10 @@ package io.v.nutz.zhgh.staffmanage.member.controller.apply;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.MsgApi; import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.models.User; import io.v.nutz.sys.models.User;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.slog.annotation.SLog; import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil; 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.MemberChangeOrigin;
@@ -101,6 +104,12 @@ public class MemberApplyController {
@RequiresPermissions("member.apply.submit") @RequiresPermissions("member.apply.submit")
@SLog(tag = "会员入会申请", msg = "提交申请") @SLog(tag = "会员入会申请", msg = "提交申请")
public Object doSubmit(MemberApplyRecord record){ public Object doSubmit(MemberApplyRecord record){
int count = dao.count(Sys_user_role.class, Cnd.where("userId", "=", record.getUserId()).and("roleId", "=", Roles.MEMBER));
if (count > 0) {
return Result.error("您已经是会员,请勿重复申请");
}
record.setMember(true); record.setMember(true);
record.setUserId(ShiroUtil.getUserId()); record.setUserId(ShiroUtil.getUserId());
record.setChangeOrigin(MemberChangeOrigin.PERSONAL.name()); record.setChangeOrigin(MemberChangeOrigin.PERSONAL.name());
@@ -119,11 +128,12 @@ public class MemberApplyController {
MemberApplyToDoHandler.CREATE_SCHOOL_TASK.exec(record, null); MemberApplyToDoHandler.CREATE_SCHOOL_TASK.exec(record, null);
// 短信通知 // 短信通知
// List<String> schoolLoginNameList = commonService.getSchoolOrBranchUnionMemberAdminLoginNames("school", null); List<String> schoolLoginNameList = commonService.getSchoolOrBranchUnionMemberAdminLoginNames("school", null);
// String schoolLoginNameListStr = schoolLoginNameList.stream().distinct().collect(Collectors.joining(",")); String schoolLoginNameListStr = schoolLoginNameList.stream().distinct().collect(Collectors.joining(","));
//
// String content = "%s老师正申请加入工会,请您点击此条消息或前往智慧工会进行审核"; String content = "%s老师正申请加入工会,请您点击此条消息或登录“智慧工会进行审核".formatted(record.getUsername());
// msgApi.sendMsg(List.of("DingTalk"), schoolLoginNameListStr, 2, "协会入会邀请", content, "", ""); String linkUrl = Globals.AppDomain + "/platform/member/apply/schoolUnion/audit/h5";
msgApi.sendMsg(List.of("DingTalk"), schoolLoginNameListStr, 2, "入会审核通知", content, "", linkUrl);
return null; return null;
} }
@@ -5,7 +5,9 @@ import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination; import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.model.Audit; import io.v.nutz.base.model.Audit;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.sys.services.SysLocalProcessService; import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.slog.annotation.SLog; import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.staffmanage.member.handle.MemberApplyToDoHandler; import io.v.nutz.zhgh.staffmanage.member.handle.MemberApplyToDoHandler;
@@ -22,6 +24,7 @@ import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop; import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
@@ -47,20 +50,24 @@ public class MemberApplySchoolUnionAuditController {
private MemberCommonService memberCommonService; private MemberCommonService memberCommonService;
@Inject @Inject
private SysLocalProcessService localProcessService; private SysLocalProcessService localProcessService;
@Inject
private MsgApi msgApi;
@At("/") @At("/")
@Ok("beetl:/platform/member/apply/schoolUnionAudit/index.html") @Ok("beetl:/platform/member/apply/schoolUnionAudit/index.html")
@RequiresPermissions("member.apply.schoolUnion.audit") @RequiresPermissions("member.apply.schoolUnion.audit")
public void index() {} public void index() {
}
@At("/h5") @At("/h5")
@Ok("beetl:/mobile/member/apply/schoolUnionAudit/index.html") @Ok("beetl:/mobile/member/apply/schoolUnionAudit/index.html")
@RequiresPermissions("member.apply.schoolUnion.audit") @RequiresPermissions("member.apply.schoolUnion.audit")
public void h5() {} public void h5() {
}
@At @At
@RequiresPermissions("member.apply.schoolUnion.audit") @RequiresPermissions("member.apply.schoolUnion.audit")
public Object pageData(MemberApplyPageForm pageForm){ public Object pageData(MemberApplyPageForm pageForm) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
record.*, record.*,
@@ -76,8 +83,9 @@ public class MemberApplySchoolUnionAuditController {
pageForm.buildSearch(cnd, "record."); pageForm.buildSearch(cnd, "record.");
if (pageForm.getAudit()) { if (pageForm.getAudit()) {
cnd.and("record.applyStateId", ">", 20); cnd.and("record.applyStateId", ">", 20);
cnd.and("record.applyStateId", "!=", 70);
} else { } else {
cnd.and("record.applyStateId", "=", 20); cnd.and("record.applyStateId", "in", List.of(20, 70));
} }
cnd.desc("record.applyDateTime"); cnd.desc("record.applyDateTime");
sql.setCondition(cnd); sql.setCondition(cnd);
@@ -91,7 +99,7 @@ public class MemberApplySchoolUnionAuditController {
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("member.apply.schoolUnion.audit") @RequiresPermissions("member.apply.schoolUnion.audit")
@SLog(type = "memberApply", tag = "会员入会申请", msg = "校工会审核") @SLog(type = "memberApply", tag = "会员入会申请", msg = "校工会审核")
public Object approval(@Param("audit") Audit audit, String id, String unionId){ public Object approval(@Param("audit") Audit audit, String id, String unionId) {
audit.setAuditor(ShiroUtil.getUserId()); audit.setAuditor(ShiroUtil.getUserId());
audit.setLoginname(ShiroUtil.getPlatformLoginname()); audit.setLoginname(ShiroUtil.getPlatformLoginname());
audit.setUsername(ShiroUtil.getPlatformUsername()); audit.setUsername(ShiroUtil.getPlatformUsername());
@@ -114,39 +122,50 @@ public class MemberApplySchoolUnionAuditController {
record.setSchoolUnionAuditId(audit.getId()); record.setSchoolUnionAuditId(audit.getId());
dao.updateIgnoreNull(record); dao.updateIgnoreNull(record);
MemberApplyToDoHandler.COMPLETE_SCHOOL_TASK.exec(record, NutMap.NEW().addv("nodeName", "校工会审核完成"));
if (audit.getAuditType() == 2) { if (audit.getAuditType() == 2) {
MemberApplyToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(record, null); 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) { } else if (audit.getAuditType() == 1) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
u.loginname, u.loginname,
u.username u.username,
FROM u.unionname
`sys_user_role` userRole FROM
LEFT JOIN sys_role role ON role.id = userRole.roleId `sys_user_role` userRole
LEFT JOIN `user` u ON u.id = userRole.userId LEFT JOIN sys_role role ON role.id = userRole.roleId
WHERE LEFT JOIN `user` u ON u.id = userRole.userId
role.`code` = 'BranchUnionMemberAdmin' and u.unionid = @unionId WHERE
group by u.loginname role.`code` = 'BranchUnionMemberAdmin' and u.unionid = @unionId
""").setParam("unionId", unionId); group by u.loginname
""").setParam("unionId", unionId);
List<NutMap> list = memberCommonService.listMap(sql); List<NutMap> list = memberCommonService.listMap(sql);
List<String> unionLeaderLoginNames = list.stream().map(v -> v.getString("loginname")).toList(); if (Lang.isNotEmpty(list)) {
MemberApplyToDoHandler.CREATE_UNION_TASK.exec(record, NutMap.NEW().addv("unionLeaderLoginNames", unionLeaderLoginNames)); 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) { NutMap nutMap = list.stream().findFirst().orElse(NutMap.NEW());
// String content = "%s老师您好,%s老师的入会申请校工会已通过,现将工会关系划入本工会,请您点击此消息或前往智慧工会进行接收" String unionname = nutMap.getString("unionname");
// .formatted(map.getString("username"), record.getUsername()); // 短信通知
// } String linkUrl = Globals.AppDomain + "/platform/member/apply/branchUnion/audit/h5";
for (NutMap map : list) {
String content = "%s,%s老师的入会申请已经通过校工会审核,现将工会关系转入您处,请点击此消息或登录“智慧工会”办理新会员接收手续。"
.formatted(unionname, record.getUsername());
System.out.println(content);
msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 2, "会员入会审核通知", content, "", linkUrl);
}
}
} else { } else {
MemberApplyToDoHandler.REFUSE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "校工会审核拒绝")); MemberApplyToDoHandler.REFUSE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "校工会审核拒绝"));
// 短信通知 // 短信通知
// String content = "%s老师您好,您的入会申请被校工会拒绝,如有疑问请及时联系校工会".formatted(record.getUsername()); String content = "尊敬的%s老师,您的入会申请未被通过,若有疑问请联系校工会,联系电话87692636".formatted(record.getUsername());
System.out.println(content);
msgApi.sendMsg(List.of("DingTalk"), record.getLoginname(), 1, "会员入会结果通知", content, "", "");
} }
MemberApplyToDoHandler.COMPLETE_SCHOOL_TASK.exec(record, NutMap.NEW().addv("nodeName", "校工会审核完成"));
return null; return null;
} }
@@ -156,10 +175,11 @@ public class MemberApplySchoolUnionAuditController {
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("member.apply.schoolUnion.audit") @RequiresPermissions("member.apply.schoolUnion.audit")
@SLog(type = "memberApply", tag = "会员入会申请", msg = "校工会撤回") @SLog(type = "memberApply", tag = "会员入会申请", msg = "校工会撤回")
public Object doRevoke(String id){ public Object doRevoke(String id) {
MemberApplyRecord record = dao.fetch(MemberApplyRecord.class, id); MemberApplyRecord record = dao.fetch(MemberApplyRecord.class, id);
dao.update(MemberApplyRecord.class, Chain.make("applyStateId", 20) dao.update(MemberApplyRecord.class, Chain.make("applyStateId", 20)
.add("schoolUnionAuditId", null), Cnd.where("id", "=", id)); .add("schoolUnionAuditId", null).add("allocationUnionId", null)
, Cnd.where("id", "=", id));
dao.clear(Audit.class, Cnd.where("id", "=", record.getSchoolUnionAuditId())); dao.clear(Audit.class, Cnd.where("id", "=", record.getSchoolUnionAuditId()));
// 待办撤回 // 待办撤回
localProcessService.revokeTask("MEMBER_APPLY@" + id, "校工会审核"); localProcessService.revokeTask("MEMBER_APPLY@" + id, "校工会审核");
@@ -37,6 +37,7 @@ import io.v.nutz.zhgh.staffmanage.member.template.MemberTemp;
import io.v.nutz.zhgh.staffmanage.member.utils.MemberUtils; import io.v.nutz.zhgh.staffmanage.member.utils.MemberUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
@@ -74,7 +75,7 @@ public class MemberChangeManageController {
@At("") @At("")
@Ok("beetl:/platform/member/change/manage/index.html") @Ok("beetl:/platform/member/change/manage/index.html")
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}) @RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}, logical = Logical.OR)
public void index() { public void index() {
} }
@@ -98,7 +99,7 @@ public class MemberChangeManageController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}) @RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}, logical = Logical.OR)
public Object pageData(@Param(value = "unionId", required = false) String unionId, public Object pageData(@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId, @Param(value = "unitId", required = false) String unitId,
@Param(value = "threeUnitId", required = false) String threeUnitId, @Param(value = "threeUnitId", required = false) String threeUnitId,
@@ -277,7 +278,7 @@ public class MemberChangeManageController {
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}) @RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}, logical = Logical.OR)
@SLog(tag = "会员高级管理-会员变更", msg = "分工会/校工会会员管理员提交变更") @SLog(tag = "会员高级管理-会员变更", msg = "分工会/校工会会员管理员提交变更")
public Object doSubmitChange(MemberChangeRecord record) { public Object doSubmitChange(MemberChangeRecord record) {
// 检验是否有变更 // 检验是否有变更
@@ -341,7 +342,7 @@ public class MemberChangeManageController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}) @RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}, logical = Logical.OR)
public Object sendSms(String userid) { public Object sendSms(String userid) {
Sys_user user = userService.fetch(userid); Sys_user user = userService.fetch(userid);
/*if (Strings.isNotBlank(user.getMobile())) { /*if (Strings.isNotBlank(user.getMobile())) {
@@ -357,7 +358,7 @@ public class MemberChangeManageController {
*/ */
@At @At
@ViReturn @ViReturn
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}) @RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}, logical = Logical.OR)
public Object allIsWelfareMember(PageForm pageForm, public Object allIsWelfareMember(PageForm pageForm,
@Param(value = "startDate", required = false) String startDate, @Param(value = "startDate", required = false) String startDate,
@Param(value = "endDate", required = false) String endDate, @Param(value = "endDate", required = false) String endDate,
@@ -429,7 +430,7 @@ public class MemberChangeManageController {
*/ */
@At @At
@ViReturn @ViReturn
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}) @RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}, logical = Logical.OR)
public Object userUnitMove(String threeUnitId, String unitId, @Param("userId[]") String[] userId) { public Object userUnitMove(String threeUnitId, String unitId, @Param("userId[]") String[] userId) {
Sys_unit unit = memberService.dao().fetch(Sys_unit.class, unitId); Sys_unit unit = memberService.dao().fetch(Sys_unit.class, unitId);
@@ -466,7 +467,7 @@ public class MemberChangeManageController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}) @RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}, logical = Logical.OR)
public Object userPageData(PageForm pageForm, public Object userPageData(PageForm pageForm,
@Param(value = "unitId", required = false) String unitId, @Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId, @Param(value = "unionId", required = false) String unionId,
@@ -505,7 +506,7 @@ public class MemberChangeManageController {
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}) @RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}, logical = Logical.OR)
public Object joinWelfareMember(String[] userIds, String taskId, public Object joinWelfareMember(String[] userIds, String taskId,
@Param(value = "threeUnitId", required = false) String threeUnitId, @Param(value = "threeUnitId", required = false) String threeUnitId,
@Param(value = "unitId", required = false) String unitId) { @Param(value = "unitId", required = false) String unitId) {
@@ -548,7 +549,7 @@ public class MemberChangeManageController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}) @RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}, logical = Logical.OR)
public Object units() { public Object units() {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("unitlevel", "=", 2); cnd.and("unitlevel", "=", 2);
@@ -560,7 +561,7 @@ public class MemberChangeManageController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}) @RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}, logical = Logical.OR)
public Object batchUpdatePersonType(@Param("users") String data) { public Object batchUpdatePersonType(@Param("users") String data) {
List<Sys_user> users = Json.fromJsonAsList(Sys_user.class, data); List<Sys_user> users = Json.fromJsonAsList(Sys_user.class, data);
for (Sys_user user : users) { for (Sys_user user : users) {
@@ -571,7 +572,7 @@ public class MemberChangeManageController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}) @RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}, logical = Logical.OR)
public Object batchUpdateUserState(@Param("users") String data) { public Object batchUpdateUserState(@Param("users") String data) {
List<Sys_user> users = Json.fromJsonAsList(Sys_user.class, data); List<Sys_user> users = Json.fromJsonAsList(Sys_user.class, data);
for (Sys_user user : users) { for (Sys_user user : users) {
@@ -583,7 +584,7 @@ public class MemberChangeManageController {
@At @At
@Ok("void") @Ok("void")
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}) @RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}, logical = Logical.OR)
public void downloadImport(HttpServletResponse response) { public void downloadImport(HttpServletResponse response) {
try { try {
ViTool.excelResponse(response, "会员导入模版.xlsx"); ViTool.excelResponse(response, "会员导入模版.xlsx");
@@ -613,7 +614,7 @@ public class MemberChangeManageController {
@At @At
@Aop(TransAop.READ_COMMITTED) @Aop(TransAop.READ_COMMITTED)
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}) @RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}, logical = Logical.OR)
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"}) @AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@SLog(type = "会员管理系统", tag = "信息维护-会员高级管理", msg = "导入会员", param = true, result = true) @SLog(type = "会员管理系统", tag = "信息维护-会员高级管理", msg = "导入会员", param = true, result = true)
public Object doImport(TempFile file) { public Object doImport(TempFile file) {
@@ -727,7 +728,7 @@ public class MemberChangeManageController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}) @RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"}, logical = Logical.OR)
public Object getAllChangeMemberInfo(String userId){ public Object getAllChangeMemberInfo(String userId){
List<NutMap> mapList = memberService.getAllChangeInfo(userId); List<NutMap> mapList = memberService.getAllChangeInfo(userId);
if (Lang.isEmpty(mapList)) { if (Lang.isEmpty(mapList)) {
@@ -196,6 +196,17 @@ public enum MemberApplyToDoHandler {
localProcessService.completeProcess("MEMBER_APPLY@" + record.getId()); localProcessService.completeProcess("MEMBER_APPLY@" + record.getId());
localProcessService.updateProcessNodeName("MEMBER_APPLY@" + record.getId(), "审核通过"); localProcessService.updateProcessNodeName("MEMBER_APPLY@" + record.getId(), "审核通过");
} }
},
/**
* 删除流程
*/
DELETE_PROCESS() {
@Override
public void exec(MemberApplyRecord record, NutMap extra) {
localProcessService.deleteProcessInstance("MEMBER_APPLY@" + record.getId());
}
}; };
@@ -217,4 +217,14 @@ public class MemberApplyRecord {
@Comment("分配的工会关系") @Comment("分配的工会关系")
@ColDefine(type = ColType.VARCHAR, width = 50) @ColDefine(type = ColType.VARCHAR, width = 50)
private String allocationUnionId; private String allocationUnionId;
@Column
@Comment("是否自愿加入工会")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isVoluntary;
@Column
@Comment("签字")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String sign;
} }
@@ -162,11 +162,9 @@ public class MemberCommonServiceImpl extends ViServiceImpl<Sys_user> implements
Set<String> allowChangeFieldNames = dictList.stream().map(Sys_dict::getCode).collect(Collectors.toSet()); Set<String> allowChangeFieldNames = dictList.stream().map(Sys_dict::getCode).collect(Collectors.toSet());
allowChangeFieldNames.add("member"); allowChangeFieldNames.add("member");
allowChangeFieldNames.add("welfareMember"); allowChangeFieldNames.add("welfareMember");
allowChangeFieldNames.add("unitid");
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName)); Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName));
dictMap.put("member", "会员状态"); dictMap.put("member", "会员状态");
dictMap.put("welfareMember", "福利会员状态"); dictMap.put("welfareMember", "福利会员状态");
dictMap.put("unitid", "单位");
return NutMap.NEW().addv("allowChangeFieldNames", allowChangeFieldNames).addv("dictMap", dictMap); return NutMap.NEW().addv("allowChangeFieldNames", allowChangeFieldNames).addv("dictMap", dictMap);
} }
@@ -357,6 +355,8 @@ public class MemberCommonServiceImpl extends ViServiceImpl<Sys_user> implements
sysUserService.clearCache(); sysUserService.clearCache();
sysRoleService.clearCache(); sysRoleService.clearCache();
sysUserService.deleteCacheAndUpdate(info.getId());
} }
} }
@@ -414,6 +414,11 @@ public class MemberCommonServiceImpl extends ViServiceImpl<Sys_user> implements
Object currentValue = this.booleanVerification(newMap.get(fieldName)); Object currentValue = this.booleanVerification(newMap.get(fieldName));
Object previousValue = this.booleanVerification(sourceMap.get(fieldName)); Object previousValue = this.booleanVerification(sourceMap.get(fieldName));
if ("unitId".equals(fieldName)) {
currentValue = (newMap.get(fieldName) == null ? this.booleanVerification(newMap.get("unitid")) : currentValue);
previousValue = (sourceMap.get(fieldName) == null ? this.booleanVerification(sourceMap.get("unitid")) : previousValue);
}
if (!ObjectUtil.equals(currentValue, previousValue)) { if (!ObjectUtil.equals(currentValue, previousValue)) {
String name = fieldsMap.getOrDefault(fieldName, fieldName); String name = fieldsMap.getOrDefault(fieldName, fieldName);
if ("unitId".equals(fieldName) || "unitid".equals(fieldName)) { if ("unitId".equals(fieldName) || "unitid".equals(fieldName)) {
@@ -7,6 +7,7 @@ import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.PageUtil; import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.sys.models.User; import io.v.nutz.sys.models.User;
import io.v.nutz.web.commons.slog.annotation.SLog; import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.zhgh.staffmanage.member.constant.MemberChangeType;
import io.v.nutz.zhgh.staffmanage.member.service.MemberCommonService; import io.v.nutz.zhgh.staffmanage.member.service.MemberCommonService;
import io.v.nutz.zhgh.staffmanage.sourcechange.model.SourceChangeMiddleTable; import io.v.nutz.zhgh.staffmanage.sourcechange.model.SourceChangeMiddleTable;
import io.v.nutz.zhgh.staffmanage.sourcechange.param.pageform.SourceChangePageForm; import io.v.nutz.zhgh.staffmanage.sourcechange.param.pageform.SourceChangePageForm;
@@ -145,8 +146,12 @@ public class SourceChangeManageController {
@ViReturn @ViReturn
@RequiresPermissions("sourcechange.manage") @RequiresPermissions("sourcechange.manage")
@SLog(tag = "人员变更管理", msg = "手动提交变更") @SLog(tag = "人员变更管理", msg = "手动提交变更")
public Object doSubmit(SourceChangeMiddleTable middleTable) { public Object doSubmit(@Param("data") SourceChangeMiddleTable middleTable, @Param("isSendMsg") boolean isSendMsg) {
sourceChangeManageService.doSourceChange(middleTable); sourceChangeManageService.doSourceChange(middleTable);
// 如果是新入职,需要发送邮件
if (isSendMsg && "新入职".equals(middleTable.getChangeInfosStr())) {
sourceChangeManageService.sendMsgToNewTeacher(middleTable);
}
return null; return null;
} }
@@ -155,13 +160,19 @@ public class SourceChangeManageController {
@ViReturn @ViReturn
@RequiresPermissions("sourcechange.manage") @RequiresPermissions("sourcechange.manage")
@SLog(tag = "人员变更管理", msg = "批量确认变更") @SLog(tag = "人员变更管理", msg = "批量确认变更")
public Object doBatchChange(@Param("data") String[] ids) { public Object doBatchChange(@Param("data") String[] ids, @Param("isSendMsg") boolean isSendMsg) {
if (Lang.isEmpty(ids)) { if (Lang.isEmpty(ids)) {
return Result.error("未获取到选择数据"); return Result.error("未获取到选择数据");
} }
List<SourceChangeMiddleTable> list = dao.query(SourceChangeMiddleTable.class, Cnd.where("id", "in", ids)); List<SourceChangeMiddleTable> list = dao.query(SourceChangeMiddleTable.class, Cnd.where("id", "in", ids));
for (SourceChangeMiddleTable middleTable : list) { for (SourceChangeMiddleTable middleTable : list) {
sourceChangeManageService.doSourceChange(middleTable); sourceChangeManageService.doSourceChange(middleTable);
// 如果是新入职,需要发送邮件
if (isSendMsg && "新入职".equals(middleTable.getChangeInfosStr())) {
sourceChangeManageService.sendMsgToNewTeacher(middleTable);
}
} }
return null; return null;
} }
@@ -1,6 +1,8 @@
package io.v.nutz.zhgh.staffmanage.sourcechange.service; package io.v.nutz.zhgh.staffmanage.sourcechange.service;
import io.v.nutz.base.service.BaseService; import io.v.nutz.base.service.BaseService;
import io.v.nutz.sys.models.User;
import io.v.nutz.zhgh.data.model.UserHistory;
import io.v.nutz.zhgh.staffmanage.sourcechange.model.SourceChangeMiddleTable; import io.v.nutz.zhgh.staffmanage.sourcechange.model.SourceChangeMiddleTable;
import java.util.Date; import java.util.Date;
@@ -24,5 +26,12 @@ public interface SourceChangeManageService extends BaseService<SourceChangeMiddl
/** /**
* 发送消息给新入职的老师,提醒可以入会 * 发送消息给新入职的老师,提醒可以入会
*/ */
void sendMsgToNewTeacher(Date date); void sendMsgToNewTeacher(SourceChangeMiddleTable middleTable);
/**
* 如果有单位异动的,找出异动前和异动后的分工会,发送消息提醒两个分工会的会员管理员
* 如果在同一个分工会下异动,则只发送一条消息
*/
void sendUnitChangeTeacher(SourceChangeMiddleTable middleTable, UserHistory history);
} }
@@ -30,6 +30,8 @@ import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; 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.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
@@ -69,11 +71,10 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
public void doSourceChange(SourceChangeMiddleTable middleTable) { public void doSourceChange(SourceChangeMiddleTable middleTable) {
// 记录当前操作的时间,用于后续区分短信通知 // 记录当前操作的时间,用于后续区分短信通知
Date date = DateUtil.date(); Date date = DateUtil.date();
// 是否新入职
boolean isNewTeacher = "新入职".equals(middleTable.getChangeInfosStr());
int count = dao().count(Sys_user.class, Cnd.where("loginname", "=", middleTable.getLoginname())); User user = dao().fetch(User.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
Sys_user info = new Sys_user();
User user = new User();
//获取可变更字段 //获取可变更字段
NutMap map = commonService.getDictAllowChangeFields(); NutMap map = commonService.getDictAllowChangeFields();
Set<String> allowChangeFieldNames = map.getAs("allowChangeFieldNames", Set.class); Set<String> allowChangeFieldNames = map.getAs("allowChangeFieldNames", Set.class);
@@ -90,34 +91,30 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
} }
List<String> changeTypes = new ArrayList<>(); List<String> changeTypes = new ArrayList<>();
if (count <= 0) {
if (isNewTeacher) {
changeTypes.add(MemberChangeType.NEW.getType()); changeTypes.add(MemberChangeType.NEW.getType());
Sys_user sysUser = BeanUtil.copyProperties(middleTable, Sys_user.class); }
dao().insert(sysUser); if (Lang.isNotEmpty(changeList)) {
user = dao().fetch(User.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
} else {
user = dao().fetch(User.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
changeTypes.add(MemberChangeType.BASIC_CHANGE.getType()); changeTypes.add(MemberChangeType.BASIC_CHANGE.getType());
}
if (!ObjectUtil.equals(user.getUserState(), middleTable.getUserState())) { if (!ObjectUtil.equals(user.getUserState(), middleTable.getUserState())) {
List<MemberChangeType> list = Arrays.stream(MemberChangeType.values()) List<MemberChangeType> list = Arrays.stream(MemberChangeType.values())
.filter(v -> v.getChangeTypeName().equals(middleTable.getUserState())).toList(); .filter(v -> v.getChangeTypeName().equals(middleTable.getUserState())).toList();
if (Lang.isNotEmpty(list)) { if (Lang.isNotEmpty(list)) {
changeTypes.add(list.get(0).getType()); changeTypes.add(list.get(0).getType());
}
} }
if (!ObjectUtil.equals(user.getMember(), middleTable.getMember())){ }
if (middleTable.getMember() == 1) { if (!ObjectUtil.equals(user.getMember(), middleTable.getMember())){
changeTypes.add(MemberChangeType.RESTORE.getType()); if (middleTable.getMember() == 1) {
} else { changeTypes.add(MemberChangeType.RESTORE.getType());
changeTypes.add(MemberChangeType.WITHDRAWAL.getType()); } else {
} changeTypes.add(MemberChangeType.WITHDRAWAL.getType());
} }
} }
info = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", middleTable.getLoginname())); Sys_user info = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
String userId = info.getId(); String userId = info.getId();
UserHistory history = new UserHistory(); UserHistory history = new UserHistory();
if (Lang.isNotEmpty(changeList)) { if (Lang.isNotEmpty(changeList)) {
@@ -128,7 +125,6 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
history.setChangeTime(date); history.setChangeTime(date);
history.setChangeOrigin(MemberChangeOrigin.HAND_MOVEMENT.name()); history.setChangeOrigin(MemberChangeOrigin.HAND_MOVEMENT.name());
// 加入会员 // 加入会员
if (middleTable.getMember() != null && middleTable.getMember() == 1) { if (middleTable.getMember() != null && middleTable.getMember() == 1) {
int activityCount = dao().count(ActivityUserScope.class, Cnd.where("userId", "=", userId).and("groupId", "=", 1)); int activityCount = dao().count(ActivityUserScope.class, Cnd.where("userId", "=", userId).and("groupId", "=", 1));
@@ -222,36 +218,78 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
dao().updateIgnoreNull(info); dao().updateIgnoreNull(info);
history.setChangeInfos(changeList); history.setChangeInfos(changeList);
if (count <= 0) { if (Lang.isNotEmpty(changeList)) {
history.setChangeInfosStr("新入职");
} else {
String changeInfos = changeList.stream().map(v -> { 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("")); }).collect(Collectors.joining(""));
if (isNewTeacher) {
changeInfos = changeInfos + ";新入职";
}
history.setChangeInfosStr(changeInfos); history.setChangeInfosStr(changeInfos);
} else if (Lang.isEmpty(changeList) && isNewTeacher){
history.setChangeInfosStr("新入职");
} }
history.setChangeTypes(changeTypes); history.setChangeTypes(changeTypes);
dao().insert(history); dao().insert(history);
dao().update(SourceChangeMiddleTable.class, Chain.make("isOperate", 2), Cnd.where("id", "=", middleTable.getId())); dao().update(SourceChangeMiddleTable.class, Chain.make("isOperate", 2), Cnd.where("id", "=", middleTable.getId()));
sysUserService.deleteCacheAndUpdate(userId);
sysUserService.clearCache(); sysUserService.clearCache();
sysRoleService.clearCache(); sysRoleService.clearCache();
// 如果有单位异动,发送消息提醒分工会
if (middleTable.getChangeTypes().contains(MemberChangeType.UNIT_CHANGE.name())){
sendUnitChangeTeacher(middleTable, history);
}
}
}
/**
* 发送入会邀请
* @param middleTable
*/
@Override
public void sendMsgToNewTeacher(SourceChangeMiddleTable middleTable) {
String context = "尊敬的%s老师,欢迎您加入杭州医学院大家庭,请您点击此条信息或登录“智慧工会”平台申请成为杭医工会会员!"
.formatted(middleTable.getUsername());
String link = Globals.AppDomain + "/platform/member/apply/submit/h5";
// msgApi.sendMsg(List.of("DingTalk"), middleTable.getLoginname(), 2, "入会邀请", context, "", link);
}
/**
* 如果有单位异动的,找出异动前和异动后的分工会,发送消息提醒两个分工会的会员管理员
* 如果在同一个分工会下异动,则只发送一条消息
*/
@Override
public void sendUnitChangeTeacher(SourceChangeMiddleTable middleTable, UserHistory history) {
// 查询出异动前的工会
Sql beforeUnionSql = Sqls.create("select un.id,un.unionname from sys_union un left join sys_unit unit on unit.unionid where unit.id = @unitId")
.setParam("unitId", history.getUnitid());
beforeUnionSql.setCallback(Sqls.callback.map());
dao().execute(beforeUnionSql);
NutMap beforeUnionMap = (NutMap) beforeUnionSql.getResult();
// 查询出异动后的工会
Sql afterUnionSql = Sqls.create("select un.id,un.unionname from sys_union un left join sys_unit unit on unit.unionid where unit.id = @unitId")
.setParam("unitId", middleTable.getUnitid());
afterUnionSql.setCallback(Sqls.callback.map());
dao().execute(afterUnionSql);
NutMap afterUnionMap = (NutMap) afterUnionSql.getResult();
// 如果这两个单位归属的是不同的分工会,发送消息提醒两个分工会
if (beforeUnionMap.getString("id").equals(afterUnionMap.getString("id"))) {
// 找到变更前的分工会会员管理员,发送消息提醒
Sql beforeUnionAdminSql = Sqls.create("");
String beforeContent = "";
// 找到变更后的分工会会员管理员,发送消息提醒
String afterContent = "";
} }
sendMsgToNewTeacher(date);
}
@Override
public void sendMsgToNewTeacher(Date date) {
List<UserHistory> historyList = dao().query(UserHistory.class, Cnd.where("changeTypes", "like", "%" + MemberChangeType.NEW.getType() + "%")
.and("DATE_FORMAT(changeTime,'%Y-%m-%d %H:%i')", "=", DateUtil.format(date, "yyyy-MM-dd HH:mm")));
// for (UserHistory history : historyList) {
// String context = "%s老师您好,欢迎加入杭医大家庭,诚挚邀请您成为工会会员,如有意愿,请您点击此条消息或前往智慧工会平台申请入会,如无意愿请忽略此消息提醒。".formatted(history.getUsername());
// String link = Globals.AppDomain + "/platform/member/apply/submit/h5";
// msgApi.sendMsg(List.of("DingTalk"), history.getLoginname(), 2, "入会邀请", context, "", link);
// }
} }
} }
@@ -149,11 +149,13 @@ layout("/mobile/platform.html"){
<van-form> <van-form>
<van-field label="审核人员" readonly name="username" v-model="formData.username" required></van-field> <van-field label="审核人员" readonly name="username" v-model="formData.username" required></van-field>
<van-field label="审核时间" readonly name="auditTime" v-model="formData.auditTime" required></van-field> <van-field label="审核时间" readonly name="auditTime" v-model="formData.auditTime" required></van-field>
<van-field label="审核意见" name="auditOpinion" v-model="formData.auditOpinion" placeholder="请输入审核意见" required></van-field> <van-field label="审核意见" name="auditOpinion"
type="textarea" maxlength="200" show-word-limit
v-model="formData.auditOpinion" placeholder="请输入审核意见" required></van-field>
</van-form> </van-form>
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px"> <div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
<van-button type="default" block @click="infoShow=false">取消</van-button> <van-button type="default" block @click="infoShow=false">取消</van-button>
<van-button type="danger" block @click.submit="doApproval(2)">退回申请</van-button> <!-- <van-button type="danger" block @click.submit="doApproval(2)">退回申请</van-button>-->
<van-button type="danger" block @click.submit="doApproval(0)">拒绝接收</van-button> <van-button type="danger" block @click.submit="doApproval(0)">拒绝接收</van-button>
<van-button type="primary" block @click.submit="doApproval(1)">同意接收</van-button> <van-button type="primary" block @click.submit="doApproval(1)">同意接收</van-button>
</div> </div>
@@ -234,7 +236,7 @@ layout("/mobile/platform.html"){
} }
let msg = '确定要通过此条申请吗?' let msg = '确定要通过此条申请吗?'
if (approvalType === 0) { if (approvalType === 0) {
msg = '拒绝后不可撤回,确定要拒绝此条申请吗?' msg = '确定要拒绝接收该教工的工会关系吗?'
} else if (approvalType === 2) { } else if (approvalType === 2) {
msg = '确定要退回此条申请吗?' msg = '确定要退回此条申请吗?'
} }
@@ -41,8 +41,8 @@ const MEMBER_APPLY_AUDIT_INFO = {
<van-cell title="人员类型">{{ viewData.personType }}</van-cell> <van-cell title="人员类型">{{ viewData.personType }}</van-cell>
<van-cell title="人员性质">{{ viewData.preparedBy || '暂无' }}</van-cell> <van-cell title="人员性质">{{ viewData.preparedBy || '暂无' }}</van-cell>
<van-cell title="会员状态">{{ viewData.member ? '会员' : '非会员' }}</van-cell> <!-- <van-cell title="会员状态">{{ viewData.member ? '会员' : '非会员' }}</van-cell>-->
<van-cell title="福利会员状态">{{ viewData.welfareMember ? '福利会员' : '非福利会员' }}</van-cell> <!-- <van-cell title="福利会员状态">{{ viewData.welfareMember ? '福利会员' : '非福利会员' }}</van-cell>-->
<van-cell title="家庭成员" class="column-cell"> <van-cell title="家庭成员" class="column-cell">
<table class="family-table"> <table class="family-table">
@@ -67,11 +67,20 @@ const MEMBER_APPLY_AUDIT_INFO = {
</table> </table>
</van-cell> </van-cell>
<van-cell title="个人简历"> <van-cell title="个人简历">
<div v-if="viewData.vita" class="text-left" v-html="viewData.vita"></div> <template #label>
<span v-else>无数据</span> <div v-if="viewData.vita" class="text-left" v-html="viewData.vita"></div>
<span style="font-size: 14px" v-else>无数据</span>
</template>
</van-cell>
<van-cell title="签字">
<template #label>
<van-image width="200" height="100" :src="CREATE_PREVIEW_URL(viewData.sign)"
v-if="viewData.sign"></van-image>
<span style="font-size: 14px" v-else>暂无</span>
</template>
</van-cell> </van-cell>
</template> </template>
</van-cell-group> </van-cell-group>
</van-tab> </van-tab>
@@ -125,7 +125,7 @@ layout("/mobile/platform.html"){
<van-button size="small" type="primary" <van-button size="small" type="primary"
v-if="[20, 70].includes(item.applyStateId)" v-if="[20, 70].includes(item.applyStateId)"
@click="openApproval(item)" @click="openApproval(item)"
style="margin-right: 4px">审核 style="margin-right: 4px">{{ item.applyStateId === 70 ? '重新审核' : '审核' }}
</van-button> </van-button>
<van-button size="small" type="danger" <van-button size="small" type="danger"
v-if="[30, 50].includes(item.applyStateId)" v-if="[30, 50].includes(item.applyStateId)"
@@ -155,7 +155,9 @@ layout("/mobile/platform.html"){
<van-field label="分配工会" v-model="formData.unionName" readonly clickable required <van-field label="分配工会" v-model="formData.unionName" readonly clickable required
@click="unionPicker = true" placeholder="请选择分配工会" @click="unionPicker = true" placeholder="请选择分配工会"
:rules="[{ required:true, message: '请选择分配工会' }]"></van-field> :rules="[{ required:true, message: '请选择分配工会' }]"></van-field>
<van-popup v-model="unionPicker" position="bottom"> <van-popup v-model="unionPicker" position="bottom"
get-container="body"
safe-area-inset-bottom>
<van-picker <van-picker
show-toolbar show-toolbar
:columns="unions" :columns="unions"
@@ -163,11 +165,13 @@ layout("/mobile/platform.html"){
@cancel="unionPicker = false" @cancel="unionPicker = false"
></van-picker> ></van-picker>
</van-popup> </van-popup>
<van-field label="审核意见" name="auditOpinion" v-model="formData.auditOpinion" placeholder="请输入审核意见" required></van-field> <van-field label="审核意见" name="auditOpinion"
type="textarea" maxlength="200" show-word-limit
v-model="formData.auditOpinion" placeholder="请输入审核意见" required></van-field>
</van-form> </van-form>
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px"> <div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
<van-button type="default" block @click="infoShow=false">取消</van-button> <van-button type="default" block @click="infoShow=false">取消</van-button>
<van-button type="danger" block @click.submit="doApproval(2)">退回申请</van-button> <!-- <van-button type="danger" block @click.submit="doApproval(2)">退回申请</van-button>-->
<van-button type="danger" block @click.submit="doApproval(0)">拒绝申请</van-button> <van-button type="danger" block @click.submit="doApproval(0)">拒绝申请</van-button>
<van-button type="primary" block @click.submit="doApproval(1)">同意申请</van-button> <van-button type="primary" block @click.submit="doApproval(1)">同意申请</van-button>
</div> </div>
@@ -143,9 +143,9 @@ layout("/mobile/platform.html"){
<van-field label="在职状态" :value="formData.userState" readonly></van-field> <van-field label="在职状态" :value="formData.userState" readonly></van-field>
<van-field label="人员类型" :value="formData.personType" readonly></van-field> <van-field label="人员类型" :value="formData.personType" readonly></van-field>
<van-field label="身份证号码" v-model="formData.idCard" placeholder="请输入身份证号码" <van-field label="身份证号码" disabled v-model="formData.idCard" placeholder="请输入身份证号码"
:rules="[{ pattern :/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, message: '身份证号码格式错误' }]"></van-field> :rules="[{ pattern :/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, message: '身份证号码格式错误' }]"></van-field>
<van-field label="联系电话" v-model="formData.mobile" type="tel" placeholder="请输入联系电话" <van-field label="联系电话" disabled v-model="formData.mobile" type="tel" placeholder="请输入联系电话"
:rules="[{ pattern :/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, message: '联系电话格式错误' }]"></van-field> :rules="[{ pattern :/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, message: '联系电话格式错误' }]"></van-field>
<van-field label="电子邮箱" v-model="formData.email" placeholder="请输入电子邮箱" <van-field label="电子邮箱" v-model="formData.email" placeholder="请输入电子邮箱"
:rules="[{ pattern :/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, message: '邮箱格式错误' }]"></van-field> :rules="[{ pattern :/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, message: '邮箱格式错误' }]"></van-field>
@@ -204,6 +204,22 @@ layout("/mobile/platform.html"){
<text-editor style="z-index: 1" v-model="formData.vita"></text-editor> <text-editor style="z-index: 1" v-model="formData.vita"></text-editor>
</template> </template>
</van-field> </van-field>
<van-cell title="入会意愿">
<template #label>
<van-checkbox style="font-size: 16px;color: #F56C6C" icon-size="24px"
v-model="formData.isVoluntary" shape="square">
我自愿加入中华全国总工会,遵守工会章程,执行工会决议,积极参加工会活动,为全面建成小康社会、把我国建设成为富强民主文明和谐的社会主义现代化国家、实现中华民族伟大复兴的中国梦而奋斗。
</van-checkbox>
</template>
</van-cell>
<van-cell title="签字">
<template #label>
<mobile-sign :is_value_base64="false" v-model="formData.sign" prefix="MEMBER_APPLY"
ref="signature"></mobile-sign>
</template>
</van-cell>
</van-form> </van-form>
<div v-if="!user.member" style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px"> <div v-if="!user.member" style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
<van-button block v-if="formData.id" type="default" @click.submit="pjaxReplace('/platform/member/apply/mine/h5')">返 回</van-button> <van-button block v-if="formData.id" type="default" @click.submit="pjaxReplace('/platform/member/apply/mine/h5')">返 回</van-button>
@@ -256,6 +272,16 @@ layout("/mobile/platform.html"){
}) })
}, },
doSubmit(){ doSubmit(){
if (!this.formData.isVoluntary) {
this.$toast.fail('请同意入会意愿')
return
}
if (!this.formData.sign) {
this.$toast.fail('请签字')
return
}
this.$dialog.confirm({ this.$dialog.confirm({
title: "保存", title: "保存",
message: "提交后将进入审核流程,无法再进行编辑,您确定要提交申请吗?", message: "提交后将进入审核流程,无法再进行编辑,您确定要提交申请吗?",
@@ -35,6 +35,12 @@ layout("/layouts/platform.html"){
<el-tag v-if="row.allocationUnionName">{{ row.allocationUnionName }}</el-tag> <el-tag v-if="row.allocationUnionName">{{ row.allocationUnionName }}</el-tag>
<el-tag v-else type="danger">未分配</el-tag> <el-tag v-else type="danger">未分配</el-tag>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='sign'">
<el-image :src="CREATE_PREVIEW_URL(row.sign)"
fit="cover"
style="height: 60px" v-if="row.sign"></el-image>
<el-tag type="warning" v-else>暂无</el-tag>
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="220"> <el-table-column label="操作" width="220">
<template slot-scope="{row}"> <template slot-scope="{row}">
@@ -82,7 +88,7 @@ layout("/layouts/platform.html"){
</el-form> </el-form>
<el-row type="flex" justify="end"> <el-row type="flex" justify="end">
<el-button plain @click="$refs.guava.index()">取消</el-button> <el-button plain @click="$refs.guava.index()">取消</el-button>
<el-button type="danger" @click="doApproval(2)">退回申请</el-button> <!-- <el-button type="danger" @click="doApproval(2)">退回申请</el-button>-->
<el-button type="danger" @click="doApproval(0)">拒绝接收</el-button> <el-button type="danger" @click="doApproval(0)">拒绝接收</el-button>
<el-button type="primary" @click="doApproval(1)">同意接收</el-button> <el-button type="primary" @click="doApproval(1)">同意接收</el-button>
</el-row> </el-row>
@@ -111,6 +117,7 @@ layout("/layouts/platform.html"){
{ prop: "unionName", label: "所属工会", sortable: true }, { prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true }, { prop: "unitName", label: "所属单位", sortable: true },
{ prop: "allocationUnionName", label: "分配工会", sortable: true }, { prop: "allocationUnionName", label: "分配工会", sortable: true },
{ prop: "sign", label: "签字" },
{ prop: "stateName", label: "当前节点", sortable: true } { prop: "stateName", label: "当前节点", sortable: true }
], ],
@@ -145,7 +152,7 @@ layout("/layouts/platform.html"){
doApproval(approvalType){ doApproval(approvalType){
let msg = '确定要通过此条申请吗?' let msg = '确定要通过此条申请吗?'
if (approvalType === 0) { if (approvalType === 0) {
msg = '拒绝后不可撤回,确定要拒绝此条申请吗?' msg = '确定要拒绝接收此教工的工会关系吗?'
} else if (approvalType === 2) { } else if (approvalType === 2) {
msg = '确定要退回此条申请吗?' msg = '确定要退回此条申请吗?'
} }
@@ -28,9 +28,9 @@ const MEMBER_APPLY_AUDIT_INFO = {
<el-descriptions-item label="人员类型">{{ viewData.personType }}</el-descriptions-item> <el-descriptions-item label="人员类型">{{ viewData.personType }}</el-descriptions-item>
<el-descriptions-item></el-descriptions-item> <el-descriptions-item></el-descriptions-item>
<el-descriptions-item label="会员状态">{{ viewData.member ? '会员' : '非会员' }}</el-descriptions-item> <!-- <el-descriptions-item label="会员状态">{{ viewData.member ? '会员' : '非会员' }}</el-descriptions-item>-->
<el-descriptions-item label="福利会员状态">{{ viewData.welfareMember ? '福利会员' : '非福利会员' }}</el-descriptions-item> <!-- <el-descriptions-item label="福利会员状态">{{ viewData.welfareMember ? '福利会员' : '非福利会员' }}</el-descriptions-item>-->
<el-descriptions-item></el-descriptions-item> <!-- <el-descriptions-item></el-descriptions-item>-->
<el-descriptions-item label="家庭主要成员" :span="3"> <el-descriptions-item label="家庭主要成员" :span="3">
<el-table v-if="viewData.families&&viewData.families.length" <el-table v-if="viewData.families&&viewData.families.length"
@@ -49,9 +49,16 @@ const MEMBER_APPLY_AUDIT_INFO = {
<el-empty v-else :image-size="50" description="暂无家庭成员信息"></el-empty> <el-empty v-else :image-size="50" description="暂无家庭成员信息"></el-empty>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="个人简况" :span="3"> <el-descriptions-item label="个人简况" :span="3">
<template slot="label">个人简况</template>
<div v-if="viewData.vita" class="text-left" v-html="viewData.vita"></div> <div v-if="viewData.vita" class="text-left" v-html="viewData.vita"></div>
<span v-else>无数据</span> <el-tag type="warning" v-else>暂无</el-tag>
</el-descriptions-item>
<el-descriptions-item label="签字信息" :span="3">
<el-image v-if="viewData.sign"
:src="CREATE_PREVIEW_URL(viewData.sign)"
fit="contain"
style="width: 300px; height: 100px"></el-image>
<el-tag type="warning" v-else>暂无</el-tag>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-tab-pane> </el-tab-pane>
@@ -63,7 +70,8 @@ const MEMBER_APPLY_AUDIT_INFO = {
<el-descriptions-item label="审核时间">{{ viewData.schoolAudit.auditTime }} <el-descriptions-item label="审核时间">{{ viewData.schoolAudit.auditTime }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="分配工会" :span="2"> <el-descriptions-item label="分配工会" :span="2">
<el-tag>{{ viewData.allocationUnionName }}</el-tag> <el-tag v-if="viewData.allocationUnionName">{{ viewData.allocationUnionName }}</el-tag>
<el-tag v-else type="warning">{{ '无数据' }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="审核意见" :span="2">{{ viewData.schoolAudit.auditOpinion }} <el-descriptions-item label="审核意见" :span="2">{{ viewData.schoolAudit.auditOpinion }}
</el-descriptions-item> </el-descriptions-item>
@@ -25,6 +25,12 @@ layout("/layouts/platform.html"){
<template scope="{row}" v-if="column.prop=='loginname'"> <template scope="{row}" v-if="column.prop=='loginname'">
<el-link @click="openView(row)" type="primary">{{row.loginname}}</el-link> <el-link @click="openView(row)" type="primary">{{row.loginname}}</el-link>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='sign'">
<el-image :src="CREATE_PREVIEW_URL(row.sign)"
fit="cover"
style="height: 60px" v-if="row.sign"></el-image>
<el-tag type="warning" v-else>暂无</el-tag>
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="220"> <el-table-column label="操作" width="220">
<template slot-scope="{row}"> <template slot-scope="{row}">
@@ -63,6 +69,7 @@ layout("/layouts/platform.html"){
{ prop: "personType", label: "人员类型", sortable: true }, { prop: "personType", label: "人员类型", sortable: true },
{ prop: "unionName", label: "所属工会", sortable: true }, { prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true }, { prop: "unitName", label: "所属单位", sortable: true },
{ prop: "sign", label: "签字" },
{ prop: "stateName", label: "当前节点", sortable: true } { prop: "stateName", label: "当前节点", sortable: true }
], ],
} }
@@ -35,11 +35,19 @@ layout("/layouts/platform.html"){
<el-tag v-if="row.allocationUnionName">{{ row.allocationUnionName }}</el-tag> <el-tag v-if="row.allocationUnionName">{{ row.allocationUnionName }}</el-tag>
<el-tag v-else type="danger">未分配</el-tag> <el-tag v-else type="danger">未分配</el-tag>
</template> </template>
<template scope="{row}" v-else-if="column.prop=='sign'">
<el-image :src="CREATE_PREVIEW_URL(row.sign)"
fit="cover"
style="height: 60px" v-if="row.sign"></el-image>
<el-tag type="warning" v-else>暂无</el-tag>
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="220"> <el-table-column label="操作" width="220">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button> <el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="[20, 70].includes(row.applyStateId)" @click="openAudit(row)" size="mini" type="primary">审核</el-button> <el-button v-if="[20, 70].includes(row.applyStateId)" @click="openAudit(row)" size="mini" type="primary">
{{ (row.applyStateId === 70) ? '重新审核' : '审核' }}
</el-button>
<el-button v-if="[30, 50].includes(row.applyStateId)" @click="doRevoke(row)" size="mini" type="danger">撤回</el-button> <el-button v-if="[30, 50].includes(row.applyStateId)" @click="doRevoke(row)" size="mini" type="danger">撤回</el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -99,7 +107,7 @@ layout("/layouts/platform.html"){
</el-form> </el-form>
<el-row type="flex" justify="end"> <el-row type="flex" justify="end">
<el-button plain @click="$refs.guava.index()">取消</el-button> <el-button plain @click="$refs.guava.index()">取消</el-button>
<el-button type="danger" @click="doApproval(2)">退回申请</el-button> <!-- <el-button type="danger" @click="doApproval(2)">退回申请</el-button>-->
<el-button type="danger" @click="doApproval(0)">拒绝申请</el-button> <el-button type="danger" @click="doApproval(0)">拒绝申请</el-button>
<el-button type="primary" @click="doApproval(1)">同意申请</el-button> <el-button type="primary" @click="doApproval(1)">同意申请</el-button>
</el-row> </el-row>
@@ -130,6 +138,7 @@ layout("/layouts/platform.html"){
{ prop: "unionName", label: "所属工会", sortable: true }, { prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true }, { prop: "unitName", label: "所属单位", sortable: true },
{ prop: "allocationUnionName", label: "分配工会", sortable: true }, { prop: "allocationUnionName", label: "分配工会", sortable: true },
{ prop: "sign", label: "签字" },
{ prop: "stateName", label: "当前节点", sortable: true } { prop: "stateName", label: "当前节点", sortable: true }
], ],
@@ -106,12 +106,12 @@ layout("/layouts/platform.html"){
<el-descriptions-item label="身份证号码"> <el-descriptions-item label="身份证号码">
<el-form-item prop="idCard"> <el-form-item prop="idCard">
<el-input v-model="formData.idCard" placeholder="请输入身份证号码" maxlength="18"></el-input> <el-input v-model="formData.idCard" disabled placeholder="请输入身份证号码" maxlength="18"></el-input>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="联系电话"> <el-descriptions-item label="联系电话">
<el-form-item prop="mobile"> <el-form-item prop="mobile">
<el-input v-model="formData.mobile" placeholder="请输入联系电话" maxlength="32"></el-input> <el-input v-model="formData.mobile" disabled placeholder="请输入联系电话" maxlength="32"></el-input>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="电子邮箱"> <el-descriptions-item label="电子邮箱">
@@ -171,6 +171,25 @@ layout("/layouts/platform.html"){
<text-editor v-model="formData.vita"></text-editor> <text-editor v-model="formData.vita"></text-editor>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="入会意愿" :span="3">
<el-form-item prop="isVoluntary">
<el-checkbox
size="medium"
style="width: 70%;color: #F56C6C;white-space: nowrap"
v-model="formData.isVoluntary">
我自愿加入中华全国总工会,遵守工会章程,执行工会决议,积极参加工会活动,为全面建成小康社会、把我国建设成为富强民主文明和谐的社会主义现代化国家、实现中华民族伟大复兴的中国梦而奋斗。
</el-checkbox>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="签字" :span="3">
<el-form-item prop="sign">
<sign :is_value_base64="false" :qz.sync="formData.sign"
prefix="MEMBER_APPLY"
ref="sign"></sign>
</el-form-item>
</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-form> </el-form>
<el-row v-if="!member" justify="end" type="flex" class="mt10"> <el-row v-if="!member" justify="end" type="flex" class="mt10">
@@ -196,6 +215,15 @@ layout("/layouts/platform.html"){
formRules: { formRules: {
username: [{required: false, message: "必填", trigger: ["change", "blur"]}], username: [{required: false, message: "必填", trigger: ["change", "blur"]}],
sex: [{required: false, message: "必填", trigger: ["change", "blur"]}], sex: [{required: false, message: "必填", trigger: ["change", "blur"]}],
isVoluntary: [{required: true, message: "必填", trigger: ["change", "blur"]}],
sign: [{required: true, message: "必填", trigger: ["change", "blur"]}],
phone: [
{
validator: (rule, value, callback) => {
},
trigger: ["change", "blur"]
}
],
email: [ email: [
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
@@ -280,6 +308,16 @@ layout("/layouts/platform.html"){
.catch() .catch()
}, },
doSubmit() { doSubmit() {
if (!this.formData.isVoluntary) {
this.$message.error("请勾选入会意愿")
return
}
if (!this.formData.sign) {
this.$message.error("请使用手机钉钉扫描二维码签字")
return
}
this.$refs.formRef.validate((valid) => { this.$refs.formRef.validate((valid) => {
if (valid) { if (valid) {
this.$confirm("提交后将进入审核流程,无法再进行编辑,您确定要提交申请吗?", "提示", { type: "warning" }) this.$confirm("提交后将进入审核流程,无法再进行编辑,您确定要提交申请吗?", "提示", { type: "warning" })
@@ -48,7 +48,7 @@ layout("/layouts/platform.html"){
</el-card> </el-card>
<el-card shadow="never" class="mt10"> <el-card shadow="never" class="mt10">
<table-tool :app="this" label="变更记录(默认查询当天变更记录,如需查询更多变更记录,请选择上方【变更日期】后进行搜索)"> <table-tool :app="this" label="变更记录(默认查询最近三个月,如需查询其他变更记录,请选择上方【变更日期】后进行搜索)">
<template #func> <template #func>
<el-button type="primary" style="margin-right: 10px" size="small" @click="doBatchChange">批量确认</el-button> <el-button type="primary" style="margin-right: 10px" size="small" @click="doBatchChange">批量确认</el-button>
@@ -152,23 +152,25 @@ layout("/layouts/platform.html"){
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(async () => { }).then(async () => {
const url = "/platform/sourcechange/manage/doBatchChange"
let isSendMsg = false
const isHasNewTeacher = this.checkUsers.some(v=> v.changeInfosStr === '新入职')
const ids = this.checkUsers.map(item => item.id) const ids = this.checkUsers.map(item => item.id)
const loading = this.$loading({ if (isHasNewTeacher) {
lock: true, this.$confirm('勾选用户中有新入职教工,是否对新入职教职工发送入会邀请?', '提示', {
text: '数据保存中请稍后...', confirmButtonText: '确定',
spinner: 'el-icon-loading', cancelButtonText: '取消',
background: 'rgba(0, 0, 0, 0.7)' type: 'warning'
}); }).then(() => {
const resp = await $.post('/platform/sourcechange/manage/doBatchChange', { isSendMsg = true
data: JSON.stringify(ids) this.doOperate(url, ids, isSendMsg)
}) }).catch(() => {
loading.close() isSendMsg = false
if (resp.code === 0) { this.doOperate(url, ids, isSendMsg)
this.$message.success(resp.msg) })
this.$refs.table.clearSelection()
await this.pageData()
} else { } else {
this.$message.warning(resp.msg) await this.doOperate(url, ids, isSendMsg)
} }
}) })
}, },
@@ -176,10 +178,41 @@ layout("/layouts/platform.html"){
this.checkUsers = val this.checkUsers = val
}, },
async doSubmit(formData){ async doSubmit(formData){
const resp = await $.post('/platform/sourcechange/manage/doSubmit', formData) const url = "/platform/sourcechange/manage/doSubmit"
let isSendMsg = false;
if (formData.changeInfosStr === '新入职') {
this.$confirm('该职工是新入职职工,是否发送入会邀请?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
isSendMsg = true
await this.doOperate(url, formData, isSendMsg)
}).catch(async () => {
isSendMsg = false
await this.doOperate(url, formData, isSendMsg)
})
} else {
await this.doOperate(url, formData, isSendMsg)
}
},
async doOperate(url, data, isSendMsg) {
const loading = this.$loading({
lock: true,
text: '数据保存中请稍后...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
const resp = await $.post(url, {
data: JSON.stringify(data),
isSendMsg: isSendMsg
})
loading.close()
if (resp.code === 0) { if (resp.code === 0) {
this.$message.success(resp.msg) this.$message.success(resp.msg)
this.$refs.guava.index() this.$refs.guava.index()
this.$refs.table.clearSelection()
await this.pageData() await this.pageData()
} else { } else {
this.$message.warning(resp.msg) this.$message.warning(resp.msg)