|
@@ -188,25 +188,23 @@ public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements I
|
|
|
|
|
|
JyUser jyUser = jyUserService.getByRyId(param.getRyId());
|
|
|
|
|
|
- JyUser jyUser2 = jyUserService.getByRyNo(param.getRyNo());
|
|
|
-
|
|
|
- if(StringUtils.isNotBlank(param.getIdCard())){
|
|
|
- JyUser byIdCard = jyUserService.getByIdCard(param.getIdCard());
|
|
|
- if(jyUser == null && byIdCard!= null){
|
|
|
- throw new BusinessException(ResultCode.ID_CARD_EXIT);
|
|
|
+ List<JyUser> jyUserList = jyUserService.getByAddParam(param);
|
|
|
+ if(!jyUserList.isEmpty()){
|
|
|
+ List<String> ryNos = jyUserList.stream().map(JyUser::getRyNo).collect(Collectors.toList());
|
|
|
+ List<String> phones = jyUserList.stream().map(JyUser::getPhone).collect(Collectors.toList());
|
|
|
+ List<String> idCards = jyUserList.stream().map(JyUser::getIdCard).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(param.getRyNo()) && ryNos.contains(param.getRyNo())){
|
|
|
+ throw new BusinessException(ResultCode.RYNO_EXITS);
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(param.getPhone()) && phones.contains(param.getPhone())){
|
|
|
+ throw new BusinessException(ResultCode.PHONE_EXIT);
|
|
|
}
|
|
|
- if(jyUser != null && byIdCard != null && !jyUser.getId().equals(byIdCard.getId())){
|
|
|
+ if(StringUtils.isNotBlank(param.getIdCard()) && idCards.contains(param.getIdCard())){
|
|
|
throw new BusinessException(ResultCode.ID_CARD_EXIT);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(jyUser == null && jyUser2!=null){
|
|
|
- throw new BusinessException(ResultCode.RYNO_EXITS);
|
|
|
- }
|
|
|
- if(jyUser != null && jyUser2 != null && !jyUser2.getId().equals(jyUser.getId())){
|
|
|
- throw new BusinessException(ResultCode.RYNO_EXITS);
|
|
|
- }
|
|
|
-
|
|
|
boolean init = false;
|
|
|
if(jyUser == null){
|
|
|
jyUser = new JyUser();
|