commit
This commit is contained in:
@@ -57,12 +57,12 @@ public class MsgApi {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param channels 推送渠道 (INNER:站内消息; SMS:短信; Mail:邮件; WeChat:微信; DingTalk:钉钉;同时推送多个渠道用英文逗号分隔 )
|
* @param channels 推送渠道 (INNER:站内消息; SMS:短信; Mail:邮件; WeChat:微信; DingTalk:钉钉;同时推送多个渠道用英文逗号分隔 )
|
||||||
* @param loginNameStr 字符串,多个工号用英文逗号分隔 ","
|
* @param loginNameStr 字符串,多个工号用英文逗号分隔 ","
|
||||||
* @param mtype 消息类型; 0: 图文 1: 文字 2: 外链
|
* @param mtype 消息类型; 0: 图文 1: 文字 2: 外链
|
||||||
* @param title 标题
|
* @param title 标题
|
||||||
* @param content 内容
|
* @param content 内容
|
||||||
* @param imageUrl 图片URL
|
* @param imageUrl 图片URL
|
||||||
* @author zhf
|
* @author zhf
|
||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
@@ -82,12 +82,12 @@ public class MsgApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param channels 推送渠道 (INNER:站内消息; SMS:短信; Mail:邮件; WeChat:微信; DingTalk:钉钉;同时推送多个渠道用英文逗号分隔 )
|
* @param channels 推送渠道 (INNER:站内消息; SMS:短信; Mail:邮件; WeChat:微信; DingTalk:钉钉;同时推送多个渠道用英文逗号分隔 )
|
||||||
* @param loginNameList 工号集合
|
* @param loginNameList 工号集合
|
||||||
* @param mtype 消息类型; 0: 图文 1: 文字 2: 外链
|
* @param mtype 消息类型; 0: 图文 1: 文字 2: 外链
|
||||||
* @param title 标题
|
* @param title 标题
|
||||||
* @param content 内容
|
* @param content 内容
|
||||||
* @param imageUrl 图片URL
|
* @param imageUrl 图片URL
|
||||||
* @author zhf
|
* @author zhf
|
||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
@@ -157,6 +157,7 @@ public class MsgApi {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 封装发送消息的参数
|
* 封装发送消息的参数
|
||||||
|
*
|
||||||
* @param channels
|
* @param channels
|
||||||
* @param loginNameList
|
* @param loginNameList
|
||||||
* @param mtype
|
* @param mtype
|
||||||
@@ -185,6 +186,7 @@ public class MsgApi {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送请求
|
* 发送请求
|
||||||
|
*
|
||||||
* @param msgToken
|
* @param msgToken
|
||||||
* @param map
|
* @param map
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -189,8 +189,8 @@ public class MsgNotifyController {
|
|||||||
} else if (msgNotify.getSendMode().equals("two")) {
|
} else if (msgNotify.getSendMode().equals("two")) {
|
||||||
List<NutMap> userScopes = msgNotifyService.getUserScopes(msgNotify.getActivityGroupId());
|
List<NutMap> userScopes = msgNotifyService.getUserScopes(msgNotify.getActivityGroupId());
|
||||||
if (flag) {
|
if (flag) {
|
||||||
msgNotifyService.sendMsg(msgNotify.getSendTypes(), userScopes, msgNotify.getContent());
|
List<String> loginNames = userScopes.stream().map(v -> v.getString("loginName")).toList();
|
||||||
|
msgNotifyService.sendMsg2(msgNotify.getSendTypes(), loginNames, msgNotify.getContent());
|
||||||
}
|
}
|
||||||
userScopes.forEach(v -> {
|
userScopes.forEach(v -> {
|
||||||
if (flag) {
|
if (flag) {
|
||||||
@@ -203,11 +203,8 @@ public class MsgNotifyController {
|
|||||||
} else if (msgNotify.getSendMode().equals("three")) {
|
} else if (msgNotify.getSendMode().equals("three")) {
|
||||||
if (flag) {
|
if (flag) {
|
||||||
List<User> user = dao.query(User.class, Cnd.where("id", "in", users));
|
List<User> user = dao.query(User.class, Cnd.where("id", "in", users));
|
||||||
List<NutMap> map = new ArrayList<>();
|
List<String> loginNames = user.stream().map(User::getLoginname).toList();
|
||||||
user.forEach(u -> {
|
msgNotifyService.sendMsg2(msgNotify.getSendTypes(), loginNames, msgNotify.getContent());
|
||||||
map.add(NutMap.NEW().addv("userId", u.getLoginname()).addv("mobile", u.getMobile()));
|
|
||||||
});
|
|
||||||
msgNotifyService.sendMsg(msgNotify.getSendTypes(), map, msgNotify.getContent());
|
|
||||||
}
|
}
|
||||||
for (String u : users) {
|
for (String u : users) {
|
||||||
if (flag) {
|
if (flag) {
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ public interface MsgNotifyService {
|
|||||||
*/
|
*/
|
||||||
void sendMsg(List<String> sendTypes, List<NutMap> receivers, String content);
|
void sendMsg(List<String> sendTypes, List<NutMap> receivers, String content);
|
||||||
|
|
||||||
|
void sendMsg2(List<String> sendTypes, List<String> loginNames, String content);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询活动设置人员
|
* 查询活动设置人员
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
package io.v.nutz.zhgh.msgNotify.service.impl;
|
package io.v.nutz.zhgh.msgNotify.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.net.URLEncodeUtil;
|
||||||
|
import cn.hutool.core.util.URLUtil;
|
||||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||||
import io.v.nutz.base.utils.DateUtil;
|
import io.v.nutz.base.utils.DateUtil;
|
||||||
import io.v.nutz.base.utils.MsgApi;
|
import io.v.nutz.base.utils.MsgApi;
|
||||||
import io.v.nutz.sys.models.User;
|
import io.v.nutz.sys.models.User;
|
||||||
|
import io.v.nutz.web.commons.base.Globals;
|
||||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||||
import io.v.nutz.zhgh.msgNotify.models.MsgNotify;
|
import io.v.nutz.zhgh.msgNotify.models.MsgNotify;
|
||||||
import io.v.nutz.zhgh.msgNotify.models.MsgNotifyUser;
|
import io.v.nutz.zhgh.msgNotify.models.MsgNotifyUser;
|
||||||
@@ -124,7 +127,7 @@ public class MsgNotifyServiceImpl extends ViServiceImpl<MsgNotify> implements Ms
|
|||||||
new Thread() {
|
new Thread() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (sendTypes.contains("0")) {
|
if (sendTypes.contains("DingTalk")) {
|
||||||
// msgApi.sendMsg(content, null, null, null, "0", receivers);
|
// msgApi.sendMsg(content, null, null, null, "0", receivers);
|
||||||
}
|
}
|
||||||
if (sendTypes.contains("1")) {
|
if (sendTypes.contains("1")) {
|
||||||
@@ -144,6 +147,15 @@ public class MsgNotifyServiceImpl extends ViServiceImpl<MsgNotify> implements Ms
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendMsg2(List<String> sendTypes, List<String> loginNames, String content) {
|
||||||
|
if (sendTypes.contains("DingTalk")) {
|
||||||
|
String url = URLUtil.encode("/file_server/fileStreamPreview?id=fa777e529921481c903c259115cc79e7");
|
||||||
|
String link = Globals.AppDomain + "/assets/platform/plugins/pdfJs/web/viewer.html?file="+url;
|
||||||
|
// msgApi.sendMsg(sendTypes, loginNames, 2, "祝贺您获得家情共话观影券,请查收观影指南!", "电影券已发放,请查收指南!",null ,link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询活动设置人员
|
* 查询活动设置人员
|
||||||
|
|||||||
@@ -255,11 +255,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<el-form-item label="发送方式" prop="sendTypes">
|
<el-form-item label="发送方式" prop="sendTypes">
|
||||||
<el-checkbox-group v-model="formData.sendTypes" size="medium">
|
<el-checkbox-group v-model="formData.sendTypes" size="medium">
|
||||||
<el-checkbox :disabled="hold" border label="0">PC门户通知和移动校园</el-checkbox>
|
<el-checkbox :disabled="hold" border label="DingTalk">钉钉</el-checkbox>
|
||||||
<el-checkbox :disabled="hold" border label="1">PC门户</el-checkbox>
|
<!-- <el-checkbox :disabled="hold" border label="1">PC门户</el-checkbox>-->
|
||||||
<el-checkbox :disabled="hold" border label="2">移动校园</el-checkbox>
|
<!-- <el-checkbox :disabled="hold" border label="2">移动校园</el-checkbox>-->
|
||||||
<el-checkbox :disabled="hold" border label="4">短信</el-checkbox>
|
<!-- <el-checkbox :disabled="hold" border label="4">短信</el-checkbox>-->
|
||||||
<el-checkbox :disabled="hold" border label="5">微信企业号</el-checkbox>
|
<!-- <el-checkbox :disabled="hold" border label="5">微信企业号</el-checkbox>-->
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user