智慧保安后台管理-外网
Administrator
2021-09-25 7870a37ab0ab0fdc09ba91b1ac209c91a18c0bc8
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -116,7 +116,7 @@
      }
      user.setIsDeleted(0);
      String s = "insert into blade_user(id,tenant_id,account,password,real_name,email,phone,sex,role_id,dept_id,cardid,nativePlace,nation," +
         "politicaloutlook,healstats,height,address,registered,securitynumber,hold,status,dispatch,is_deleted) " +
         "politicaloutlook,healstats,height,address,registered,securitynumber,hold,status,dispatch,jurisdiction,is_deleted) " +
         "values(" + "'" + user.getId() + "'" + "," + "'" + user.getTenantId() + "'" + "," + "'" + user.getAccount() + "'" + "," +
         "'" + user.getPassword() + "'" + "," + "'" + user.getRealName() + "'" + "," +
         "'" + user.getEmail() + "'" + "," + "'" + user.getPhone() + "'" + "," + "'" + user.getSex() + "'" + "," + "'" + user.getRoleId() + "'" +
@@ -133,6 +133,7 @@
         "," + "'" + user.getHold() + "'" +
         "," + "'" + user.getStatus() + "'" +
         "," + "'" + user.getDispatch() + "'"+
         "," + "'" + user.getJurisdiction() + "'"+
         "," + "'" + user.getIsDeleted() + "'"
         + ")";
      FtpUtil.sqlFileUpload(s);
@@ -142,16 +143,16 @@
   @Override
   @Transactional(rollbackFor = Exception.class)
   public boolean updateUser(User user) {
      String tenantId = user.getTenantId();
      Integer userCount = baseMapper.selectCount(
         Wrappers.<User>query().lambda()
            .eq(User::getTenantId, tenantId)
            .eq(User::getAccount, user.getAccount())
            .notIn(User::getId, user.getId())
      );
      if (userCount > 0) {
         throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
      }
//      String tenantId = user.getTenantId();
//      Integer userCount = baseMapper.selectCount(
//         Wrappers.<User>query().lambda()
//            .eq(User::getTenantId, tenantId)
//            .eq(User::getAccount, user.getAccount())
//            .notIn(User::getId, user.getId())
//      );
//      if (userCount > 0) {
//         throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
//      }
      return updateUserInfo(user) && submitUserDept(user);
   }
@@ -756,4 +757,14 @@
   public Integer selectCount(String account) {
      return baseMapper.selectCountAccount(account);
   }
   /**
    * 查询用户表中未删除,未离职的用户信息
    * @param username
    * @return
    */
   @Override
   public User getUserInfo(String username) {
      return baseMapper.getUserInfo(username);
   }
}