guoshilong
2024-03-13 d3e4b81d25bc075a4759b0babf113ad5329aa6d4
skjcmanager/skjcmanager-service/skjcmanager-user/src/main/java/cn/gistack/system/user/service/impl/UserServiceImpl.java
@@ -32,6 +32,7 @@
import cn.gistack.system.user.excel.UserExcel;
import cn.gistack.system.user.mapper.UserMapper;
import cn.gistack.system.user.service.IUserDeptService;
import cn.gistack.system.user.service.IUserEncipherService;
import cn.gistack.system.user.service.IUserOauthService;
import cn.gistack.system.user.service.IUserService;
import cn.gistack.system.user.supo.UserSUPO;
@@ -82,6 +83,8 @@
   private final BladeTenantProperties tenantProperties;
   private final IPwdClient pwdClient;
   private final IUserEncipherService userEncipherService;
   @Override
   @Transactional(rollbackFor = Exception.class)
@@ -145,10 +148,13 @@
   @Override
   @Transactional(rollbackFor = Exception.class)
   public boolean save(User entity) {
      //对User进行加密
      encryptUserInfo(entity);
      return super.save(entity);
      boolean saveUser = super.save(entity);
      boolean saveUserEncipher = userEncipherService.save(new UserEncipher(entity));
      return saveUserEncipher && saveUser;
   }
   @Override
@@ -174,11 +180,14 @@
   }
   @Override
   @Transactional(rollbackFor = Exception.class)
   public boolean updateById(User entity) {
      encryptUserInfo(entity);
      boolean updateUser = super.updateById(entity);
      boolean updateUserEncipher = userEncipherService.updateById(new UserEncipher(entity));
      return super.updateById(entity);
      return updateUser&&updateUserEncipher;
   }
   private boolean submitUserDept(User user) {
@@ -381,7 +390,7 @@
      if (Func.contains(Func.toLongArray(userIds), AuthUtil.getUserId())) {
         throw new ServiceException("不能删除本账号!");
      }
      return deleteLogic(Func.toLongList(userIds));
      return deleteLogic(Func.toLongList(userIds)) && userEncipherService.deleteLogic(Func.toLongList(userIds));
   }
   @Override
@@ -541,4 +550,13 @@
   public List<User> getUserByPhoneIds(String phoneIds) {
      return baseMapper.getUserByPhoneIds(phoneIds);
   }
   @Override
   public int getSysUserNum(String adCode) {
      List<Long> deptIdList = new ArrayList<>();
         deptIdList = SysCache.getDeptChildIds(Long.parseLong(adCode));
      int number = baseMapper.getSysUserNum(deptIdList);
      return number;
   }
}