| | |
| | | if (reqDTO.getModuleType() == null) { |
| | | throw new Exception("ModuleType不能为空"); |
| | | } |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(reqDTO.getPredictTime()); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | reqDTO.setPredictTime(calendar.getTime()); |
| | | |
| | | log.info("预测参数:" + JSON.toJSONString(reqDTO)); |
| | | MdkPredictModuleRespDTO result = new MdkPredictModuleRespDTO(); |
| | | result.setPredictTime(reqDTO.getPredictTime()); |
| | | result.setModuleType(reqDTO.getModuleType()); |
| | | List<DmModuleEntity> moduleList = dmModuleService.getModuleByModuleType(reqDTO.getModuleType()); |
| | | log.info("预测计算开始: " + System.currentTimeMillis()); |
| | | for (DmModuleEntity module : moduleList) { |
| | |
| | | try { |
| | | if (redisTemplate.hasKey(catchKey)) { |
| | | log.info("查找调度结果缓存: " + catchKey); |
| | | return JSON.parseObject(JSONObject.toJSONString(redisTemplate.opsForValue().get(catchKey)), MdkScheduleRespDTO.class); |
| | | return JSON.parseObject(redisTemplate.opsForValue().get(catchKey).toString(), MdkScheduleRespDTO.class); |
| | | } |
| | | log.info("调度计算开始: " + System.currentTimeMillis()); |
| | | log.info("reqDTO=" + JSON.toJSONString(reqDTO)); |