|
@@ -10,8 +10,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.hssx.cloudmodel.util.ExcelUtil;
|
|
import com.hssx.cloudmodel.util.ExcelUtil;
|
|
import com.hssx.cloudmodel.util.HttpRespMsg;
|
|
import com.hssx.cloudmodel.util.HttpRespMsg;
|
|
import com.hssx.cloudmodel.util.TimeAndCountUtil;
|
|
import com.hssx.cloudmodel.util.TimeAndCountUtil;
|
|
|
|
+import org.apache.xmlbeans.impl.common.ConcurrentReaderHashMap;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.thymeleaf.expression.Maps;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -20,6 +22,7 @@ import java.text.SimpleDateFormat;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -208,7 +211,22 @@ public class MouldHistoryServiceImpl extends ServiceImpl<MouldHistoryMapper, Mou
|
|
//模具运行次数
|
|
//模具运行次数
|
|
List<MouldCycleRuntime> cycleRuntime = mouldCycleRuntimeMapper.selectList(new QueryWrapper<MouldCycleRuntime>().eq("equipment_no", equipmentNo).eq("date_str", time));
|
|
List<MouldCycleRuntime> cycleRuntime = mouldCycleRuntimeMapper.selectList(new QueryWrapper<MouldCycleRuntime>().eq("equipment_no", equipmentNo).eq("date_str", time));
|
|
cycleRuntime = cycleRuntime.stream().sorted(Comparator.comparing(MouldCycleRuntime::getTimeSlot)).collect(Collectors.toList());
|
|
cycleRuntime = cycleRuntime.stream().sorted(Comparator.comparing(MouldCycleRuntime::getTimeSlot)).collect(Collectors.toList());
|
|
- listMap.put("runtime", cycleRuntime);
|
|
|
|
|
|
+ Map<String, MouldCycleRuntime> set = TimeAndCountUtil.getSet();
|
|
|
|
+ Map<String, List<MouldCycleRuntime>> collect = cycleRuntime.stream().collect(Collectors.groupingBy(MouldCycleRuntime::getTimeSlot));
|
|
|
|
+ for (Map.Entry<String, List<MouldCycleRuntime>> entry : collect.entrySet()) {
|
|
|
|
+ MouldCycleRuntime vo = new MouldCycleRuntime();
|
|
|
|
+ if(entry.getValue().size()>0){
|
|
|
|
+ vo.setDateStr(entry.getValue().get(0).getDateStr());
|
|
|
|
+ vo.setEquipmentNo(entry.getValue().get(0).getEquipmentNo());
|
|
|
|
+ vo.setRuntime(entry.getValue().get(0).getRuntime());
|
|
|
|
+ vo.setTimeSlot(entry.getValue().get(0).getTimeSlot());
|
|
|
|
+ set.put(entry.getKey(),vo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Map<String, MouldCycleRuntime> runtimeResult = new LinkedHashMap<>();
|
|
|
|
+ set.entrySet().stream().sorted(Map.Entry.<String, MouldCycleRuntime>comparingByKey().reversed())
|
|
|
|
+ .forEachOrdered(e -> runtimeResult.put(e.getKey(), e.getValue()));
|
|
|
|
+ listMap.put("runtime", runtimeResult);
|
|
msg.data = map;
|
|
msg.data = map;
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|