|
|
|
@ -39,6 +39,7 @@ import org.springframework.util.Assert;
|
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.function.Function; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author hx |
|
|
|
@ -237,6 +238,8 @@ public class StationAttributeServiceImpl extends BaseServiceImpl<StationAttribut
|
|
|
|
|
.map(stationAttr -> this.fillAttrId(stationAttrList,stationAttr)) |
|
|
|
|
.sorted(Comparator.comparing(StationAttributeVo::getSort,Comparator.nullsLast(Integer::compareTo))) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
// 排序完成之后循环赋值
|
|
|
|
|
Stream.iterate(1,n -> n+1).limit(result.size()).forEach(index -> result.get(index-1).setSort(index)); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -282,7 +285,6 @@ public class StationAttributeServiceImpl extends BaseServiceImpl<StationAttribut
|
|
|
|
|
result.setUpdateTime(null); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
stationAttr.setSort(null); |
|
|
|
|
} |
|
|
|
|
return stationAttr; |
|
|
|
|
} |
|
|
|
|