功能优化
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
package com.ruoyi.system.domain.entity.log;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
+14
-8
@@ -1,9 +1,15 @@
|
||||
package com.ruoyi.system.domain.entity.shortmessage;
|
||||
|
||||
import java.util.Date;
|
||||
import javax.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import lombok.*;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@@ -20,6 +26,11 @@ public class MsSmsSendHistoryRecord {
|
||||
*/
|
||||
@Column(name = "case_appli_id")
|
||||
private Long caseAppliId;
|
||||
/**
|
||||
* 短信模板表主键id
|
||||
*/
|
||||
@Column(name = "ms_sms_template_id")
|
||||
private Long msSmsTemplateId;
|
||||
|
||||
/**
|
||||
* 案件编号
|
||||
@@ -44,11 +55,6 @@ public class MsSmsSendHistoryRecord {
|
||||
@Column(name = "send_status")
|
||||
private Long sendStatus;
|
||||
|
||||
/**
|
||||
* 发送内容
|
||||
*/
|
||||
@Column(name = "send_content")
|
||||
private String sendContent;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.system.domain.entity.sms;
|
||||
|
||||
import javax.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Table(name = "ms_sms_send_history_record_param")
|
||||
public class MsSmsSendHistoryRecordParam {
|
||||
@Id
|
||||
@GeneratedValue(generator = "JDBC")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 短信历史记录表id
|
||||
*/
|
||||
@Column(name = "sms_record_history_id")
|
||||
private Long smsRecordHistoryId;
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
@Column(name = "param_value")
|
||||
private String paramValue;
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.ruoyi.system.domain.entity.sms;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Table(name = "ms_sms_send_record_param")
|
||||
public class MsSmsSendRecordParam {
|
||||
@Id
|
||||
@GeneratedValue(generator = "JDBC")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 短信记录表id
|
||||
*/
|
||||
@Column(name = "sms_record_id")
|
||||
private Long smsRecordId;
|
||||
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
@Column(name = "param_value")
|
||||
private String paramValue;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.ruoyi.system.domain.entity.sms;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Table(name = "ms_sms_template")
|
||||
public class MsSmsTemplate {
|
||||
@Id
|
||||
@GeneratedValue(generator = "JDBC")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 腾讯云模板id
|
||||
*/
|
||||
@Column(name = "template_id")
|
||||
private String templateId;
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 模板内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 模板参数
|
||||
*/
|
||||
@Transient
|
||||
private List<MsSmsTemplateParam> templateParams;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.ruoyi.system.domain.entity.sms;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Table(name = "ms_sms_template_param")
|
||||
public class MsSmsTemplateParam {
|
||||
@Id
|
||||
@GeneratedValue(generator = "JDBC")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* ms_sms_template表id
|
||||
*/
|
||||
@Column(name = "sms_template_id")
|
||||
private Long smsTemplateId;
|
||||
|
||||
/**
|
||||
* 参数
|
||||
*/
|
||||
private String param;
|
||||
/**
|
||||
* 参数名
|
||||
*/
|
||||
@Column(name = "param_name")
|
||||
private String paramName;
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
@Transient
|
||||
private String paramValue;
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.system.mapper.sms;
|
||||
|
||||
import com.ruoyi.system.domain.entity.sms.MsSmsSendHistoryRecordParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MsSmsSendHistoryRecordParamMapper extends Mapper<MsSmsSendHistoryRecordParam> {
|
||||
/**
|
||||
* 批量新增
|
||||
* @param historyRecordParams
|
||||
*/
|
||||
@Select("<script> INSERT INTO ms_sms_send_history_record_param (sms_record_history_id, param_value)\n" +
|
||||
" VALUES\n" +
|
||||
" <foreach item=\"item\" index=\"index\" collection=\"list\" separator=\",\">\n" +
|
||||
" (#{item.smsRecordHistoryId}, #{item.paramValue})\n" +
|
||||
" </foreach> " +
|
||||
"</script>")
|
||||
void batchInsert(@Param("list") List<MsSmsSendHistoryRecordParam> historyRecordParams);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.system.mapper.sms;
|
||||
|
||||
import com.ruoyi.system.domain.entity.sms.MsSmsSendRecordParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MsSmsSendRecordParamMapper extends Mapper<MsSmsSendRecordParam> {
|
||||
/**
|
||||
* 批量插入
|
||||
* @param list
|
||||
*/
|
||||
@Select("<script> INSERT INTO ms_sms_send_record_param (sms_record_id, param_value)\n" +
|
||||
" VALUES\n" +
|
||||
" <foreach item=\"item\" index=\"index\" collection=\"list\" separator=\",\">\n" +
|
||||
" (#{item.smsRecordId}, #{item.paramValue})\n" +
|
||||
" </foreach> " +
|
||||
"</script>")
|
||||
void batchInsert(@Param("list") List<MsSmsSendRecordParam> list);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.ruoyi.system.mapper.sms;
|
||||
|
||||
import com.ruoyi.system.domain.entity.sms.MsSmsTemplate;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface MsSmsTemplateMapper extends Mapper<MsSmsTemplate> {
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ruoyi.system.mapper.sms;
|
||||
|
||||
import com.ruoyi.system.domain.entity.sms.MsSmsTemplateParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MsSmsTemplateParamMapper extends Mapper<MsSmsTemplateParam> {
|
||||
@Select("<script> INSERT INTO ms_sms_template_param (sms_template_id, param,param_name)\n" +
|
||||
" VALUES\n" +
|
||||
" <foreach item=\"item\" index=\"index\" collection=\"list\" separator=\",\">\n" +
|
||||
" (#{item.smsTemplateId}, #{item.param}, #{item.paramName})\n" +
|
||||
" </foreach> " +
|
||||
"</script>")
|
||||
void batchInsert(@Param("list") List<MsSmsTemplateParam> templateParams);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.TreeSelect;
|
||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||
import com.ruoyi.system.domain.vo.RouterVo;
|
||||
@@ -149,4 +150,10 @@ public interface ISysMenuService
|
||||
*/
|
||||
|
||||
Set<String> selectAdminMenu();
|
||||
|
||||
/**
|
||||
* 根据用户查询菜单权限字符
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getMenuPermsByUser();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
@@ -16,6 +17,7 @@ import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.system.mapper.SysDeptMapper;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseApplicationMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -39,6 +41,8 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
private SysRoleMapper roleMapper;
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
@Autowired
|
||||
MsCaseApplicationMapper caseApplicationMapper;
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
@@ -302,6 +306,11 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
@Override
|
||||
public int deleteDeptById(Long deptId)
|
||||
{
|
||||
// 查询部门是否与案件有关
|
||||
List<Long> caseList = caseApplicationMapper.selectCaseByDeptId(deptId);
|
||||
if(CollectionUtil.isNotEmpty(caseList)){
|
||||
throw new ServiceException("该部门有关联案件,不允许删除");
|
||||
}
|
||||
SysDept sysDept = deptMapper.selectDeptById(deptId);
|
||||
if(sysDept!=null) {
|
||||
// 删除缓存
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.TreeSelect;
|
||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
@@ -139,6 +140,14 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
return permsSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getMenuPermsByUser() {
|
||||
AjaxResult result = AjaxResult.success();
|
||||
List<String> perms = menuMapper.selectMenuPermsByUserId(SecurityUtils.getUserId());
|
||||
result.put("perms",perms);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID查询菜单
|
||||
*
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.ruoyi.system.domain.SysUserRole;
|
||||
import com.ruoyi.system.mapper.*;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseApplicationMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -30,6 +31,7 @@ import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.validation.Validator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -70,6 +72,8 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||
protected Validator validator;
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
@Autowired
|
||||
MsCaseApplicationMapper msCaseApplicationMapper;
|
||||
|
||||
/**
|
||||
* 根据条件分页查询用户列表
|
||||
@@ -460,9 +464,16 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||
@Transactional
|
||||
public int deleteUserById(Long userId) {
|
||||
// 删除用户与角色关联
|
||||
userRoleMapper.deleteUserRoleByUserId(userId);
|
||||
// userRoleMapper.deleteUserRoleByUserId(userId);
|
||||
// 删除用户与岗位表
|
||||
userPostMapper.deleteUserPostByUserId(userId);
|
||||
// userPostMapper.deleteUserPostByUserId(userId);
|
||||
// 与案件有关的人员不能删除
|
||||
List<Long> userIds = new ArrayList<>();
|
||||
userIds.add(userId);
|
||||
List<Long> caseIds= msCaseApplicationMapper.countCasePerson(userIds);
|
||||
if(CollectionUtil.isNotEmpty(caseIds)){
|
||||
throw new ServiceException("该人员已参与案件,不能删除");
|
||||
}
|
||||
int i = userMapper.deleteUserById(userId);
|
||||
// 删除缓存
|
||||
redisCache.deleteObject(CacheConstants.USER_KEY+userId);
|
||||
@@ -478,6 +489,14 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||
@Override
|
||||
@Transactional
|
||||
public int deleteUserByIds(Long[] userIds) {
|
||||
// 校验是否与案件关联
|
||||
if(userIds==null || userIds.length==0){
|
||||
throw new ServiceException("请选择删除的用户");
|
||||
}
|
||||
List<Long> caseIds= msCaseApplicationMapper.countCasePerson(new ArrayList<>(Arrays.asList(userIds)));
|
||||
if(CollectionUtil.isNotEmpty(caseIds)){
|
||||
throw new ServiceException("删除人员中存在与案件关联的人员,不能删除");
|
||||
}
|
||||
for (Long userId : userIds) {
|
||||
checkUserAllowed(new SysUser(userId));
|
||||
checkUserDataScope(userId);
|
||||
|
||||
Reference in New Issue
Block a user