发短信

This commit is contained in:
Paidax
2025-03-13 08:47:48 +08:00
parent 645e8002aa
commit 5927a814e9
29 changed files with 697 additions and 457 deletions
@@ -17,10 +17,12 @@ import io.v.nutz.zhgh.staffmanage.member.handle.MemberApplyToDoHandler;
import io.v.nutz.zhgh.staffmanage.member.service.MemberCommonService; import io.v.nutz.zhgh.staffmanage.member.service.MemberCommonService;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
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.Sqls;
import org.nutz.dao.sql.Sql; 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.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang; import org.nutz.lang.Lang;
@@ -80,6 +82,7 @@ public class ClubRegistApplyController {
@At @At
@POST @POST
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.clubRegistApply") @RequiresPermissions("sys.club.clubRegist.clubRegistApply")
public Object doAdd(@Param(value = "club", required = false) Sys_club club, public Object doAdd(@Param(value = "club", required = false) Sys_club club,
@Param(value = "isSave", required = false) Boolean isSave, @Param(value = "isSave", required = false) Boolean isSave,
@@ -115,7 +118,7 @@ public class ClubRegistApplyController {
LEFT JOIN sys_role role ON role.id = userRole.roleId LEFT JOIN sys_role role ON role.id = userRole.roleId
LEFT JOIN `user` u ON u.id = userRole.userId LEFT JOIN `user` u ON u.id = userRole.userId
WHERE WHERE
role.`code` = 'BranchUnionMemberAdmin' and u.unionid = @unionId role.`code` = 'H04' and u.unionid = @unionId
group by u.loginname group by u.loginname
""").setParam("unionId", Vi.getUnionId()); """).setParam("unionId", Vi.getUnionId());
List<NutMap> list = memberCommonService.listMap(sql); List<NutMap> list = memberCommonService.listMap(sql);
@@ -217,6 +220,7 @@ public class ClubRegistApplyController {
@At @At
@POST @POST
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.clubRegistApply") @RequiresPermissions("sys.club.clubRegist.clubRegistApply")
public Object doEdit(@Param(value = "club", required = false) Sys_club club, public Object doEdit(@Param(value = "club", required = false) Sys_club club,
@Param(value = "isSave", required = false) Boolean isSave, @Param(value = "isSave", required = false) Boolean isSave,
@@ -9,12 +9,15 @@ import io.v.nutz.sys.constant.club.ClubRegistAuditState;
import io.v.nutz.sys.controllers.platform.sys.handler.ClubRegisterApplyToDoHandler; import io.v.nutz.sys.controllers.platform.sys.handler.ClubRegisterApplyToDoHandler;
import io.v.nutz.sys.models.Sys_club; import io.v.nutz.sys.models.Sys_club;
import io.v.nutz.sys.services.SysClubService; import io.v.nutz.sys.services.SysClubService;
import io.v.nutz.sys.services.SysLocalProcessService;
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;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
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.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.util.NutMap; import org.nutz.lang.util.NutMap;
@@ -34,11 +37,12 @@ import java.util.Date;
@Ok("json") @Ok("json")
public class ClubUnitPartAuditController { public class ClubUnitPartAuditController {
@Inject
private SysClubService sysClubService;
@Inject @Inject
private Dao dao; private Dao dao;
@Inject
private SysClubService sysClubService;
@Inject
private SysLocalProcessService localProcessService;
@At("") @At("")
@Ok("beetl:/platform/sys/club/regist/unitPartAudit.html") @Ok("beetl:/platform/sys/club/regist/unitPartAudit.html")
@@ -70,6 +74,7 @@ public class ClubUnitPartAuditController {
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.unitPartAudit") @RequiresPermissions("sys.club.clubRegist.unitPartAudit")
public Object doReview(Audit audit, String clubId, Integer pass) { public Object doReview(Audit audit, String clubId, Integer pass) {
audit.setAuditor(ShiroUtil.getPlatformUid()); audit.setAuditor(ShiroUtil.getPlatformUid());
@@ -100,9 +105,14 @@ public class ClubUnitPartAuditController {
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.unitPartAudit") @RequiresPermissions("sys.club.clubRegist.unitPartAudit")
public Object rollback(String id) { public Object rollback(String id) {
dao.update(Sys_club.class, Chain.make("state", ClubRegistAuditState.UNIT_PART_READY), Cnd.where("id", "=", id)); Sys_club club = dao.fetch(Sys_club.class, id);
dao.clear(Audit.class, Cnd.where("id", "=", club.getUnitPartAuditId()));
dao.update(Sys_club.class, Chain.make("state", ClubRegistAuditState.UNIT_PART_READY)
.add("unitPartAuditId", null), Cnd.where("id", "=", id));
localProcessService.revokeTask("CLUB_APPLY@" + id, "分工会审核");
return null; return null;
} }
} }
@@ -9,12 +9,15 @@ import io.v.nutz.sys.constant.club.ClubRegistAuditState;
import io.v.nutz.sys.controllers.platform.sys.handler.ClubRegisterApplyToDoHandler; import io.v.nutz.sys.controllers.platform.sys.handler.ClubRegisterApplyToDoHandler;
import io.v.nutz.sys.models.Sys_club; import io.v.nutz.sys.models.Sys_club;
import io.v.nutz.sys.services.SysClubService; import io.v.nutz.sys.services.SysClubService;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
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.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.util.NutMap; import org.nutz.lang.util.NutMap;
@@ -34,11 +37,13 @@ import java.util.Date;
@Ok("json") @Ok("json")
public class ClubXTAuditController { public class ClubXTAuditController {
@Inject
private SysClubService sysClubService;
@Inject @Inject
private Dao dao; private Dao dao;
@Inject
private SysClubService sysClubService;
@Inject
private SysLocalProcessService localProcessService;
@At("") @At("")
@Ok("beetl:/platform/sys/club/regist/xtAudit.html") @Ok("beetl:/platform/sys/club/regist/xtAudit.html")
@@ -67,6 +72,7 @@ public class ClubXTAuditController {
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.xtAudit") @RequiresPermissions("sys.club.clubRegist.xtAudit")
public Object doReview(Audit audit, String clubId, Integer pass, @Param("..")Sys_club sys_club) { public Object doReview(Audit audit, String clubId, Integer pass, @Param("..")Sys_club sys_club) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString()); audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
@@ -84,7 +90,7 @@ public class ClubXTAuditController {
} else if (pass == 2) { } else if (pass == 2) {
club.setState(ClubRegistAuditState.XT_BACK_MODIFY); club.setState(ClubRegistAuditState.XT_BACK_MODIFY);
//退回修改 //退回修改
ClubRegisterApplyToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(club, NutMap.NEW().addv("nodeName","校办公室主管退回修改")); ClubRegisterApplyToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(club, NutMap.NEW().addv("nodeName","工会办公室主管退回修改"));
} else { } else {
club.setState(ClubRegistAuditState.XGH_READY); club.setState(ClubRegistAuditState.XGH_READY);
//校工会审核 //校工会审核
@@ -98,9 +104,15 @@ public class ClubXTAuditController {
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.xtAudit") @RequiresPermissions("sys.club.clubRegist.xtAudit")
public Object rollback(String id) { public Object rollback(String id) {
dao.update(Sys_club.class, Chain.make("state", ClubRegistAuditState.XT_READY).add("schoolReplyFile", null), Cnd.where("id", "=", id)); Sys_club club = dao.fetch(Sys_club.class, id);
dao.clear(Audit.class, Cnd.where("id", "=", club.getXtAuditId()));
dao.update(Sys_club.class, Chain.make("state", ClubRegistAuditState.XT_READY)
.add("schoolReplyFile", null).add("xtAuditId", null)
, Cnd.where("id", "=", id));
localProcessService.revokeTask("CLUB_APPLY@" + id, "校工会办公室主管审核");
return null; return null;
} }
} }
@@ -12,14 +12,17 @@ import io.v.nutz.sys.constant.club.ClubRegistAuditState;
import io.v.nutz.sys.controllers.platform.sys.handler.ClubRegisterApplyToDoHandler; import io.v.nutz.sys.controllers.platform.sys.handler.ClubRegisterApplyToDoHandler;
import io.v.nutz.sys.models.*; import io.v.nutz.sys.models.*;
import io.v.nutz.sys.services.SysClubService; import io.v.nutz.sys.services.SysClubService;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.sys.services.SysRoleService; import io.v.nutz.sys.services.SysRoleService;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
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.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.Lang;
@@ -52,6 +55,8 @@ public class ClubXghReplyController {
private Dao dao; private Dao dao;
@Inject @Inject
private MsgApi msgApi; private MsgApi msgApi;
@Inject
private SysLocalProcessService localProcessService;
@At("") @At("")
@Ok("beetl:/platform/sys/club/regist/xghReply.html") @Ok("beetl:/platform/sys/club/regist/xghReply.html")
@@ -80,6 +85,7 @@ public class ClubXghReplyController {
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.xghReply") @RequiresPermissions("sys.club.clubRegist.xghReply")
public Object doReview(Audit audit, String clubId, Integer pass, @Param("..")Sys_club sys_club) { public Object doReview(Audit audit, String clubId, Integer pass, @Param("..")Sys_club sys_club) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString()); audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
@@ -89,7 +95,7 @@ public class ClubXghReplyController {
audit = dao.insert(audit); audit = dao.insert(audit);
Sys_club club = dao.fetch(Sys_club.class, clubId); Sys_club club = dao.fetch(Sys_club.class, clubId);
ClubRegisterApplyToDoHandler.COMPLETE_PROCESS.exec(club, NutMap.NEW().addv("nodeName", "校工会完成审核")); ClubRegisterApplyToDoHandler.COMPLETE_PROCESS.exec(club, NutMap.NEW().addv("nodeName", "校工会批复完成"));
if (pass == 1) { if (pass == 1) {
club.setState(ClubRegistAuditState.XGH_REJECTED); club.setState(ClubRegistAuditState.XGH_REJECTED);
dao.clear(Sys_user_role.class, Cnd.where("stid", "=", clubId) dao.clear(Sys_user_role.class, Cnd.where("stid", "=", clubId)
@@ -104,6 +110,7 @@ public class ClubXghReplyController {
} else { } else {
club.setState(ClubRegistAuditState.SCHOOL_PASS); club.setState(ClubRegistAuditState.SCHOOL_PASS);
//审核通过 //审核通过
ClubRegisterApplyToDoHandler.COMPLETE_SCHOOL_TASK.exec(club, null);
ClubRegisterApplyToDoHandler.COMPLETE_PROCESS.exec(club, null); ClubRegisterApplyToDoHandler.COMPLETE_PROCESS.exec(club, null);
//审核通过加角色 //审核通过加角色
List<Sys_user_role> userRoles = new ArrayList<>(); List<Sys_user_role> userRoles = new ArrayList<>();
@@ -126,8 +133,7 @@ public class ClubXghReplyController {
if(sysClubUser != null) { if(sysClubUser != null) {
Sys_user sysUser = dao.fetch(Sys_user.class, sysClubUser.getUserid()); Sys_user sysUser = dao.fetch(Sys_user.class, sysClubUser.getUserid());
String content = "%s老师您好,您申请注册的%s已经审核通过。".formatted(sysUser.getUsername(), club.getName()); String content = "%s老师您好,您申请注册的%s已经审核通过。".formatted(sysUser.getUsername(), club.getName());
String link = ""; msgApi.sendMsg(List.of("DingTalk"), sysUser.getLoginname(), 1, "协会注册", content, "", "");
msgApi.sendMsg(List.of("DingTalk"), sysUser.getLoginname(), 2, "协会注册", content, "", link);
} }
} }
club.setXghAuditId(audit.getId()); club.setXghAuditId(audit.getId());
@@ -137,20 +143,21 @@ public class ClubXghReplyController {
@At @At
@ViReturn @ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.xghReply") @RequiresPermissions("sys.club.clubRegist.xghReply")
public Object rollback(String id) { public Object rollback(String id) {
Sys_club club = dao.fetch(Sys_club.class, id);
dao.clear(Audit.class, Cnd.where("id", "=", club.getXghAuditId()));
dao.update(Sys_club.class, Chain.make("state", ClubRegistAuditState.XGH_READY) dao.update(Sys_club.class, Chain.make("state", ClubRegistAuditState.XGH_READY)
.add("foundTime", null) .add("foundTime", null).add("xghAuditId", null)
, Cnd.where("id", "=", id)); , Cnd.where("id", "=", id));
//删除对应角色 //删除对应角色
List<Sys_club_user> sysClubUsers = dao.query(Sys_club_user.class,
Cnd.where("clubid", "=", id).and("sf", "!=", 2));
sysClubUsers.forEach(item -> {
dao.clear(Sys_user_role.class, Cnd.where("stid", "=", id) dao.clear(Sys_user_role.class, Cnd.where("stid", "=", id)
.and("roleid", "=", getRoleId(item.getSf()))); .and("roleid", "in", List.of(Roles.club01, Roles.club02, Roles.club03, Roles.club04)));
});
sysUserService.clearCache(); sysUserService.clearCache();
sysRoleService.clearCache(); sysRoleService.clearCache();
localProcessService.revokeTask("CLUB_APPLY@" + id, "校工会批复");
return null; return null;
} }
@@ -142,8 +142,23 @@ public enum ClubRegisterApplyToDoHandler {
@Override @Override
public void exec(Sys_club club, NutMap extra) { public void exec(Sys_club club, NutMap extra) {
// 获取校工会办公室主任xcywt // 获取校工会办公室主任xcywt
Sys_role sysRole = sysRoleService.getByCode("xcywt"); // Sys_role sysRole = sysRoleService.getByCode("xcywt");
List<String> assignments = sysUserRoleService.queryRoleUserLogin(sysRole.getId()); // List<String> assignments = sysUserRoleService.queryRoleUserLogin(sysRole.getId());
Sql sql = Sqls.create("""
SELECT
u.loginname
FROM
sys_user_role userRole
LEFT JOIN sys_role role ON userRole.roleId = role.id
LEFT JOIN sys_user u ON u.id = userRole.userId
where role.`code` = 'xcywt'
GROUP BY
u.id
""");
sql.setCallback(Sqls.callback.strList());
dao.execute(sql);
List<String> assignments = sql.getList(String.class);
localProcessService.createTask( localProcessService.createTask(
"CLUB_APPLY@" + club.getId(), "CLUB_APPLY@" + club.getId(),
"CLUB_APPLY_TX_SCHOOL_AUDIT", "CLUB_APPLY_TX_SCHOOL_AUDIT",
@@ -183,9 +198,25 @@ public enum ClubRegisterApplyToDoHandler {
CREATE_SCHOOL_TASK() { CREATE_SCHOOL_TASK() {
@Override @Override
public void exec(Sys_club club, NutMap extra) { public void exec(Sys_club club, NutMap extra) {
// 获取校工会会员管理员 // 获取校协会管理员
Sys_role sysRole = sysRoleService.getByCode("xxhgly"); // Sys_role sysRole = sysRoleService.getByCode("xxhgly");
List<String> assignments = sysUserRoleService.queryRoleUserLogin(sysRole.getId()); // List<String> assignments = sysUserRoleService.queryRoleUserLogin(sysRole.getId());
Sql sql = Sqls.create("""
SELECT
u.loginname
FROM
sys_user_role userRole
LEFT JOIN sys_role role ON userRole.roleId = role.id
LEFT JOIN sys_user u ON u.id = userRole.userId
where role.`code` = 'xxhgly'
GROUP BY
u.id
""");
sql.setCallback(Sqls.callback.strList());
dao.execute(sql);
List<String> assignments = sql.getList(String.class);
localProcessService.createTask( localProcessService.createTask(
"CLUB_APPLY@" + club.getId(), "CLUB_APPLY@" + club.getId(),
"CLUB_APPLY_SCHOOL_AUDIT", "CLUB_APPLY_SCHOOL_AUDIT",
@@ -219,47 +250,6 @@ public enum ClubRegisterApplyToDoHandler {
} }
}, },
/**
* 创建协会确认任务
*/
CREATE_CLUB_CONFIRM_TASK() {
@Override
public void exec(Sys_club club, NutMap extra) {
// 获取校工会会员管理员
List<String> schoolLeaderLoginNames = memberService.getSchoolOrBranchUnionMemberAdminLoginNames("school", ShiroUtil.getUserId());
localProcessService.createTask(
"CLUB_APPLY@" + club.getId(),
"CLUB_APPLY_CONFIRM_AUDIT",
"协会确认",
ShiroUtil.getUserId(),
schoolLeaderLoginNames,
"/platform/sys/club/clubConfirm",
"/platform/sys/club/clubConfirm",
"/platform/sys/club/clubConfirm",
"/platform/sys/club/clubConfirm"
);
localProcessService.updateProcessNodeName("CLUB_APPLY@" + club.getId(), "协会确认");
}
},
/**
* 协会确认完成
*/
COMPLETE_CLUB_CONFIRM_TASK() {
@Override
public void exec(Sys_club club, NutMap extra) {
String nodeName = extra.getString("nodeName");
localProcessService.completeTask(
"CLUB_APPLY_CONFIRM_AUDIT",
"CLUB_APPLY@" + club.getId(),
ShiroUtil.getUserId(),
nodeName
);
localProcessService.updateProcessNodeName("CLUB_APPLY@" + club.getId(), nodeName);
}
},
/** /**
* 审核拒绝 * 审核拒绝
*/ */
@@ -279,6 +269,16 @@ public enum ClubRegisterApplyToDoHandler {
localProcessService.completeProcess("CLUB_APPLY@" + club.getId()); localProcessService.completeProcess("CLUB_APPLY@" + club.getId());
localProcessService.updateProcessNodeName("CLUB_APPLY@" + club.getId(), "审核通过"); localProcessService.updateProcessNodeName("CLUB_APPLY@" + club.getId(), "审核通过");
} }
},
/**
* 删除流程
*/
DELETE_PROCESS() {
@Override
public void exec(Sys_club club, NutMap extra) {
localProcessService.deleteProcessInstance("CLUB_APPLY@" + club.getId());
}
}; };
@@ -1,5 +1,6 @@
package io.v.nutz.task.job.sourcechange; package io.v.nutz.task.job.sourcechange;
import cn.hutool.core.date.DateUtil;
import io.v.nutz.base.utils.MsgApi; import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.zhgh.staffmanage.member.constant.MemberChangeType; import io.v.nutz.zhgh.staffmanage.member.constant.MemberChangeType;
import io.v.nutz.zhgh.staffmanage.sourcechange.model.SourceChangeMiddleTable; import io.v.nutz.zhgh.staffmanage.sourcechange.model.SourceChangeMiddleTable;
@@ -15,6 +16,7 @@ import org.quartz.JobExecutionException;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@IocBean @IocBean
public class SourceChangeJob implements Job { public class SourceChangeJob implements Job {
@@ -25,52 +27,34 @@ public class SourceChangeJob implements Job {
@Override @Override
public void execute(JobExecutionContext context) throws JobExecutionException { public void execute(JobExecutionContext context) throws JobExecutionException {
// 获取当前日期 // 今天的日期,yyyy-MM-dd格式
LocalDate currentDate = LocalDate.now(); String today = DateUtil.today();
// 查询出今天的变更记录
List<SourceChangeMiddleTable> list = dao.query(SourceChangeMiddleTable.class,
Cnd.where("DATE_FORMAT(changeTime, '%Y-%m-%d')", "=", today));
// 抽出所有的变更类型
List<String> changeTypeList = list.stream().map(SourceChangeMiddleTable::getChangeTypes).flatMap(List::stream).toList();
// 各类型的对应list,例如 NEW -> List<NEW>
Map<String, List<String>> collect = changeTypeList.stream().collect(Collectors.groupingBy(item -> item));
// 定义日期格式 // 获取变更的枚举
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); Map<String, String> map = Arrays.stream(MemberChangeType.values())
.collect(Collectors.toMap(MemberChangeType::getType, MemberChangeType::getChangeTypeName));
// 格式化日期 // 更新的变更类型的人数
String formattedDate = currentDate.format(formatter); List<NutMap> updateDataList = new ArrayList<>();
collect.forEach((key, value) -> {
List<SourceChangeMiddleTable> list = dao.query(SourceChangeMiddleTable.class, Cnd.NEW().and("changeTime", "like", formattedDate)); if (map.containsKey(key)) {
updateDataList.add(NutMap.NEW().addv("changeType", map.get(key)).addv("count", value.size()));
// 统计各类型人数
Map<MemberChangeType, Integer> countMap = new HashMap<>();
for (MemberChangeType type : MemberChangeType.values()) {
countMap.put(type, 0);
}
for (SourceChangeMiddleTable item : list) {
for (MemberChangeType type : MemberChangeType.values()) {
if (item.getChangeTypes().contains(type.getType())) {
countMap.put(type, countMap.get(type) + 1);
}
}
} }
});
StringBuffer msg = new StringBuffer(); // 收集成发送短信内容
msg.append("日期:"+formattedDate); String updateDataStr = updateDataList.stream().map(v -> {
appendIfPositive(msg, "新入职", countMap.get(MemberChangeType.NEW)); return v.getString("changeType") + "" + v.getInt("count") + "";
appendIfPositive(msg, "在职", countMap.get(MemberChangeType.WORK)); }).collect(Collectors.joining(","));
appendIfPositive(msg, "离校", countMap.get(MemberChangeType.LEAVE_SCHOOL)); String content = "智慧工会" + today + "数据更新汇总:" + updateDataStr;
appendIfPositive(msg, "退休", countMap.get(MemberChangeType.RETIRE));
appendIfPositive(msg, "辞职", countMap.get(MemberChangeType.RESIGN));
appendIfPositive(msg, "调出", countMap.get(MemberChangeType.OUT));
appendIfPositive(msg, "离职", countMap.get(MemberChangeType.LEAVE_OFFICE));
appendIfPositive(msg, "其它", countMap.get(MemberChangeType.OTHER));
appendIfPositive(msg, "单位异动", countMap.get(MemberChangeType.UNIT_CHANGE));
appendIfPositive(msg, "基本信息异动", countMap.get(MemberChangeType.BASIC_CHANGE));
List<String> channels=new ArrayList<>(); msgApi.sendMsg(List.of("DingTalk"), "2004000022", 1, "数据更新汇总", content, "", "");
channels.add("DingTalk");
//msgApi.sendMsg(channels, "", 1,"0",msg.toString(),null,null);
}
private void appendIfPositive(StringBuffer msg, String label, Integer count) {
if (count > 0) {
msg.append("" + label + "" + count + "");
}
} }
} }
@@ -135,8 +135,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());
@@ -149,15 +147,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<>();
@@ -252,9 +244,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,6 +122,7 @@ 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);
// 短信通知 // 短信通知
@@ -122,7 +131,8 @@ public class MemberApplySchoolUnionAuditController {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
u.loginname, u.loginname,
u.username u.username,
u.unionname
FROM FROM
`sys_user_role` userRole `sys_user_role` userRole
LEFT JOIN sys_role role ON role.id = userRole.roleId LEFT JOIN sys_role role ON role.id = userRole.roleId
@@ -133,20 +143,29 @@ public class MemberApplySchoolUnionAuditController {
""").setParam("unionId", unionId); """).setParam("unionId", unionId);
List<NutMap> list = memberCommonService.listMap(sql); List<NutMap> list = memberCommonService.listMap(sql);
if (Lang.isNotEmpty(list)) {
List<String> unionLeaderLoginNames = list.stream().map(v -> v.getString("loginname")).toList(); List<String> unionLeaderLoginNames = list.stream().map(v -> v.getString("loginname")).toList();
MemberApplyToDoHandler.CREATE_UNION_TASK.exec(record, NutMap.NEW().addv("unionLeaderLoginNames", unionLeaderLoginNames)); MemberApplyToDoHandler.CREATE_UNION_TASK.exec(record, NutMap.NEW().addv("unionLeaderLoginNames", unionLeaderLoginNames));
// 获取审核人的工会
NutMap nutMap = list.stream().findFirst().orElse(NutMap.NEW());
String unionname = nutMap.getString("unionname");
// 短信通知 // 短信通知
// for (NutMap map : list) { String linkUrl = Globals.AppDomain + "/platform/member/apply/branchUnion/audit/h5";
// String content = "%s老师您好,%s老师的入会申请校工会已通过,现将工会关系划入本工会,请您点击此消息或前往智慧工会进行接收" for (NutMap map : list) {
// .formatted(map.getString("username"), record.getUsername()); 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;
} }
@@ -24,5 +24,5 @@ public interface SourceChangeManageService extends BaseService<SourceChangeMiddl
/** /**
* 发送消息给新入职的老师,提醒可以入会 * 发送消息给新入职的老师,提醒可以入会
*/ */
void sendMsgToNewTeacher(Date date); void sendMsgToNewTeacher(SourceChangeMiddleTable middleTable);
} }
@@ -69,11 +69,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,16 +89,13 @@ 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())
@@ -115,9 +111,8 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
changeTypes.add(MemberChangeType.WITHDRAWAL.getType()); 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 +123,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,14 +216,18 @@ 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(""));
history.setChangeInfosStr(changeInfos); if (isNewTeacher) {
changeInfos = changeInfos + ";新入职";
} }
history.setChangeInfosStr(changeInfos);
} else if (Lang.isEmpty(changeList) && isNewTeacher){
history.setChangeInfosStr("新入职");
}
history.setChangeTypes(changeTypes); history.setChangeTypes(changeTypes);
dao().insert(history); dao().insert(history);
@@ -238,20 +236,14 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
sysUserService.clearCache(); sysUserService.clearCache();
sysRoleService.clearCache(); sysRoleService.clearCache();
} }
sendMsgToNewTeacher(date);
} }
@Override @Override
public void sendMsgToNewTeacher(Date date) { public void sendMsgToNewTeacher(SourceChangeMiddleTable middleTable) {
List<UserHistory> historyList = dao().query(UserHistory.class, Cnd.where("changeTypes", "like", "%" + MemberChangeType.NEW.getType() + "%") String context = "尊敬的%s老师,欢迎您加入杭州医学院大家庭,请您点击此条信息或登录“智慧工会”平台申请成为杭医工会会员!"
.and("DATE_FORMAT(changeTime,'%Y-%m-%d %H:%i')", "=", DateUtil.format(date, "yyyy-MM-dd HH:mm"))); .formatted(middleTable.getUsername());
String link = Globals.AppDomain + "/platform/member/apply/submit/h5";
// for (UserHistory history : historyList) { msgApi.sendMsg(List.of("DingTalk"), middleTable.getLoginname(), 2, "入会邀请", context, "", link);
// 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);
// }
} }
} }
@@ -9,7 +9,7 @@
<script src="/assets/platform/plugins/jquery/jquery-1.11.1.min.js"></script> <script src="/assets/platform/plugins/jquery/jquery-1.11.1.min.js"></script>
<script> <script>
const {$, BtnMenu, DropListMenu, PanelMenu, DropList, Panel, Tooltip} = wangEditor const { $, BtnMenu, DropListMenu, PanelMenu, DropList, Panel, Tooltip } = wangEditor
class AlertMenu extends BtnMenu { class AlertMenu extends BtnMenu {
constructor(editor) { constructor(editor) {
@@ -23,22 +23,22 @@ class AlertMenu extends BtnMenu {
clickHandler() { clickHandler() {
const _this = this const _this = this
const inputFileElement = document.querySelector('#'+this.editor.textElemId).parentElement.parentElement.nextElementSibling const inputFileElement = document.querySelector("#" + this.editor.textElemId).parentElement.parentElement.nextElementSibling
inputFileElement.click() inputFileElement.click()
inputFileElement.addEventListener('change', function () { inputFileElement.addEventListener("change", function() {
const loading = ELEMENT.Loading.service({ const loading = ELEMENT.Loading.service({
lock: true, lock: true,
text: '解析中', text: "解析中",
spinner: 'el-icon-loading', spinner: "el-icon-loading",
background: 'rgba(0, 0, 0, 0.7)' background: "rgba(0, 0, 0, 0.7)"
}) })
const file = this.files[0]; const file = this.files[0]
const fileName = file.name const fileName = file.name
if (!fileName.toLowerCase().endsWith('.doc') && !fileName.toLowerCase().endsWith('.docx')) { if (!fileName.toLowerCase().endsWith(".doc") && !fileName.toLowerCase().endsWith(".docx")) {
alert('请上传doc或者docx的文件') alert("请上传doc或者docx的文件")
_this.clearInputFile() _this.clearInputFile()
loading.close() loading.close()
return return
@@ -46,27 +46,27 @@ class AlertMenu extends BtnMenu {
const formData = new FormData() const formData = new FormData()
formData.append('file', file, file.name) formData.append("file", file, file.name)
axios.post('/file_server/word2Html', formData, {}).then(response => { axios.post("/file_server/word2Html", formData, {}).then(response => {
console.log(response.data) console.log(response.data)
loading.close() loading.close()
if (response.data.code === 0) { if (response.data.code === 0) {
_this.editor.txt.html(response.data.data) _this.editor.txt.html(response.data.data)
} else { } else {
alert(response.data.msg + ',上传word失败,请联系管理员!') alert(response.data.msg + ",上传word失败,请联系管理员!")
_this.clearInputFile() _this.clearInputFile()
} }
}).catch(error => { }).catch(error => {
loading.close() loading.close()
console.log(error) console.log(error)
_this.clearInputFile() _this.clearInputFile()
alert('上传word失败,请联系管理员!') alert("上传word失败,请联系管理员!")
}); })
}); })
} }
clearInputFile() { clearInputFile() {
const obj = document.getElementById('fileInput'); const obj = document.getElementById("fileInput")
obj.outerHTML = obj.outerHTML obj.outerHTML = obj.outerHTML
} }
@@ -76,14 +76,14 @@ class AlertMenu extends BtnMenu {
} }
wangEditor.registerMenu('alertMenuKey', AlertMenu) wangEditor.registerMenu("alertMenuKey", AlertMenu)
module.exports = { module.exports = {
name: "textEditor", name: "textEditor",
props: { props: {
// 定义值属性,用于接收父组件传递的值 // 定义值属性,用于接收父组件传递的值
value: { value: {
type: String, type: String,
default: '' default: ""
}, },
height: { height: {
type: Number, type: Number,
@@ -91,36 +91,36 @@ module.exports = {
}, },
placeholder: { placeholder: {
type: String, type: String,
default: '请输入正文' default: "请输入正文"
}, },
menus: { menus: {
type: Array, type: Array,
default: () => { default: () => {
return [ return [
'head',//标题 "head",//标题
'bold',//加粗 "bold",//加粗
'fontSize',//字号 "fontSize",//字号
'fontName',//字体 "fontName",//字体
'italic',//斜体 "italic",//斜体
'underline',//下划线 "underline",//下划线
'strikeThrough',//删除线 "strikeThrough",//删除线
'indent',//缩进 "indent",//缩进
'lineHeight',//行高 "lineHeight",//行高
'foreColor',//文字颜色 "foreColor",//文字颜色
'backColor',//背景颜色 "backColor",//背景颜色
//'link',//链接 //'link',//链接
'list',//序列 "list",//序列
'todo',//待办 "todo",//待办
'justify',//对齐 "justify",//对齐
'quote',//引用 "quote",//引用
// 'emoticon',//表情 // 'emoticon',//表情
'image', "image",
//'video', //'video',
'table', "table",
//'code', //'code',
'splitLine',//分割线 "splitLine",//分割线
'undo', "undo",
'redo', "redo"
] ]
} }
} }
@@ -136,7 +136,7 @@ module.exports = {
watch: { watch: {
value: { value: {
handler: function (newValue) { handler: function(newValue) {
this.$nextTick(() => { this.$nextTick(() => {
if (newValue !== this.editor.txt.html()) { if (newValue !== this.editor.txt.html()) {
this.editor.txt.html(newValue) this.editor.txt.html(newValue)
@@ -154,6 +154,7 @@ module.exports = {
let _this = this let _this = this
this.editor = new wangEditor(this.$refs.editorDom) this.editor = new wangEditor(this.$refs.editorDom)
this.editor.config.focus = false this.editor.config.focus = false
this.editor.config.uploadImgMaxSize = 10 * 1024 * 1024
//内容change回调 //内容change回调
this.editor.config.onchange = (newHtml) => { this.editor.config.onchange = (newHtml) => {
@@ -164,7 +165,7 @@ module.exports = {
} }
//配置图片上传 //配置图片上传
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) { this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
// resultFiles 是 input 中选中的文件列表 // resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法 // insertImgFn 是获取图片 url 后,插入到编辑器的方法
@@ -173,7 +174,7 @@ module.exports = {
if (v.code === 0) { if (v.code === 0) {
insertImgFn(APP_DOMAIN + CREATE_PREVIEW_URL(v.data.filepath)) insertImgFn(APP_DOMAIN + CREATE_PREVIEW_URL(v.data.filepath))
} else { } else {
ELEMENT.message.warning('图片上传失败') ELEMENT.message.warning("图片上传失败")
} }
}) })
}) })
@@ -192,10 +193,10 @@ module.exports = {
const children = this.editor.$textElem.children() const children = this.editor.$textElem.children()
for (let i = 0; i < children.elems.length; i++) { for (let i = 0; i < children.elems.length; i++) {
const node = children.elems[i] const node = children.elems[i]
if (node && node.nodeType === Node.TEXT_NODE && node.textContent.trim().length !== '') { if (node && node.nodeType === Node.TEXT_NODE && node.textContent.trim().length !== "") {
return false return false
} }
if (node && node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() === 'p' && node.innerText.trim() !== '') { if (node && node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() === "p" && node.innerText.trim() !== "") {
return false return false
} }
} }
@@ -204,11 +205,11 @@ module.exports = {
uploadFiles(resultFiles) { uploadFiles(resultFiles) {
return resultFiles.map(async file => { return resultFiles.map(async file => {
const formData = new FormData() const formData = new FormData()
formData.append('file', file, file.name) formData.append("file", file, file.name)
formData.append("folderPath", "/wangEditorImg/") formData.append("folderPath", "/wangEditorImg/")
return jQuery.ajax({ return jQuery.ajax({
url: '/file_server/uploadFile', url: "/file_server/uploadFile",
type: 'post', type: "post",
data: formData, data: formData,
processData: false, processData: false,
contentType: false contentType: false
@@ -81,8 +81,8 @@ module.exports = {
clearInterval(signatureInterval) clearInterval(signatureInterval)
const ts = new Date().getTime() + (Math.floor(Math.random() * (1000 - 1 + 1)) + 1).toString() const ts = new Date().getTime() + (Math.floor(Math.random() * (1000 - 1 + 1)) + 1).toString()
console.log(ts) console.log(ts)
// this.postAddress = location.protocol + '//' + location.host + '/signature?prefix=' + this.prefix + '&id=' + ts + "&is_value_base64=" + this.is_value_base64 this.postAddress = location.protocol + '//' + location.host + '/signature?prefix=' + this.prefix + '&id=' + ts + "&is_value_base64=" + this.is_value_base64
this.postAddress = 'https://zhgh.hmc.edu.cn/signature?prefix=' + this.prefix + '&id=' + ts + "&is_value_base64=" + this.is_value_base64 // this.postAddress = 'https://zhgh.hmc.edu.cn/signature?prefix=' + this.prefix + '&id=' + ts + "&is_value_base64=" + this.is_value_base64
this.showQrCode = true this.showQrCode = true
@@ -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="个人简历">
<template #label>
<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> <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" })
@@ -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(() => {
isSendMsg = false
this.doOperate(url, ids, isSendMsg)
}) })
loading.close()
if (resp.code === 0) {
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)