提交 07aeee7d authored 作者: zjm's avatar zjm

fix(单位模块): 组织机构单位未排序

组织机构单位未排序
上级 cf0a6da3
...@@ -4,10 +4,7 @@ import com.tykj.dev.device.user.subject.entity.AreaExhibition; ...@@ -4,10 +4,7 @@ import com.tykj.dev.device.user.subject.entity.AreaExhibition;
import com.tykj.dev.device.user.subject.entity.Units; import com.tykj.dev.device.user.subject.entity.Units;
import lombok.Data; import lombok.Data;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -61,7 +58,7 @@ public class AreaExhibitionCache { ...@@ -61,7 +58,7 @@ public class AreaExhibitionCache {
* 根据区域id查询下级以及 * 根据区域id查询下级以及
*/ */
public List<AreaExhibition> findByFatherId(Integer fatherId){ public List<AreaExhibition> findByFatherId(Integer fatherId){
return new ArrayList<>(idMap.values()).stream().filter(areaExhibition -> fatherId.equals(areaExhibition.getFatherId())).collect(Collectors.toList()); return new ArrayList<>(idMap.values()).stream().filter(areaExhibition -> fatherId.equals(areaExhibition.getFatherId())).sorted(Comparator.comparing(AreaExhibition::getOrders)).collect(Collectors.toList());
} }
public AreaExhibitionCache refresh(List<AreaExhibition> areaExhibitionList){ public AreaExhibitionCache refresh(List<AreaExhibition> areaExhibitionList){
......
...@@ -41,7 +41,7 @@ public class UnitsCache { ...@@ -41,7 +41,7 @@ public class UnitsCache {
} }
public List<Units> findAllByAreaExhibitionId(Integer areaExhibitionId){ public List<Units> findAllByAreaExhibitionId(Integer areaExhibitionId){
return new ArrayList<>(idMap.values()).stream().filter(units -> units.getExhibitionId().equals(areaExhibitionId)).collect(Collectors.toList()); return new ArrayList<>(idMap.values()).stream().filter(units -> units.getExhibitionId().equals(areaExhibitionId)).sorted(Comparator.comparing(Units::getShowOrder)).collect(Collectors.toList());
} }
public List<Units> findAllByAreaExhibitionIdList(List<Integer> areaExhibitionIds){ public List<Units> findAllByAreaExhibitionIdList(List<Integer> areaExhibitionIds){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论