Commit 6a70b45d by 王祖波

素材排序

parent ceff8cfe
...@@ -9,6 +9,7 @@ import java.util.Map; ...@@ -9,6 +9,7 @@ import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cn.hutool.core.collection.ListUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -185,7 +186,13 @@ public class MaterialApiServiceImpl implements MaterialApiService { ...@@ -185,7 +186,13 @@ public class MaterialApiServiceImpl implements MaterialApiService {
if (materialFrom == null || materialFrom == 1) { if (materialFrom == null || materialFrom == 1) {
return materialService.listMaterialByIds(materialIds); return materialService.listMaterialByIds(materialIds);
}else { }else {
return materialService.listContentMaterialByIds(materialIds,1); List<MaterialDTO> materialDTOS = materialService.listContentMaterialByIds(materialIds, 1);
materialDTOS.sort(((o1, o2) -> {
int io1 = materialIds.indexOf(o1.getMaterialId());
int io2 = materialIds.indexOf(o2.getMaterialId());
return io1 - io2;
}));
return materialDTOS;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment