| | |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, BigDecimal> getPredictLastValue(PredictLastValueReqVO reqVO) { |
| | | Map<String, BigDecimal> result = new HashMap<>(reqVO.getItemNos().size()); |
| | | if (CollectionUtils.isEmpty(reqVO.getItemNos())) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, BigDecimal> getPredictValueByTime(PredictLastValueReqVO reqVO) { |
| | | Map<String, BigDecimal> result = new HashMap<>(reqVO.getItemNos().size()); |
| | | if (CollectionUtils.isEmpty(reqVO.getItemNos())) { |
| | | return result; |
| | | } |
| | | List<String[]> itemNos = reqVO.getItemNos(); |
| | | for (String[] itemNo : itemNos) { |
| | | String key = itemNo[0] + "_" + itemNo[1] + "_" + itemNo[2]; |
| | | ItemVO predictItem = mmPredictItemService.getItemByItemNo(itemNo[0]); |
| | | if (predictItem == null || predictItem.getLastTime() == null) { |
| | | result.put(key, BigDecimal.ZERO); |
| | | } |
| | | MmItemOutputEntity outPut = mmItemOutputService.getByItemid(predictItem.getId(), itemNo[1], itemNo[2]); |
| | | List<Object[]> curData = mmItemResultJsonService.getData(outPut.getId(), reqVO.getPredictTime(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND); |
| | | if (CollectionUtils.isEmpty(curData)) { |
| | | result.put(key, BigDecimal.ZERO); |
| | | } else { |
| | | result.put(key, new BigDecimal(curData.get(curData.size() - 1)[1].toString())); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public List<StScheduleRecordVO> getLastScheduleData(String scheduleCode, Integer limit) { |
| | | if (StringUtils.isBlank(scheduleCode)) { |
| | | return null; |