|
@@ -70,7 +70,6 @@ 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 ;
|
|
- JyUserPlatform jyUserPlatform ;
|
|
|
|
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);
|
|
@@ -79,11 +78,9 @@ 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();
|
|
- jyUserPlatform = new JyUserPlatform();
|
|
|
|
JyUser jyUser = jyUserService.getByIdCard(param.getIdCard());
|
|
JyUser jyUser = jyUserService.getByIdCard(param.getIdCard());
|
|
if(jyUser != null){
|
|
if(jyUser != null){
|
|
- param.setJyUserId(jyUser.getId());
|
|
|
|
- sysUserService.updateRoleId(jyUser.getSysUserId(),48);
|
|
|
|
|
|
+ throw new BusinessException(ResultCode.ID_CARD_EXIT);
|
|
}
|
|
}
|
|
|
|
|
|
}else {
|
|
}else {
|
|
@@ -96,18 +93,15 @@ public class JyPlatformServiceImpl extends ServiceImpl<IJyPlatformMapper, JyPlat
|
|
if(jyPlatform2 != null && !jyPlatform2.getId().equals(jyPlatform.getId())){
|
|
if(jyPlatform2 != null && !jyPlatform2.getId().equals(jyPlatform.getId())){
|
|
throw new BusinessException(ResultCode.ID_CARD_EXIT);
|
|
throw new BusinessException(ResultCode.ID_CARD_EXIT);
|
|
}
|
|
}
|
|
- jyUserPlatform = jyUserPlatformService.getByIdCard(jyPlatform.getIdCard());
|
|
|
|
}
|
|
}
|
|
BeanUtils.copyProperties(param,jyPlatform);
|
|
BeanUtils.copyProperties(param,jyPlatform);
|
|
- BeanUtils.copyProperties(param,jyUserPlatform);
|
|
|
|
this.saveOrUpdate(jyPlatform);
|
|
this.saveOrUpdate(jyPlatform);
|
|
- jyUserPlatform.setPlatformId(jyPlatform.getId());
|
|
|
|
- jyUserPlatformService.saveOrUpdate(jyUserPlatform);
|
|
|
|
|
|
|
|
return jyPlatform;
|
|
return jyPlatform;
|
|
}
|
|
}
|
|
|
|
|
|
- private JyPlatform getByIdCard(String idCard) {
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public JyPlatform getByIdCard(String idCard) {
|
|
LambdaQueryWrapper<JyPlatform> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<JyPlatform> wrapper = new LambdaQueryWrapper<>();
|
|
wrapper.eq(JyPlatform::getIdCard,idCard);
|
|
wrapper.eq(JyPlatform::getIdCard,idCard);
|
|
return this.getOne(wrapper);
|
|
return this.getOne(wrapper);
|
|
@@ -139,8 +133,7 @@ public class JyPlatformServiceImpl extends ServiceImpl<IJyPlatformMapper, JyPlat
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
}
|
|
}
|
|
//update userRole
|
|
//update userRole
|
|
- JyUserPlatform jyUserPlatform = jyUserPlatformService.getByIdCard(jyPlatform.getIdCard());
|
|
|
|
- JyUser jyUser = jyUserService.getById(jyUserPlatform.getJyUserId());
|
|
|
|
|
|
+ JyUser jyUser = jyUserService.getById(param.getJyUserId());
|
|
if(jyUser != null){
|
|
if(jyUser != null){
|
|
sysUserService.updateRoleId(jyUser.getSysUserId(),48);
|
|
sysUserService.updateRoleId(jyUser.getSysUserId(),48);
|
|
}
|
|
}
|
|
@@ -164,12 +157,11 @@ public class JyPlatformServiceImpl extends ServiceImpl<IJyPlatformMapper, JyPlat
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
}
|
|
}
|
|
//update userRole
|
|
//update userRole
|
|
- JyUserPlatform jyUserPlatform = jyUserPlatformService.getByIdCard(jyPlatform.getIdCard());
|
|
|
|
- JyUser jyUser = jyUserService.getById(jyUserPlatform.getJyUserId());
|
|
|
|
|
|
+ JyUser jyUser = jyUserService.getById(param.getJyUserId());
|
|
if(jyUser != null){
|
|
if(jyUser != null){
|
|
sysUserService.updateRoleId(jyUser.getSysUserId(),47);
|
|
sysUserService.updateRoleId(jyUser.getSysUserId(),47);
|
|
}
|
|
}
|
|
- jyUserPlatformService.updatePlatformId(param.getId(),param.getToPlatformId());
|
|
|
|
|
|
+ jyUserService.updatePlatformId(param.getId(),param.getToPlatformId());
|
|
this.updateStatus(jyPlatform.getId(),1);
|
|
this.updateStatus(jyPlatform.getId(),1);
|
|
|
|
|
|
|
|
|
|
@@ -185,4 +177,6 @@ public class JyPlatformServiceImpl extends ServiceImpl<IJyPlatformMapper, JyPlat
|
|
}
|
|
}
|
|
return list.stream().map(JyPlatform::getIdCard).collect(Collectors.toList());
|
|
return list.stream().map(JyPlatform::getIdCard).collect(Collectors.toList());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|