| | |
| | | |
| | | public ArimaPredictReqPo() {}; |
| | | |
| | | public ArimaPredictReqPo(String damId, String pointId, String type, int number) { |
| | | public ArimaPredictReqPo(String damId, String pointId, String type) { |
| | | this.damId = damId; |
| | | this.pointId = pointId; |
| | | this.type = type; |
| | | this.number = number; |
| | | } |
| | | |
| | | public ArimaPredictReqPo (DataResChildrenPo pojo, String type, int number) { |
| | | public ArimaPredictReqPo (DataResChildrenPo pojo, String type) { |
| | | this.damId = pojo.getRes_cd(); |
| | | this.pointId = pojo.getCd(); |
| | | this.type = type; |
| | | this.number = number; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @GetMapping(value = "/getTest2") |
| | | public R getTest2() { |
| | | ArimaPredictReqPo po = new ArimaPredictReqPo("42011640018","02","3",24); |
| | | ArimaPredictReqPo po = new ArimaPredictReqPo("42011640018","02","3"); |
| | | nkyService.arimaPredict(po); |
| | | return R.data(null); |
| | | } |
| | |
| | | public void predictData(String type) { |
| | | List<DataResChildrenPo> cdList = getCdList(type); |
| | | cdList.forEach(dataResChildrenPo -> { |
| | | ArimaPredictReqPo arimaPredictReqPo = new ArimaPredictReqPo(dataResChildrenPo, type, 7); |
| | | ArimaPredictReqPo arimaPredictReqPo = new ArimaPredictReqPo(dataResChildrenPo, type); |
| | | //循环预测请求 |
| | | nkyService.arimaPredict(arimaPredictReqPo); |
| | | }); |
| | |
| | | @Override |
| | | public HstPredict hstQuery(QueryReqPo po) { |
| | | JSONObject jsonObject = requestNkyApi(HST_QUERY, JSON.toJSONString(po)); |
| | | HstPredict hstPredict = jsonObject.toJavaObject(HstPredict.class); |
| | | return hstPredict; |
| | | if (jsonObject == null){ |
| | | return null; |
| | | } |
| | | JSONArray data = jsonObject.getJSONArray("data"); |
| | | |
| | | if (data.size()>0){ |
| | | HstPredict hstPredict = data.getJSONObject(0).toJavaObject(HstPredict.class); |
| | | return hstPredict; |
| | | |
| | | }else { |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |