mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-30 03:58:09 +08:00
bugfix 修复枪列表排序空指针异常
This commit is contained in:
@@ -444,9 +444,10 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
|
|||||||
// 定义 status 的优先级(值越小,优先级越高)
|
// 定义 status 的优先级(值越小,优先级越高)
|
||||||
Map<Integer, Integer> priority = Collections.unmodifiableMap(new HashMap<Integer, Integer>() {{
|
Map<Integer, Integer> priority = Collections.unmodifiableMap(new HashMap<Integer, Integer>() {{
|
||||||
put(Integer.parseInt(PileConnectorDataBaseStatusEnum.FREE.getValue()), 1); // 空闲 → 1
|
put(Integer.parseInt(PileConnectorDataBaseStatusEnum.FREE.getValue()), 1); // 空闲 → 1
|
||||||
put(Integer.parseInt(PileConnectorDataBaseStatusEnum.OCCUPIED_NOT_CHARGED.getValue()), 2); // 占用 → 2
|
put(Integer.parseInt(PileConnectorDataBaseStatusEnum.OCCUPIED_NOT_CHARGED.getValue()), 2); // 占用(未充电) → 2
|
||||||
put(Integer.parseInt(PileConnectorDataBaseStatusEnum.FAULT.getValue()), 3); // 故障 → 3
|
put(Integer.parseInt(PileConnectorDataBaseStatusEnum.OCCUPIED_CHARGING.getValue()), 3); // 占用(充电中) → 3
|
||||||
put(Integer.parseInt(PileConnectorDataBaseStatusEnum.OFF_NETWORK.getValue()), 4); // 离线 → 4
|
put(Integer.parseInt(PileConnectorDataBaseStatusEnum.FAULT.getValue()), 4); // 故障 → 4
|
||||||
|
put(Integer.parseInt(PileConnectorDataBaseStatusEnum.OFF_NETWORK.getValue()), 5); // 离线 → 5
|
||||||
}});
|
}});
|
||||||
pileConnectorInfoList.sort(
|
pileConnectorInfoList.sort(
|
||||||
Comparator.comparingInt((PileConnectorInfoVO vo) -> priority.get(vo.getStatus()))
|
Comparator.comparingInt((PileConnectorInfoVO vo) -> priority.get(vo.getStatus()))
|
||||||
|
|||||||
Reference in New Issue
Block a user