|
@@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Objects;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -129,7 +130,23 @@ public class JyUserPlatformServiceImpl extends ServiceImpl<IJyUserPlatformMapper
|
|
if(StringUtils.isBlank(param.getQueryKey())){
|
|
if(StringUtils.isBlank(param.getQueryKey())){
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
}
|
|
}
|
|
- return this.getBaseMapper().queryByKey(param.getQueryKey());
|
|
|
|
|
|
+ List<JyUserPlatform> jyUserPlatforms = this.getBaseMapper().queryByKey(param.getQueryKey());
|
|
|
|
+
|
|
|
|
+ List<Integer> collect = jyUserPlatforms.stream().map(JyUserPlatform::getPlatformId).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
|
+ HashMap<Integer,JyPlatform> map = new HashMap<>();
|
|
|
|
+ if(!collect.isEmpty()){
|
|
|
|
+ List<JyPlatform> jyPlatforms = platformService.listByIds(collect);
|
|
|
|
+ jyPlatforms.forEach(e -> map.put(e.getId(),e));
|
|
|
|
+ }
|
|
|
|
+ for (JyUserPlatform jyUserPlatform : jyUserPlatforms) {
|
|
|
|
+ if(jyUserPlatform.getPlatformId()!=null){
|
|
|
|
+ JyPlatform jyPlatform =map.get(jyUserPlatform.getPlatformId());
|
|
|
|
+ if(jyPlatform != null){
|
|
|
|
+ jyUserPlatform.setPlatformName(jyPlatform.getPlatformName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return jyUserPlatforms;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|