Browse Source

[feat]增加批量发送短信动态模版配置

dev
杨威 6 months ago
parent
commit
0871084c84
  1. 2
      dk-api/api-system/src/main/java/org/dromara/system/api/RemoteSubmailConfigService.java
  2. 6
      dk-modules/system/src/main/java/org/dromara/system/dubbo/RemoteSubmailConfigServiceImpl.java
  3. 2
      dk-modules/system/src/main/java/org/dromara/system/service/ISysSubmailConfigService.java
  4. 8
      dk-modules/system/src/main/java/org/dromara/system/service/impl/SysSubmailConfigServiceImpl.java
  5. 2
      dk-modules/workflow/src/main/java/org/dromara/workflow/service/impl/FlwTaskServiceImpl.java

2
dk-api/api-system/src/main/java/org/dromara/system/api/RemoteSubmailConfigService.java

@ -35,6 +35,6 @@ public interface RemoteSubmailConfigService {
* @param userId
* @param noticeMap
*/
void remoteSendUser(String code,List<Long> userId,Map<String, Object> noticeMap);
void remoteSendUser(String code,List<Long> userId,Map<String, Object> noticeMap,String project);
}

6
dk-modules/system/src/main/java/org/dromara/system/dubbo/RemoteSubmailConfigServiceImpl.java

@ -60,7 +60,7 @@ public class RemoteSubmailConfigServiceImpl implements RemoteSubmailConfigServic
Long deptId = Convert.toLong(map.get("deptId"));
List<SysUserVo> sysUserVos = userService.selectUserListByDept(Convert.toLong(deptId));
Set<String> phones = sysUserVos.stream().filter(u -> u.getNoticeType() == 1 && StrUtil.isNotEmpty(u.getPhonenumber())).map(SysUserVo::getPhonenumber).collect(Collectors.toSet());
sysSubmailConfigService.sendPhone(code,phones, JSON.toJSONString(map));
sysSubmailConfigService.sendPhone(code,phones, JSON.toJSONString(map),null);
}
}
@ -74,7 +74,7 @@ public class RemoteSubmailConfigServiceImpl implements RemoteSubmailConfigServic
* @param noticeMap
*/
@Override
public void remoteSendUser(String code, List<Long> userIds, Map<String, Object> noticeMap) {
public void remoteSendUser(String code, List<Long> userIds, Map<String, Object> noticeMap,String project) {
userIds.forEach(userId -> {
SysUserVo sysUserVo = userService.selectUserById(userId);
@ -83,7 +83,7 @@ public class RemoteSubmailConfigServiceImpl implements RemoteSubmailConfigServic
Set<String> phones = new HashSet<>();
phones.add(sysUserVo.getPhonenumber());
sysSubmailConfigService.sendPhone(code,phones, JSON.toJSONString(noticeMap));
sysSubmailConfigService.sendPhone(code,phones, JSON.toJSONString(noticeMap),project);
}
});

2
dk-modules/system/src/main/java/org/dromara/system/service/ISysSubmailConfigService.java

@ -72,7 +72,7 @@ public interface ISysSubmailConfigService {
R<String> cmdSend(String code, String multiParam);
R<String> sendPhone(String code,Set<String>phones, String multiParam);
R<String> sendPhone(String code,Set<String>phones, String multiParam,String project);
String submailSendUtil(SysSubmailConfigBo bo, List<SysSubmailConfigUserVo> configUserVoList);
String submailSendPhone(SysSubmailConfigBo bo, Set<String> phones);

8
dk-modules/system/src/main/java/org/dromara/system/service/impl/SysSubmailConfigServiceImpl.java

@ -3,6 +3,7 @@ package org.dromara.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONArray;
@ -187,7 +188,7 @@ public class SysSubmailConfigServiceImpl implements ISysSubmailConfigService {
}
@Override
public R<String> sendPhone(String code, Set<String> phones, String multiParam) {
public R<String> sendPhone(String code, Set<String> phones, String multiParam,String project) {
//找到生效配置
SysSubmailConfigBo bo = new SysSubmailConfigBo();
bo.setCode(code);
@ -197,6 +198,11 @@ public class SysSubmailConfigServiceImpl implements ISysSubmailConfigService {
}
SysSubmailConfigVo firstConfigVo = sysSubmailConfigVoTempList.get(0);
//如果模版不为空则使用传过来的模版
if (ObjectUtil.isNotEmpty(project)){
firstConfigVo.setProject(project);
}
BeanUtil.copyProperties(firstConfigVo,bo);
bo.setMultiParam(multiParam);

2
dk-modules/workflow/src/main/java/org/dromara/workflow/service/impl/FlwTaskServiceImpl.java

@ -243,7 +243,7 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
//发送短信是否属于指派
if(completeTaskBo.getAssign()){
remoteSubmailConfigService.remoteSendUser("smsMultixsend",List.of(Long.valueOf(completeTaskBo.getHandler())),noticeMap);
remoteSubmailConfigService.remoteSendUser("smsMultixsend",List.of(Long.valueOf(completeTaskBo.getHandler())),noticeMap,"kKv7s3");
}

Loading…
Cancel
Save