| | |
| | | processMainEntity.setStandValue(standValue == null ? BigDecimal.valueOf(-2) : BigDecimal.valueOf(standValue)); |
| | | Double theoryValue = getConfValue("DATAPOINT",conf.getExt2()); |
| | | processMainEntity.setTheoryValue(theoryValue == null ? BigDecimal.valueOf(-2) : BigDecimal.valueOf(theoryValue)); |
| | | // 计算 月累计 当前自然月 |
| | | // 计算 当月累计 当前自然月 |
| | | int days = calendar.get(Calendar.DAY_OF_MONTH); |
| | | calendar.set(Calendar.DAY_OF_MONTH,1); |
| | | String clock_30 = DateUtils.format(calendar.getTime(), DateUtils.FORMAT_YEAR_MONTH_DAY); |
| | | List<CokingProcessMainEntity> historyList_30 = cokingProcessMainService.historyList(clock_30, clock, "day",processMainEntity.getIndCode()); |
| | | historyList_30.add(processMainEntity); |
| | | double monthValue = historyList_30.stream().mapToDouble(e -> e.getRealValue().doubleValue()).average().orElse(0.0) * 30; |
| | | // 过滤-2,平均值*一号到当天总天数 |
| | | double monthValue = historyList_30.stream().filter(e -> e.getRealValue().equals(BigDecimal.valueOf(-2))).mapToDouble(e -> e.getRealValue().doubleValue()).average().orElse(0.0) * days; |
| | | processMainEntity.setMonthValue(BigDecimal.valueOf(monthValue)); |
| | | |
| | | // 计算 历史平均 |
| | |
| | | String clock_90 = DateUtils.format(calendar.getTime(), DateUtils.FORMAT_YEAR_MONTH_DAY); |
| | | List<CokingProcessMainEntity> historyList_90 = cokingProcessMainService.historyList(clock_90, clock, "day",processMainEntity.getIndCode()); |
| | | historyList_90.add(processMainEntity); |
| | | // 过滤-2 |
| | | historyList_90 = historyList_90.stream().filter(e -> e.getRealValue().equals(BigDecimal.valueOf(-2))).collect(Collectors.toList()); |
| | | double avgValue = historyList_90.stream().mapToDouble(e -> e.getRealValue().doubleValue()).average().orElse(0.0); |
| | | processMainEntity.setAvgValue(BigDecimal.valueOf(avgValue)); |
| | | // 历史最优 |