From 26526de10d49c3422a6d6c2d55fe5a2997786ad9 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期一, 21 七月 2025 13:58:37 +0800
Subject: [PATCH] Merge branch 'dev' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile into dev
---
ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/governmentCloud/UploadDataTaskUtil.java | 331 ++++--------------------------------------------------
1 files changed, 29 insertions(+), 302 deletions(-)
diff --git a/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/governmentCloud/UploadDataTaskUtil.java b/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/governmentCloud/UploadDataTaskUtil.java
index cedb457..f21d309 100644
--- a/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/governmentCloud/UploadDataTaskUtil.java
+++ b/ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/governmentCloud/UploadDataTaskUtil.java
@@ -2,22 +2,25 @@
import com.alibaba.fastjson.JSONObject;
-import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.redis.service.RedisService;
import com.ruoyi.integration.api.model.*;
import com.ruoyi.jianguan.mongodb.service.*;
import com.ruoyi.jianguan.mqtt.config.TopicConstants;
import com.ruoyi.jianguan.mqtt.util.MqttPushUtil;
-import com.ruoyi.jianguan.rocket.model.ErrorMessageMessage;
import io.netty.util.concurrent.DefaultThreadFactory;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+import java.text.SimpleDateFormat;
import java.time.LocalDate;
-import java.time.LocalDateTime;
+import java.util.Date;
import java.util.List;
+import java.util.Objects;
import java.util.concurrent.*;
/**
@@ -28,73 +31,28 @@
public class UploadDataTaskUtil {
@Autowired
- private AcquisitionBillingModeService acquisitionBillingModeService;
- @Autowired
- private BillingModeVerifyService billingModeVerifyService;
- @Autowired
- private BmsAbortService bmsAbortService;
- @Autowired
- private BmsDemandAndChargerExportationService bmsDemandAndChargerExportationService;
- @Autowired
- private OnlineService onlineService;
- @Autowired
- private EndChargeService endChargeService;
- @Autowired
- private ErrorMessageMessageService errorMessageMessageService;
- @Autowired
private UploadRealTimeMonitoringDataService uploadRealTimeMonitoringDataService;
@Autowired
- private ChargingHandshakeService chargingHandshakeService;
- @Autowired
- private ParameterSettingService parameterSettingService;
- @Autowired
- private MotorAbortService motorAbortService;
- @Autowired
- private BmsInformationService bmsInformationService;
- @Autowired
- private ChargingPileStartsChargingService chargingPileStartsChargingService;
- @Autowired
- private PlatformStartChargingReplyService platformStartChargingReplyService;
- @Autowired
- private PlatformStopChargingReplyService platformStopChargingReplyService;
- @Autowired
- private TransactionRecordService transactionRecordService;
- @Autowired
- private UpdateBalanceReplyService updateBalanceReplyService;
- @Autowired
- private SynchronizeOfflineCardReplyService synchronizeOfflineCardReplyService;
- @Autowired
- private ClearOfflineCardReplyService clearOfflineCardReplyService;
- @Autowired
- private WorkingParameterSettingReplyService workingParameterSettingReplyService;
- @Autowired
- private TimingSettingService timingSettingService;
- @Autowired
- private SetupBillingModelReplyService setupBillingModelReplyService;
- @Autowired
- private GroundLockRealTimeDataService groundLockRealTimeDataService;
- @Autowired
- private ChargingPileReturnsGroundLockDataService chargingPileReturnsGroundLockDataService;
- @Autowired
- private PlatformRestartReplyService platformRestartReplyService;
- @Autowired
- private PlatformRemoteUpdateReplyService platformRemoteUpdateReplyService;
- @Autowired
- private QrCodeDeliveryReplyService qrCodeDeliveryReplyService;
- @Autowired
- private SecurityDetectionService securityDetectionService;
- @Autowired
private MqttPushUtil mqttPushUtil;
+ @Autowired
+ private RedisService redisService;
/**
* 每天的9点执行的任务
*/
- @Scheduled(cron = "0 0 9 * * *")
-// @Scheduled(fixedRate = 60000)
+ @Scheduled(fixedRate = 86400000)
public void taskDay(){
try {
- // 传输mongodb的硬件数据
- createCustomThreadPool();
+ // 判断是否存在标识
+ Thread.sleep(1000);
+ String flag = redisService.getCacheObject("cloud_integration");
+ System.out.println("市政云硬件数据传输标识:" + flag);
+ if (Objects.isNull(flag)) {
+ log.info("市政云硬件数据传输无标识,开始传输硬件数据");
+ redisService.setCacheObject("cloud_integration", "1",24L,TimeUnit.HOURS);
+ // 传输mongodb的硬件数据
+ createCustomThreadPool();
+ }
}catch (Exception e){
e.printStackTrace();
}
@@ -132,260 +90,29 @@
try {
LocalDate localDate = LocalDate.now().minusDays(1);
- String startTime = localDate + " 00:00:00";
- String endTime = localDate + " 23:59:59";
+ String start = localDate + " 00:00:00";
+ String end = localDate + " 23:59:59";
+ Date startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(start);
+ Date endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(end);
// 查询所有的mango数据
- List<AcquisitionBillingMode> acquisitionBillingModeList = acquisitionBillingModeService.getRangeTimeData(startTime, endTime);
- List<BillingModeVerify> billingModeVerifyList = billingModeVerifyService.getRangeTimeData(startTime, endTime);
- List<BmsAbort> bmsAbortList = bmsAbortService.getRangeTimeData(startTime, endTime);
- List<BmsDemandAndChargerExportation> bmsDemandAndChargerExportationList = bmsDemandAndChargerExportationService.getRangeTimeData(startTime, endTime);
- List<Online> onlineList = onlineService.getRangeTimeData(startTime, endTime);
- List<EndCharge> endChargeList = endChargeService.getRangeTimeData(startTime, endTime);
- List<ErrorMessageMessage> errorMessageMessageList = errorMessageMessageService.getRangeTimeData(startTime, endTime);
List<UploadRealTimeMonitoringData> uploadRealTimeMonitoringDataList = uploadRealTimeMonitoringDataService.getRangeTimeData(startTime, endTime);
- List<ChargingHandshake> chargingHandshakeList = chargingHandshakeService.getRangeTimeData(startTime, endTime);
- List<ParameterSetting> parameterSettingList = parameterSettingService.getRangeTimeData(startTime, endTime);
- List<MotorAbort> motorAbortList = motorAbortService.getRangeTimeData(startTime, endTime);
- List<BmsInformation> bmsInformationList = bmsInformationService.getRangeTimeData(startTime, endTime);
- List<ChargingPileStartsCharging> chargingPileStartsChargingList = chargingPileStartsChargingService.getRangeTimeData(startTime, endTime);
- List<PlatformStartChargingReply> platformStartChargingReplyList = platformStartChargingReplyService.getRangeTimeData(startTime, endTime);
- List<PlatformStopChargingReply> platformStopChargingReplyList = platformStopChargingReplyService.getRangeTimeData(startTime, endTime);
- List<TransactionRecord> transactionRecordList = transactionRecordService.getRangeTimeData(startTime, endTime);
- List<UpdateBalanceReply> updateBalanceReplyList = updateBalanceReplyService.getRangeTimeData(startTime, endTime);
- List<SynchronizeOfflineCardReply> synchronizeOfflineCardReplyList = synchronizeOfflineCardReplyService.getRangeTimeData(startTime, endTime);
- List<ClearOfflineCardReply> clearOfflineCardReplyList = clearOfflineCardReplyService.getRangeTimeData(startTime, endTime);
- List<WorkingParameterSettingReply> workingParameterSettingReplyList = workingParameterSettingReplyService.getRangeTimeData(startTime, endTime);
- List<TimingSetting> timingSettingList = timingSettingService.getRangeTimeData(startTime, endTime);
- List<SetupBillingModelReply> setupBillingModelReplyList = setupBillingModelReplyService.getRangeTimeData(startTime, endTime);
- List<GroundLockRealTimeData> groundLockRealTimeDataList = groundLockRealTimeDataService.getRangeTimeData(startTime, endTime);
- List<ChargingPileReturnsGroundLockData> chargingPileReturnsGroundLockDataList = chargingPileReturnsGroundLockDataService.getRangeTimeData(startTime, endTime);
- List<PlatformRestartReply> platformRestartReplyList = platformRestartReplyService.getRangeTimeData(startTime, endTime);
- List<PlatformRemoteUpdateReply> platformRemoteUpdateReplyList = platformRemoteUpdateReplyService.getRangeTimeData(startTime, endTime);
- List<QrCodeDeliveryReply> qrCodeDeliveryReplyList = qrCodeDeliveryReplyService.getRangeTimeData(startTime, endTime);
- List<SecurityDetection> securityDetectionList = securityDetectionService.getRangeTimeData(startTime, endTime);
+ System.err.println("查询所有的mango数据:"+uploadRealTimeMonitoringDataList.size());
customthreadPoolExecutor.execute(() -> {
- if (acquisitionBillingModeList != null && acquisitionBillingModeList.size() > 0) {
- for (AcquisitionBillingMode acquisitionBillingMode : acquisitionBillingModeList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", acquisitionBillingMode.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", acquisitionBillingMode.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (billingModeVerifyList != null && billingModeVerifyList.size() > 0) {
- for (BillingModeVerify billingModeVerify : billingModeVerifyList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", billingModeVerify.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", billingModeVerify.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (bmsAbortList != null && bmsAbortList.size() > 0) {
- for (BmsAbort bmsAbort : bmsAbortList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", bmsAbort.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", bmsAbort.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (bmsDemandAndChargerExportationList != null && bmsDemandAndChargerExportationList.size() > 0) {
- for (BmsDemandAndChargerExportation bmsDemandAndChargerExportation : bmsDemandAndChargerExportationList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", bmsDemandAndChargerExportation.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", bmsDemandAndChargerExportation.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (onlineList != null && onlineList.size() > 0) {
- for (Online online : onlineList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", online.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", online.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (endChargeList != null && endChargeList.size() > 0) {
- for (EndCharge endCharge : endChargeList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", endCharge.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", endCharge.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (errorMessageMessageList != null && errorMessageMessageList.size() > 0) {
- for (ErrorMessageMessage errorMessageMessage : errorMessageMessageList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", errorMessageMessage.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", errorMessageMessage.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
if (uploadRealTimeMonitoringDataList != null && uploadRealTimeMonitoringDataList.size() > 0) {
for (UploadRealTimeMonitoringData uploadRealTimeMonitoringData : uploadRealTimeMonitoringDataList) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("device_code", uploadRealTimeMonitoringData.getCharging_pile_code());
jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", uploadRealTimeMonitoringData.getCharging_pile_code()), jsonObject.toJSONString());
+ jsonObject.put("properties", uploadRealTimeMonitoringData);
+ 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());
}
}
- if (chargingHandshakeList != null && chargingHandshakeList.size() > 0) {
- for (ChargingHandshake chargingHandshake : chargingHandshakeList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", chargingHandshake.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", chargingHandshake.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (parameterSettingList != null && parameterSettingList.size() > 0) {
- for (ParameterSetting parameterSetting : parameterSettingList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", parameterSetting.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", parameterSetting.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (motorAbortList != null && motorAbortList.size() > 0) {
- for (MotorAbort motorAbort : motorAbortList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", motorAbort.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", motorAbort.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (bmsInformationList != null && bmsInformationList.size() > 0) {
- for (BmsInformation bmsInformation : bmsInformationList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", bmsInformation.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", bmsInformation.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (chargingPileStartsChargingList != null && chargingPileStartsChargingList.size() > 0) {
- for (ChargingPileStartsCharging chargingPileStartsCharging : chargingPileStartsChargingList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", chargingPileStartsCharging.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", chargingPileStartsCharging.getCharging_pile_code()),jsonObject.toJSONString());
- }
- }
- if (platformStartChargingReplyList != null && platformStartChargingReplyList.size() > 0) {
- for (PlatformStartChargingReply platformStartChargingReply : platformStartChargingReplyList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", platformStartChargingReply.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", platformStartChargingReply.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (platformStopChargingReplyList != null && platformStopChargingReplyList.size() > 0) {
- for (PlatformStopChargingReply platformStopChargingReply : platformStopChargingReplyList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", platformStopChargingReply.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", platformStopChargingReply.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (transactionRecordList != null && transactionRecordList.size() > 0) {
- for (TransactionRecord transactionRecord : transactionRecordList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", transactionRecord.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", transactionRecord.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
-// if (updateBalanceReplyList != null && updateBalanceReplyList.size() > 0) {
-// for (UpdateBalanceReply updateBalanceReply : updateBalanceReplyList) {
-// mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", updateBalanceReply.getCharging_pile_code()), JSONObject.toJSONString(updateBalanceReply));
-// }
-// }
-// if (synchronizeOfflineCardReplyList != null && synchronizeOfflineCardReplyList.size() > 0) {
-// for (SynchronizeOfflineCardReply synchronizeOfflineCardReply : synchronizeOfflineCardReplyList) {
-// mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", synchronizeOfflineCardReply.getCharging_pile_code()), JSONObject.toJSONString(synchronizeOfflineCardReply));
-// }
-// }
-// if (clearOfflineCardReplyList != null && clearOfflineCardReplyList.size() > 0) {
-// for (ClearOfflineCardReply clearOfflineCardReply : clearOfflineCardReplyList) {
-// mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", clearOfflineCardReply.getCharging_pile_code()), JSONObject.toJSONString(clearOfflineCardReply));
-// }
-// }
- if (workingParameterSettingReplyList != null && workingParameterSettingReplyList.size() > 0) {
- for (WorkingParameterSettingReply workingParameterSettingReply : workingParameterSettingReplyList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", workingParameterSettingReply.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", workingParameterSettingReply.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (timingSettingList != null && timingSettingList.size() > 0) {
- for (TimingSetting timingSetting : timingSettingList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", timingSetting.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", timingSetting.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
-// if (setupBillingModelReplyList != null && setupBillingModelReplyList.size() > 0) {
-// for (SetupBillingModelReply setupBillingModelReply : setupBillingModelReplyList) {
-// mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", setupBillingModelReply.getCharging_pile_code()), JSONObject.toJSONString(setupBillingModelReply));
-// }
-// }
- if (groundLockRealTimeDataList != null && groundLockRealTimeDataList.size() > 0) {
- for (GroundLockRealTimeData groundLockRealTimeData : groundLockRealTimeDataList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", groundLockRealTimeData.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", groundLockRealTimeData.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (chargingPileReturnsGroundLockDataList != null && chargingPileReturnsGroundLockDataList.size() > 0) {
- for (ChargingPileReturnsGroundLockData chargingPileReturnsGroundLockData : chargingPileReturnsGroundLockDataList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", chargingPileReturnsGroundLockData.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", chargingPileReturnsGroundLockData.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (platformRestartReplyList != null && platformRestartReplyList.size() > 0) {
- for (PlatformRestartReply platformRestartReply : platformRestartReplyList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", platformRestartReply.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", platformRestartReply.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (platformRemoteUpdateReplyList != null && platformRemoteUpdateReplyList.size() > 0) {
- for (PlatformRemoteUpdateReply platformRemoteUpdateReply : platformRemoteUpdateReplyList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", platformRemoteUpdateReply.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", platformRemoteUpdateReply.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (qrCodeDeliveryReplyList != null && qrCodeDeliveryReplyList.size() > 0) {
- for (QrCodeDeliveryReply qrCodeDeliveryReply : qrCodeDeliveryReplyList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", qrCodeDeliveryReply.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", qrCodeDeliveryReply.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
- if (securityDetectionList != null && securityDetectionList.size() > 0) {
- for (SecurityDetection securityDetection : securityDetectionList) {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("device_code", securityDetection.getCharging_pile_code());
- jsonObject.put("report_time", System.currentTimeMillis());
- mqttPushUtil.pushChargePileData(TopicConstants.CHARGE_PILE_CODE.replace("CHARGE_PILE_CODE", securityDetection.getCharging_pile_code()), jsonObject.toJSONString());
- }
- }
-
});
TimeUnit.MILLISECONDS.sleep(1);
-
-// Future<String> future = customthreadPoolExecutor.submit(() -> {
-// log.info("线程:{},办理业务", Thread.currentThread().getName());
-// return "业务办理完成";
-// });
-// log.info(future.get());
} finally {
gracefulShutdown(customthreadPoolExecutor);
}
--
Gitblit v1.7.1