Bläddra i källkod

小程序接口

chenliqu 2 år sedan
förälder
incheckning
81352427dd

+ 4 - 4
ruoyi-modules/znyl-resource/src/main/java/com/ruoyi/resource/service/impl/ZnylJhrxxServiceImpl.java

@@ -119,6 +119,8 @@ public class ZnylJhrxxServiceImpl implements IZnylJhrxxService
             if(StringUtils.isNotNull(znylJhrxx.getUserid()) && StringUtils.isNotEmpty(znylJhrxx.getUserid())){
                 List<ZnylJhrxx> list = znylJhrxxMapper.userLogin(znylJhrxx.getUserid(),null,null,null);
                 if(!list.isEmpty()){
+                    throw new CustomException("用户账号已注册!");
+                } else {
                     ZnylYgry ygry = znylYgryMapper.selectByAccount(SecurityUtils.getUsername());// 运管
                     if (null != ygry && null != ygry.getId()) {
                         znylJhrxx.setPassword("123456789");
@@ -130,8 +132,6 @@ public class ZnylJhrxxServiceImpl implements IZnylJhrxxService
                     } else {
                         throw new CustomException("用户信息获取失败!");
                     }
-                } else {
-                    throw new CustomException("用户账号已注册!");
                 }
             }else {
                 throw new CustomException("用户信息获取失败!");
@@ -233,9 +233,9 @@ public class ZnylJhrxxServiceImpl implements IZnylJhrxxService
         if(StringUtils.isNotNull(znylJhrxx.getUserid()) && StringUtils.isNotEmpty(znylJhrxx.getUserid())) {
             List<ZnylJhrxx> list = znylJhrxxMapper.userLogin(znylJhrxx.getUserid(), null, null, null);
             if (!list.isEmpty()) {
-                return znylJhrxxMapper.insertZnylJhrxx(znylJhrxx);
-            }else {
                 throw new CustomException("用户账号已注册!");
+            }else {
+                return znylJhrxxMapper.insertZnylJhrxx(znylJhrxx);
             }
         }else {
             throw new CustomException("用户信息获取失败!");