lyhzzz 9 mesiacov pred
rodič
commit
39601f20e6

+ 18 - 1
src/main/java/com/fdkankan/manage/service/impl/JyUserPlatformServiceImpl.java

@@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -129,7 +130,23 @@ public class JyUserPlatformServiceImpl extends ServiceImpl<IJyUserPlatformMapper
         if(StringUtils.isBlank(param.getQueryKey())){
             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;
     }
 
 

+ 1 - 1
src/main/java/com/fdkankan/manage/vo/JyUserPlatform.java

@@ -53,5 +53,5 @@ public class JyUserPlatform implements Serializable {
 
     private Date updateTime;
 
-
+    private String platformName;
 }