|
@@ -66,7 +66,8 @@ public class JyPlatformServiceImpl extends ServiceImpl<IJyPlatformMapper, JyPlat
|
|
|
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
}
|
|
}
|
|
- JyPlatform jyPlatform ;
|
|
|
|
|
|
+ JyPlatform jyPlatform = null;
|
|
|
|
+ JyUser jyUser = null;
|
|
if(param.getId() == null){ //创建平台自动生成平台访问地址
|
|
if(param.getId() == null){ //创建平台自动生成平台访问地址
|
|
String uuid = UUID.randomUUID().toString().substring(0, 18).replace("-", "");
|
|
String uuid = UUID.randomUUID().toString().substring(0, 18).replace("-", "");
|
|
param.setPlatformAddress(uuid);
|
|
param.setPlatformAddress(uuid);
|
|
@@ -75,8 +76,8 @@ public class JyPlatformServiceImpl extends ServiceImpl<IJyPlatformMapper, JyPlat
|
|
throw new BusinessException(ResultCode.ID_CARD_EXIT);
|
|
throw new BusinessException(ResultCode.ID_CARD_EXIT);
|
|
}
|
|
}
|
|
jyPlatform = new JyPlatform();
|
|
jyPlatform = new JyPlatform();
|
|
- JyUser jyUser = jyUserService.getByIdCard(param.getIdCard());
|
|
|
|
- if(jyUser != null){
|
|
|
|
|
|
+ jyUser = jyUserService.getByIdCard(param.getIdCard());
|
|
|
|
+ if(jyUser != null && (jyUser.getPlatformId() != null || jyUser.getIsJm() == 0)){
|
|
throw new BusinessException(ResultCode.ID_CARD_EXIT);
|
|
throw new BusinessException(ResultCode.ID_CARD_EXIT);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -93,7 +94,9 @@ public class JyPlatformServiceImpl extends ServiceImpl<IJyPlatformMapper, JyPlat
|
|
}
|
|
}
|
|
BeanUtils.copyProperties(param,jyPlatform);
|
|
BeanUtils.copyProperties(param,jyPlatform);
|
|
this.saveOrUpdate(jyPlatform);
|
|
this.saveOrUpdate(jyPlatform);
|
|
-
|
|
|
|
|
|
+ if (jyUser !=null){
|
|
|
|
+ jyUserService.updatePlatformId(jyUser.getId(),jyPlatform.getId());
|
|
|
|
+ }
|
|
return jyPlatform;
|
|
return jyPlatform;
|
|
}
|
|
}
|
|
|
|
|