Explorar o código

添加用户,判断用户状态

lyhzzz %!s(int64=2) %!d(string=hai) anos
pai
achega
19dcef1d00

+ 3 - 0
src/main/java/com/fdkankan/sale/controller/SysUserController.java

@@ -54,6 +54,9 @@ public class SysUserController extends BaseController{
         if(user ==null){
             throw new BusinessException(ResultCode.USER_NOT_EXIST);
         }
+        if(user.getStatus() == 0){
+            throw new BusinessException(ResultCode.USERNAME_ERROR);
+        }
         sysUserService.addOrUpdate(user,param);
         return ResultData.ok();
     }

+ 1 - 0
src/main/java/com/fdkankan/sale/service/impl/SysUserServiceImpl.java

@@ -187,6 +187,7 @@ public class SysUserServiceImpl extends ServiceImpl<ISysUserMapper, SysUser> imp
         if(StringUtils.isNotBlank(userName)){
             wrapper.like(SysUser::getUserName,userName);
         }
+        wrapper.eq(SysUser::getStatus,1);
         return this.list(wrapper);
     }