bug整改
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package io.v.nutz.base.model;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class msgUser implements Serializable {
|
||||
|
||||
private String type;
|
||||
private String userId;
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.v.nutz.base.enums.Env;
|
||||
import io.v.nutz.base.model.msgUser;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.integration.jedis.RedisService;
|
||||
@@ -34,83 +35,90 @@ public class MsgApi {
|
||||
|
||||
|
||||
/**
|
||||
* @param channels 推送渠道 (INNER:站内消息; SMS:短信; Mail:邮件; WeChat:微信; DingTalk:钉钉;同时推送多个渠道用英文逗号分隔 )
|
||||
* @param loginNameStr 字符串,多个工号用英文逗号分隔 ","
|
||||
* @param mtype 消息类型; 0: 图文 1: 文字 2: 外链
|
||||
* @param title 标题
|
||||
* @param content 内容
|
||||
* @param imageUrl 图片URL
|
||||
* @author zhf
|
||||
* @param msgTitle 消息标题
|
||||
* @param msgContent 消息内容
|
||||
* @param msgType 消息类型(0:图文,1:文字,2:外链)
|
||||
* @param sendStatus 发送状态,1:实时发送 2:定时消息
|
||||
* @param sendChannel 发送渠道Mail:邮件,WeChat:微信, IntelligenceMode:智能渠道 多个渠道用英文逗号隔开(如果选择智能模式则不可再选其他模式)
|
||||
* @param receivers 接收人,Json格式(当sendMode为普通模式normal 时必填) 接收人格式:type为接收人类型,默认为User; usreId可以填写工号或手机号;name为接收人姓名
|
||||
* @param waitLink 页面的跳转地址,当消息是待办消息时(必填)。
|
||||
* @author hpf
|
||||
* @description
|
||||
*/
|
||||
public void sendMsg(List<String> channels, String loginNameStr, Integer mtype, String title, String content, String imageUrl,String link) {
|
||||
// try {
|
||||
// if (!Globals.MyConfig.getBoolean("SendMsg")) {
|
||||
// log.info("发送失败,消息暂未开启!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (Globals.isEnv(Env.dev)) {
|
||||
// log.info("开发模式不允许发送短信!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (StrUtil.isBlank(title)||StrUtil.isBlank(content) ||Lang.isEmpty(channels) || Lang.isEmpty(loginNameStr)) {
|
||||
// log.info("发送失败,缺少需要参数请检查!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// String msgToken = getMsgToken();
|
||||
// NutMap map = new NutMap();
|
||||
// map.put("channel", String.join(",", channels));
|
||||
// //推送范围(1:普通模式;2:全体教师;3:全体学生;4:全体人员)
|
||||
// map.put("objScope", 1);
|
||||
// map.put("objIds", loginNameStr);
|
||||
// map.put("mtype", mtype);
|
||||
// map.put("sendStatus", 1);
|
||||
// map.put("title", title);
|
||||
// map.put("content", content);
|
||||
// map.put("imageUrl", imageUrl);
|
||||
// map.put("link", link);
|
||||
//
|
||||
// HttpRequest request = HttpUtil.createPost(MSG_API)
|
||||
// .header("token", msgToken)
|
||||
// .body(Json.toJson(map));
|
||||
// JSONObject jsonObject = JSON.parseObject(request.execute().body());
|
||||
// int status = jsonObject.getInteger("code");
|
||||
//
|
||||
// if (status == 200) {
|
||||
// log.info("发送成功>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
// } else {
|
||||
// log.info("发送失败>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
// throw new RuntimeException("Message sending failed with status code: " + status + ", Message: " + jsonObject.getString("message"));
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
public void sendMsg(String msgTitle, String msgContent, Integer msgType, Integer sendStatus, String sendChannel, List<msgUser> receivers, String waitLink) {
|
||||
try {
|
||||
if (!Globals.MyConfig.getBoolean("SendMsg")) {
|
||||
log.info("发送失败,消息暂未开启!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Globals.isEnv(Env.dev)) {
|
||||
log.info("开发模式不允许发送短信!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(msgTitle)||StrUtil.isBlank(msgContent) ||StrUtil.isEmpty(sendChannel)||receivers.size()==0) {
|
||||
log.info("发送失败,缺少需要参数请检查!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
String msgToken = getMsgToken();
|
||||
NutMap map = new NutMap();
|
||||
|
||||
map.put("token", msgToken);
|
||||
map.put("msgtitle", msgTitle);
|
||||
map.put("msgContent", msgContent);
|
||||
map.put("msgType", msgType);
|
||||
map.put("sendStatus", sendStatus);
|
||||
map.put("sendChannel", sendChannel);
|
||||
map.put("sendMode", "normal");
|
||||
map.put("receivers", receivers);
|
||||
map.put("waitLink", waitLink);
|
||||
//发送
|
||||
map.put("sendMsgType", 1);
|
||||
|
||||
HttpRequest request = HttpUtil.createPost(MSG_API)
|
||||
.body(Json.toJson(map));
|
||||
JSONObject jsonObject = JSON.parseObject(request.execute().body());
|
||||
int status = jsonObject.getInteger("rspCode");
|
||||
|
||||
if (status == 000000) {
|
||||
log.info("发送成功>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
} else {
|
||||
log.info("发送失败>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
throw new RuntimeException("Message sending failed with status code: " + status + ", Message: " + jsonObject.getString("rspMsg"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static final String TOKEN_API = "https://mc.zjitc.edu.cn/msg/getThirdAPIToken";
|
||||
private static final String APP_Id = "MSG10029935";
|
||||
private static final String APP_PASSWORD = "N2NkOTI3NDVmZjY0ZTkwYTI0OGVjYjQzYjZhNDIyMzE";
|
||||
private static final String MSG_TOKEN_NAME = "msgToken";
|
||||
private static final String MSG_API = "https://mc.zjitc.edu.cn/message/sendMessageApi";
|
||||
|
||||
/**
|
||||
* 获取token
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String getMsgToken() {
|
||||
// String token = redisService.get(MSG_TOKEN_NAME);
|
||||
// if (StrUtil.isBlank(token)) {
|
||||
// String body = HttpRequest.post(TOKEN_API + "?appKey=" + APP_KEY + "&appSecret=" + APP_SECRET).execute().body();
|
||||
// NutMap map = Json.fromJson(NutMap.class, body);
|
||||
// if (map.getInt("code") == 200) {
|
||||
// NutMap data = Json.fromJson(NutMap.class, map.getString("data"));
|
||||
// token = data.getString("accessToken");
|
||||
// redisService.setex(MSG_TOKEN_NAME, 3600, token);
|
||||
// } else {
|
||||
// token = "";
|
||||
// }
|
||||
// }
|
||||
// return token;
|
||||
return null;
|
||||
String token = redisService.get(MSG_TOKEN_NAME);
|
||||
if (StrUtil.isBlank(token)) {
|
||||
String body = HttpRequest.post(TOKEN_API + "?appId=" + APP_Id + "&appPassword=" + APP_PASSWORD).execute().body();
|
||||
NutMap map = Json.fromJson(NutMap.class, body);
|
||||
if (map.getInt("rspCode") == 000000) {
|
||||
NutMap data = Json.fromJson(NutMap.class, map.getString("resultData"));
|
||||
token = data.getString("token");
|
||||
redisService.setex(MSG_TOKEN_NAME, 3600, token);
|
||||
} else {
|
||||
token = "";
|
||||
}
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -332,8 +332,8 @@ public class SysHomeController {
|
||||
String time1 = liElement.selectFirst("div.cal-date-day").text();
|
||||
String time2 = liElement.selectFirst("div.cal-date-month").text();
|
||||
String title = liElement.selectFirst("a.cal-title").text();
|
||||
row.put("href", href);
|
||||
row.put("time", time1 + "-" + time2);
|
||||
row.put("href", url+href);
|
||||
row.put("time", time2 + "-" + time1);
|
||||
row.put("text", title);
|
||||
return row;
|
||||
}).collect(Collectors.toList());
|
||||
@@ -354,7 +354,7 @@ public class SysHomeController {
|
||||
String href = liElement.selectFirst("a.flex-box").attr("href");
|
||||
String time = liElement.selectFirst("div.date-line").text();
|
||||
String title = liElement.selectFirst("div.flex-1").text();
|
||||
row.put("href", href);
|
||||
row.put("href",url+href);
|
||||
row.put("time", time);
|
||||
row.put("text", title);
|
||||
return row;
|
||||
|
||||
+11
-2
@@ -2,7 +2,9 @@ package io.v.nutz.sys.controllers.platform.sys.club.regist;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.msgUser;
|
||||
import io.v.nutz.base.page.Pagination;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
@@ -30,6 +32,7 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -214,10 +217,16 @@ public class ClubMyApplyController {
|
||||
Map<String, Sys_user> userMap = sysUsers.stream().collect(Collectors.toMap(Sys_user::getLoginname, o -> o));
|
||||
for (String user : userList) {
|
||||
Sys_user sysUser = userMap.get(user);
|
||||
msgUser msgUser=new msgUser();
|
||||
msgUser.setName("User");
|
||||
msgUser.setUserId(sysUser.getLoginname());
|
||||
msgUser.setName(sysUser.getUsername());
|
||||
List<msgUser> users = new ArrayList<>();
|
||||
users.add(msgUser);
|
||||
String content = "%s老师您好,欢迎加入%s,请进入入会申请进行确认!".formatted(sysUser.getUsername(), sysClub.getName());
|
||||
String link = Globals.AppDomain + "/platform/sys/club/sq/mobile";
|
||||
msgApi.sendMsg(List.of("DingTalk"), user, 2, "协会入会邀请", content, "", link);
|
||||
|
||||
//msgApi.sendMsg(List.of("DingTalk"), user, 2, "协会入会邀请", content, "", link);
|
||||
msgApi.sendMsg("协会入会邀请", content, 1, 1, "SMS", users,"");
|
||||
dao.update(
|
||||
Sys_club_user.class,
|
||||
Chain.make("sendMsg", true),
|
||||
|
||||
+13
-1
@@ -3,7 +3,9 @@ package io.v.nutz.sys.controllers.platform.sys.club.regist;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.msgUser;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
@@ -17,12 +19,15 @@ 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.Nutz;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.impl.entity.NutEntity;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
@@ -125,9 +130,16 @@ public class ClubXghReplyController {
|
||||
Sys_club_user sysClubUser = sysClubUsers.stream().filter(o -> o.getSf() == 1).findFirst().orElse(null);
|
||||
if(sysClubUser != null) {
|
||||
Sys_user sysUser = dao.fetch(Sys_user.class, sysClubUser.getUserid());
|
||||
msgUser msgUser = new msgUser();
|
||||
msgUser.setName("User");
|
||||
msgUser.setUserId(sysUser.getLoginname());
|
||||
msgUser.setName(sysUser.getUsername());
|
||||
List<msgUser> users = new ArrayList<>();
|
||||
users.add(msgUser);
|
||||
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(), 2, "协会注册", content, "", link);
|
||||
msgApi.sendMsg("协会注册", content, 1, 1, "SMS",users ,"");
|
||||
}
|
||||
}
|
||||
club.setXghAuditId(audit.getId());
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package io.v.nutz.task.job.trainSingUp;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.v.nutz.base.model.msgUser;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.zhgh.trainSignUp.service.TrainSignUpActivityService;
|
||||
import org.nutz.dao.Cnd;
|
||||
@@ -14,6 +16,7 @@ import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@@ -90,7 +93,14 @@ public class SendMsgBeforeClassJob implements Job {
|
||||
item.getString("courseLocation")
|
||||
);
|
||||
}
|
||||
msgApi.sendMsg(List.of("DingTalk"), item.getString("loginname"), 1, "活动开始通知", content, "", "");
|
||||
msgUser user=new msgUser();
|
||||
user.setName("User");
|
||||
user.setUserId(item.getString("loginname"));
|
||||
user.setName(item.getString("username"));
|
||||
List<msgUser> users = new ArrayList<>();
|
||||
users.add(user);
|
||||
msgApi.sendMsg("活动开始通知", content, 1, 1, "SMS", users,"");
|
||||
//msgApi.sendMsg(List.of("DingTalk"), item.getString("loginname"), 1, "活动开始通知", content, "", "");
|
||||
// msgApi.sendWxMsg("温馨提醒","","text",content,List.of(item.getString("loginname")),"");
|
||||
// sendMsg.pushWeChatMsg("温馨提醒", content, item.getString("loginname"));
|
||||
});
|
||||
|
||||
@@ -53,9 +53,9 @@ public class Globals {
|
||||
//项目短名称
|
||||
public static String AppShrotName = "";
|
||||
//项目域名 (设置一个默认的 为优先级考虑)
|
||||
public static String AppDomain = "https://zhgh.zjitc.edu.cn";
|
||||
public static String AppDomain = "http://zhgh.zjitc.edu.cn";
|
||||
//cas地址
|
||||
public static String CasAddress = "https://sso.zjitc.edu.cn/";
|
||||
public static String CasAddress = "http://sso.zjitc.edu.cn/";
|
||||
//文件访问域名
|
||||
public static String AppFileDomain = "";
|
||||
//文件上传路径
|
||||
|
||||
@@ -61,7 +61,7 @@ public class SourceUserController {
|
||||
un.DWMC unitname,
|
||||
un.DWMCDM unitcode
|
||||
FROM
|
||||
`user_db` u
|
||||
`v_user_db` u
|
||||
LEFT JOIN dep_db un ON u.DWDM = un.DWMCDM
|
||||
$condition
|
||||
""");
|
||||
|
||||
@@ -202,7 +202,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
//不更新会员和福利会员字段
|
||||
source.setMember(null);
|
||||
source.setWelfareMember(null);
|
||||
Sys_user user = userMap.get(source.getLoginname().toLowerCase());
|
||||
Sys_user user = userMap.get(source.getLoginname());
|
||||
|
||||
if (isAuto) {
|
||||
checkMemberOrWelfareMember(changeConfig, source, user, addMemberUserIds, deleteMemberUserIds,
|
||||
@@ -524,6 +524,9 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
NutMap newMap = Lang.obj2nutmap(source);
|
||||
// 原数据
|
||||
NutMap sourceMap = Lang.obj2nutmap(user);
|
||||
if (StrUtil.isBlank(newMap.getString("member"))) {
|
||||
sourceMap.put("member", null);
|
||||
}
|
||||
// 变更记录
|
||||
List<NutMap> changeList = new ArrayList<>();
|
||||
for (String fieldName : allowChangeFieldNames) {
|
||||
@@ -570,6 +573,9 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
// 获取变更记录
|
||||
NutMap newMap = Lang.obj2nutmap(source);
|
||||
NutMap sourceMap = Lang.obj2nutmap(user);
|
||||
if (StrUtil.isBlank(newMap.getString("member"))) {
|
||||
sourceMap.put("member", null);
|
||||
}
|
||||
List<NutMap> changeList = new ArrayList<>();
|
||||
for (String fieldName : allowChangeFieldNames) {
|
||||
memberCommonService.extractChange(newMap, sourceMap, fieldName, dictMap, changeList);
|
||||
@@ -607,7 +613,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
}
|
||||
}
|
||||
|
||||
if (!ObjectUtil.equals(user.getMember(), source.getMember())){
|
||||
if (source.getMember() != null && !ObjectUtil.equals(user.getMember(), source.getMember())){
|
||||
if (source.getMember() == 1) {
|
||||
changeTypes.add(MemberChangeType.RESTORE.getType());
|
||||
} else {
|
||||
|
||||
+19
-2
@@ -5,8 +5,10 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.model.msgUser;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
@@ -38,6 +40,7 @@ import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -171,7 +174,14 @@ public class MemberApplyBranchUnionAuditController {
|
||||
.formatted(user.getUsername(), union.getUnionname());
|
||||
System.out.println(content);
|
||||
sysUserService.deleteCacheAndUpdate(record.getUserId());
|
||||
msgApi.sendMsg(List.of("DingTalk"), record.getLoginname(), 1, "入会结果通知", content, "", "");
|
||||
msgUser msgUser=new msgUser();
|
||||
msgUser.setName("User");
|
||||
msgUser.setUserId(sysUser.getLoginname());
|
||||
msgUser.setName(sysUser.getUsername());
|
||||
List<msgUser> users = new ArrayList<>();
|
||||
users.add(msgUser);
|
||||
msgApi.sendMsg("入会结果通知", content, 1, 1, "SMS", users,"");
|
||||
//msgApi.sendMsg(List.of("DingTalk"), record.getLoginname(), 1, "入会结果通知", content, "", "");
|
||||
} else {
|
||||
// 杭州医学院,分工会拒绝接收,还要去创建校工会的审核任务
|
||||
MemberApplyToDoHandler.REFUSE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "分工会拒绝接收"));
|
||||
@@ -180,7 +190,14 @@ public class MemberApplyBranchUnionAuditController {
|
||||
.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);
|
||||
//msgApi.sendMsg(List.of("DingTalk"), record.getLoginname(), 2, "入会结果通知", content, "", linkUrl);
|
||||
msgUser user=new msgUser();
|
||||
user.setName("User");
|
||||
user.setUserId(record.getLoginname());
|
||||
user.setName(record.getUsername());
|
||||
List<msgUser> users = new ArrayList<>();
|
||||
users.add(user);
|
||||
msgApi.sendMsg("入会结果通知", content, 1, 1, "SMS", users,linkUrl);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
+11
-2
@@ -2,6 +2,7 @@ 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.model.msgUser;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.sys.models.Sys_user_role;
|
||||
@@ -129,11 +130,19 @@ public class MemberApplyController {
|
||||
|
||||
// 短信通知
|
||||
List<String> schoolLoginNameList = commonService.getSchoolOrBranchUnionMemberAdminLoginNames("school", null);
|
||||
String schoolLoginNameListStr = schoolLoginNameList.stream().distinct().collect(Collectors.joining(","));
|
||||
List<msgUser> users = schoolLoginNameList.stream().map(item -> {
|
||||
msgUser user = new msgUser();
|
||||
user.setType("User");
|
||||
user.setUserId(item);
|
||||
return user;
|
||||
}).collect(Collectors.toList());
|
||||
//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);
|
||||
|
||||
//msgApi.sendMsg(List.of("DingTalk"), schoolLoginNameListStr, 2, "入会审核通知", content, "", linkUrl);
|
||||
msgApi.sendMsg("入会审核通知", content, 1, 1, "SMS", users,linkUrl);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+20
-2
@@ -3,8 +3,10 @@ package io.v.nutz.zhgh.staffmanage.member.controller.apply;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.model.msgUser;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.sys.services.SysLocalProcessService;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
@@ -30,6 +32,7 @@ import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -156,15 +159,30 @@ public class MemberApplySchoolUnionAuditController {
|
||||
String content = "%s,%s老师的入会申请已经通过校工会审核,现将工会关系转入您处,请点击此消息或登录“智慧工会”办理新会员接收手续。"
|
||||
.formatted(unionname, record.getUsername());
|
||||
System.out.println(content);
|
||||
msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 2, "会员入会审核通知", content, "", linkUrl);
|
||||
msgUser user=new msgUser();
|
||||
user.setName("User");
|
||||
user.setUserId(map.getString("loginname"));
|
||||
user.setName(map.getString("username"));
|
||||
List<msgUser> users = new ArrayList<>();
|
||||
users.add(user);
|
||||
//msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 2, "会员入会审核通知", content, "", linkUrl);
|
||||
msgApi.sendMsg("会员入会审核通知", content, 1, 1, "SMS", users,linkUrl);
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
MemberApplyToDoHandler.REFUSE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "校工会审核拒绝"));
|
||||
msgUser user=new msgUser();
|
||||
user.setName("User");
|
||||
user.setUserId(record.getLoginname());
|
||||
user.setName(record.getUsername());
|
||||
List<msgUser> users = new ArrayList<>();
|
||||
users.add(user);
|
||||
// 短信通知
|
||||
String content = "尊敬的%s老师,您的入会申请未被通过,若有疑问请联系校工会,联系电话87692636".formatted(record.getUsername());
|
||||
System.out.println(content);
|
||||
msgApi.sendMsg(List.of("DingTalk"), record.getLoginname(), 1, "会员入会结果通知", content, "", "");
|
||||
//msgApi.sendMsg(List.of("DingTalk"), record.getLoginname(), 1, "会员入会结果通知", content, "", "");
|
||||
msgApi.sendMsg("会员入会结果通知", content, 1, 1, "SMS", users,"");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
+24
-24
@@ -52,8 +52,8 @@ public class MemberAnalysisController {
|
||||
gh.unioncode as unionCode,
|
||||
gh.unionname as unionName,
|
||||
( SELECT count( 1 ) FROM member_his WHERE `year` = @lastYear AND unionid = gh.id ) AS '往年会员人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE currentUnionId = gh.id AND currentUnitId != originUnitId AND YEAR ( applyTime ) = @currentYear ) AS '校内异动变动到我工会人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE originUnionId = gh.id AND currentUnitId != originUnitId AND YEAR ( applyTime ) = @currentYear ) AS '校内异动我工会减少人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE unitId = gh.id AND unitId != changeOrigin AND YEAR ( applyDateTime ) = @currentYear ) AS '校内异动变动到我工会人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE changeOrigin = gh.id AND unitId != changeOrigin AND YEAR ( applyDateTime ) = @currentYear ) AS '校内异动我工会减少人数',
|
||||
(
|
||||
SELECT
|
||||
count( 1 )
|
||||
@@ -61,9 +61,9 @@ public class MemberAnalysisController {
|
||||
member_change_record mcr
|
||||
LEFT JOIN `user` u ON u.id = mcr.userId
|
||||
WHERE
|
||||
mcr.`type` IN ( 2, 7 )
|
||||
mcr.`changeType` IN ( 2, 7 )
|
||||
AND u.unionid = gh.id
|
||||
AND YEAR ( mcr.applyTime ) = @currentYear
|
||||
AND YEAR ( mcr.applyDateTime ) = @currentYear
|
||||
) AS '新入职、恢复人数',
|
||||
(
|
||||
SELECT
|
||||
@@ -72,9 +72,9 @@ public class MemberAnalysisController {
|
||||
member_change_record mcr
|
||||
LEFT JOIN `user` u ON u.id = mcr.userId
|
||||
WHERE
|
||||
mcr.`type` IN ( 3, 4, 5, 6, 8 )
|
||||
mcr.`changeType` IN ( 3, 4, 5, 6, 8 )
|
||||
AND u.unionid = gh.id
|
||||
AND YEAR ( mcr.applyTime ) = @currentYear
|
||||
AND YEAR ( mcr.applyDateTime ) = @currentYear
|
||||
) AS '离职、去世、退休、开除、退会人数',
|
||||
(select count(1) from `user` where member = 1 and unionid = gh.id) as currentYearMemberNum
|
||||
FROM
|
||||
@@ -123,8 +123,8 @@ public class MemberAnalysisController {
|
||||
dw.unitcode as unitCode,
|
||||
dw.`name` as unitName,
|
||||
( SELECT count( 1 ) FROM member_his WHERE `year` = @lastYear AND unitid = dw.id ) AS '往年会员人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE currentUnitId = dw.id AND currentUnitId != originUnitId AND YEAR ( applyTime ) = @currentYear ) AS '校内异动变动到我单位人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE originUnitId = dw.id AND currentUnitId != originUnitId AND YEAR ( applyTime ) = @currentYear ) AS '校内异动我单位减少人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE unitId = dw.id AND unitId != changeOrigin AND YEAR ( applyDateTime ) = @currentYear ) AS '校内异动变动到我单位人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE changeOrigin = dw.id AND unitId != changeOrigin AND YEAR ( applyDateTime ) = @currentYear ) AS '校内异动我单位减少人数',
|
||||
(
|
||||
SELECT
|
||||
count( 1 )
|
||||
@@ -132,9 +132,9 @@ public class MemberAnalysisController {
|
||||
member_change_record mcr
|
||||
LEFT JOIN `user` u ON u.id = mcr.userId
|
||||
WHERE
|
||||
mcr.`type` IN ( 2, 7 )
|
||||
mcr.`changeType` IN ( 2, 7 )
|
||||
AND u.unitid = dw.id
|
||||
AND YEAR ( mcr.applyTime ) = @currentYear
|
||||
AND YEAR ( mcr.applyDateTime ) = @currentYear
|
||||
) AS '新入职、恢复人数',
|
||||
(
|
||||
SELECT
|
||||
@@ -143,9 +143,9 @@ public class MemberAnalysisController {
|
||||
member_change_record mcr
|
||||
LEFT JOIN `user` u ON u.id = mcr.userId
|
||||
WHERE
|
||||
mcr.`type` IN ( 3, 4, 5, 6, 8 )
|
||||
mcr.`changeType` IN ( 3, 4, 5, 6, 8 )
|
||||
AND u.unitid = dw.id
|
||||
AND YEAR ( mcr.applyTime ) = @currentYear
|
||||
AND YEAR ( mcr.applyDateTime ) = @currentYear
|
||||
) AS '离职、去世、退休、开除、退会人数',
|
||||
(select count(1) from `user` where member = 1 and unitid = dw.id) as currentYearMemberNum
|
||||
FROM
|
||||
@@ -192,8 +192,8 @@ public class MemberAnalysisController {
|
||||
dw.unitcode as unitCode,
|
||||
dw.`name` as unitName,
|
||||
( SELECT count( 1 ) FROM member_his WHERE `year` = @lastYear AND unitid = dw.id ) AS '往年会员人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE currentUnitId = dw.id AND currentUnitId != originUnitId AND YEAR ( applyTime ) = @currentYear ) AS '校内异动变动到我单位人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE originUnitId = dw.id AND currentUnitId != originUnitId AND YEAR ( applyTime ) = @currentYear ) AS '校内异动我单位减少人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE unitId = dw.id AND unitId != changeOrigin AND YEAR ( applyDateTime ) = @currentYear ) AS '校内异动变动到我单位人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE changeOrigin = dw.id AND unitId != changeOrigin AND YEAR ( applyDateTime ) = @currentYear ) AS '校内异动我单位减少人数',
|
||||
(
|
||||
SELECT
|
||||
count( 1 )
|
||||
@@ -201,9 +201,9 @@ public class MemberAnalysisController {
|
||||
member_change_record mcr
|
||||
LEFT JOIN `user` u ON u.id = mcr.userId
|
||||
WHERE
|
||||
mcr.`type` IN ( 2, 7 )
|
||||
mcr.`changeType` IN ( 2, 7 )
|
||||
AND u.unitid = dw.id
|
||||
AND YEAR ( mcr.applyTime ) = @currentYear
|
||||
AND YEAR ( mcr.applyDateTime ) = @currentYear
|
||||
) AS '新入职、恢复人数',
|
||||
(
|
||||
SELECT
|
||||
@@ -212,9 +212,9 @@ public class MemberAnalysisController {
|
||||
member_change_record mcr
|
||||
LEFT JOIN `user` u ON u.id = mcr.userId
|
||||
WHERE
|
||||
mcr.`type` IN ( 3, 4, 5, 6, 8 )
|
||||
mcr.`changeType` IN ( 3, 4, 5, 6, 8 )
|
||||
AND u.unitid = dw.id
|
||||
AND YEAR ( mcr.applyTime ) = @currentYear
|
||||
AND YEAR ( mcr.applyDateTime ) = @currentYear
|
||||
) AS '离职、去世、退休、开除、退会人数',
|
||||
(select count(1) from `user` where member = 1 and unitid = dw.id) as currentYearMemberNum
|
||||
FROM
|
||||
@@ -228,8 +228,8 @@ public class MemberAnalysisController {
|
||||
gh.unioncode as unionCode,
|
||||
gh.unionname as unionName,
|
||||
( SELECT count( 1 ) FROM member_his WHERE `year` = @lastYear AND unionid = gh.id ) AS '往年会员人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE currentUnionId = gh.id AND currentUnitId != originUnitId AND YEAR ( applyTime ) = @currentYear ) AS '校内异动变动到我单位人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE originUnionId = gh.id AND currentUnitId != originUnitId AND YEAR ( applyTime ) = @currentYear ) AS '校内异动我单位减少人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE unitId = gh.id AND unitId != changeOrigin AND YEAR ( applyDateTime ) = @currentYear ) AS '校内异动变动到我单位人数',
|
||||
( SELECT count( 1 ) FROM member_change_record WHERE changeOrigin = gh.id AND unitId != changeOrigin AND YEAR ( applyDateTime ) = @currentYear ) AS '校内异动我单位减少人数',
|
||||
(
|
||||
SELECT
|
||||
count( 1 )
|
||||
@@ -237,9 +237,9 @@ public class MemberAnalysisController {
|
||||
member_change_record mcr
|
||||
LEFT JOIN `user` u ON u.id = mcr.userId
|
||||
WHERE
|
||||
mcr.`type` IN ( 2, 7 )
|
||||
mcr.`changeType` IN ( 2, 7 )
|
||||
AND u.unionid = gh.id
|
||||
AND YEAR ( mcr.applyTime ) = @currentYear
|
||||
AND YEAR ( mcr.applyDateTime ) = @currentYear
|
||||
) AS '新入职、恢复人数',
|
||||
(
|
||||
SELECT
|
||||
@@ -248,9 +248,9 @@ public class MemberAnalysisController {
|
||||
member_change_record mcr
|
||||
LEFT JOIN `user` u ON u.id = mcr.userId
|
||||
WHERE
|
||||
mcr.`type` IN ( 3, 4, 5, 6, 8 )
|
||||
mcr.`changeType` IN ( 3, 4, 5, 6, 8 )
|
||||
AND u.unionid = gh.id
|
||||
AND YEAR ( mcr.applyTime ) = @currentYear
|
||||
AND YEAR ( mcr.applyDateTime ) = @currentYear
|
||||
) AS '离职、去世、退休、开除、退会人数',
|
||||
(select count(1) from `user` where member = 1 and unionid = gh.id) as currentYearMemberNum
|
||||
FROM
|
||||
|
||||
+2
-2
@@ -88,8 +88,8 @@ public class SourceChangeManageController {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("username",pageForm.getSearchKeyword());
|
||||
seg.orLike("loginname",pageForm.getSearchKeyword());
|
||||
seg.orLike("scmt.username",pageForm.getSearchKeyword());
|
||||
seg.orLike("scmt.loginname",pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
}
|
||||
}
|
||||
if (!ObjectUtil.equals(user.getMember(), middleTable.getMember())){
|
||||
if (middleTable.getMember() == 1) {
|
||||
if (middleTable.getMember()!=null&&middleTable.getMember() == 1) {
|
||||
changeTypes.add(MemberChangeType.RESTORE.getType());
|
||||
} else {
|
||||
changeTypes.add(MemberChangeType.WITHDRAWAL.getType());
|
||||
|
||||
@@ -3,7 +3,9 @@ package io.v.nutz.zhgh.welfare.controller;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.msgUser;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
@@ -299,7 +301,8 @@ public class WelfareProjectMangeController {
|
||||
public Object sendMsgToNotWelfareUsers(String projectId, String sendMsgValue) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname
|
||||
u.loginname,
|
||||
u.username
|
||||
FROM
|
||||
welfare_list wl
|
||||
left join sys_user u on u.id = wl.userId
|
||||
@@ -316,13 +319,21 @@ public class WelfareProjectMangeController {
|
||||
""");
|
||||
sql.setParam("projectId", projectId);
|
||||
List<NutMap> userList = listService.listMap(sql);
|
||||
Set<String> loginNameList = userList.stream().map(user -> user.getString("loginname")).collect(Collectors.toSet());
|
||||
String loginNames = loginNameList.stream().collect(Collectors.joining(","));
|
||||
List<msgUser> list = userList.stream().map(user -> {
|
||||
msgUser msgUser = new msgUser();
|
||||
msgUser.setName("User");
|
||||
msgUser.setUserId(user.getString("loginname"));
|
||||
msgUser.setName(user.getString("username"));
|
||||
return msgUser;
|
||||
}).collect(Collectors.toList());
|
||||
//String loginNames = loginNameList.stream().collect(Collectors.joining(","));
|
||||
|
||||
WelfareProject project = dao.fetch(WelfareProject.class, projectId);
|
||||
String link = Globals.AppDomain + "/mobile/welfare/list/receive?projectId=%s".formatted(projectId);
|
||||
|
||||
msgApi.sendMsg("职工福利", sendMsgValue, 1, 1, "SMS", list,link);
|
||||
// String imageUrl = Globals.AppDomain + "/file_server/fileStreamPreview?id=" + project.getCover();
|
||||
msgApi.sendMsg(List.of("DingTalk"), loginNames, 2, "职工福利", sendMsgValue, "", link);
|
||||
//msgApi.sendMsg(List.of("DingTalk"), loginNames, 2, "职工福利", sendMsgValue, "", link);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ const userInfo = {
|
||||
<div>🆔我的工号:${@shiro.getPrincipalProperty('loginname')}</div>
|
||||
<div>⭕我的性别:${@shiro.getPrincipalProperty('sex')}</div>
|
||||
<div>🟢我的单位:${@shiro.getPrincipalProperty('unit').getName()}</div>
|
||||
|
||||
<div>🟤我的工会:${@shiro.getPrincipalProperty('union').getUnionname()}</div>
|
||||
<div>📕系统角色:
|
||||
<!--#for(role in @shiro.getPrincipalProperty('roles')){#-->
|
||||
<span style="font-size: 14px;color: #666;">${@role.getName()}</span>
|
||||
|
||||
Reference in New Issue
Block a user