|
@@ -41,7 +41,7 @@ public class MouldHistoryServiceImpl extends ServiceImpl<MouldHistoryMapper, Mou
|
|
List<MouldCycleRuntime> list = mouldCycleRuntimeMapper.selectList(new QueryWrapper<MouldCycleRuntime>().eq("equipment_no", equipmentNo).eq("date_str",time));
|
|
List<MouldCycleRuntime> list = mouldCycleRuntimeMapper.selectList(new QueryWrapper<MouldCycleRuntime>().eq("equipment_no", equipmentNo).eq("date_str",time));
|
|
// List<MouldHistoryVO> list = mouldHistoryMapper.selectOpeningAndClosingTimesChart(equipmentNo,time);
|
|
// List<MouldHistoryVO> list = mouldHistoryMapper.selectOpeningAndClosingTimesChart(equipmentNo,time);
|
|
// Set<MouldHistoryVO> set = TimeAndCountUtil.getSet();
|
|
// Set<MouldHistoryVO> set = TimeAndCountUtil.getSet();
|
|
-// Map<String, Integer> map = TimeAndCountUtil.getMap();
|
|
|
|
|
|
+ Map<String, Integer> map = TimeAndCountUtil.getMap();
|
|
// Integer count = 0;
|
|
// Integer count = 0;
|
|
// Map<String, List<MouldHistoryVO>> mapList = list.stream().collect(Collectors.groupingBy(MouldHistoryVO::getTime));
|
|
// Map<String, List<MouldHistoryVO>> mapList = list.stream().collect(Collectors.groupingBy(MouldHistoryVO::getTime));
|
|
// for(Map.Entry<String, List<MouldHistoryVO>> entry:mapList.entrySet()){
|
|
// for(Map.Entry<String, List<MouldHistoryVO>> entry:mapList.entrySet()){
|
|
@@ -132,6 +132,68 @@ public class MouldHistoryServiceImpl extends ServiceImpl<MouldHistoryMapper, Mou
|
|
@Override
|
|
@Override
|
|
public HttpRespMsg openingAndClosingTimesChartCycle(String equipmentNo,String time) {
|
|
public HttpRespMsg openingAndClosingTimesChartCycle(String equipmentNo,String time) {
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
|
+ Map<String, Integer> map = TimeAndCountUtil.getMap();
|
|
|
|
+ List<MouldHistoryVO> list = mouldHistoryTimeMapper.getOpeningAndClosingTimesChartCycle(equipmentNo,time);
|
|
|
|
+ Integer count = 0;
|
|
|
|
+ Map<String, List<MouldHistoryVO>> mapList = list.stream().collect(Collectors.groupingBy(MouldHistoryVO::getTime));
|
|
|
|
+ for(Map.Entry<String, List<MouldHistoryVO>> entry:mapList.entrySet()){
|
|
|
|
+ if("00".equals(entry.getKey())){
|
|
|
|
+ map.put("00:00-01:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble()
|
|
|
|
+ );
|
|
|
|
+ }else if("01".equals(entry.getKey())){
|
|
|
|
+ map.put("01:00-02:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("02".equals(entry.getKey())){
|
|
|
|
+ map.put("02:00-03:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("03".equals(entry.getKey())){
|
|
|
|
+ map.put("03:00-04:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("04".equals(entry.getKey())){
|
|
|
|
+ map.put("04:00-05:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("05".equals(entry.getKey())){
|
|
|
|
+ map.put("05:00-06:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("06".equals(entry.getKey())){
|
|
|
|
+ map.put("06:00-07:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("07".equals(entry.getKey())){
|
|
|
|
+ map.put("07:00-08:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("08".equals(entry.getKey())){
|
|
|
|
+ map.put("08:00-09:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("09".equals(entry.getKey())){
|
|
|
|
+ map.put("09:00-10:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("10".equals(entry.getKey())){
|
|
|
|
+ map.put("10:00-11:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("11".equals(entry.getKey())){
|
|
|
|
+ map.put("11:00-12:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("12".equals(entry.getKey())){
|
|
|
|
+ map.put("12:00-13:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("13".equals(entry.getKey())){
|
|
|
|
+ map.put("13:00-14:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("14".equals(entry.getKey())){
|
|
|
|
+ map.put("14:00-15:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("15".equals(entry.getKey())){
|
|
|
|
+ map.put("15:00-16:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("16".equals(entry.getKey())){
|
|
|
|
+ map.put("16:00-17:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("17".equals(entry.getKey())){
|
|
|
|
+ map.put("17:00-18:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("18".equals(entry.getKey())){
|
|
|
|
+ map.put("18:00-19:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("19".equals(entry.getKey())){
|
|
|
|
+ map.put("19:00-20:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("20".equals(entry.getKey())){
|
|
|
|
+ map.put("20:00-21:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("21".equals(entry.getKey())){
|
|
|
|
+ map.put("21:00-22:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("22".equals(entry.getKey())){
|
|
|
|
+ map.put("22:00-23:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }else if("23".equals(entry.getKey())){
|
|
|
|
+ map.put("23:00-24:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ System.out.println("原来的map===>"+map);
|
|
|
|
+ Map<String, Integer> result = map.entrySet().stream()
|
|
|
|
+ .sorted(Map.Entry.comparingByKey())
|
|
|
|
+ .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
|
|
|
|
+ (oleValue, newValue) -> oleValue, LinkedHashMap::new));
|
|
|
|
+ System.out.println("排序后的map===>"+result);
|
|
// mouldHistoryTimeVO.setStartTime(mouldHistoryTimeVO.getStartTime()+" 00:00:00");
|
|
// mouldHistoryTimeVO.setStartTime(mouldHistoryTimeVO.getStartTime()+" 00:00:00");
|
|
// mouldHistoryTimeVO.setEndTime(mouldHistoryTimeVO.getEndTime()+" 23:59:59");
|
|
// mouldHistoryTimeVO.setEndTime(mouldHistoryTimeVO.getEndTime()+" 23:59:59");
|
|
// List<MouldHistoryTimeVO> list = mouldHistoryTimeMapper.getOpeningAndClosingTimesChartCycle(mouldHistoryTimeVO.getStartTime(),mouldHistoryTimeVO.getEndTime(),mouldHistoryTimeVO.getEquipmentNo());
|
|
// List<MouldHistoryTimeVO> list = mouldHistoryTimeMapper.getOpeningAndClosingTimesChartCycle(mouldHistoryTimeVO.getStartTime(),mouldHistoryTimeVO.getEndTime(),mouldHistoryTimeVO.getEquipmentNo());
|
|
@@ -151,6 +213,7 @@ public class MouldHistoryServiceImpl extends ServiceImpl<MouldHistoryMapper, Mou
|
|
// resultList = resultList.stream().sorted(Comparator.comparing(MouldHistoryTimeVO::getTime)).collect(Collectors.toList());
|
|
// resultList = resultList.stream().sorted(Comparator.comparing(MouldHistoryTimeVO::getTime)).collect(Collectors.toList());
|
|
// System.out.println("排序后的resultList===>"+resultList);
|
|
// System.out.println("排序后的resultList===>"+resultList);
|
|
// msg.data = resultList;
|
|
// msg.data = resultList;
|
|
|
|
+ msg.data = result;
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|