| | |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.integration.api.model.*; |
| | | import com.ruoyi.jianguan.mongodb.service.*; |
| | |
| | | /** |
| | | * 每天的9点执行的任务 |
| | | */ |
| | | @Scheduled(cron = "0 0 16 * * *") |
| | | @Scheduled(cron = "0 0 10 * * *") |
| | | // @Scheduled(fixedRate = 60000) |
| | | public void taskDay(){ |
| | | try { |
| | |
| | | customthreadPoolExecutor.execute(() -> { |
| | | if (uploadRealTimeMonitoringDataList != null && uploadRealTimeMonitoringDataList.size() > 0) { |
| | | for (UploadRealTimeMonitoringData uploadRealTimeMonitoringData : uploadRealTimeMonitoringDataList) { |
| | | log.info("线程:{},办理业务", Thread.currentThread().getName()); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("device_code", uploadRealTimeMonitoringData.getCharging_pile_code()); |
| | | jsonObject.put("report_time", System.currentTimeMillis()); |
| | | jsonObject.put("properties", uploadRealTimeMonitoringData); |
| | | mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", uploadRealTimeMonitoringData.getCharging_pile_code()), jsonObject.toJSONString()); |
| | | R<String> chargePileCode = mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", uploadRealTimeMonitoringData.getCharging_pile_code()), jsonObject.toJSONString()); |
| | | log.info("返回结果:{}", chargePileCode.getData()); |
| | | log.info("数据:{}", uploadRealTimeMonitoringData.getCharging_pile_code()); |
| | | log.info("数据:{}", jsonObject.toJSONString()); |
| | | } |