Explorar o código

fix(service): 统一添加权限校验异常声明并清理冗余代码

- 在多个服务类方法中添加 throws BusinessException 异常声明,统一权限校验异常处理
- 在权限校验相关方法中增加异常抛出,确保无权操作时能正确抛出异常
- 移除 SysParamBaseDataService 和 SysUserGroupRelationService 中未使用的 sysCustomerFollowMapper 变量
- 删除 SysUserRoleRelationService 中异步执行更新用户角色的注释代码,简化逻辑
- 清理 SysParamBaseDataService 中注释掉的业务校验代码,保留核心逻辑
- 增加日志记录及异常抛出,提升后台管理操作的可靠性与一致性
zhangxf hai 3 semanas
pai
achega
2fcfd373f6

+ 2 - 2
src/main/java/com/jtzx/crm/module/sys/service/SysCustomerDataPermissionService.java

@@ -19,7 +19,7 @@ public class SysCustomerDataPermissionService {
     /**
      * 客户权限,只允许管理员和普通成员查看,没有小组长权限,如果小组长同时是管理员或普通成员,则可以查看
      */
-    public void publicPrivateCustomerPermission() {
+    public void publicPrivateCustomerPermission() throws BusinessException{
         if (CollUtil.isEmpty(UserContextHolder.getUserContext().getRoles())) {
             throw new BusinessException(400, "无权操作");
         }
@@ -29,7 +29,7 @@ public class SysCustomerDataPermissionService {
         }
     }
 
-    public void adminPermission(){
+    public void adminPermission() throws BusinessException{
         if (!UserContextHolder.getUserContext().getRoles().contains("Admin")) {
             throw new BusinessException(400, "无权操作");
         }

+ 10 - 10
src/main/java/com/jtzx/crm/module/sys/service/SysCustomerDataPrivateService.java

@@ -59,7 +59,7 @@ public class SysCustomerDataPrivateService {
      *
      * @return
      */
-    public SysCustomerPrivateSelectBO queryHeadSelectPrivateData() {
+    public SysCustomerPrivateSelectBO queryHeadSelectPrivateData() throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         SysCustomerPrivateSelectBO resultData = SysCustomerPrivateSelectBO.builder().build();
         //类型
@@ -80,7 +80,7 @@ public class SysCustomerDataPrivateService {
     /**
      * 后台管理-我的客户(学校)分页列表
      */
-    public PageResult<SysCustomerDataPrivateBO> adminList(AdminSysCustomerDataPrivateListDTO dto) {
+    public PageResult<SysCustomerDataPrivateBO> adminList(AdminSysCustomerDataPrivateListDTO dto) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         List<Long> userIds = Lists.newArrayList();
         if (dto.getUserId() != null) {
@@ -145,7 +145,7 @@ public class SysCustomerDataPrivateService {
      * @param dto
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminUpdateCustomerData(AdminSysCustomerDataInsertOrUpdateDTO dto) {
+    public void adminUpdateCustomerData(AdminSysCustomerDataInsertOrUpdateDTO dto) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         sysCustomerDataService.adminUpdate(dto);
     }
@@ -157,7 +157,7 @@ public class SysCustomerDataPrivateService {
      * @param customerId
      */
     @Transactional(rollbackFor = Exception.class)
-    public void returnCustomerPublicData(Long customerId) {
+    public void returnCustomerPublicData(Long customerId) throws BusinessException{
         List<String> roles = UserContextHolder.getUserContext().getRoles();
         if (!roles.contains("Admin") && !roles.contains("Member")) {
             throw new BusinessException(400, "无权操作");
@@ -173,7 +173,7 @@ public class SysCustomerDataPrivateService {
      * @return
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminInsertCustomerPerson(AdminSysCustomerPersonInsertOrUpdateDTO dto) {
+    public void adminInsertCustomerPerson(AdminSysCustomerPersonInsertOrUpdateDTO dto) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         sysCustomerPersonService.adminInsert(dto);
     }
@@ -185,7 +185,7 @@ public class SysCustomerDataPrivateService {
      * @param dto
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminUpdateCustomerPerson(AdminSysCustomerPersonInsertOrUpdateDTO dto) {
+    public void adminUpdateCustomerPerson(AdminSysCustomerPersonInsertOrUpdateDTO dto) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         sysCustomerPersonService.adminUpdate(dto);
     }
@@ -196,7 +196,7 @@ public class SysCustomerDataPrivateService {
      * @param id
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminDeleteCustomerPerson(Long id) {
+    public void adminDeleteCustomerPerson(Long id) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         sysCustomerPersonService.adminDelete(id);
     }
@@ -205,7 +205,7 @@ public class SysCustomerDataPrivateService {
     /**
      * 查询我的客户联系人
      */
-    public List<SysCustomerPersonBO> adminListCustomerPerson(CustomerPersonReqDTO dto) {
+    public List<SysCustomerPersonBO> adminListCustomerPerson(CustomerPersonReqDTO dto) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
 
         return sysCustomerPersonService.adminList(dto);
@@ -218,7 +218,7 @@ public class SysCustomerDataPrivateService {
      * @param customerId
      * @return
      */
-    public List<TransferUserReqBO> queryTransferUser(Long customerId) {
+    public List<TransferUserReqBO> queryTransferUser(Long customerId) throws BusinessException{
 
         permissionService.publicPrivateCustomerPermission();
         return sysCustomerDataService.queryTransferUser(customerId);
@@ -229,7 +229,7 @@ public class SysCustomerDataPrivateService {
      *
      * @param dto
      */
-    public void transferUser(TransferUserReqDTO dto) {
+    public void transferUser(TransferUserReqDTO dto) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         sysCustomerDataService.transferUser(dto);
     }

+ 10 - 10
src/main/java/com/jtzx/crm/module/sys/service/SysCustomerDataPublicService.java

@@ -63,7 +63,7 @@ public class SysCustomerDataPublicService {
      *
      * @return
      */
-    public SysCustomerPublicSelectBO queryHeadSelectData() {
+    public SysCustomerPublicSelectBO queryHeadSelectData() throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         //返回数据对象
         SysCustomerPublicSelectBO resultData = SysCustomerPublicSelectBO.builder().build();
@@ -112,7 +112,7 @@ public class SysCustomerDataPublicService {
      * @param dto
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminInsertCustomerData(AdminSysCustomerDataInsertOrUpdateDTO dto) {
+    public void adminInsertCustomerData(AdminSysCustomerDataInsertOrUpdateDTO dto) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         sysCustomerDataService.adminInsert(dto);
     }
@@ -123,7 +123,7 @@ public class SysCustomerDataPublicService {
      * @param dto
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminUpdateCustomerData(AdminSysCustomerDataInsertOrUpdateDTO dto) {
+    public void adminUpdateCustomerData(AdminSysCustomerDataInsertOrUpdateDTO dto) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         sysCustomerDataService.adminUpdate(dto);
     }
@@ -134,7 +134,7 @@ public class SysCustomerDataPublicService {
      * @param id
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminDeleteCustomerData(Long id) {
+    public void adminDeleteCustomerData(Long id) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         sysCustomerDataService.adminDelete(id);
     }
@@ -145,7 +145,7 @@ public class SysCustomerDataPublicService {
      * @param customerId
      */
     @Transactional(rollbackFor = Exception.class)
-    public void claimCustomer(Long customerId) {
+    public void claimCustomer(Long customerId) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         sysCustomerDataService.claimCustomer(customerId);
     }
@@ -158,7 +158,7 @@ public class SysCustomerDataPublicService {
      * @return
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminInsertCustomerPerson(AdminSysCustomerPersonInsertOrUpdateDTO dto) {
+    public void adminInsertCustomerPerson(AdminSysCustomerPersonInsertOrUpdateDTO dto) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         sysCustomerPersonService.adminInsert(dto);
     }
@@ -170,7 +170,7 @@ public class SysCustomerDataPublicService {
      * @param dto
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminUpdateCustomerPerson(AdminSysCustomerPersonInsertOrUpdateDTO dto) {
+    public void adminUpdateCustomerPerson(AdminSysCustomerPersonInsertOrUpdateDTO dto) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         sysCustomerPersonService.adminUpdate(dto);
     }
@@ -181,7 +181,7 @@ public class SysCustomerDataPublicService {
      * @param id
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminDeleteCustomerPerson(Long id) {
+    public void adminDeleteCustomerPerson(Long id) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         sysCustomerPersonService.adminDelete(id);
     }
@@ -189,7 +189,7 @@ public class SysCustomerDataPublicService {
     /**
      * 查询公海客户联系人
      */
-    public List<SysCustomerPersonBO> adminListCustomerPerson(CustomerPersonReqDTO dto) {
+    public List<SysCustomerPersonBO> adminListCustomerPerson(CustomerPersonReqDTO dto) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         return sysCustomerPersonService.adminList(dto);
     }
@@ -233,7 +233,7 @@ public class SysCustomerDataPublicService {
     /**
      * 操作日志列表查询
      */
-    public SysCustomerOperLogDataBO queryOperLogData(AdminSysCustomerOperLogListDTO dto) {
+    public SysCustomerOperLogDataBO queryOperLogData(AdminSysCustomerOperLogListDTO dto) throws BusinessException{
         permissionService.publicPrivateCustomerPermission();
         List<Long> userIds = Lists.newArrayList();
         if (dto.getOperUserId() != null) {

+ 4 - 4
src/main/java/com/jtzx/crm/module/sys/service/SysCustomerDataService.java

@@ -174,7 +174,7 @@ public class SysCustomerDataService {
      * 后台管理-删除
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminDelete(Long id) {
+    public void adminDelete(Long id) throws BusinessException{
         log.info("[后台管理-客户(学校)数据-删除] >> id={}", id);
         SysCustomerDataEntity entity = sysCustomerDataMapper.selectById(id);
         if (entity != null) {
@@ -316,7 +316,7 @@ public class SysCustomerDataService {
      * @param customerId
      */
     @Transactional(rollbackFor = Exception.class)
-    public void returnCustomerData(Long customerId) {
+    public void returnCustomerData(Long customerId) throws BusinessException {
         //先查询有没有赢单
         SysCustomerDataEntity sysCustomerDataEntity = sysCustomerDataMapper.selectById(customerId);
         if (sysCustomerDataEntity == null) {
@@ -391,7 +391,7 @@ public class SysCustomerDataService {
      *
      * @param dto
      */
-    public void transferUser(TransferUserReqDTO dto) {
+    public void transferUser(TransferUserReqDTO dto) throws BusinessException{
         SysCustomerDataEntity sysCustomerDataEntity = sysCustomerDataMapper.selectById(dto.getCustomerId());
         if (sysCustomerDataEntity == null) {
             throw new BusinessException(400, "客户信息不存在");
@@ -458,7 +458,7 @@ public class SysCustomerDataService {
      * @param customerId
      * @return
      */
-    public List<TransferUserReqBO> queryTransferUser(Long customerId) {
+    public List<TransferUserReqBO> queryTransferUser(Long customerId) throws BusinessException{
         SysCustomerDataEntity sysCustomerDataEntity = sysCustomerDataMapper.selectById(customerId);
         if (sysCustomerDataEntity == null) {
             throw new BusinessException(400, "客户信息不存在");

+ 2 - 2
src/main/java/com/jtzx/crm/module/sys/service/SysCustomerFollowAuditService.java

@@ -35,7 +35,7 @@ public class SysCustomerFollowAuditService {
     /**
      * 赢单审核申请列表查询
      */
-    public SysCustomerFollowAuditDataBO adminList(Integer auditStatus) {
+    public SysCustomerFollowAuditDataBO adminList(Integer auditStatus) throws BusinessException{
 
         if (!UserContextHolder.getUserContext().getRoles().contains("Admin")) {
             throw new BusinessException(403, "无权操作");
@@ -82,7 +82,7 @@ public class SysCustomerFollowAuditService {
      *
      * @param id
      */
-    public void auditFollow(Long id, Integer auditStatus) {
+    public void auditFollow(Long id, Integer auditStatus) throws BusinessException{
         if (!UserContextHolder.getUserContext().getRoles().contains("Admin")) {
             throw new BusinessException(403, "无权操作");
         }

+ 3 - 3
src/main/java/com/jtzx/crm/module/sys/service/SysCustomerPersonService.java

@@ -85,7 +85,7 @@ public class SysCustomerPersonService {
      * 后台管理-新增
      */
     @Transactional(rollbackFor = Exception.class)
-    public Long adminInsert(AdminSysCustomerPersonInsertOrUpdateDTO dto) {
+    public Long adminInsert(AdminSysCustomerPersonInsertOrUpdateDTO dto) throws BusinessException{
         log.info("[后台管理-客户(学校)联系人数据-新增] >> DTO={}", dto);
         SysCustomerDataEntity sysCustomerDataEntity = sysCustomerDataMapper.selectById(dto.getCustomerId());
         if (sysCustomerDataEntity == null) {
@@ -120,7 +120,7 @@ public class SysCustomerPersonService {
      * 后台管理-编辑
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminUpdate(AdminSysCustomerPersonInsertOrUpdateDTO dto) {
+    public void adminUpdate(AdminSysCustomerPersonInsertOrUpdateDTO dto) throws BusinessException{
         log.info("[后台管理-客户(学校)联系人数据-编辑] >> DTO={}", dto);
         SysCustomerDataEntity entity = sysCustomerDataMapper.selectById(dto.getCustomerId());
         if (entity == null) {
@@ -171,7 +171,7 @@ public class SysCustomerPersonService {
      * 后台管理-删除
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminDelete(Long id) {
+    public void adminDelete(Long id) throws BusinessException{
         log.info("[后台管理-客户(学校)联系人数据-删除] >> id={}", id);
         SysCustomerPersonEntity sysCustomerPersonEntity = sysCustomerPersonMapper.selectById(id);
         if (sysCustomerPersonEntity == null) {

+ 2 - 2
src/main/java/com/jtzx/crm/module/sys/service/SysGroupService.java

@@ -85,7 +85,7 @@ public class SysGroupService {
      * 后台管理-编辑
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminUpdate(AdminSysGroupInsertOrUpdateDTO dto) {
+    public void adminUpdate(AdminSysGroupInsertOrUpdateDTO dto) throws BusinessException{
         log.info("[后台管理-后台分组数据-编辑] >> DTO={}", dto);
         SysGroupEntity entity = sysGroupMapper.selectById(dto.getId());
         if (!dto.getTitle().equals(entity.getTitle())) {
@@ -111,7 +111,7 @@ public class SysGroupService {
      * 后台管理-删除
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminDelete(Long id) {
+    public void adminDelete(Long id) throws BusinessException{
         log.info("[后台管理-后台分组数据-删除] >> id={}", id);
         //分组下面有人员就不能删除
         long size =

+ 1 - 37
src/main/java/com/jtzx/crm/module/sys/service/SysParamBaseDataService.java

@@ -5,7 +5,6 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.jtzx.crm.module.sys.entity.SysParamBaseDataEntity;
-import com.jtzx.crm.module.sys.mapper.SysCustomerFollowMapper;
 import com.jtzx.crm.module.sys.mapper.SysParamBaseDataMapper;
 import com.jtzx.crm.module.sys.model.request.AdminSysParamBaseDataInsertOrUpdateDTO;
 import com.jtzx.crm.module.sys.model.response.SysParamBaseDataBO;
@@ -29,7 +28,6 @@ public class SysParamBaseDataService {
 
     private final SysParamBaseDataMapper sysParamBaseDataMapper;
 
-    private final SysCustomerFollowMapper sysCustomerFollowMapper;
 
     /**
      * 查询学段
@@ -123,8 +121,6 @@ public class SysParamBaseDataService {
                 sysParamBaseDataMapper.updateById(sysParamBaseDataEntity);
             });
         }
-
-
         return entity.getId();
     }
 
@@ -135,22 +131,6 @@ public class SysParamBaseDataService {
     public void update(AdminSysParamBaseDataInsertOrUpdateDTO dto) {
         log.info("[后台管理-学段,产品,职务,跟进管理-编辑] >> DTO={}", dto);
         SysParamBaseDataEntity entity = sysParamBaseDataMapper.selectById(dto.getId());
-//        if (!entity.getTitle().equals(dto.getTitle())) {
-//            long count =
-//                    sysCustomerFollowMapper.selectCount(
-//                            new LambdaQueryWrapper<>(SysCustomerFollowEntity.class)
-//                                    .select(
-//                                            SysCustomerFollowEntity::getId
-//                                    )
-//                                    .eq(dto.getType() == 0, SysCustomerFollowEntity::getStageId, dto.getId())
-//                                    .eq(dto.getType() == 1, SysCustomerFollowEntity::getProductId, dto.getId())
-//                                    .eq(dto.getType() == 2, SysCustomerFollowEntity::getPositionId, dto.getId())
-//                                    .eq(dto.getType() == 3, SysCustomerFollowEntity::getFollowId, dto.getId())
-//                    );
-//            if (count > 0) {
-//                throw new BusinessException(400, "存在跟进数据,不能删除");
-//            }
-//        }
         dto.setType(null);
         BeanUtil.copyProperties(dto, entity);
         sysParamBaseDataMapper.updateById(entity);
@@ -160,7 +140,7 @@ public class SysParamBaseDataService {
      * 后台管理-删除,学段,产品,职务,跟进状态数据
      */
     @Transactional(rollbackFor = Exception.class)
-    public void delete(Long id) {
+    public void delete(Long id) throws BusinessException{
         log.info("[后台管理-学段,产品,职务,跟进管理-删除] >> id={}", id);
         SysParamBaseDataEntity sysParamBaseDataEntity = sysParamBaseDataMapper.selectById(id);
         //把id之后的数据编号都往前提一个数
@@ -168,22 +148,6 @@ public class SysParamBaseDataService {
             if (sysParamBaseDataEntity.getStatus() == 1) {
                 throw new BusinessException(400, "系统默认不能删除");
             }
-
-//            long count =
-//                    sysCustomerFollowMapper.selectCount(
-//                            new LambdaQueryWrapper<>(SysCustomerFollowEntity.class)
-//                                    .select(
-//                                            SysCustomerFollowEntity::getId
-//                                    )
-//                                    .eq(sysParamBaseDataEntity.getType() == 0, SysCustomerFollowEntity::getStageId, sysParamBaseDataEntity.getId())
-//                                    .eq(sysParamBaseDataEntity.getType() == 1, SysCustomerFollowEntity::getProductId, sysParamBaseDataEntity.getId())
-//                                    .eq(sysParamBaseDataEntity.getType() == 2, SysCustomerFollowEntity::getPositionId, sysParamBaseDataEntity.getId())
-//                                    .eq(sysParamBaseDataEntity.getType() == 3, SysCustomerFollowEntity::getFollowId, sysParamBaseDataEntity.getId())
-//                    );
-//            if (count > 0) {
-//                throw new BusinessException(400, "存在跟进数据,不能删除");
-//            }
-
             List<SysParamBaseDataEntity> dataEntityList =
                     sysParamBaseDataMapper.selectList(
                             new LambdaQueryWrapper<>(sysParamBaseDataEntity)

+ 1 - 2
src/main/java/com/jtzx/crm/module/sys/service/SysUserGroupRelationService.java

@@ -49,7 +49,6 @@ public class SysUserGroupRelationService {
 
     private final AsyncVThreadConfiguration asyncVThreadConfiguration;
 
-    private final SysCustomerFollowMapper sysCustomerFollowMapper;
 
     /**
      * 查询所有用户(左侧列表数据)
@@ -370,7 +369,7 @@ public class SysUserGroupRelationService {
      * 后台管理-新增
      */
     @Transactional(rollbackFor = Exception.class)
-    public Long adminInsert(AdminSysUserGroupRelationDTO dto) {
+    public Long adminInsert(AdminSysUserGroupRelationDTO dto) throws BusinessException{
         log.info("[后台管理-数据表注释-新增] >> DTO={}", dto);
         //先判断有没有同个人有没有重复
         long count =

+ 1 - 19
src/main/java/com/jtzx/crm/module/sys/service/SysUserRoleRelationService.java

@@ -9,7 +9,6 @@ import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
-import com.jtzx.crm.config.AsyncVThreadConfiguration;
 import com.jtzx.crm.module.api.util.CrmAdminStpUtil;
 import com.jtzx.crm.module.sys.entity.SysGroupEntity;
 import com.jtzx.crm.module.sys.entity.SysRoleEntity;
@@ -48,8 +47,6 @@ public class SysUserRoleRelationService {
 
     private final SysGroupMapper sysGroupMapper;
 
-    private final AsyncVThreadConfiguration asyncVThreadConfiguration;
-
     /**
      * 更新用户redis中的角色信息
      *
@@ -443,7 +440,7 @@ public class SysUserRoleRelationService {
      * 注:本方法较为特殊,仅供SysTenantFacadeImpl调用
      */
     @Transactional(rollbackFor = Exception.class)
-    public Long adminInsert(UserRoleRelationInsertDTO dto) {
+    public Long adminInsert(UserRoleRelationInsertDTO dto) throws BusinessException{
 
         long count =
                 sysUserRoleRelationMapper.selectCount(
@@ -491,13 +488,6 @@ public class SysUserRoleRelationService {
                     .setUserId(dto.getUserId()).setRoleId(dto.getRoleId()).setGroupId(dto.getGroupId()).setRoleValue(sysRoleEntity.getValue());
             sysUserRoleRelationMapper.insert(entity);
             this.updateUserRole(dto.getUserId());
-//            if (sysRoleEntity.getValue().equals("Admin")) {
-//                CrmAdminStpUtil.kickout(dto.getUserId());
-//            } else {
-//                //异步执行更新用户角色问题
-//                asyncVThreadConfiguration.getAsyncExecutor().execute(() ->
-//                        this.updateUserRole(dto.getUserId()));
-//            }
         }
 
     }
@@ -509,14 +499,6 @@ public class SysUserRoleRelationService {
             sysUserRoleRelationMapper.deleteById(id);
             //如果处理的是管理员,需要重新登陆
             CrmAdminStpUtil.kickout(roleRelationEntity.getUserId());
-//            this.updateUserRole(roleRelationEntity.getUserId());
-//            if (roleRelationEntity.getRoleValue().equals("Admin")) {
-//                CrmAdminStpUtil.kickout(roleRelationEntity.getUserId());
-//            } else {
-//                //异步执行更新用户角色问题
-//                asyncVThreadConfiguration.getAsyncExecutor().execute(() ->
-//                        this.updateUserRole(roleRelationEntity.getUserId()));
-//            }
         }
     }
 

+ 5 - 5
src/main/java/com/jtzx/crm/module/sys/service/SysUserService.java

@@ -116,7 +116,7 @@ public class SysUserService {
      * 后台管理-编辑
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminUpdate(InsertOrUpdateSysUserDTO dto) {
+    public void adminUpdate(InsertOrUpdateSysUserDTO dto) throws BusinessException{
         log.info("[后台管理-编辑后台用户] >> 入参={}", dto);
         SysUserEntity entity = sysUserMapper.selectById(dto.getId());
         if (!entity.getUserName().equals(dto.getUsername())) {
@@ -141,7 +141,7 @@ public class SysUserService {
      * 后台管理-删除
      */
     @Transactional(rollbackFor = Exception.class)
-    public void adminDelete(Collection<Long> ids) {
+    public void adminDelete(Collection<Long> ids) throws BusinessException{
         log.info("[后台管理-删除后台用户] >> 入参={}", ids);
         preDeleteCheck(ids);
         long count =
@@ -226,7 +226,7 @@ public class SysUserService {
     /**
      * 后台管理-修改用户密码
      */
-    public void UpdateUserPassword(UpdateSysUserPasswordDTO dto) {
+    public void UpdateUserPassword(UpdateSysUserPasswordDTO dto) throws BusinessException{
         if (StrUtil.isEmpty(dto.getNewPassword())) {
             throw new BusinessException(400, "密码不能为空");
         }
@@ -245,7 +245,7 @@ public class SysUserService {
      *
      * @param userId
      */
-    public Integer updateUserStatus(Long userId) {
+    public Integer updateUserStatus(Long userId) throws BusinessException{
         SysUserEntity sysUserEntity = sysUserMapper.selectById(userId);
         if (sysUserEntity == null) {
             throw new BusinessException(400, "用户不存在");
@@ -266,7 +266,7 @@ public class SysUserService {
      * @param userId
      * @param followType 开关的跟进类型,公海跟进-publicFollow,历史跟进 -historyFollow
      */
-    public Integer updateUserFollow(Long userId, String followType) {
+    public Integer updateUserFollow(Long userId, String followType) throws BusinessException{
         SysUserEntity sysUserEntity = sysUserMapper.selectById(userId);
         if (sysUserEntity == null) {
             throw new BusinessException(400, "用户不存在");