From 2c7a721e947d86d4f8988a9b2b11b87ad7e923bf Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期一, 02 九月 2024 11:57:31 +0800 Subject: [PATCH] 处理消息中转 --- /dev/null | 124 --------------- ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/constant/SendTagConstant.java | 109 +++++++++++++ ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/produce/EnhanceProduce.java | 104 ++++++------ ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/model/UploadRealTimeMonitoringData.java | 2 ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java | 86 ++++++++++ 5 files changed, 247 insertions(+), 178 deletions(-) diff --git a/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/model/UploadRealTimeMonitoringData.java b/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/model/UploadRealTimeMonitoringData.java index 5338fa8..0669156 100644 --- a/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/model/UploadRealTimeMonitoringData.java +++ b/ruoyi-api/ruoyi-api-integration/src/main/java/com/ruoyi/integration/api/model/UploadRealTimeMonitoringData.java @@ -43,6 +43,8 @@ private BigDecimal period_service_price;// @ApiModelProperty("时段服务费") + private BigDecimal period_charging_degree;// @ApiModelProperty("时段充电度数") + } diff --git a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/constant/SendTagConstant.java b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/constant/SendTagConstant.java new file mode 100644 index 0000000..9088d1e --- /dev/null +++ b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/constant/SendTagConstant.java @@ -0,0 +1,109 @@ +package com.ruoyi.integration.iotda.constant; + + +/** + * @author xiaochen + * @Date 2024/8/22 15:28 + */ +public class SendTagConstant { + /** + * 充电桩登录认证 + */ + public static final String ONLINE ="online"; + /** + * 充电桩心跳包 + */ + public static final String PING ="ping"; + /** + * 计费模型验证请求 + */ + public static final String BILLING_MODE_VERIFY ="billing_mode_verify"; + /** + * 充电桩计费模型请求 + */ + public static final String ACQUISITION_BILLING_MODE ="acquisition_billing_mode"; + /** + * 上传实时监测数据 + */ + public static final String UPLOAD_REAL_TIME_MONITORING_DATA ="upload_real_time_monitoring_data"; + /** + * 充电握手 + */ + public static final String CHARGING_HANDSHAKE ="charging_handshake"; + /** + * 充电阶段BMS中止 + */ + public static final String BMS_ABORT ="bms_abort"; + /** + * 充电阶段充电机中止 + */ + public static final String MOTOR_ABORT ="motor_abort"; + /** + * 充电过程BMS需求、充电机输出 + */ + public static final String BMS_DEMAND_AND_CHARGER_EXPORTATION ="bms_demand_and_charger_exportation"; + /** + * 充电过程BMS信息 + */ + public static final String BMS_INFORMATION ="bms_information"; + /** + * 充电桩主动申请启动充电 + */ + public static final String CHARGING_PILE_STARTS_CHARGING ="charging_pile_starts_charging"; + /** + * 远程启机命令回复 + */ + public static final String PLATFORM_START_CHARGING_REPLY ="platform_start_charging_reply"; + /** + * 远程停机命令回复 + */ + public static final String PLATFORM_STOP_CHARGING_REPLY ="platform_stop_charging_reply"; + /** + * 交易记录 + */ + public static final String TRANSACTION_RECORD ="transaction_record"; + /** + * 余额更新应答 + */ + public static final String UPDATE_BALANCE_REPLY ="update_balance_reply"; + /** + * 卡数据同步应答 + */ + public static final String SYNCHRONIZE_OFFLINE_CARD_REPLY ="synchronize_offline_card_reply"; + /** + * 离线卡数据清除应答 + */ + public static final String CLEAR_OFFLINE_CARD_REPLY ="clear_offline_card_reply"; + /** + * 离线卡数据查询应答 + */ + public static final String QUERY_OFFLINE_CARD_REPLY ="query_offline_card_reply"; + /** + * 充电桩工作参数设置应答 + */ + public static final String WORKING_PARAMETER_SETTING_REPLY ="working_parameter_setting_reply"; + /** + * 对时设置应答 + */ + public static final String TIMING_SETTING_REPLY ="timing_setting_reply"; + /** + * 计费模型应答 + */ + public static final String SETUP_BILLING_MODEL_REPLY ="setup_billing_model_reply"; + /** + * 地锁数据上送(充电桩上送) + */ + public static final String GROUND_LOCK_REAL_TIME_DATA ="ground_lock_real_time_data"; + /** + * 充电桩返回数据(上行) + */ + public static final String CHARGING_PILE_RETURNS_GROUND_LOCK_DATA ="charging_pile_returns_ground_lock_data"; + /** + * 远程重启应答 + */ + public static final String PLATFORM_RESTART_REPLY ="platform_restart_reply"; + /** + * 远程更新应答 + */ + public final static String PLATFORM_REMOTE_UPDATE_REPLY ="platform_remote_update_reply"; +} diff --git a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/enums/SendTagMenu.java b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/enums/SendTagMenu.java deleted file mode 100644 index d4e01ed..0000000 --- a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/enums/SendTagMenu.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.ruoyi.integration.iotda.enums; - - -/** - * @author xiaochen - * @Date 2024/8/22 15:28 - */ -public enum SendTagMenu { - /** - * 充电桩登录认证 - */ - ONLINE ("online"), - /** - * 充电桩心跳包 - */ - PING ("ping"), - /** - * 计费模型验证请求 - */ - BILLING_MODE_VERIFY ("billing_mode_verify"), - /** - * 充电桩计费模型请求 - */ - ACQUISITION_BILLING_MODE ("acquisition_billing_mode"), - /** - * 上传实时监测数据 - */ - UPLOAD_REAL_TIME_MONITORING_DATA ("upload_real_time_monitoring_data"), - /** - * 充电握手 - */ - CHARGING_HANDSHAKE ("charging_handshake"), - /** - * 充电阶段BMS中止 - */ - BMS_ABORT ("bms_abort"), - /** - * 充电阶段充电机中止 - */ - MOTOR_ABORT ("motor_abort"), - /** - * 充电过程BMS需求、充电机输出 - */ - BMS_DEMAND_AND_CHARGER_EXPORTATION ("bms_demand_and_charger_exportation"), - /** - * 充电过程BMS信息 - */ - BMS_INFORMATION ("bms_information"), - /** - * 充电桩主动申请启动充电 - */ - CHARGING_PILE_STARTS_CHARGING ("charging_pile_starts_charging"), - /** - * 远程启机命令回复 - */ - PLATFORM_START_CHARGING_REPLY ("platform_start_charging_reply"), - /** - * 远程停机命令回复 - */ - PLATFORM_STOP_CHARGING_REPLY ("platform_stop_charging_reply"), - /** - * 交易记录 - */ - TRANSACTION_RECORD ("transaction_record"), - /** - * 余额更新应答 - */ - UPDATE_BALANCE_REPLY ("update_balance_reply"), - /** - * 卡数据同步应答 - */ - SYNCHRONIZE_OFFLINE_CARD_REPLY ("synchronize_offline_card_reply"), - /** - * 离线卡数据清除应答 - */ - CLEAR_OFFLINE_CARD_REPLY ("clear_offline_card_reply"), - /** - * 离线卡数据查询应答 - */ - QUERY_OFFLINE_CARD_REPLY ("query_offline_card_reply"), - /** - * 充电桩工作参数设置应答 - */ - WORKING_PARAMETER_SETTING_REPLY ("working_parameter_setting_reply"), - /** - * 对时设置应答 - */ - TIMING_SETTING_REPLY ("timing_setting_reply"), - /** - * 计费模型应答 - */ - SETUP_BILLING_MODEL_REPLY ("setup_billing_model_reply"), - /** - * 地锁数据上送(充电桩上送) - */ - GROUND_LOCK_REAL_TIME_DATA ("ground_lock_real_time_data"), - /** - * 充电桩返回数据(上行) - */ - CHARGING_PILE_RETURNS_GROUND_LOCK_DATA ("charging_pile_returns_ground_lock_data"), - /** - * 远程重启应答 - */ - PLATFORM_RESTART_REPLY ("platform_restart_reply"), - /** - * 远程更新应答 - */ - PLATFORM_REMOTE_UPDATE_REPLY ("platform_remote_update_reply"), - ; - private String value; - - - SendTagMenu(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java index acf6897..3640b42 100644 --- a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java +++ b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/iotda/utils/listener/IotMessageListener.java @@ -2,7 +2,11 @@ import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.integration.iotda.constant.SendTagConstant; +import com.ruoyi.integration.rocket.produce.EnhanceProduce; import lombok.extern.slf4j.Slf4j; +import org.apache.rocketmq.client.producer.SendResult; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @@ -16,6 +20,8 @@ @RestController public class IotMessageListener { + @Autowired + private EnhanceProduce enhanceProduce; /** * 设备消息监听 @@ -27,9 +33,85 @@ public AjaxResult<String> message(@RequestBody JSONObject jsonObject) throws IOException { log.info("接收到消息中转:{}",jsonObject); JSONObject content = jsonObject.getJSONObject("content"); - if (content.getString("name").equals("device_status_change")){ - //设备状态改变 + String service_id = content.getString("service_id"); + log.info("服务id:{}",service_id); + SendResult sendResult; + // 设备消息下发 + switch (service_id){ + case SendTagConstant.ONLINE: + sendResult = enhanceProduce.onlineMessage(content); + break; + case SendTagConstant.PING: + sendResult = enhanceProduce.pingMessage(content); + break; + case SendTagConstant.BILLING_MODE_VERIFY: + sendResult = enhanceProduce.billingModeVerifyMessage(content); + break; + case SendTagConstant.ACQUISITION_BILLING_MODE: + sendResult = enhanceProduce.acquisitionBillingModeMessage(content); + break; + case SendTagConstant.UPLOAD_REAL_TIME_MONITORING_DATA: + sendResult = enhanceProduce.uploadRealTimeMonitoringDataMessage(content); + break; + case SendTagConstant.CHARGING_HANDSHAKE: + sendResult = enhanceProduce.chargingHandshakeMessage(content); + break; + case SendTagConstant.BMS_ABORT: + sendResult = enhanceProduce.bmsAbortMessage(content); + break; + case SendTagConstant.MOTOR_ABORT: + sendResult = enhanceProduce.motorAbortMessage(content); + break; + case SendTagConstant.BMS_DEMAND_AND_CHARGER_EXPORTATION: + sendResult = enhanceProduce.bmsDemandAndChargerExportationMessage(content); + break; + case SendTagConstant.BMS_INFORMATION: + sendResult = enhanceProduce.bmsInformationMessage(content); + break; + case SendTagConstant.CHARGING_PILE_STARTS_CHARGING: + sendResult = enhanceProduce.chargingPileStartsChargingMessage(content); + break; + case SendTagConstant.PLATFORM_START_CHARGING_REPLY: + sendResult = enhanceProduce.platformStartChargingReplyMessage(content); + break; + case SendTagConstant.PLATFORM_STOP_CHARGING_REPLY: + sendResult = enhanceProduce.platformStopChargingReplyMessage(content); + break; + case SendTagConstant.TRANSACTION_RECORD: + sendResult = enhanceProduce.transactionRecordMessage(content); + break; + case SendTagConstant.UPDATE_BALANCE_REPLY: + sendResult = enhanceProduce.updateBalanceReplyMessage(content); + break; + case SendTagConstant.SYNCHRONIZE_OFFLINE_CARD_REPLY: + sendResult = enhanceProduce.synchronizeOfflineCardReplyMessage(content); + break; + case SendTagConstant.CLEAR_OFFLINE_CARD_REPLY: + sendResult = enhanceProduce.clearOfflineCardReplyMessage(content); + break; + case SendTagConstant.WORKING_PARAMETER_SETTING_REPLY: + sendResult = enhanceProduce.workingParameterSettingReplyMessage(content); + break; + case SendTagConstant.TIMING_SETTING_REPLY: + sendResult = enhanceProduce.timingSettingReplyMessage(content); + break; + case SendTagConstant.SETUP_BILLING_MODEL_REPLY: + sendResult = enhanceProduce.setupBillingModelReplyMessage(content); + break; + case SendTagConstant.GROUND_LOCK_REAL_TIME_DATA: + sendResult = enhanceProduce.groundLockRealTimeDataMessage(content); + break; + case SendTagConstant.CHARGING_PILE_RETURNS_GROUND_LOCK_DATA: + sendResult = enhanceProduce.chargingPileReturnsGroundLockDataMessage(content); + break; + case SendTagConstant.PLATFORM_RESTART_REPLY: + sendResult = enhanceProduce.platformRestartReplyMessage(content); + break; + default: + sendResult = enhanceProduce.platformRemoteUpdateReplyMessage(content); + break; } + log.info("rocketmq消息下发结果:{}",sendResult); return AjaxResult.success(); } diff --git a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/produce/EnhanceProduceController.java b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/produce/EnhanceProduce.java similarity index 68% rename from ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/produce/EnhanceProduceController.java rename to ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/produce/EnhanceProduce.java index eb4f3e2..5586e13 100644 --- a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/produce/EnhanceProduceController.java +++ b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/produce/EnhanceProduce.java @@ -2,22 +2,22 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import com.ruoyi.integration.iotda.enums.SendTagMenu; +import com.ruoyi.integration.iotda.constant.SendTagConstant; import com.ruoyi.integration.rocket.model.*; import com.ruoyi.integration.rocket.util.RocketMQEnhanceTemplate; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.apache.rocketmq.client.producer.SendResult; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.UUID; -@RestController -@RequestMapping("enhance") @Slf4j -public class EnhanceProduceController { +@Component +public class EnhanceProduce { //注入增强后的模板,可以自动实现环境隔离,日志记录 @Setter(onMethod_ = @Autowired) @@ -33,8 +33,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.ONLINE.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.ONLINE.getValue(), message); + message.setSource(SendTagConstant.ONLINE); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.ONLINE, message); } /** @@ -45,8 +45,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.PING.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.PING.getValue(), message); + message.setSource(SendTagConstant.PING); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.PING, message); } /** @@ -57,8 +57,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.BILLING_MODE_VERIFY.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.BILLING_MODE_VERIFY.getValue(), message); + message.setSource(SendTagConstant.BILLING_MODE_VERIFY); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.BILLING_MODE_VERIFY, message); } /** @@ -69,8 +69,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.ACQUISITION_BILLING_MODE.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.ACQUISITION_BILLING_MODE.getValue(), message); + message.setSource(SendTagConstant.ACQUISITION_BILLING_MODE); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.ACQUISITION_BILLING_MODE, message); } /** @@ -81,8 +81,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.UPLOAD_REAL_TIME_MONITORING_DATA.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.UPLOAD_REAL_TIME_MONITORING_DATA.getValue(), message); + message.setSource(SendTagConstant.UPLOAD_REAL_TIME_MONITORING_DATA); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.UPLOAD_REAL_TIME_MONITORING_DATA, message); } /** @@ -93,8 +93,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.CHARGING_HANDSHAKE.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.CHARGING_HANDSHAKE.getValue(), message); + message.setSource(SendTagConstant.CHARGING_HANDSHAKE); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.CHARGING_HANDSHAKE, message); } /** @@ -105,8 +105,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.BMS_ABORT.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.BMS_ABORT.getValue(), message); + message.setSource(SendTagConstant.BMS_ABORT); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.BMS_ABORT, message); } /** @@ -117,8 +117,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.MOTOR_ABORT.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.MOTOR_ABORT.getValue(), message); + message.setSource(SendTagConstant.MOTOR_ABORT); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.MOTOR_ABORT, message); } /** @@ -129,8 +129,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.BMS_DEMAND_AND_CHARGER_EXPORTATION.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.BMS_DEMAND_AND_CHARGER_EXPORTATION.getValue(), message); + message.setSource(SendTagConstant.BMS_DEMAND_AND_CHARGER_EXPORTATION); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.BMS_DEMAND_AND_CHARGER_EXPORTATION, message); } /** @@ -141,8 +141,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.BMS_INFORMATION.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.BMS_INFORMATION.getValue(), message); + message.setSource(SendTagConstant.BMS_INFORMATION); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.BMS_INFORMATION, message); } /** @@ -153,8 +153,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.CHARGING_PILE_STARTS_CHARGING.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.CHARGING_PILE_STARTS_CHARGING.getValue(), message); + message.setSource(SendTagConstant.CHARGING_PILE_STARTS_CHARGING); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.CHARGING_PILE_STARTS_CHARGING, message); } /** @@ -165,8 +165,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.PLATFORM_START_CHARGING_REPLY.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.PLATFORM_START_CHARGING_REPLY.getValue(), message); + message.setSource(SendTagConstant.PLATFORM_START_CHARGING_REPLY); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.PLATFORM_START_CHARGING_REPLY, message); } /** @@ -177,8 +177,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.PLATFORM_STOP_CHARGING_REPLY.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.PLATFORM_STOP_CHARGING_REPLY.getValue(), message); + message.setSource(SendTagConstant.PLATFORM_STOP_CHARGING_REPLY); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.PLATFORM_STOP_CHARGING_REPLY, message); } /** @@ -189,8 +189,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.TRANSACTION_RECORD.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.TRANSACTION_RECORD.getValue(), message); + message.setSource(SendTagConstant.TRANSACTION_RECORD); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.TRANSACTION_RECORD, message); } /** @@ -201,8 +201,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.UPDATE_BALANCE_REPLY.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.UPDATE_BALANCE_REPLY.getValue(), message); + message.setSource(SendTagConstant.UPDATE_BALANCE_REPLY); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.UPDATE_BALANCE_REPLY, message); } /** @@ -213,8 +213,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.SYNCHRONIZE_OFFLINE_CARD_REPLY.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.SYNCHRONIZE_OFFLINE_CARD_REPLY.getValue(), message); + message.setSource(SendTagConstant.SYNCHRONIZE_OFFLINE_CARD_REPLY); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.SYNCHRONIZE_OFFLINE_CARD_REPLY, message); } /** @@ -225,8 +225,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.CLEAR_OFFLINE_CARD_REPLY.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.CLEAR_OFFLINE_CARD_REPLY.getValue(), message); + message.setSource(SendTagConstant.CLEAR_OFFLINE_CARD_REPLY); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.CLEAR_OFFLINE_CARD_REPLY, message); } /** @@ -237,8 +237,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.WORKING_PARAMETER_SETTING_REPLY.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.WORKING_PARAMETER_SETTING_REPLY.getValue(), message); + message.setSource(SendTagConstant.WORKING_PARAMETER_SETTING_REPLY); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.WORKING_PARAMETER_SETTING_REPLY, message); } /** @@ -249,8 +249,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.TIMING_SETTING_REPLY.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.TIMING_SETTING_REPLY.getValue(), message); + message.setSource(SendTagConstant.TIMING_SETTING_REPLY); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.TIMING_SETTING_REPLY, message); } /** @@ -261,8 +261,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.SETUP_BILLING_MODEL_REPLY.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.SETUP_BILLING_MODEL_REPLY.getValue(), message); + message.setSource(SendTagConstant.SETUP_BILLING_MODEL_REPLY); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.SETUP_BILLING_MODEL_REPLY, message); } /** @@ -273,8 +273,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.GROUND_LOCK_REAL_TIME_DATA.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.GROUND_LOCK_REAL_TIME_DATA.getValue(), message); + message.setSource(SendTagConstant.GROUND_LOCK_REAL_TIME_DATA); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.GROUND_LOCK_REAL_TIME_DATA, message); } /** @@ -285,8 +285,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.CHARGING_PILE_RETURNS_GROUND_LOCK_DATA.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.CHARGING_PILE_RETURNS_GROUND_LOCK_DATA.getValue(), message); + message.setSource(SendTagConstant.CHARGING_PILE_RETURNS_GROUND_LOCK_DATA); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.CHARGING_PILE_RETURNS_GROUND_LOCK_DATA, message); } /** @@ -297,8 +297,8 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.PLATFORM_RESTART_REPLY.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.PLATFORM_RESTART_REPLY.getValue(), message); + message.setSource(SendTagConstant.PLATFORM_RESTART_REPLY); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.PLATFORM_RESTART_REPLY, message); } /** @@ -309,7 +309,7 @@ // 设置业务key message.setKey(UUID.randomUUID().toString()); // 设置消息来源,便于查询 - message.setSource(SendTagMenu.PLATFORM_REMOTE_UPDATE_REPLY.getValue()); - return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.PLATFORM_REMOTE_UPDATE_REPLY.getValue(), message); + message.setSource(SendTagConstant.PLATFORM_REMOTE_UPDATE_REPLY); + return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.PLATFORM_REMOTE_UPDATE_REPLY, message); } } \ No newline at end of file -- Gitblit v1.7.1