|
@@ -18,10 +18,7 @@ import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@@ -130,11 +127,26 @@ public class DeviceDetailsService {
|
|
|
Map<String, List<ProEconTestingPoint>> resultMap = new HashMap<>();
|
|
|
Map<String, ProBasicEquipment> wtmap = CacheContext.wtmap;
|
|
|
QueryWrapper<ProEconTestingPoint> qw = new QueryWrapper<>();
|
|
|
- qw.lambda().eq(ProEconTestingPoint::getModel, wtmap.get(wtid).getModelId()).eq(ProEconTestingPoint::getLogicalUnitId, part);
|
|
|
- qw.lambda().eq(ProEconTestingPoint::getSpare3,"1");
|
|
|
+ qw.lambda()
|
|
|
+ .eq(ProEconTestingPoint::getModel, wtmap.get(wtid).getModelId())
|
|
|
+ .eq(ProEconTestingPoint::getLogicalUnitId, part)
|
|
|
+ .eq(ProEconTestingPoint::getSpare3, "1")
|
|
|
+ .orderByAsc(ProEconTestingPoint::getNemCode); // 添加数据库层面的排序
|
|
|
+
|
|
|
List<ProEconTestingPoint> list = proEconTestingPointService.list(qw);
|
|
|
- resultMap.put("AI", list.stream().filter(i -> i.getUniformCode().startsWith("AI")).collect(Collectors.toList()));
|
|
|
- resultMap.put("DI", list.stream().filter(i -> i.getUniformCode().startsWith("DI")).collect(Collectors.toList()));
|
|
|
+
|
|
|
+ // 对AI列表按nemcod排序
|
|
|
+ resultMap.put("AI", list.stream()
|
|
|
+ .filter(i -> i.getUniformCode().startsWith("AI"))
|
|
|
+ .sorted(Comparator.comparing(ProEconTestingPoint::getNemCode))
|
|
|
+ .collect(Collectors.toList()));
|
|
|
+
|
|
|
+ // 对DI列表按nemcod排序
|
|
|
+ resultMap.put("DI", list.stream()
|
|
|
+ .filter(i -> i.getUniformCode().startsWith("DI"))
|
|
|
+ .sorted(Comparator.comparing(ProEconTestingPoint::getNemCode))
|
|
|
+ .collect(Collectors.toList()));
|
|
|
+
|
|
|
return resultMap;
|
|
|
}
|
|
|
}
|