| | |
| | | resultJson.setPredicttime(predictTime); |
| | | List<Double> jsonValueList = entry.getValue().stream().map(valueVO -> valueVO.getDataValue()).collect(Collectors.toList()); |
| | | resultJson.setJsonvalue(JSONArray.toJSONString(jsonValueList)); |
| | | resultJson.setCumulant(""); |
| | | resultJsonList.add(resultJson); |
| | | } |
| | | // json结果存入mysql |
| | |
| | | influxModelResultVOS.forEach(item -> { |
| | | Object[] dataItem = new Object[2]; |
| | | dataItem[0] = DateUtils.format(Date.from(item.getTimestamp()), timeFormat); |
| | | dataItem[1] = BigDecimal.valueOf(Double.valueOf(item.getValue().toString())).setScale(2, BigDecimal.ROUND_HALF_UP); |
| | | dataItem[1] = BigDecimal.valueOf(Double.valueOf(item.getValue().toString())).setScale(3, BigDecimal.ROUND_HALF_UP); |
| | | result.add(dataItem); |
| | | }); |
| | | return result; |