消息修改
This commit is contained in:
+1
@@ -32,6 +32,7 @@ public class SysAnnouncement implements Serializable {
|
||||
* 标题
|
||||
*/
|
||||
@Excel(name = "标题", width = 15)
|
||||
@Dict(dicCode = "message_type")
|
||||
private java.lang.String titile;
|
||||
/**
|
||||
* 内容
|
||||
|
||||
+2
@@ -2,6 +2,7 @@ package com.jero.modules.system.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
@@ -29,6 +30,7 @@ public class AnnouncementSendModel implements Serializable {
|
||||
/**用户id*/
|
||||
private java.lang.String userId;
|
||||
/**标题*/
|
||||
@Dict(dicCode = "message_type")
|
||||
private java.lang.String titile;
|
||||
/**内容*/
|
||||
private java.lang.String msgContent;
|
||||
|
||||
+7
@@ -243,4 +243,11 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
String resetPassword(String username);
|
||||
|
||||
void verificationChangePassword(SysLoginVO loginVO);
|
||||
|
||||
/**
|
||||
* 通过角色编码,查询角色下用户
|
||||
* @param roleCode 角色集合
|
||||
* @return
|
||||
*/
|
||||
List<SysUser> getRolesUser(List<String> roleCode);
|
||||
}
|
||||
|
||||
+32
-5
@@ -407,13 +407,13 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
}
|
||||
SysMessageTemplate sysSmsTemplate = sysSmsTemplates.get(0);
|
||||
//模板标题
|
||||
title = title==null?sysSmsTemplate.getTemplateName():title;
|
||||
// title = title==null?sysSmsTemplate.getTemplateName():title;
|
||||
//模板内容
|
||||
String content = sysSmsTemplate.getTemplateContent();
|
||||
if(map!=null) {
|
||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||
String str = "${" + entry.getKey() + "}";
|
||||
title = title.replace(str, entry.getValue());
|
||||
// title = title.replace(str, entry.getValue());
|
||||
content = content.replace(str, entry.getValue());
|
||||
}
|
||||
}
|
||||
@@ -1015,7 +1015,7 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendEmailTemplateMsg(String email,String title,String templateCode,HashMap<String,String> map) {
|
||||
public void sendEmailTemplateMsg(String email,String title,String templateCode,Map<String,String> map) {
|
||||
if(StringUtils.isBlank(email)){
|
||||
throw new JeroBootException("邮件接收人不能为空");
|
||||
}
|
||||
@@ -1028,13 +1028,13 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
}
|
||||
SysMessageTemplate sysSmsTemplate = sysSmsTemplates.get(0);
|
||||
//模板标题
|
||||
title = Objects.isNull(title) ? sysSmsTemplate.getTemplateName() : title;
|
||||
// title = Objects.isNull(title) ? sysSmsTemplate.getTemplateName() : title;
|
||||
//模板内容
|
||||
String content = sysSmsTemplate.getTemplateContent();
|
||||
if(!Objects.isNull(map)) {
|
||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||
String str = "${" + entry.getKey() + "}";
|
||||
title = title.replace(str, entry.getValue());
|
||||
// title = title.replace(str, entry.getValue());
|
||||
content = content.replace(str, entry.getValue());
|
||||
}
|
||||
}
|
||||
@@ -1059,6 +1059,33 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
huaWeiSmsUtil.sendVerificationCode(phone, codeType, codeTime, templateParas);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendSMS(String phone, String codeType, String codeTime,String templateCode,HashMap<String,String> map) {
|
||||
if(StringUtils.isBlank(phone)){
|
||||
throw new JeroBootException("手机号不能为空");
|
||||
}
|
||||
if(StringUtils.isBlank(templateCode)){
|
||||
throw new JeroBootException("模板编码不能为空");
|
||||
}
|
||||
List<SysMessageTemplate> sysSmsTemplates = sysMessageTemplateService.selectByCode(templateCode);
|
||||
if(CollectionUtils.isEmpty(sysSmsTemplates)){
|
||||
throw new JeroBootException("消息模板不存在,模板编码:"+templateCode);
|
||||
}
|
||||
SysMessageTemplate sysSmsTemplate = sysSmsTemplates.get(0);
|
||||
//模板标题
|
||||
String title = sysSmsTemplate.getTemplateName();
|
||||
//模板内容
|
||||
String content = sysSmsTemplate.getTemplateContent();
|
||||
if(!Objects.isNull(map)) {
|
||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||
String str = "${" + entry.getKey() + "}";
|
||||
title = title.replace(str, entry.getValue());
|
||||
content = content.replace(str, entry.getValue());
|
||||
}
|
||||
}
|
||||
huaWeiSmsUtil.sendVerificationCode(phone, codeType, codeTime, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门id查询部门所有的父级(不包含自己)
|
||||
* @author 马志朝
|
||||
|
||||
+27
@@ -27,7 +27,9 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
@@ -520,6 +522,31 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
//SysRole sysRole = sysRoleMapper.selectOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleCode, roles.get(0)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUser> getRolesUser(List<String> roleCode) {
|
||||
if(CollectionUtils.isEmpty(roleCode)){
|
||||
throw new JeroBootException("角色编码为空!");
|
||||
}
|
||||
LambdaQueryWrapper<SysRole> queryRole = new LambdaQueryWrapper<>();
|
||||
queryRole.in(SysRole::getRoleCode,roleCode);
|
||||
List<SysRole> listSysRole = sysRoleMapper.selectList(queryRole);
|
||||
if(CollectionUtils.isEmpty(listSysRole)){
|
||||
throw new JeroBootException("角色不存在!");
|
||||
}
|
||||
List<String> listRoleId = listSysRole.stream().map(SysRole::getId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<SysUserRole> querySysUserRole = new LambdaQueryWrapper<>();
|
||||
querySysUserRole.in(SysUserRole::getRoleId,listRoleId);
|
||||
List<SysUserRole> listSysUserRole = sysUserRoleMapper.selectList(querySysUserRole);
|
||||
if(StringUtils.isEmpty(listSysUserRole)){
|
||||
return null;
|
||||
}
|
||||
List<String> listUserId = listSysUserRole.stream().map(SysUserRole::getUserId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<SysUser> querySysUser = new LambdaQueryWrapper<>();
|
||||
querySysUser.in(SysUser::getId,listUserId);
|
||||
List<SysUser> listSysUser = userMapper.selectList(querySysUser);
|
||||
return listSysUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* 忘记密码校验
|
||||
* @param user
|
||||
|
||||
Reference in New Issue
Block a user