|
@@ -156,11 +156,13 @@ public class JyUserPlatformServiceImpl extends ServiceImpl<IJyUserPlatformMapper
|
|
|
sysRoles.forEach(e -> roleMap.put(e.getId(),e));
|
|
|
}
|
|
|
}
|
|
|
- JyPlatformUserWait jyPlatformUserWait = platformUserWaitService.getByName(param.getQueryKey());
|
|
|
- if(jyPlatformUserWait != null){
|
|
|
- JyUserPlatform jyUserPlatform = new JyUserPlatform();
|
|
|
- BeanUtils.copyProperties(jyPlatformUserWait,jyUserPlatform);
|
|
|
- jyUserPlatforms.add(jyUserPlatform);
|
|
|
+ List<JyPlatformUserWait> jyPlatformUserWaits = platformUserWaitService.getByQueryKey(param.getQueryKey());
|
|
|
+ if(jyPlatformUserWaits.isEmpty()){
|
|
|
+ for (JyPlatformUserWait jyPlatformUserWait : jyPlatformUserWaits) {
|
|
|
+ JyUserPlatform jyUserPlatform = new JyUserPlatform();
|
|
|
+ BeanUtils.copyProperties(jyPlatformUserWait,jyUserPlatform);
|
|
|
+ jyUserPlatforms.add(jyUserPlatform);
|
|
|
+ }
|
|
|
}
|
|
|
List<Integer> collect = jyUserPlatforms.stream().map(JyUserPlatform::getPlatformId).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
HashMap<Integer,JyPlatform> map = new HashMap<>();
|
|
@@ -220,11 +222,12 @@ public class JyUserPlatformServiceImpl extends ServiceImpl<IJyUserPlatformMapper
|
|
|
continue;
|
|
|
}
|
|
|
String name = map.get(0);
|
|
|
- if(StringUtils.isBlank(name) ){
|
|
|
+ String idCard = map.get(1);
|
|
|
+ if(StringUtils.isBlank(name) || StringUtils.isNotBlank(idCard)){
|
|
|
errorIndex.add(index -3 );
|
|
|
continue;
|
|
|
}
|
|
|
- JyUser user = jyUserService.getByNickName(name);
|
|
|
+ JyUser user = jyUserService.getByIdCard(idCard);
|
|
|
if(user != null && user.getPlatformId() == null){
|
|
|
updatePlatformUserList.add(user.getId());
|
|
|
continue;
|
|
@@ -233,18 +236,19 @@ public class JyUserPlatformServiceImpl extends ServiceImpl<IJyUserPlatformMapper
|
|
|
errorIndex.add(index -3 );
|
|
|
continue;
|
|
|
}
|
|
|
- JyPlatformUserWait jyPlatformUserWait = platformUserWaitService.getByName(name);
|
|
|
+ JyPlatformUserWait jyPlatformUserWait = platformUserWaitService.getByIdCard(idCard);
|
|
|
if(jyPlatformUserWait != null ){
|
|
|
errorIndex.add(index -3 );
|
|
|
continue;
|
|
|
}
|
|
|
- List<JyUserPlatformAddParam> collect = params.stream().filter(e -> e.getName().equals(name)).collect(Collectors.toList());
|
|
|
+ List<JyUserPlatformAddParam> collect = params.stream().filter(e -> e.getIdCard().equals(idCard)).collect(Collectors.toList());
|
|
|
if(!collect.isEmpty()){
|
|
|
errorIndex.add(index -3 );
|
|
|
continue;
|
|
|
}
|
|
|
JyUserPlatformAddParam param = new JyUserPlatformAddParam();
|
|
|
param.setName(name);
|
|
|
+ param.setIdCard(idCard);
|
|
|
params.add(param);
|
|
|
}
|
|
|
if(!errorIndex.isEmpty()){
|
|
@@ -271,10 +275,32 @@ public class JyUserPlatformServiceImpl extends ServiceImpl<IJyUserPlatformMapper
|
|
|
JyPlatformUserWait jyPlatformUserWait = new JyPlatformUserWait();
|
|
|
jyPlatformUserWait.setName(param.getName());
|
|
|
jyPlatformUserWait.setPlatformId(this.getLoginPlatformId());
|
|
|
+ jyPlatformUserWait.setIdCard(param.getIdCard());
|
|
|
platformUserWaitService.save(jyPlatformUserWait);
|
|
|
count ++;
|
|
|
}
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void addWaitUser(JyUserPlatformAddParam param) {
|
|
|
+ if(StringUtils.isBlank(param.getName()) || StringUtils.isBlank(param.getIdCard())) {
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
+ }
|
|
|
+
|
|
|
+ JyPlatformUserWait byIdCard = platformUserWaitService.getByIdCard(param.getIdCard());
|
|
|
+ if(byIdCard != null){
|
|
|
+ throw new BusinessException(ResultCode.ID_CARD_EXIT);
|
|
|
+ }
|
|
|
+ JyUser byIdCard1 = jyUserService.getByIdCard(param.getIdCard());
|
|
|
+ if(byIdCard1 != null){
|
|
|
+ throw new BusinessException(ResultCode.ID_CARD_EXIT);
|
|
|
+ }
|
|
|
+
|
|
|
+ JyPlatformUserWait jyPlatformUserWait = new JyPlatformUserWait();
|
|
|
+ jyPlatformUserWait.setName(param.getName());
|
|
|
+ jyPlatformUserWait.setPlatformId(this.getLoginPlatformId());
|
|
|
+ jyPlatformUserWait.setIdCard(param.getIdCard());
|
|
|
+ platformUserWaitService.save(jyPlatformUserWait);
|
|
|
+ }
|
|
|
}
|