|
@@ -133,7 +133,7 @@ public class TwinEmpCalcServiceImpl implements ITwinEmpCalcService {
|
|
|
List<TwinCalcHourSpec> specHourList = hourSpecService.selectTwinCalcHourSpecListByDate(date);
|
|
|
specHourList.forEach(TwinCalcHourSpec::setTeam);
|
|
|
// 按照deviceId、density、mick、team,并统计每组的length总和
|
|
|
- Map<String, List<TwinCalcHourSpec>> specHourMap = specHourList.stream().collect(Collectors.groupingBy(o -> o.getDeviceId() + "-" + o.getTeam(), LinkedHashMap::new, Collectors.toList()));
|
|
|
+// Map<String, List<TwinCalcHourSpec>> specHourMap = specHourList.stream().collect(Collectors.groupingBy(o -> o.getDeviceId() + "-" + o.getTeam(), LinkedHashMap::new, Collectors.toList()));
|
|
|
List<TwinCalcDay> twinCalcDays = twinCalcDayService.selectTwinCalcDayListByTime(date, date);
|
|
|
Map<Long, TwinCalcDay> calcMap = twinCalcDays.stream().collect(Collectors.toMap(TwinCalcDay::getDeviceId, o -> o));
|
|
|
Map<Long, BigDecimal> effMap = twinCalcDays.stream().collect(Collectors.toMap(TwinCalcDay::getDeviceId, TwinCalcDay::getEfficiency));
|
|
@@ -241,9 +241,9 @@ public class TwinEmpCalcServiceImpl implements ITwinEmpCalcService {
|
|
|
// List<TwinCalcHourSpec> hourList = specs.stream().filter(t -> t.getHour() == hour).collect(Collectors.toList());
|
|
|
// }
|
|
|
//按密度和米克重、毛高分组统计
|
|
|
- Map<String, BigDecimal> resultMap = hourList.stream().collect(Collectors.groupingBy(t -> t.getDensity() + "-" + t.getMick() + "-" + t.getHeight(), Collectors.reducing(BigDecimal.ZERO, TwinCalcHourSpec::getLength, BigDecimal::add)));
|
|
|
+ Map<String, BigDecimal> resultMap = hourList.stream().collect(Collectors.groupingBy(t -> t.getDensity() + "||" + t.getMick() + "||" + t.getHeight() + "||" + t.getSpec(), Collectors.reducing(BigDecimal.ZERO, TwinCalcHourSpec::getLength, BigDecimal::add)));
|
|
|
for (String ss : resultMap.keySet()) {
|
|
|
- String[] temp = ss.split("-");
|
|
|
+ String[] temp = ss.split("\\|\\|");
|
|
|
BigDecimal density = new BigDecimal(temp[0]).setScale(2, RoundingMode.HALF_UP);
|
|
|
Integer mick = Integer.parseInt(temp[1]);
|
|
|
TwinEmpCalc calc = new TwinEmpCalc();
|
|
@@ -252,6 +252,11 @@ public class TwinEmpCalcServiceImpl implements ITwinEmpCalcService {
|
|
|
BigDecimal height = new BigDecimal(temp[2]).setScale(2, RoundingMode.HALF_UP);
|
|
|
calc.setHeight(height);
|
|
|
}
|
|
|
+ if (temp.length == 4 && StringUtils.isNotEmpty(temp[3]) && !"null".equals(temp[3])) {
|
|
|
+ calc.setSpec(temp[3]);
|
|
|
+ } else {
|
|
|
+ calc.setSpec("");
|
|
|
+ }
|
|
|
calc.setEfficiency(effMap.get(deviceId));
|
|
|
calc.setEmpDate(emp.getEmpDate());
|
|
|
BigDecimal length = resultMap.get(ss);
|