lyhzzz 9 months ago
parent
commit
bcb6a4faae

+ 1 - 0
src/main/java/com/fdkankan/manage/common/ResultCode.java

@@ -91,6 +91,7 @@ public enum ResultCode  {
     UNQUINX_INDEX(60019, "违反唯一约束"),
     PHONE_EXIT(60020, "手机号已存在"),
     PLATFORM_USER_ADDERROR(60021, "该用户身份为平台管理员,无法更改其平台,如需继续,请联系超级管理员更改平台管理员身份后再试"),
+    ID_CARD_EXIT2(60022, "该用户已属其他平台,请更换用户后再试"),
     ;
 
     private Integer code;

+ 5 - 1
src/main/java/com/fdkankan/manage/service/impl/JyPlatformServiceImpl.java

@@ -71,7 +71,7 @@ public class JyPlatformServiceImpl extends ServiceImpl<IJyPlatformMapper, JyPlat
         JyUser jyUser = null;
         jyUser = jyUserService.getByIdCard(param.getIdCard());
         if(jyUser != null && jyUser.getPlatformId() != null  ){
-            throw new BusinessException(ResultCode.ID_CARD_EXIT);
+            throw new BusinessException(ResultCode.ID_CARD_EXIT2);
         }
 
         if(param.getId() == null){  //创建平台自动生成平台访问地址
@@ -90,6 +90,10 @@ public class JyPlatformServiceImpl extends ServiceImpl<IJyPlatformMapper, JyPlat
             if(jyPlatform == null){
                 throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
             }
+            JyPlatform jyPlatform2  = this.getByIdCard(param.getIdCard());
+            if(jyPlatform2 != null && !jyPlatform2.getId().equals(jyPlatform.getId())){
+                throw new BusinessException(ResultCode.ID_CARD_EXIT);
+            }
             if(!param.getIdCard().equals(jyPlatform.getIdCard())){
                 JyUser jyUser1 = jyUserService.getByIdCard(jyPlatform.getIdCard());
                 if(jyUser1 != null){