发短信

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 org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
@@ -80,6 +82,7 @@ public class ClubRegistApplyController {
@At
@POST
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.clubRegistApply")
public Object doAdd(@Param(value = "club", required = false) Sys_club club,
@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 `user` u ON u.id = userRole.userId
WHERE
role.`code` = 'BranchUnionMemberAdmin' and u.unionid = @unionId
role.`code` = 'H04' and u.unionid = @unionId
group by u.loginname
""").setParam("unionId", Vi.getUnionId());
List<NutMap> list = memberCommonService.listMap(sql);
@@ -217,6 +220,7 @@ public class ClubRegistApplyController {
@At
@POST
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.clubRegistApply")
public Object doEdit(@Param(value = "club", required = false) Sys_club club,
@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.models.Sys_club;
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.zhgh.staffmanage.member.handle.MemberApplyToDoHandler;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
@@ -34,11 +37,12 @@ import java.util.Date;
@Ok("json")
public class ClubUnitPartAuditController {
@Inject
private SysClubService sysClubService;
@Inject
private Dao dao;
@Inject
private SysClubService sysClubService;
@Inject
private SysLocalProcessService localProcessService;
@At("")
@Ok("beetl:/platform/sys/club/regist/unitPartAudit.html")
@@ -70,6 +74,7 @@ public class ClubUnitPartAuditController {
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.unitPartAudit")
public Object doReview(Audit audit, String clubId, Integer pass) {
audit.setAuditor(ShiroUtil.getPlatformUid());
@@ -100,9 +105,14 @@ public class ClubUnitPartAuditController {
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.unitPartAudit")
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;
}
}
@@ -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.models.Sys_club;
import io.v.nutz.sys.services.SysClubService;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
@@ -34,11 +37,13 @@ import java.util.Date;
@Ok("json")
public class ClubXTAuditController {
@Inject
private SysClubService sysClubService;
@Inject
private Dao dao;
@Inject
private SysClubService sysClubService;
@Inject
private SysLocalProcessService localProcessService;
@At("")
@Ok("beetl:/platform/sys/club/regist/xtAudit.html")
@@ -67,6 +72,7 @@ public class ClubXTAuditController {
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.xtAudit")
public Object doReview(Audit audit, String clubId, Integer pass, @Param("..")Sys_club sys_club) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
@@ -84,7 +90,7 @@ public class ClubXTAuditController {
} else if (pass == 2) {
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 {
club.setState(ClubRegistAuditState.XGH_READY);
//校工会审核
@@ -98,9 +104,15 @@ public class ClubXTAuditController {
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.xtAudit")
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;
}
}
@@ -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.models.*;
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.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
@@ -52,6 +55,8 @@ public class ClubXghReplyController {
private Dao dao;
@Inject
private MsgApi msgApi;
@Inject
private SysLocalProcessService localProcessService;
@At("")
@Ok("beetl:/platform/sys/club/regist/xghReply.html")
@@ -80,6 +85,7 @@ public class ClubXghReplyController {
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.xghReply")
public Object doReview(Audit audit, String clubId, Integer pass, @Param("..")Sys_club sys_club) {
audit.setAuditor(ShiroUtil.getPrincipalProperty("id").toString());
@@ -89,7 +95,7 @@ public class ClubXghReplyController {
audit = dao.insert(audit);
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) {
club.setState(ClubRegistAuditState.XGH_REJECTED);
dao.clear(Sys_user_role.class, Cnd.where("stid", "=", clubId)
@@ -104,6 +110,7 @@ public class ClubXghReplyController {
} else {
club.setState(ClubRegistAuditState.SCHOOL_PASS);
//审核通过
ClubRegisterApplyToDoHandler.COMPLETE_SCHOOL_TASK.exec(club, null);
ClubRegisterApplyToDoHandler.COMPLETE_PROCESS.exec(club, null);
//审核通过加角色
List<Sys_user_role> userRoles = new ArrayList<>();
@@ -126,8 +133,7 @@ public class ClubXghReplyController {
if(sysClubUser != null) {
Sys_user sysUser = dao.fetch(Sys_user.class, sysClubUser.getUserid());
String content = "%s老师您好,您申请注册的%s已经审核通过。".formatted(sysUser.getUsername(), club.getName());
String link = "";
msgApi.sendMsg(List.of("DingTalk"), sysUser.getLoginname(), 2, "协会注册", content, "", link);
msgApi.sendMsg(List.of("DingTalk"), sysUser.getLoginname(), 1, "协会注册", content, "", "");
}
}
club.setXghAuditId(audit.getId());
@@ -137,20 +143,21 @@ public class ClubXghReplyController {
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("sys.club.clubRegist.xghReply")
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)
.add("foundTime", null)
.add("foundTime", null).add("xghAuditId", null)
, 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)
.and("roleid", "=", getRoleId(item.getSf())));
});
dao.clear(Sys_user_role.class, Cnd.where("stid", "=", id)
.and("roleid", "in", List.of(Roles.club01, Roles.club02, Roles.club03, Roles.club04)));
sysUserService.clearCache();
sysRoleService.clearCache();
localProcessService.revokeTask("CLUB_APPLY@" + id, "校工会批复");
return null;
}
@@ -142,8 +142,23 @@ public enum ClubRegisterApplyToDoHandler {
@Override
public void exec(Sys_club club, NutMap extra) {
// 获取校工会办公室主任xcywt
Sys_role sysRole = sysRoleService.getByCode("xcywt");
List<String> assignments = sysUserRoleService.queryRoleUserLogin(sysRole.getId());
// Sys_role sysRole = sysRoleService.getByCode("xcywt");
// 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(
"CLUB_APPLY@" + club.getId(),
"CLUB_APPLY_TX_SCHOOL_AUDIT",
@@ -183,9 +198,25 @@ public enum ClubRegisterApplyToDoHandler {
CREATE_SCHOOL_TASK() {
@Override
public void exec(Sys_club club, NutMap extra) {
// 获取校工会会员管理员
Sys_role sysRole = sysRoleService.getByCode("xxhgly");
List<String> assignments = sysUserRoleService.queryRoleUserLogin(sysRole.getId());
// 获取校协会管理员
// Sys_role sysRole = sysRoleService.getByCode("xxhgly");
// 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(
"CLUB_APPLY@" + club.getId(),
"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.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;
import cn.hutool.core.date.DateUtil;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.zhgh.staffmanage.member.constant.MemberChangeType;
import io.v.nutz.zhgh.staffmanage.sourcechange.model.SourceChangeMiddleTable;
@@ -15,6 +16,7 @@ import org.quartz.JobExecutionException;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@IocBean
public class SourceChangeJob implements Job {
@@ -25,52 +27,34 @@ public class SourceChangeJob implements Job {
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 今天的日期,yyyy-MM-dd格式
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<SourceChangeMiddleTable> list = dao.query(SourceChangeMiddleTable.class, Cnd.NEW().and("changeTime", "like", formattedDate));
// 统计各类型人数
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);
}
// 更新的变更类型的人数
List<NutMap> updateDataList = new ArrayList<>();
collect.forEach((key, value) -> {
if (map.containsKey(key)) {
updateDataList.add(NutMap.NEW().addv("changeType", map.get(key)).addv("count", value.size()));
}
}
});
StringBuffer msg = new StringBuffer();
msg.append("日期:"+formattedDate);
appendIfPositive(msg, "新入职", countMap.get(MemberChangeType.NEW));
appendIfPositive(msg, "在职", countMap.get(MemberChangeType.WORK));
appendIfPositive(msg, "离校", countMap.get(MemberChangeType.LEAVE_SCHOOL));
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));
// 收集成发送短信内容
String updateDataStr = updateDataList.stream().map(v -> {
return v.getString("changeType") + "" + v.getInt("count") + "";
}).collect(Collectors.joining(","));
String content = "智慧工会" + today + "数据更新汇总:" + updateDataStr;
List<String> channels=new ArrayList<>();
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 + "");
}
msgApi.sendMsg(List.of("DingTalk"), "2004000022", 1, "数据更新汇总", content, "", "");
}
}
@@ -135,8 +135,6 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
List<Sys_user> needDoUpdateList = new CopyOnWriteArrayList<>();
// 新增的用户
List<Sys_user> needInitUserList = new CopyOnWriteArrayList<>();
// 添加角色的用户
List<Sys_user_role> userRoles = new CopyOnWriteArrayList<>();
// 人员更新配置的对象
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<Sys_dict> dictList = sysDictService.getSubListByCode("ALLOW_CHANGE_FIELDS");
Set<String> allowChangeFieldNames = dictList.stream().map(Sys_dict::getCode).collect(Collectors.toSet());
allowChangeFieldNames.add("member");
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", "单位");
NutMap map = memberCommonService.getDictAllowChangeFields();
Set<String> allowChangeFieldNames = map.getAs("allowChangeFieldNames", Set.class);
Map<String, String> dictMap = map.getAs("dictMap", Map.class);
// 添加会员角色
List<String> addMemberUserIds = new CopyOnWriteArrayList<>();
@@ -252,9 +244,13 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
//如果有新用户,增加到用户表同时增加角色
if (Lang.isNotEmpty(needInitUserList)) {
sysUserService.fastInsert(needInitUserList);
List<String> userIdList = userRoles.stream().map(Sys_user_role::getUserId).collect(Collectors.toList());
sysUserRoleService.dao().clear(Sys_user_role.class, Cnd.where("userId", "in", userIdList));
sysUserRoleService.insert(userRoles);
List<Sys_user_role> roleList = needInitUserList.stream().map(item -> {
Sys_user_role userRole = new Sys_user_role();
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 io.v.nutz.base.annontation.ViReturn;
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.sys.models.Sys_union;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.models.User;
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.utils.ShiroUtil;
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.Param;
import java.util.List;
/**
* @version 1.0
* @Author zzr
@@ -50,6 +55,10 @@ public class MemberApplyBranchUnionAuditController {
@Inject
private Dao dao;
@Inject
private MsgApi msgApi;
@Inject
private SysUserService sysUserService;
@Inject
private MemberCommonService memberCommonService;
@Inject
private SysLocalProcessService localProcessService;
@@ -124,13 +133,15 @@ public class MemberApplyBranchUnionAuditController {
record.setBranchUnionAuditId(audit.getId());
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) {
MemberApplyToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(record, null);
} else if (audit.getAuditType() == 1) {
MemberApplyToDoHandler.COMPLETE_PROCESS.exec(record, null);
// 判断是否改变了工会关系
User user = dao.fetch(User.class, Cnd.where("id", "=", record.getUserId()));
if (!ObjectUtil.equals(user.getUnionid(), record.getAllocationUnionId())) {
if (dao.count(SpecialStaff.class, Cnd.where("userId", "=", record.getUserId())) > 0) {
dao.clear(SpecialStaff.class, Cnd.where("userId", "=", record.getUserId()));
@@ -138,7 +149,6 @@ public class MemberApplyBranchUnionAuditController {
}
if (!ObjectUtil.equals(user.getUnionid(), record.getAllocationUnionId())) {
Sys_union union = dao.fetch(Sys_union.class, Cnd.where("id", "=", record.getAllocationUnionId()));
SpecialStaff staff = new SpecialStaff();
staff.setUserId(record.getUserId());
staff.setPersonnelRelationUnitId(user.getUnitid());
@@ -155,10 +165,23 @@ public class MemberApplyBranchUnionAuditController {
BeanUtil.copyProperties(record, sysUser);
sysUser.setId(user.getId());
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 {
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;
}
@@ -170,11 +193,11 @@ public class MemberApplyBranchUnionAuditController {
@SLog(type = "memberApply", tag = "会员入会申请", msg = "分工会撤回")
public Object doRevoke(String 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));
dao.clear(Audit.class, Cnd.where("id", "=", record.getBranchUnionAuditId()));
// 待办撤回
localProcessService.revokeTask("MEMBER_APPLY@" + id, "分工会审核");
localProcessService.revokeTask("MEMBER_APPLY@" + id, "分工会接收");
return null;
}
}
@@ -3,7 +3,10 @@ package io.v.nutz.zhgh.staffmanage.member.controller.apply;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
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.web.commons.base.Globals;
import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.staffmanage.member.constant.MemberChangeOrigin;
@@ -101,6 +104,12 @@ public class MemberApplyController {
@RequiresPermissions("member.apply.submit")
@SLog(tag = "会员入会申请", msg = "提交申请")
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.setUserId(ShiroUtil.getUserId());
record.setChangeOrigin(MemberChangeOrigin.PERSONAL.name());
@@ -119,11 +128,12 @@ public class MemberApplyController {
MemberApplyToDoHandler.CREATE_SCHOOL_TASK.exec(record, null);
// 短信通知
// List<String> schoolLoginNameList = commonService.getSchoolOrBranchUnionMemberAdminLoginNames("school", null);
// String schoolLoginNameListStr = schoolLoginNameList.stream().distinct().collect(Collectors.joining(","));
//
// String content = "%s老师正申请加入工会,请您点击此条消息或前往智慧工会进行审核";
// msgApi.sendMsg(List.of("DingTalk"), schoolLoginNameListStr, 2, "协会入会邀请", content, "", "");
List<String> schoolLoginNameList = commonService.getSchoolOrBranchUnionMemberAdminLoginNames("school", null);
String schoolLoginNameListStr = schoolLoginNameList.stream().distinct().collect(Collectors.joining(","));
String content = "%s老师正申请加入工会,请您点击此条消息或登录“智慧工会进行审核".formatted(record.getUsername());
String linkUrl = Globals.AppDomain + "/platform/member/apply/schoolUnion/audit/h5";
msgApi.sendMsg(List.of("DingTalk"), schoolLoginNameListStr, 2, "入会审核通知", content, "", linkUrl);
return null;
}
@@ -5,7 +5,9 @@ import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
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.web.commons.base.Globals;
import io.v.nutz.web.commons.slog.annotation.SLog;
import io.v.nutz.web.commons.utils.ShiroUtil;
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.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
@@ -47,20 +50,24 @@ public class MemberApplySchoolUnionAuditController {
private MemberCommonService memberCommonService;
@Inject
private SysLocalProcessService localProcessService;
@Inject
private MsgApi msgApi;
@At("/")
@Ok("beetl:/platform/member/apply/schoolUnionAudit/index.html")
@RequiresPermissions("member.apply.schoolUnion.audit")
public void index() {}
public void index() {
}
@At("/h5")
@Ok("beetl:/mobile/member/apply/schoolUnionAudit/index.html")
@RequiresPermissions("member.apply.schoolUnion.audit")
public void h5() {}
public void h5() {
}
@At
@RequiresPermissions("member.apply.schoolUnion.audit")
public Object pageData(MemberApplyPageForm pageForm){
public Object pageData(MemberApplyPageForm pageForm) {
Sql sql = Sqls.create("""
SELECT
record.*,
@@ -76,8 +83,9 @@ public class MemberApplySchoolUnionAuditController {
pageForm.buildSearch(cnd, "record.");
if (pageForm.getAudit()) {
cnd.and("record.applyStateId", ">", 20);
cnd.and("record.applyStateId", "!=", 70);
} else {
cnd.and("record.applyStateId", "=", 20);
cnd.and("record.applyStateId", "in", List.of(20, 70));
}
cnd.desc("record.applyDateTime");
sql.setCondition(cnd);
@@ -91,7 +99,7 @@ public class MemberApplySchoolUnionAuditController {
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("member.apply.schoolUnion.audit")
@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.setLoginname(ShiroUtil.getPlatformLoginname());
audit.setUsername(ShiroUtil.getPlatformUsername());
@@ -114,39 +122,50 @@ public class MemberApplySchoolUnionAuditController {
record.setSchoolUnionAuditId(audit.getId());
dao.updateIgnoreNull(record);
MemberApplyToDoHandler.COMPLETE_SCHOOL_TASK.exec(record, NutMap.NEW().addv("nodeName", "校工会审核完成"));
if (audit.getAuditType() == 2) {
MemberApplyToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(record, null);
// 短信通知
// String content = "%s老师您好,您的入会申请被校工会退回,您可根据退回原因修改后再次提交,如有疑问请及时联系校工会".formatted(record.getUsername());
} else if (audit.getAuditType() == 1) {
Sql sql = Sqls.create("""
SELECT
u.loginname,
u.username
FROM
`sys_user_role` userRole
LEFT JOIN sys_role role ON role.id = userRole.roleId
LEFT JOIN `user` u ON u.id = userRole.userId
WHERE
role.`code` = 'BranchUnionMemberAdmin' and u.unionid = @unionId
group by u.loginname
""").setParam("unionId", unionId);
SELECT
u.loginname,
u.username,
u.unionname
FROM
`sys_user_role` userRole
LEFT JOIN sys_role role ON role.id = userRole.roleId
LEFT JOIN `user` u ON u.id = userRole.userId
WHERE
role.`code` = 'BranchUnionMemberAdmin' and u.unionid = @unionId
group by u.loginname
""").setParam("unionId", unionId);
List<NutMap> list = memberCommonService.listMap(sql);
List<String> unionLeaderLoginNames = list.stream().map(v -> v.getString("loginname")).toList();
MemberApplyToDoHandler.CREATE_UNION_TASK.exec(record, NutMap.NEW().addv("unionLeaderLoginNames", unionLeaderLoginNames));
if (Lang.isNotEmpty(list)) {
List<String> unionLeaderLoginNames = list.stream().map(v -> v.getString("loginname")).toList();
MemberApplyToDoHandler.CREATE_UNION_TASK.exec(record, NutMap.NEW().addv("unionLeaderLoginNames", unionLeaderLoginNames));
// 短信通知
// for (NutMap map : list) {
// String content = "%s老师您好,%s老师的入会申请校工会已通过,现将工会关系划入本工会,请您点击此消息或前往智慧工会进行接收"
// .formatted(map.getString("username"), record.getUsername());
// }
// 获取审核人的工会
NutMap nutMap = list.stream().findFirst().orElse(NutMap.NEW());
String unionname = nutMap.getString("unionname");
// 短信通知
String linkUrl = Globals.AppDomain + "/platform/member/apply/branchUnion/audit/h5";
for (NutMap map : list) {
String content = "%s,%s老师的入会申请已经通过校工会审核,现将工会关系转入您处,请点击此消息或登录“智慧工会”办理新会员接收手续。"
.formatted(unionname, record.getUsername());
System.out.println(content);
msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 2, "会员入会审核通知", content, "", linkUrl);
}
}
} else {
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;
}
@@ -156,10 +175,11 @@ public class MemberApplySchoolUnionAuditController {
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("member.apply.schoolUnion.audit")
@SLog(type = "memberApply", tag = "会员入会申请", msg = "校工会撤回")
public Object doRevoke(String id){
public Object doRevoke(String id) {
MemberApplyRecord record = dao.fetch(MemberApplyRecord.class, id);
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()));
// 待办撤回
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 lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
@@ -74,7 +75,7 @@ public class MemberChangeManageController {
@At("")
@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() {
}
@@ -98,7 +99,7 @@ public class MemberChangeManageController {
@At
@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,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "threeUnitId", required = false) String threeUnitId,
@@ -277,7 +278,7 @@ public class MemberChangeManageController {
@At
@ViReturn
@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 = "分工会/校工会会员管理员提交变更")
public Object doSubmitChange(MemberChangeRecord record) {
// 检验是否有变更
@@ -341,7 +342,7 @@ public class MemberChangeManageController {
@At
@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) {
Sys_user user = userService.fetch(userid);
/*if (Strings.isNotBlank(user.getMobile())) {
@@ -357,7 +358,7 @@ public class MemberChangeManageController {
*/
@At
@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,
@Param(value = "startDate", required = false) String startDate,
@Param(value = "endDate", required = false) String endDate,
@@ -429,7 +430,7 @@ public class MemberChangeManageController {
*/
@At
@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) {
Sys_unit unit = memberService.dao().fetch(Sys_unit.class, unitId);
@@ -466,7 +467,7 @@ public class MemberChangeManageController {
@At
@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,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "unionId", required = false) String unionId,
@@ -505,7 +506,7 @@ public class MemberChangeManageController {
@At
@ViReturn
@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,
@Param(value = "threeUnitId", required = false) String threeUnitId,
@Param(value = "unitId", required = false) String unitId) {
@@ -548,7 +549,7 @@ public class MemberChangeManageController {
@At
@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() {
Cnd cnd = Cnd.NEW();
cnd.and("unitlevel", "=", 2);
@@ -560,7 +561,7 @@ public class MemberChangeManageController {
@At
@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) {
List<Sys_user> users = Json.fromJsonAsList(Sys_user.class, data);
for (Sys_user user : users) {
@@ -571,7 +572,7 @@ public class MemberChangeManageController {
@At
@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) {
List<Sys_user> users = Json.fromJsonAsList(Sys_user.class, data);
for (Sys_user user : users) {
@@ -583,7 +584,7 @@ public class MemberChangeManageController {
@At
@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) {
try {
ViTool.excelResponse(response, "会员导入模版.xlsx");
@@ -613,7 +614,7 @@ public class MemberChangeManageController {
@At
@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"})
@SLog(type = "会员管理系统", tag = "信息维护-会员高级管理", msg = "导入会员", param = true, result = true)
public Object doImport(TempFile file) {
@@ -727,7 +728,7 @@ public class MemberChangeManageController {
@At
@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){
List<NutMap> mapList = memberService.getAllChangeInfo(userId);
if (Lang.isEmpty(mapList)) {
@@ -196,6 +196,17 @@ public enum MemberApplyToDoHandler {
localProcessService.completeProcess("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("分配的工会关系")
@ColDefine(type = ColType.VARCHAR, width = 50)
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());
allowChangeFieldNames.add("member");
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", "单位");
return NutMap.NEW().addv("allowChangeFieldNames", allowChangeFieldNames).addv("dictMap", dictMap);
}
@@ -357,6 +355,8 @@ public class MemberCommonServiceImpl extends ViServiceImpl<Sys_user> implements
sysUserService.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 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)) {
String name = fieldsMap.getOrDefault(fieldName, 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.sys.models.User;
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.sourcechange.model.SourceChangeMiddleTable;
import io.v.nutz.zhgh.staffmanage.sourcechange.param.pageform.SourceChangePageForm;
@@ -145,8 +146,12 @@ public class SourceChangeManageController {
@ViReturn
@RequiresPermissions("sourcechange.manage")
@SLog(tag = "人员变更管理", msg = "手动提交变更")
public Object doSubmit(SourceChangeMiddleTable middleTable) {
public Object doSubmit(@Param("data") SourceChangeMiddleTable middleTable, @Param("isSendMsg") boolean isSendMsg) {
sourceChangeManageService.doSourceChange(middleTable);
// 如果是新入职需要发送邮件
if (isSendMsg && "新入职".equals(middleTable.getChangeInfosStr())) {
sourceChangeManageService.sendMsgToNewTeacher(middleTable);
}
return null;
}
@@ -155,13 +160,19 @@ public class SourceChangeManageController {
@ViReturn
@RequiresPermissions("sourcechange.manage")
@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)) {
return Result.error("未获取到选择数据");
}
List<SourceChangeMiddleTable> list = dao.query(SourceChangeMiddleTable.class, Cnd.where("id", "in", ids));
for (SourceChangeMiddleTable middleTable : list) {
sourceChangeManageService.doSourceChange(middleTable);
// 如果是新入职需要发送邮件
if (isSendMsg && "新入职".equals(middleTable.getChangeInfosStr())) {
sourceChangeManageService.sendMsgToNewTeacher(middleTable);
}
}
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) {
// 记录当前操作的时间用于后续区分短信通知
Date date = DateUtil.date();
// 是否新入职
boolean isNewTeacher = "新入职".equals(middleTable.getChangeInfosStr());
int count = dao().count(Sys_user.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
Sys_user info = new Sys_user();
User user = new User();
User user = dao().fetch(User.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
//获取可变更字段
NutMap map = commonService.getDictAllowChangeFields();
Set<String> allowChangeFieldNames = map.getAs("allowChangeFieldNames", Set.class);
@@ -90,34 +89,30 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
}
List<String> changeTypes = new ArrayList<>();
if (count <= 0) {
if (isNewTeacher) {
changeTypes.add(MemberChangeType.NEW.getType());
Sys_user sysUser = BeanUtil.copyProperties(middleTable, Sys_user.class);
dao().insert(sysUser);
user = dao().fetch(User.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
} else {
user = dao().fetch(User.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
}
if (Lang.isNotEmpty(changeList)) {
changeTypes.add(MemberChangeType.BASIC_CHANGE.getType());
}
if (!ObjectUtil.equals(user.getUserState(), middleTable.getUserState())) {
List<MemberChangeType> list = Arrays.stream(MemberChangeType.values())
.filter(v -> v.getChangeTypeName().equals(middleTable.getUserState())).toList();
if (Lang.isNotEmpty(list)) {
changeTypes.add(list.get(0).getType());
}
if (!ObjectUtil.equals(user.getUserState(), middleTable.getUserState())) {
List<MemberChangeType> list = Arrays.stream(MemberChangeType.values())
.filter(v -> v.getChangeTypeName().equals(middleTable.getUserState())).toList();
if (Lang.isNotEmpty(list)) {
changeTypes.add(list.get(0).getType());
}
if (!ObjectUtil.equals(user.getMember(), middleTable.getMember())){
if (middleTable.getMember() == 1) {
changeTypes.add(MemberChangeType.RESTORE.getType());
} else {
changeTypes.add(MemberChangeType.WITHDRAWAL.getType());
}
}
if (!ObjectUtil.equals(user.getMember(), middleTable.getMember())){
if (middleTable.getMember() == 1) {
changeTypes.add(MemberChangeType.RESTORE.getType());
} else {
changeTypes.add(MemberChangeType.WITHDRAWAL.getType());
}
}
info = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
Sys_user info = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
String userId = info.getId();
UserHistory history = new UserHistory();
if (Lang.isNotEmpty(changeList)) {
@@ -128,7 +123,6 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
history.setChangeTime(date);
history.setChangeOrigin(MemberChangeOrigin.HAND_MOVEMENT.name());
// 加入会员
if (middleTable.getMember() != null && middleTable.getMember() == 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);
history.setChangeInfos(changeList);
if (count <= 0) {
history.setChangeInfosStr("新入职");
} else {
if (Lang.isNotEmpty(changeList)) {
String changeInfos = changeList.stream().map(v -> {
return v.getString("fieldName") + "" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "->" + HtmlUtil.cleanHtmlTag(v.getString("newValue"));
}).collect(Collectors.joining(""));
if (isNewTeacher) {
changeInfos = changeInfos + ";新入职";
}
history.setChangeInfosStr(changeInfos);
} else if (Lang.isEmpty(changeList) && isNewTeacher){
history.setChangeInfosStr("新入职");
}
history.setChangeTypes(changeTypes);
dao().insert(history);
@@ -238,20 +236,14 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
sysUserService.clearCache();
sysRoleService.clearCache();
}
sendMsgToNewTeacher(date);
}
@Override
public void sendMsgToNewTeacher(Date date) {
List<UserHistory> historyList = dao().query(UserHistory.class, Cnd.where("changeTypes", "like", "%" + MemberChangeType.NEW.getType() + "%")
.and("DATE_FORMAT(changeTime,'%Y-%m-%d %H:%i')", "=", DateUtil.format(date, "yyyy-MM-dd HH:mm")));
// for (UserHistory history : historyList) {
// String context = "%s老师您好,欢迎加入杭医大家庭,诚挚邀请您成为工会会员,如有意愿,请您点击此条消息或前往智慧工会平台申请入会,如无意愿请忽略此消息提醒。".formatted(history.getUsername());
// String link = Globals.AppDomain + "/platform/member/apply/submit/h5";
// msgApi.sendMsg(List.of("DingTalk"), history.getLoginname(), 2, "入会邀请", context, "", link);
// }
public void sendMsgToNewTeacher(SourceChangeMiddleTable middleTable) {
String context = "尊敬的%s老师,欢迎您加入杭州医学院大家庭,请您点击此条信息或登录“智慧工会”平台申请成为杭医工会会员!"
.formatted(middleTable.getUsername());
String link = Globals.AppDomain + "/platform/member/apply/submit/h5";
msgApi.sendMsg(List.of("DingTalk"), middleTable.getLoginname(), 2, "入会邀请", context, "", link);
}
}
@@ -1,224 +1,225 @@
<template>
<div>
<div ref="editorDom"></div>
<input type="file" style="display: none;" />
</div>
<div>
<div ref="editorDom"></div>
<input type="file" style="display: none;" />
</div>
</template>
<script src="/assets/platform/plugins/jquery/jquery-1.11.1.min.js"></script>
<script>
const {$, BtnMenu, DropListMenu, PanelMenu, DropList, Panel, Tooltip} = wangEditor
const { $, BtnMenu, DropListMenu, PanelMenu, DropList, Panel, Tooltip } = wangEditor
class AlertMenu extends BtnMenu {
constructor(editor) {
const $elem = wangEditor.$(
`<div class="w-e-menu" data-title="上传word">
constructor(editor) {
const $elem = wangEditor.$(
`<div class="w-e-menu" data-title="上传word">
<i class="fa fa-file-word-o" aria-hidden="true" /></i>
</div>`
)
super($elem, editor)
}
)
super($elem, editor)
}
clickHandler() {
const _this = this
const inputFileElement = document.querySelector('#'+this.editor.textElemId).parentElement.parentElement.nextElementSibling
inputFileElement.click()
inputFileElement.addEventListener('change', function () {
const loading = ELEMENT.Loading.service({
lock: true,
text: '解析中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
clickHandler() {
const _this = this
const inputFileElement = document.querySelector("#" + this.editor.textElemId).parentElement.parentElement.nextElementSibling
inputFileElement.click()
inputFileElement.addEventListener("change", function() {
const loading = ELEMENT.Loading.service({
lock: true,
text: "解析中",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)"
})
})
const file = this.files[0];
const fileName = file.name
const file = this.files[0]
const fileName = file.name
if (!fileName.toLowerCase().endsWith('.doc') && !fileName.toLowerCase().endsWith('.docx')) {
alert('请上传doc或者docx的文件')
_this.clearInputFile()
loading.close()
return
}
if (!fileName.toLowerCase().endsWith(".doc") && !fileName.toLowerCase().endsWith(".docx")) {
alert("请上传doc或者docx的文件")
_this.clearInputFile()
loading.close()
return
}
const formData = new FormData()
formData.append('file', file, file.name)
axios.post('/file_server/word2Html', formData, {}).then(response => {
console.log(response.data)
loading.close()
if (response.data.code === 0) {
_this.editor.txt.html(response.data.data)
} else {
alert(response.data.msg + ',上传word失败,请联系管理员!')
_this.clearInputFile()
}
}).catch(error => {
loading.close()
console.log(error)
_this.clearInputFile()
alert('上传word失败,请联系管理员!')
});
});
}
const formData = new FormData()
formData.append("file", file, file.name)
axios.post("/file_server/word2Html", formData, {}).then(response => {
console.log(response.data)
loading.close()
if (response.data.code === 0) {
_this.editor.txt.html(response.data.data)
} else {
alert(response.data.msg + ",上传word失败,请联系管理员!")
_this.clearInputFile()
}
}).catch(error => {
loading.close()
console.log(error)
_this.clearInputFile()
alert("上传word失败,请联系管理员!")
})
})
}
clearInputFile() {
const obj = document.getElementById('fileInput');
obj.outerHTML = obj.outerHTML
}
clearInputFile() {
const obj = document.getElementById("fileInput")
obj.outerHTML = obj.outerHTML
}
tryChangeActive() {
this.active()
}
tryChangeActive() {
this.active()
}
}
wangEditor.registerMenu('alertMenuKey', AlertMenu)
wangEditor.registerMenu("alertMenuKey", AlertMenu)
module.exports = {
name: "textEditor",
props: {
//
value: {
type: String,
default: ''
},
height: {
type: Number,
default: 300
},
placeholder: {
type: String,
default: '请输入正文'
},
menus: {
type: Array,
default: () => {
return [
'head',//
'bold',//
'fontSize',//
'fontName',//
'italic',//
'underline',//线
'strikeThrough',//线
'indent',//
'lineHeight',//
'foreColor',//
'backColor',//
//'link',//
'list',//
'todo',//
'justify',//
'quote',//
// 'emoticon',//
'image',
//'video',
'table',
//'code',
'splitLine',//线
'undo',
'redo',
]
}
}
},
data() {
return {
editor: null
}
},
mounted() {
this.initEditor()
},
watch: {
value: {
handler: function (newValue) {
this.$nextTick(() => {
if (newValue !== this.editor.txt.html()) {
this.editor.txt.html(newValue)
} else {
// this.editor.selection.moveCursor(this.editor.$textElem.elems[0], 1)
}
})
},
immediate: true
}
},
methods: {
initEditor() {
let _this = this
this.editor = new wangEditor(this.$refs.editorDom)
this.editor.config.focus = false
//change
this.editor.config.onchange = (newHtml) => {
this.cursorPos = this.editor.selection.getCursorPos()
const range = this.editor.selection.getRange()
range.setStart(range.startContainer, Math.max(this.cursorPos, range.endOffset))
this.$emit("input", newHtml)
}
//
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
// resultFiles input
// insertImgFn url
Promise.all(_this.uploadFiles(resultFiles)).then(res => {
res.forEach(v => {
if (v.code === 0) {
insertImgFn(APP_DOMAIN + CREATE_PREVIEW_URL(v.data.filepath))
} else {
ELEMENT.message.warning('图片上传失败')
name: "textEditor",
props: {
//
value: {
type: String,
default: ""
},
height: {
type: Number,
default: 300
},
placeholder: {
type: String,
default: "请输入正文"
},
menus: {
type: Array,
default: () => {
return [
"head",//
"bold",//
"fontSize",//
"fontName",//
"italic",//
"underline",//线
"strikeThrough",//线
"indent",//
"lineHeight",//
"foreColor",//
"backColor",//
//'link',//
"list",//
"todo",//
"justify",//
"quote",//
// 'emoticon',//
"image",
//'video',
"table",
//'code',
"splitLine",//线
"undo",
"redo"
]
}
})
})
}
},
data() {
return {
editor: null
}
},
mounted() {
this.initEditor()
},
}
//
this.editor.config.pasteFilterStyle = false
//
this.editor.config.height = this.height
//
this.editor.config.menus = this.menus
this.editor.config.placeholder = this.placeholder
this.editor.create()
},
isEmptyEditor() {
const children = this.editor.$textElem.children()
for (let i = 0; i < children.elems.length; i++) {
const node = children.elems[i]
if (node && node.nodeType === Node.TEXT_NODE && node.textContent.trim().length !== '') {
return false
watch: {
value: {
handler: function(newValue) {
this.$nextTick(() => {
if (newValue !== this.editor.txt.html()) {
this.editor.txt.html(newValue)
} else {
// this.editor.selection.moveCursor(this.editor.$textElem.elems[0], 1)
}
})
},
immediate: true
}
if (node && node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() === 'p' && node.innerText.trim() !== '') {
return false
}
}
return true
},
uploadFiles(resultFiles) {
return resultFiles.map(async file => {
const formData = new FormData()
formData.append('file', file, file.name)
formData.append("folderPath", "/wangEditorImg/")
return jQuery.ajax({
url: '/file_server/uploadFile',
type: 'post',
data: formData,
processData: false,
contentType: false
})
})
methods: {
initEditor() {
let _this = this
this.editor = new wangEditor(this.$refs.editorDom)
this.editor.config.focus = false
this.editor.config.uploadImgMaxSize = 10 * 1024 * 1024
//change
this.editor.config.onchange = (newHtml) => {
this.cursorPos = this.editor.selection.getCursorPos()
const range = this.editor.selection.getRange()
range.setStart(range.startContainer, Math.max(this.cursorPos, range.endOffset))
this.$emit("input", newHtml)
}
//
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
// resultFiles input
// insertImgFn url
Promise.all(_this.uploadFiles(resultFiles)).then(res => {
res.forEach(v => {
if (v.code === 0) {
insertImgFn(APP_DOMAIN + CREATE_PREVIEW_URL(v.data.filepath))
} else {
ELEMENT.message.warning("图片上传失败")
}
})
})
}
//
this.editor.config.pasteFilterStyle = false
//
this.editor.config.height = this.height
//
this.editor.config.menus = this.menus
this.editor.config.placeholder = this.placeholder
this.editor.create()
},
isEmptyEditor() {
const children = this.editor.$textElem.children()
for (let i = 0; i < children.elems.length; i++) {
const node = children.elems[i]
if (node && node.nodeType === Node.TEXT_NODE && node.textContent.trim().length !== "") {
return false
}
if (node && node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() === "p" && node.innerText.trim() !== "") {
return false
}
}
return true
},
uploadFiles(resultFiles) {
return resultFiles.map(async file => {
const formData = new FormData()
formData.append("file", file, file.name)
formData.append("folderPath", "/wangEditorImg/")
return jQuery.ajax({
url: "/file_server/uploadFile",
type: "post",
data: formData,
processData: false,
contentType: false
})
})
}
},
created() {
}
},
created() {
}
}
</script>
@@ -81,8 +81,8 @@ module.exports = {
clearInterval(signatureInterval)
const ts = new Date().getTime() + (Math.floor(Math.random() * (1000 - 1 + 1)) + 1).toString()
console.log(ts)
// 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 = 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.showQrCode = true
@@ -149,11 +149,13 @@ layout("/mobile/platform.html"){
<van-form>
<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="审核意见" 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>
<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="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="primary" block @click.submit="doApproval(1)">同意接收</van-button>
</div>
@@ -234,7 +236,7 @@ layout("/mobile/platform.html"){
}
let msg = '确定要通过此条申请吗?'
if (approvalType === 0) {
msg = '拒绝后不可撤回,确定要拒绝此条申请吗?'
msg = '确定要拒绝接收该教工的工会关系吗?'
} else if (approvalType === 2) {
msg = '确定要退回此条申请吗?'
}
@@ -41,8 +41,8 @@ const MEMBER_APPLY_AUDIT_INFO = {
<van-cell title="人员类型">{{ viewData.personType }}</van-cell>
<van-cell title="人员性质">{{ viewData.preparedBy || '暂无' }}</van-cell>
<van-cell title="会员状态">{{ viewData.member ? '会员' : '非会员' }}</van-cell>
<van-cell title="福利会员状态">{{ viewData.welfareMember ? '福利会员' : '非福利会员' }}</van-cell>
<!-- <van-cell title="会员状态">{{ viewData.member ? '会员' : '非会员' }}</van-cell>-->
<!-- <van-cell title="福利会员状态">{{ viewData.welfareMember ? '福利会员' : '非福利会员' }}</van-cell>-->
<van-cell title="家庭成员" class="column-cell">
<table class="family-table">
@@ -67,11 +67,20 @@ const MEMBER_APPLY_AUDIT_INFO = {
</table>
</van-cell>
<van-cell title="个人简历">
<div v-if="viewData.vita" class="text-left" v-html="viewData.vita"></div>
<span v-else>无数据</span>
<template #label>
<div v-if="viewData.vita" class="text-left" v-html="viewData.vita"></div>
<span style="font-size: 14px" v-else>无数据</span>
</template>
</van-cell>
<van-cell title="签字">
<template #label>
<van-image width="200" height="100" :src="CREATE_PREVIEW_URL(viewData.sign)"
v-if="viewData.sign"></van-image>
<span style="font-size: 14px" v-else>暂无</span>
</template>
</van-cell>
</template>
</van-cell-group>
</van-tab>
@@ -125,7 +125,7 @@ layout("/mobile/platform.html"){
<van-button size="small" type="primary"
v-if="[20, 70].includes(item.applyStateId)"
@click="openApproval(item)"
style="margin-right: 4px">审核
style="margin-right: 4px">{{ item.applyStateId === 70 ? '重新审核' : '审核' }}
</van-button>
<van-button size="small" type="danger"
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
@click="unionPicker = true" placeholder="请选择分配工会"
: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
show-toolbar
:columns="unions"
@@ -163,11 +165,13 @@ layout("/mobile/platform.html"){
@cancel="unionPicker = false"
></van-picker>
</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>
<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="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="primary" block @click.submit="doApproval(1)">同意申请</van-button>
</div>
@@ -143,9 +143,9 @@ layout("/mobile/platform.html"){
<van-field label="在职状态" :value="formData.userState" 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>
<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>
<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>
@@ -204,6 +204,22 @@ layout("/mobile/platform.html"){
<text-editor style="z-index: 1" v-model="formData.vita"></text-editor>
</template>
</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>
<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>
@@ -256,6 +272,16 @@ layout("/mobile/platform.html"){
})
},
doSubmit(){
if (!this.formData.isVoluntary) {
this.$toast.fail('请同意入会意愿')
return
}
if (!this.formData.sign) {
this.$toast.fail('请签字')
return
}
this.$dialog.confirm({
title: "保存",
message: "提交后将进入审核流程,无法再进行编辑,您确定要提交申请吗?",
@@ -35,6 +35,12 @@ layout("/layouts/platform.html"){
<el-tag v-if="row.allocationUnionName">{{ row.allocationUnionName }}</el-tag>
<el-tag v-else type="danger">未分配</el-tag>
</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 label="操作" width="220">
<template slot-scope="{row}">
@@ -82,7 +88,7 @@ layout("/layouts/platform.html"){
</el-form>
<el-row type="flex" justify="end">
<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="primary" @click="doApproval(1)">同意接收</el-button>
</el-row>
@@ -111,6 +117,7 @@ layout("/layouts/platform.html"){
{ prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true },
{ prop: "allocationUnionName", label: "分配工会", sortable: true },
{ prop: "sign", label: "签字" },
{ prop: "stateName", label: "当前节点", sortable: true }
],
@@ -145,7 +152,7 @@ layout("/layouts/platform.html"){
doApproval(approvalType){
let msg = '确定要通过此条申请吗?'
if (approvalType === 0) {
msg = '拒绝后不可撤回,确定要拒绝此条申请吗?'
msg = '确定要拒绝接收此教工的工会关系吗?'
} else if (approvalType === 2) {
msg = '确定要退回此条申请吗?'
}
@@ -28,9 +28,9 @@ const MEMBER_APPLY_AUDIT_INFO = {
<el-descriptions-item label="人员类型">{{ viewData.personType }}</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<el-descriptions-item label="会员状态">{{ viewData.member ? '会员' : '非会员' }}</el-descriptions-item>
<el-descriptions-item label="福利会员状态">{{ viewData.welfareMember ? '福利会员' : '非福利会员' }}</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<!-- <el-descriptions-item label="会员状态">{{ viewData.member ? '会员' : '非会员' }}</el-descriptions-item>-->
<!-- <el-descriptions-item label="福利会员状态">{{ viewData.welfareMember ? '福利会员' : '非福利会员' }}</el-descriptions-item>-->
<!-- <el-descriptions-item></el-descriptions-item>-->
<el-descriptions-item label="家庭主要成员" :span="3">
<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-descriptions-item>
<el-descriptions-item label="个人简况" :span="3">
<template slot="label">个人简况</template>
<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>
</el-tab-pane>
@@ -63,7 +70,8 @@ const MEMBER_APPLY_AUDIT_INFO = {
<el-descriptions-item label="审核时间">{{ viewData.schoolAudit.auditTime }}
</el-descriptions-item>
<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 label="审核意见" :span="2">{{ viewData.schoolAudit.auditOpinion }}
</el-descriptions-item>
@@ -25,6 +25,12 @@ layout("/layouts/platform.html"){
<template scope="{row}" v-if="column.prop=='loginname'">
<el-link @click="openView(row)" type="primary">{{row.loginname}}</el-link>
</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 label="操作" width="220">
<template slot-scope="{row}">
@@ -63,6 +69,7 @@ layout("/layouts/platform.html"){
{ prop: "personType", label: "人员类型", sortable: true },
{ prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true },
{ prop: "sign", label: "签字" },
{ 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-else type="danger">未分配</el-tag>
</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 label="操作" width="220">
<template slot-scope="{row}">
<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>
</template>
</el-table-column>
@@ -99,7 +107,7 @@ layout("/layouts/platform.html"){
</el-form>
<el-row type="flex" justify="end">
<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="primary" @click="doApproval(1)">同意申请</el-button>
</el-row>
@@ -130,6 +138,7 @@ layout("/layouts/platform.html"){
{ prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true },
{ prop: "allocationUnionName", label: "分配工会", sortable: true },
{ prop: "sign", label: "签字" },
{ prop: "stateName", label: "当前节点", sortable: true }
],
@@ -106,12 +106,12 @@ layout("/layouts/platform.html"){
<el-descriptions-item label="身份证号码">
<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-descriptions-item>
<el-descriptions-item label="联系电话">
<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-descriptions-item>
<el-descriptions-item label="电子邮箱">
@@ -171,6 +171,25 @@ layout("/layouts/platform.html"){
<text-editor v-model="formData.vita"></text-editor>
</el-form-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-form>
<el-row v-if="!member" justify="end" type="flex" class="mt10">
@@ -196,6 +215,15 @@ layout("/layouts/platform.html"){
formRules: {
username: [{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: [
{
validator: (rule, value, callback) => {
@@ -280,6 +308,16 @@ layout("/layouts/platform.html"){
.catch()
},
doSubmit() {
if (!this.formData.isVoluntary) {
this.$message.error("请勾选入会意愿")
return
}
if (!this.formData.sign) {
this.$message.error("请使用手机钉钉扫描二维码签字")
return
}
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("提交后将进入审核流程,无法再进行编辑,您确定要提交申请吗?", "提示", { type: "warning" })
@@ -152,23 +152,25 @@ layout("/layouts/platform.html"){
cancelButtonText: '取消',
type: 'warning'
}).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 loading = this.$loading({
lock: true,
text: '数据保存中请稍后...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
const resp = await $.post('/platform/sourcechange/manage/doBatchChange', {
data: JSON.stringify(ids)
})
loading.close()
if (resp.code === 0) {
this.$message.success(resp.msg)
this.$refs.table.clearSelection()
await this.pageData()
if (isHasNewTeacher) {
this.$confirm('勾选用户中有新入职教工,是否对新入职教职工发送入会邀请?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
isSendMsg = true
this.doOperate(url, ids, isSendMsg)
}).catch(() => {
isSendMsg = false
this.doOperate(url, ids, isSendMsg)
})
} else {
this.$message.warning(resp.msg)
await this.doOperate(url, ids, isSendMsg)
}
})
},
@@ -176,10 +178,41 @@ layout("/layouts/platform.html"){
this.checkUsers = val
},
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) {
this.$message.success(resp.msg)
this.$refs.guava.index()
this.$refs.table.clearSelection()
await this.pageData()
} else {
this.$message.warning(resp.msg)