产线看板-"单位小时完工率"与"产线一次下线合格率"部分的时间段排序优化

tags/yfai-mes-ext-v1.0
logic.fang 10 months ago
parent 4d68d813e3
commit 684d5ea5d9

@ -416,7 +416,7 @@ public class IMesYfBoardServiceImpl implements IMesYfBoardService {
* @return * @return
*/ */
private Map<String, Map<String, String>> getLastHoursTimeZoneMap(Integer designatedQuantity) { private Map<String, Map<String, String>> getLastHoursTimeZoneMap(Integer designatedQuantity) {
Map<String, Map<String, String>> timeZoneMap = new TreeMap<>(); Map<String, Map<String, String>> timeZoneMap = new LinkedHashMap<>();
DateTimeFormatter hourFormatter = DateTimeFormatter.ofPattern("HH"); DateTimeFormatter hourFormatter = DateTimeFormatter.ofPattern("HH");
DateTimeFormatter dayFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd "); DateTimeFormatter dayFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd ");
LocalDateTime nowTime = LocalDateTime.now(); LocalDateTime nowTime = LocalDateTime.now();
@ -450,7 +450,14 @@ public class IMesYfBoardServiceImpl implements IMesYfBoardService {
timeZoneMap.put(START_TIME, map); timeZoneMap.put(START_TIME, map);
} }
} }
return timeZoneMap; //倒序处理
Map<String, Map<String, String>> collectResult = new LinkedHashMap<>();
ListIterator<Map.Entry> i = new ArrayList<Map.Entry>(timeZoneMap.entrySet()).listIterator(timeZoneMap.size());
while (i.hasPrevious()) {
Map.Entry entry = i.previous();
collectResult.put(String.valueOf(entry.getKey()), (HashMap<String, String>) entry.getValue());
}
return collectResult;
} }
} }

Loading…
Cancel
Save