ludc
2023-10-16 a45d0bcbea9078e54da9956c619dacb3c51fe1f1
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserServiceImpl.java
@@ -84,7 +84,7 @@
   @Transactional(rollbackFor = Exception.class)
   public boolean submit(User user) {
      if (StringUtil.isBlank(user.getTenantId())) {
         // user.setTenantId(BladeConstant.ADMIN_TENANT_ID);
         // user.setTenantId(nacosConfigCache.getAdminUserInfo().getTenantId());
         // 默认设置为管理组下的用户
         user.setTenantId(nacosConfigCache.getAdminUserInfo().getTenantId());
      }
@@ -106,7 +106,7 @@
      Boolean flag = true;
      for (User user : users){
         if (StringUtil.isBlank(user.getTenantId())) {
            user.setTenantId(BladeConstant.ADMIN_TENANT_ID);
            user.setTenantId(nacosConfigCache.getAdminUserInfo().getTenantId());
         }
         String tenantId = user.getTenantId();
         if (Func.isNotEmpty(user.getPassword())) {
@@ -166,7 +166,7 @@
   @Override
   public List<User> selectAllUser(User user, Long deptId){
      List<Long> deptIdList = SysCache.getDeptChildIds(deptId);
      List<User> users = baseMapper.selectUserPage(user, deptIdList, (AuthUtil.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : AuthUtil.getTenantId()));
      List<User> users = baseMapper.selectUserPage(user, deptIdList, (AuthUtil.getTenantId().equals(nacosConfigCache.getAdminUserInfo().getTenantId()) ? StringPool.EMPTY : AuthUtil.getTenantId()));
      return users;
   }
@@ -526,6 +526,9 @@
         pwdupdateday = dateToDay(pwdUpdateTime);
      }
      Strategy strategy = sysClient.getByUserId(userId).getData();
      if(Func.isNotEmpty(strategy)){
         throw new ServiceException("密码策略查询为空,请检查当前租户下是否存在默认密码策略!");
      }
      //是否提醒通过最后一次修改密码的时间加上过期时间减去当前时间,如果小于过期提醒时间就进行提醒,如果<=0就提醒必须修改密码
      long reminder = pwdupdateday+strategy.getExpirationTime()-dateToDay(new Date());
      //提醒用户必须修改密码