3 文件已复制
1 文件已重命名
2个文件已删除
3个文件已修改
100个文件已添加
New file |
| | |
| | | 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; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.iotda.enums; |
| | | |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @Date 2024/8/22 15:28 |
| | | */ |
| | | public enum ServiceIdMenu { |
| | | /** |
| | | * 登录认证应答 |
| | | */ |
| | | ONLINE_REPLY ("online_reply"), |
| | | /** |
| | | * 登录认证应答 |
| | | */ |
| | | PONG ("pong"), |
| | | /** |
| | | * 计费模型验证请求应答 |
| | | */ |
| | | BILLING_MODE_VERIFY_REPLY ("billing_mode_verify_reply"), |
| | | /** |
| | | * 计费模型请求应答 |
| | | */ |
| | | ACQUISITION_BILLING_MODE_REPLY ("acquisition_billing_mode_reply"), |
| | | /** |
| | | * 读取实时监测数据 |
| | | */ |
| | | READ_REAL_TIME_MONITORING_DATA ("read_real_time_monitoring_data"), |
| | | /** |
| | | * 充电结束 |
| | | */ |
| | | END_CHARGE ("end_charge"), |
| | | /** |
| | | * 运营平台确认启动充电 |
| | | */ |
| | | PLATFORM_CONFIRMATION_CHARGING ("platform_confirmation_charging"), |
| | | /** |
| | | * 运营平台远程控制启机 |
| | | */ |
| | | PLATFORM_START_CHARGING ("platform_start_charging"), |
| | | /** |
| | | * 运营平台远程停机 |
| | | */ |
| | | PLATFORM_STOP_CHARGING ("platform_stop_charging"), |
| | | /** |
| | | * 交易记录确认 |
| | | */ |
| | | CONFIRM_TRANSACTION_RECORD ("confirm_transaction_record"), |
| | | /** |
| | | * 远程账户余额更新 |
| | | */ |
| | | UPDATE_BALANCE ("update_balance"), |
| | | /** |
| | | * 离线卡数据同步 |
| | | */ |
| | | SYNCHRONIZE_OFFLINE_CARD ("synchronize_offline_card"), |
| | | /** |
| | | * 离线卡数据清除 |
| | | */ |
| | | CLEAR_OFFLINE_CARD ("clear_offline_card"), |
| | | /** |
| | | * 离线卡数据查询 |
| | | */ |
| | | QUERY_OFFLINE_CARD ("query_offline_card"), |
| | | /** |
| | | * 充电桩工作参数设置 |
| | | */ |
| | | WORKING_PARAMETER_SETTING ("working_parameter_setting"), |
| | | /** |
| | | * 对时设置 |
| | | */ |
| | | TIMING_SETTING ("timing_setting"), |
| | | /** |
| | | * 计费模型设置 |
| | | */ |
| | | SETUP_BILLING_MODEL ("setup_billing_model"), |
| | | /** |
| | | * 遥控地锁升锁与降锁命令 (下行) |
| | | */ |
| | | OPEN_OR_CLOSE_GROUND_LOCK ("open_or_close_ground_lock"), |
| | | /** |
| | | * 远程重启 |
| | | */ |
| | | PLATFORM_RESTART ("platform_restart"), |
| | | /** |
| | | * 远程更新 |
| | | */ |
| | | PLATFORM_REMOTE_UPDATE ("platform_remote_update"), |
| | | ; |
| | | private String value; |
| | | |
| | | |
| | | ServiceIdMenu(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | } |
| | |
| | | * @throws IOException |
| | | */ |
| | | @PostMapping(value = "/message") |
| | | public AjaxResult<Integer> add(@RequestBody JSONObject jsonObject) throws IOException { |
| | | System.err.println(jsonObject); |
| | | 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")){ |
| | | //设备状态改变 |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.integration.iotda.constant.ServiceIdConstant; |
| | | import com.ruoyi.integration.iotda.enums.ServiceIdMenu; |
| | | import com.ruoyi.integration.mongodb.model.*; |
| | | import com.ruoyi.integration.mongodb.service.*; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class MessageUtil { |
| | | |
| | | @Autowired |
| | |
| | | private PlatformRestartService platformRestartService; |
| | | @Autowired |
| | | private PlatformRemoteUpdateService platformRemoteUpdateService; |
| | | @Autowired |
| | | private MessageConvertUtil messageConvertUtil; |
| | | |
| | | /** |
| | | * 登录认证应答 |
| | |
| | | */ |
| | | public String onlineReply(OnlineReply onlineReply){ |
| | | onlineReplyService.create(onlineReply); |
| | | return getMessageJsonString(onlineReply, ServiceIdConstant.ONLINE_REPLY); |
| | | return getMessageJsonString(onlineReply, ServiceIdMenu.ONLINE_REPLY.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String pong(Pong pong){ |
| | | pongService.create(pong); |
| | | return getMessageJsonString(pong, ServiceIdConstant.PONG); |
| | | return getMessageJsonString(pong, ServiceIdMenu.PONG.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String billingModeVerifyReply(BillingModeVerifyReply billingModeVerifyReply){ |
| | | billingModeVerifyReplyService.create(billingModeVerifyReply); |
| | | return getMessageJsonString(billingModeVerifyReply, ServiceIdConstant.BILLING_MODE_VERIFY_REPLY); |
| | | return getMessageJsonString(billingModeVerifyReply, ServiceIdMenu.BILLING_MODE_VERIFY_REPLY.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String acquisitionBillingModeReply(AcquisitionBillingModeReply acquisitionBillingModeReply){ |
| | | acquisitionBillingModeReplyService.create(acquisitionBillingModeReply); |
| | | return getMessageJsonString(acquisitionBillingModeReply, ServiceIdConstant.ACQUISITION_BILLING_MODE_REPLY); |
| | | return getMessageJsonString(acquisitionBillingModeReply, ServiceIdMenu.ACQUISITION_BILLING_MODE_REPLY.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String readRealTimeMonitoringData(ReadRealTimeMonitoringData readRealTimeMonitoringData){ |
| | | readRealTimeMonitoringDataService.create(readRealTimeMonitoringData); |
| | | return getMessageJsonString(readRealTimeMonitoringData, ServiceIdConstant.READ_REAL_TIME_MONITORING_DATA); |
| | | return getMessageJsonString(readRealTimeMonitoringData, ServiceIdMenu.READ_REAL_TIME_MONITORING_DATA.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String endCharge(EndCharge endCharge){ |
| | | endChargeService.create(endCharge); |
| | | return getMessageJsonString(endCharge, ServiceIdConstant.END_CHARGE); |
| | | return getMessageJsonString(endCharge, ServiceIdMenu.END_CHARGE.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String platformConfirmationCharging(PlatformConfirmationCharging platformConfirmationCharging){ |
| | | platformConfirmationChargingService.create(platformConfirmationCharging); |
| | | return getMessageJsonString(platformConfirmationCharging, ServiceIdConstant.PLATFORM_CONFIRMATION_CHARGING); |
| | | return getMessageJsonString(platformConfirmationCharging, ServiceIdMenu.PLATFORM_CONFIRMATION_CHARGING.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String platformConfirmationCharging(PlatformStartCharging platformStartCharging){ |
| | | platformStartChargingService.create(platformStartCharging); |
| | | return getMessageJsonString(platformStartCharging, ServiceIdConstant.PLATFORM_START_CHARGING); |
| | | return getMessageJsonString(platformStartCharging, ServiceIdMenu.PLATFORM_START_CHARGING.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String platformStopCharging(PlatformStopCharging platformStopCharging){ |
| | | platformStopChargingService.create(platformStopCharging); |
| | | return getMessageJsonString(platformStopCharging, ServiceIdConstant.PLATFORM_STOP_CHARGING); |
| | | return getMessageJsonString(platformStopCharging, ServiceIdMenu.PLATFORM_STOP_CHARGING.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String confirmTransactionRecord(ConfirmTransactionRecord confirmTransactionRecord){ |
| | | confirmTransactionRecordService.create(confirmTransactionRecord); |
| | | return getMessageJsonString(confirmTransactionRecord, ServiceIdConstant.CONFIRM_TRANSACTION_RECORD); |
| | | return getMessageJsonString(confirmTransactionRecord, ServiceIdMenu.CONFIRM_TRANSACTION_RECORD.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String updateBalance(UpdateBalance updateBalance){ |
| | | updateBalanceService.create(updateBalance); |
| | | return getMessageJsonString(updateBalance, ServiceIdConstant.UPDATE_BALANCE); |
| | | return getMessageJsonString(updateBalance, ServiceIdMenu.UPDATE_BALANCE.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String synchronizeOfflineCard(SynchronizeOfflineCard synchronizeOfflineCard){ |
| | | synchronizeOfflineCardService.create(synchronizeOfflineCard); |
| | | return getMessageJsonString(synchronizeOfflineCard, ServiceIdConstant.SYNCHRONIZE_OFFLINE_CARD); |
| | | return getMessageJsonString(synchronizeOfflineCard, ServiceIdMenu.SYNCHRONIZE_OFFLINE_CARD.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String clearOfflineCard(ClearOfflineCard clearOfflineCard){ |
| | | clearOfflineCardService.create(clearOfflineCard); |
| | | return getMessageJsonString(clearOfflineCard, ServiceIdConstant.CLEAR_OFFLINE_CARD); |
| | | return getMessageJsonString(clearOfflineCard, ServiceIdMenu.CLEAR_OFFLINE_CARD.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String queryOfflineCard(QueryOfflineCard queryOfflineCard){ |
| | | queryOfflineCardService.create(queryOfflineCard); |
| | | return getMessageJsonString(queryOfflineCard, ServiceIdConstant.QUERY_OFFLINE_CARD); |
| | | return getMessageJsonString(queryOfflineCard, ServiceIdMenu.QUERY_OFFLINE_CARD.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String workingParameterSetting(WorkingParameterSetting workingParameterSetting){ |
| | | workingParameterSettingService.create(workingParameterSetting); |
| | | return getMessageJsonString(workingParameterSetting, ServiceIdConstant.WORKING_PARAMETER_SETTING); |
| | | return getMessageJsonString(workingParameterSetting, ServiceIdMenu.WORKING_PARAMETER_SETTING.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String timingSetting(TimingSetting timingSetting){ |
| | | timingSettingService.create(timingSetting); |
| | | return getMessageJsonString(timingSetting, ServiceIdConstant.TIMING_SETTING); |
| | | return getMessageJsonString(timingSetting, ServiceIdMenu.TIMING_SETTING.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String setupBillingModel(SetupBillingModel setupBillingModel){ |
| | | setupBillingModelService.create(setupBillingModel); |
| | | return getMessageJsonString(setupBillingModel, ServiceIdConstant.SETUP_BILLING_MODEL); |
| | | return getMessageJsonString(setupBillingModel, ServiceIdMenu.SETUP_BILLING_MODEL.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public String openOrCloseGroundLock(OpenOrCloseGroundLock openOrCloseGroundLock){ |
| | | openOrCloseGroundLockService.create(openOrCloseGroundLock); |
| | | return getMessageJsonString(openOrCloseGroundLock, ServiceIdConstant.OPEN_OR_CLOSE_GROUND_LOCK); |
| | | return getMessageJsonString(openOrCloseGroundLock, ServiceIdMenu.OPEN_OR_CLOSE_GROUND_LOCK.getValue()); |
| | | } |
| | | /** |
| | | * 远程重启 |
| | |
| | | */ |
| | | public String platformRestart(PlatformRestart platformRestart){ |
| | | platformRestartService.create(platformRestart); |
| | | return getMessageJsonString(platformRestart, ServiceIdConstant.PLATFORM_RESTART); |
| | | return getMessageJsonString(platformRestart, ServiceIdMenu.PLATFORM_RESTART.getValue()); |
| | | } |
| | | /** |
| | | * 远程更新 |
| | |
| | | */ |
| | | public String platformRemoteUpdate(PlatformRemoteUpdate platformRemoteUpdate){ |
| | | platformRemoteUpdateService.create(platformRemoteUpdate); |
| | | return getMessageJsonString(platformRemoteUpdate, ServiceIdConstant.PLATFORM_REMOTE_UPDATE); |
| | | return getMessageJsonString(platformRemoteUpdate, ServiceIdMenu.PLATFORM_REMOTE_UPDATE.getValue()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param serviceId 服务ID |
| | | * @return |
| | | */ |
| | | private String getMessageJsonString(Object object, String serviceId){ |
| | | public String getMessageJsonString(Object object, String serviceId){ |
| | | JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(object)); |
| | | jsonObject.put("service_id", serviceId); |
| | | return jsonObject.toJSONString(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.AcquisitionBillingMode; |
| | | |
| | | public interface AcquisitionBillingModeService extends BaseService<AcquisitionBillingMode> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.BillingModeVerify; |
| | | |
| | | public interface BillingModeVerifyService extends BaseService<BillingModeVerify> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.BmsAbort; |
| | | |
| | | public interface BmsAbortService extends BaseService<BmsAbort> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.BmsDemandAndChargerExportation; |
| | | |
| | | public interface BmsDemandAndChargerExportationService extends BaseService<BmsDemandAndChargerExportation> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.BmsInformation; |
| | | |
| | | public interface BmsInformationService extends BaseService<BmsInformation> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.ChargingHandshake; |
| | | |
| | | public interface ChargingHandshakeService extends BaseService<ChargingHandshake> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.ChargingPileReturnsGroundLockData; |
| | | |
| | | public interface ChargingPileReturnsGroundLockDataService extends BaseService<ChargingPileReturnsGroundLockData> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.ChargingPileStartsCharging; |
| | | |
| | | public interface ChargingPileStartsChargingService extends BaseService<ChargingPileStartsCharging> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.ClearOfflineCardReply; |
| | | |
| | | public interface ClearOfflineCardReplyService extends BaseService<ClearOfflineCardReply> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.GroundLockRealTimeData; |
| | | |
| | | public interface GroundLockRealTimeDataService extends BaseService<GroundLockRealTimeData> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.MotorAbort; |
| | | |
| | | public interface MotorAbortService extends BaseService<MotorAbort> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.ParameterSetting; |
| | | |
| | | public interface ParameterSettingService extends BaseService<ParameterSetting> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.Ping; |
| | | |
| | | public interface PingService extends BaseService<Ping> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.PlatformRemoteUpdateReply; |
| | | |
| | | public interface PlatformRemoteUpdateReplyService extends BaseService<PlatformRemoteUpdateReply> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.PlatformRestartReply; |
| | | |
| | | public interface PlatformRestartReplyService extends BaseService<PlatformRestartReply> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.PlatformStartChargingReply; |
| | | |
| | | public interface PlatformStartChargingReplyService extends BaseService<PlatformStartChargingReply> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.PlatformStopChargingReply; |
| | | |
| | | public interface PlatformStopChargingReplyService extends BaseService<PlatformStopChargingReply> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.QueryOfflineCardReply; |
| | | |
| | | public interface QueryOfflineCardReplyService extends BaseService<QueryOfflineCardReply> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.SetupBillingModelReply; |
| | | |
| | | public interface SetupBillingModelReplyService extends BaseService<SetupBillingModelReply> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.SynchronizeOfflineCardReply; |
| | | |
| | | public interface SynchronizeOfflineCardReplyService extends BaseService<SynchronizeOfflineCardReply> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.TimingSettingReply; |
| | | |
| | | public interface TimingSettingReplyService extends BaseService<TimingSettingReply> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.TransactionRecord; |
| | | |
| | | public interface TransactionRecordService extends BaseService<TransactionRecord> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.UpdateBalanceReply; |
| | | |
| | | public interface UpdateBalanceReplyService extends BaseService<UpdateBalanceReply> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.UploadRealTimeMonitoringData; |
| | | |
| | | public interface UploadRealTimeMonitoringDataService extends BaseService<UploadRealTimeMonitoringData> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service; |
| | | |
| | | import com.ruoyi.integration.mongodb.base.BaseService; |
| | | import com.ruoyi.integration.mongodb.model.WorkingParameterSettingReply; |
| | | |
| | | public interface WorkingParameterSettingReplyService extends BaseService<WorkingParameterSettingReply> { |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.AcquisitionBillingMode; |
| | | import com.ruoyi.integration.mongodb.service.AcquisitionBillingModeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class AcquisitionBillingModeServiceImpl implements AcquisitionBillingModeService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(AcquisitionBillingMode acquisitionBillingMode) { |
| | | mongoTemplate.save(acquisitionBillingMode); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public AcquisitionBillingMode findById(String id) { |
| | | return mongoTemplate.findById(id, AcquisitionBillingMode.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<AcquisitionBillingMode> findAll() { |
| | | return mongoTemplate.findAll(AcquisitionBillingMode.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.BillingModeVerify; |
| | | import com.ruoyi.integration.mongodb.service.BillingModeVerifyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class BillingModeVerifyServiceImpl implements BillingModeVerifyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(BillingModeVerify billingModeVerify) { |
| | | mongoTemplate.save(billingModeVerify); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public BillingModeVerify findById(String id) { |
| | | return mongoTemplate.findById(id, BillingModeVerify.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<BillingModeVerify> findAll() { |
| | | return mongoTemplate.findAll(BillingModeVerify.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.BmsAbort; |
| | | import com.ruoyi.integration.mongodb.service.BmsAbortService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class BmsAbortServiceImpl implements BmsAbortService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(BmsAbort bmsAbort) { |
| | | mongoTemplate.save(bmsAbort); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public BmsAbort findById(String id) { |
| | | return mongoTemplate.findById(id, BmsAbort.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<BmsAbort> findAll() { |
| | | return mongoTemplate.findAll(BmsAbort.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.BmsDemandAndChargerExportation; |
| | | import com.ruoyi.integration.mongodb.service.BmsDemandAndChargerExportationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class BmsDemandAndChargerExportationServiceImpl implements BmsDemandAndChargerExportationService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(BmsDemandAndChargerExportation bmsDemandAndChargerExportation) { |
| | | mongoTemplate.save(bmsDemandAndChargerExportation); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public BmsDemandAndChargerExportation findById(String id) { |
| | | return mongoTemplate.findById(id, BmsDemandAndChargerExportation.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<BmsDemandAndChargerExportation> findAll() { |
| | | return mongoTemplate.findAll(BmsDemandAndChargerExportation.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.BmsInformation; |
| | | import com.ruoyi.integration.mongodb.service.BmsInformationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class BmsInformationServiceImpl implements BmsInformationService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(BmsInformation bmsInformation) { |
| | | mongoTemplate.save(bmsInformation); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public BmsInformation findById(String id) { |
| | | return mongoTemplate.findById(id, BmsInformation.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<BmsInformation> findAll() { |
| | | return mongoTemplate.findAll(BmsInformation.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.ChargingHandshake; |
| | | import com.ruoyi.integration.mongodb.service.ChargingHandshakeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ChargingHandshakeServiceImpl implements ChargingHandshakeService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(ChargingHandshake chargingHandshake) { |
| | | mongoTemplate.save(chargingHandshake); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ChargingHandshake findById(String id) { |
| | | return mongoTemplate.findById(id, ChargingHandshake.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ChargingHandshake> findAll() { |
| | | return mongoTemplate.findAll(ChargingHandshake.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.ChargingPileReturnsGroundLockData; |
| | | import com.ruoyi.integration.mongodb.service.ChargingPileReturnsGroundLockDataService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ChargingPileReturnsGroundLockDataServiceImpl implements ChargingPileReturnsGroundLockDataService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(ChargingPileReturnsGroundLockData chargingPileReturnsGroundLockData) { |
| | | mongoTemplate.save(chargingPileReturnsGroundLockData); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ChargingPileReturnsGroundLockData findById(String id) { |
| | | return mongoTemplate.findById(id, ChargingPileReturnsGroundLockData.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ChargingPileReturnsGroundLockData> findAll() { |
| | | return mongoTemplate.findAll(ChargingPileReturnsGroundLockData.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.ChargingPileStartsCharging; |
| | | import com.ruoyi.integration.mongodb.service.ChargingPileStartsChargingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ChargingPileStartsChargingServiceImpl implements ChargingPileStartsChargingService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(ChargingPileStartsCharging chargingPileStartsCharging) { |
| | | mongoTemplate.save(chargingPileStartsCharging); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ChargingPileStartsCharging findById(String id) { |
| | | return mongoTemplate.findById(id, ChargingPileStartsCharging.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ChargingPileStartsCharging> findAll() { |
| | | return mongoTemplate.findAll(ChargingPileStartsCharging.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.ClearOfflineCardReply; |
| | | import com.ruoyi.integration.mongodb.service.ClearOfflineCardReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ClearOfflineCardReplyServiceImpl implements ClearOfflineCardReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(ClearOfflineCardReply clearOfflineCardReply) { |
| | | mongoTemplate.save(clearOfflineCardReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ClearOfflineCardReply findById(String id) { |
| | | return mongoTemplate.findById(id, ClearOfflineCardReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ClearOfflineCardReply> findAll() { |
| | | return mongoTemplate.findAll(ClearOfflineCardReply.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.GroundLockRealTimeData; |
| | | import com.ruoyi.integration.mongodb.service.GroundLockRealTimeDataService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class GroundLockRealTimeDataServiceImpl implements GroundLockRealTimeDataService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(GroundLockRealTimeData groundLockRealTimeData) { |
| | | mongoTemplate.save(groundLockRealTimeData); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public GroundLockRealTimeData findById(String id) { |
| | | return mongoTemplate.findById(id, GroundLockRealTimeData.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<GroundLockRealTimeData> findAll() { |
| | | return mongoTemplate.findAll(GroundLockRealTimeData.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.MotorAbort; |
| | | import com.ruoyi.integration.mongodb.service.MotorAbortService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class MotorAbortServiceImpl implements MotorAbortService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(MotorAbort motorAbort) { |
| | | mongoTemplate.save(motorAbort); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public MotorAbort findById(String id) { |
| | | return mongoTemplate.findById(id, MotorAbort.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<MotorAbort> findAll() { |
| | | return mongoTemplate.findAll(MotorAbort.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.ParameterSetting; |
| | | import com.ruoyi.integration.mongodb.service.ParameterSettingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ParameterSettingServiceImpl implements ParameterSettingService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(ParameterSetting parameterSetting) { |
| | | mongoTemplate.save(parameterSetting); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public ParameterSetting findById(String id) { |
| | | return mongoTemplate.findById(id, ParameterSetting.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<ParameterSetting> findAll() { |
| | | return mongoTemplate.findAll(ParameterSetting.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.Ping; |
| | | import com.ruoyi.integration.mongodb.service.PingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class PingServiceImpl implements PingService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(Ping ping) { |
| | | mongoTemplate.save(ping); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public Ping findById(String id) { |
| | | return mongoTemplate.findById(id, Ping.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<Ping> findAll() { |
| | | return mongoTemplate.findAll(Ping.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.PlatformRemoteUpdateReply; |
| | | import com.ruoyi.integration.mongodb.service.PlatformRemoteUpdateReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class PlatformRemoteUpdateReplyServiceImpl implements PlatformRemoteUpdateReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(PlatformRemoteUpdateReply platformRemoteUpdateReply) { |
| | | mongoTemplate.save(platformRemoteUpdateReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformRemoteUpdateReply findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformRemoteUpdateReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformRemoteUpdateReply> findAll() { |
| | | return mongoTemplate.findAll(PlatformRemoteUpdateReply.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.PlatformRestartReply; |
| | | import com.ruoyi.integration.mongodb.service.PlatformRestartReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class PlatformRestartReplyServiceImpl implements PlatformRestartReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(PlatformRestartReply platformRestartReply) { |
| | | mongoTemplate.save(platformRestartReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformRestartReply findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformRestartReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformRestartReply> findAll() { |
| | | return mongoTemplate.findAll(PlatformRestartReply.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.PlatformStartChargingReply; |
| | | import com.ruoyi.integration.mongodb.service.PlatformStartChargingReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class PlatformStartChargingReplyServiceImpl implements PlatformStartChargingReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(PlatformStartChargingReply platformStartChargingReply) { |
| | | mongoTemplate.save(platformStartChargingReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformStartChargingReply findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformStartChargingReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformStartChargingReply> findAll() { |
| | | return mongoTemplate.findAll(PlatformStartChargingReply.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.PlatformStopChargingReply; |
| | | import com.ruoyi.integration.mongodb.service.PlatformStopChargingReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class PlatformStopChargingReplyServiceImpl implements PlatformStopChargingReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(PlatformStopChargingReply platformStopChargingReply) { |
| | | mongoTemplate.save(platformStopChargingReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public PlatformStopChargingReply findById(String id) { |
| | | return mongoTemplate.findById(id, PlatformStopChargingReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlatformStopChargingReply> findAll() { |
| | | return mongoTemplate.findAll(PlatformStopChargingReply.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.QueryOfflineCardReply; |
| | | import com.ruoyi.integration.mongodb.service.QueryOfflineCardReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class QueryOfflineCardReplyServiceImpl implements QueryOfflineCardReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(QueryOfflineCardReply queryOfflineCardReply) { |
| | | mongoTemplate.save(queryOfflineCardReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public QueryOfflineCardReply findById(String id) { |
| | | return mongoTemplate.findById(id, QueryOfflineCardReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<QueryOfflineCardReply> findAll() { |
| | | return mongoTemplate.findAll(QueryOfflineCardReply.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.SetupBillingModelReply; |
| | | import com.ruoyi.integration.mongodb.service.SetupBillingModelReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class SetupBillingModelReplyServiceImpl implements SetupBillingModelReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(SetupBillingModelReply setupBillingModelReply) { |
| | | mongoTemplate.save(setupBillingModelReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public SetupBillingModelReply findById(String id) { |
| | | return mongoTemplate.findById(id, SetupBillingModelReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<SetupBillingModelReply> findAll() { |
| | | return mongoTemplate.findAll(SetupBillingModelReply.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.SetupBillingModel; |
| | | import com.ruoyi.integration.mongodb.model.SynchronizeOfflineCardReply; |
| | | import com.ruoyi.integration.mongodb.service.SynchronizeOfflineCardReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class SynchronizeOfflineCardReplyServiceImpl implements SynchronizeOfflineCardReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(SynchronizeOfflineCardReply synchronizeOfflineCardReply) { |
| | | mongoTemplate.save(synchronizeOfflineCardReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public SynchronizeOfflineCardReply findById(String id) { |
| | | return mongoTemplate.findById(id, SynchronizeOfflineCardReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<SynchronizeOfflineCardReply> findAll() { |
| | | return mongoTemplate.findAll(SynchronizeOfflineCardReply.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.TimingSettingReply; |
| | | import com.ruoyi.integration.mongodb.service.TimingSettingReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class TimingSettingReplyServiceImpl implements TimingSettingReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(TimingSettingReply timingSettingReply) { |
| | | mongoTemplate.save(timingSettingReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public TimingSettingReply findById(String id) { |
| | | return mongoTemplate.findById(id, TimingSettingReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<TimingSettingReply> findAll() { |
| | | return mongoTemplate.findAll(TimingSettingReply.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.TimingSetting; |
| | | import com.ruoyi.integration.mongodb.model.TransactionRecord; |
| | | import com.ruoyi.integration.mongodb.service.TransactionRecordService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class TransactionRecordServiceImpl implements TransactionRecordService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(TransactionRecord transactionRecord) { |
| | | mongoTemplate.save(transactionRecord); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public TransactionRecord findById(String id) { |
| | | return mongoTemplate.findById(id, TransactionRecord.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<TransactionRecord> findAll() { |
| | | return mongoTemplate.findAll(TransactionRecord.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.TransactionRecord; |
| | | import com.ruoyi.integration.mongodb.model.UpdateBalanceReply; |
| | | import com.ruoyi.integration.mongodb.service.UpdateBalanceReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class UpdateBalanceReplyServiceImpl implements UpdateBalanceReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(UpdateBalanceReply updateBalanceReply) { |
| | | mongoTemplate.save(updateBalanceReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public UpdateBalanceReply findById(String id) { |
| | | return mongoTemplate.findById(id, UpdateBalanceReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<UpdateBalanceReply> findAll() { |
| | | return mongoTemplate.findAll(UpdateBalanceReply.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.mongodb.service.UploadRealTimeMonitoringDataService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class UploadRealTimeMonitoringDataServiceImpl implements UploadRealTimeMonitoringDataService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Override |
| | | public int create(UploadRealTimeMonitoringData uploadRealTimeMonitoringData) { |
| | | mongoTemplate.save(uploadRealTimeMonitoringData); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public UploadRealTimeMonitoringData findById(String id) { |
| | | return mongoTemplate.findById(id, UploadRealTimeMonitoringData.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<UploadRealTimeMonitoringData> findAll() { |
| | | return mongoTemplate.findAll(UploadRealTimeMonitoringData.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.mongodb.service.impl; |
| | | |
| | | import com.ruoyi.integration.iotda.constant.IotConstant; |
| | | import com.ruoyi.integration.mongodb.model.WorkingParameterSettingReply; |
| | | import com.ruoyi.integration.mongodb.service.WorkingParameterSettingReplyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class WorkingParameterSettingReplyServiceImpl implements WorkingParameterSettingReplyService { |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | @Override |
| | | public int create(WorkingParameterSettingReply workingParameterSettingReply) { |
| | | mongoTemplate.save(workingParameterSettingReply); |
| | | return IotConstant.SUCCESS; |
| | | } |
| | | |
| | | @Override |
| | | public WorkingParameterSettingReply findById(String id) { |
| | | return mongoTemplate.findById(id, WorkingParameterSettingReply.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<WorkingParameterSettingReply> findAll() { |
| | | return mongoTemplate.findAll(WorkingParameterSettingReply.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.AcquisitionBillingMode; |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.service.AcquisitionBillingModeService; |
| | | import com.ruoyi.integration.rocket.model.AcquisitionBillingModeMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class AcquisitionBillingModeMessageListener extends EnhanceMessageHandler<AcquisitionBillingModeMessage> implements RocketMQListener<AcquisitionBillingModeMessage> { |
| | | |
| | | @Autowired |
| | | private AcquisitionBillingModeService acquisitionBillingModeService; |
| | | |
| | | @Override |
| | | protected void handleMessage(AcquisitionBillingModeMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("充电桩计费模型请求-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | AcquisitionBillingMode acquisitionBillingMode = new AcquisitionBillingMode(); |
| | | BeanUtils.copyProperties(message,acquisitionBillingMode); |
| | | acquisitionBillingModeService.create(acquisitionBillingMode); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(AcquisitionBillingModeMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(AcquisitionBillingModeMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(AcquisitionBillingModeMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.AcquisitionBillingMode; |
| | | import com.ruoyi.integration.mongodb.model.BillingModeVerify; |
| | | import com.ruoyi.integration.mongodb.service.BillingModeVerifyService; |
| | | import com.ruoyi.integration.rocket.model.BillingModeVerifyMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class BillingModeVerifyMessageListener extends EnhanceMessageHandler<BillingModeVerifyMessage> implements RocketMQListener<BillingModeVerifyMessage> { |
| | | |
| | | @Autowired |
| | | private BillingModeVerifyService billingModeVerifyService; |
| | | |
| | | @Override |
| | | protected void handleMessage(BillingModeVerifyMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("计费模型验证请求-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | BillingModeVerify billingModeVerify = new BillingModeVerify(); |
| | | BeanUtils.copyProperties(message,billingModeVerify); |
| | | billingModeVerifyService.create(billingModeVerify); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(BillingModeVerifyMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(BillingModeVerifyMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(BillingModeVerifyMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
copy from ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/listener/EnhanceMemberMessageListener.java
copy to ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/listener/BmsAbortMessageListener.java
File was copied from ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/listener/EnhanceMemberMessageListener.java |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.rocket.test.MemberMessage; |
| | | import com.ruoyi.integration.mongodb.model.BillingModeVerify; |
| | | import com.ruoyi.integration.mongodb.model.BmsAbort; |
| | | import com.ruoyi.integration.mongodb.service.BmsAbortService; |
| | | import com.ruoyi.integration.rocket.model.BmsAbortMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class EnhanceMemberMessageListener extends EnhanceMessageHandler<MemberMessage> implements RocketMQListener<MemberMessage> { |
| | | public class BmsAbortMessageListener extends EnhanceMessageHandler<BmsAbortMessage> implements RocketMQListener<BmsAbortMessage> { |
| | | |
| | | @Autowired |
| | | private BmsAbortService bmsAbortService; |
| | | @Override |
| | | protected void handleMessage(MemberMessage message) throws Exception { |
| | | protected void handleMessage(BmsAbortMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | System.out.println("业务消息处理:"+message.getUserName()); |
| | | log.info("充电阶段BMS中止-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | BmsAbort bmsAbort = new BmsAbort(); |
| | | BeanUtils.copyProperties(message,bmsAbort); |
| | | bmsAbortService.create(bmsAbort); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(MemberMessage message) { |
| | | protected void handleMaxRetriesExceeded(BmsAbortMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(MemberMessage message) { |
| | | protected boolean filter(BmsAbortMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(MemberMessage memberMessage) { |
| | | super.dispatchMessage(memberMessage); |
| | | public void onMessage(BmsAbortMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.BmsAbort; |
| | | import com.ruoyi.integration.mongodb.model.BmsDemandAndChargerExportation; |
| | | import com.ruoyi.integration.mongodb.service.BmsDemandAndChargerExportationService; |
| | | import com.ruoyi.integration.rocket.model.BmsDemandAndChargerExportationMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class BmsDemandAndChargerExportationMessageListener extends EnhanceMessageHandler<BmsDemandAndChargerExportationMessage> implements RocketMQListener<BmsDemandAndChargerExportationMessage> { |
| | | |
| | | @Autowired |
| | | private BmsDemandAndChargerExportationService bmsDemandAndChargerExportationService; |
| | | @Override |
| | | protected void handleMessage(BmsDemandAndChargerExportationMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("充电过程BMS需求、充电机输出-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | BmsDemandAndChargerExportation bmsDemandAndChargerExportation = new BmsDemandAndChargerExportation(); |
| | | BeanUtils.copyProperties(message,bmsDemandAndChargerExportation); |
| | | bmsDemandAndChargerExportationService.create(bmsDemandAndChargerExportation); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(BmsDemandAndChargerExportationMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(BmsDemandAndChargerExportationMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(BmsDemandAndChargerExportationMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.BmsDemandAndChargerExportation; |
| | | import com.ruoyi.integration.mongodb.model.BmsInformation; |
| | | import com.ruoyi.integration.mongodb.service.BmsInformationService; |
| | | import com.ruoyi.integration.rocket.model.BmsInformationMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class BmsInformationMessageListener extends EnhanceMessageHandler<BmsInformationMessage> implements RocketMQListener<BmsInformationMessage> { |
| | | @Autowired |
| | | private BmsInformationService bmsInformationService; |
| | | |
| | | @Override |
| | | protected void handleMessage(BmsInformationMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("充电过程BMS信息-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | BmsInformation bmsInformation = new BmsInformation(); |
| | | BeanUtils.copyProperties(message,bmsInformation); |
| | | bmsInformationService.create(bmsInformation); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(BmsInformationMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(BmsInformationMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(BmsInformationMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.BmsInformation; |
| | | import com.ruoyi.integration.mongodb.model.ChargingHandshake; |
| | | import com.ruoyi.integration.mongodb.service.ChargingHandshakeService; |
| | | import com.ruoyi.integration.rocket.model.ChargingHandshakeMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class ChargingHandshakeMessageListener extends EnhanceMessageHandler<ChargingHandshakeMessage> implements RocketMQListener<ChargingHandshakeMessage> { |
| | | |
| | | @Autowired |
| | | private ChargingHandshakeService chargingHandshakeService; |
| | | @Override |
| | | protected void handleMessage(ChargingHandshakeMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("充电握手-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | ChargingHandshake chargingHandshake = new ChargingHandshake(); |
| | | BeanUtils.copyProperties(message,chargingHandshake); |
| | | chargingHandshakeService.create(chargingHandshake); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(ChargingHandshakeMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(ChargingHandshakeMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(ChargingHandshakeMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.ChargingHandshake; |
| | | import com.ruoyi.integration.mongodb.model.ChargingPileReturnsGroundLockData; |
| | | import com.ruoyi.integration.mongodb.service.ChargingPileReturnsGroundLockDataService; |
| | | import com.ruoyi.integration.rocket.model.ChargingPileReturnsGroundLockDataMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class ChargingPileReturnsGroundLockDataMessageListener extends EnhanceMessageHandler<ChargingPileReturnsGroundLockDataMessage> implements RocketMQListener<ChargingPileReturnsGroundLockDataMessage> { |
| | | |
| | | @Autowired |
| | | private ChargingPileReturnsGroundLockDataService chargingPileReturnsGroundLockDataService; |
| | | @Override |
| | | protected void handleMessage(ChargingPileReturnsGroundLockDataMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("充电桩返回数据(上行)-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | ChargingPileReturnsGroundLockData chargingPileReturnsGroundLockData = new ChargingPileReturnsGroundLockData(); |
| | | BeanUtils.copyProperties(message,chargingPileReturnsGroundLockData); |
| | | chargingPileReturnsGroundLockDataService.create(chargingPileReturnsGroundLockData); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(ChargingPileReturnsGroundLockDataMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(ChargingPileReturnsGroundLockDataMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(ChargingPileReturnsGroundLockDataMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.ChargingPileReturnsGroundLockData; |
| | | import com.ruoyi.integration.mongodb.model.ChargingPileStartsCharging; |
| | | import com.ruoyi.integration.mongodb.service.ChargingPileStartsChargingService; |
| | | import com.ruoyi.integration.rocket.model.ChargingPileStartsChargingMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class ChargingPileStartsChargingMessageListener extends EnhanceMessageHandler<ChargingPileStartsChargingMessage> implements RocketMQListener<ChargingPileStartsChargingMessage> { |
| | | |
| | | @Autowired |
| | | private ChargingPileStartsChargingService chargingPileStartsChargingService; |
| | | @Override |
| | | protected void handleMessage(ChargingPileStartsChargingMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("充电桩主动申请启动充电-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | ChargingPileStartsCharging chargingPileStartsCharging = new ChargingPileStartsCharging(); |
| | | BeanUtils.copyProperties(message,chargingPileStartsCharging); |
| | | chargingPileStartsChargingService.create(chargingPileStartsCharging); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(ChargingPileStartsChargingMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(ChargingPileStartsChargingMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(ChargingPileStartsChargingMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.ChargingPileStartsCharging; |
| | | import com.ruoyi.integration.mongodb.model.ClearOfflineCardReply; |
| | | import com.ruoyi.integration.mongodb.service.ClearOfflineCardReplyService; |
| | | import com.ruoyi.integration.rocket.model.ClearOfflineCardReplyMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class ClearOfflineCardReplyMessageListener extends EnhanceMessageHandler<ClearOfflineCardReplyMessage> implements RocketMQListener<ClearOfflineCardReplyMessage> { |
| | | |
| | | @Autowired |
| | | private ClearOfflineCardReplyService clearOfflineCardReplyService; |
| | | @Override |
| | | protected void handleMessage(ClearOfflineCardReplyMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("离线卡数据清除应答-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | ClearOfflineCardReply clearOfflineCardReply = new ClearOfflineCardReply(); |
| | | BeanUtils.copyProperties(message,clearOfflineCardReply); |
| | | clearOfflineCardReplyService.create(clearOfflineCardReply); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(ClearOfflineCardReplyMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(ClearOfflineCardReplyMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(ClearOfflineCardReplyMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.ClearOfflineCardReply; |
| | | import com.ruoyi.integration.mongodb.model.GroundLockRealTimeData; |
| | | import com.ruoyi.integration.mongodb.service.GroundLockRealTimeDataService; |
| | | import com.ruoyi.integration.rocket.model.GroundLockRealTimeDataMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class GroundLockRealTimeDataMessageListener extends EnhanceMessageHandler<GroundLockRealTimeDataMessage> implements RocketMQListener<GroundLockRealTimeDataMessage> { |
| | | |
| | | @Autowired |
| | | private GroundLockRealTimeDataService groundLockRealTimeDataService; |
| | | @Override |
| | | protected void handleMessage(GroundLockRealTimeDataMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("地锁数据上送(充电桩上送)-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | GroundLockRealTimeData groundLockRealTimeData = new GroundLockRealTimeData(); |
| | | BeanUtils.copyProperties(message,groundLockRealTimeData); |
| | | groundLockRealTimeDataService.create(groundLockRealTimeData); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(GroundLockRealTimeDataMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(GroundLockRealTimeDataMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(GroundLockRealTimeDataMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
copy from ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/listener/EnhanceMemberMessageListener.java
copy to ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/listener/MotorAbortMessageListener.java
File was copied from ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/listener/EnhanceMemberMessageListener.java |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.rocket.test.MemberMessage; |
| | | import com.ruoyi.integration.mongodb.model.GroundLockRealTimeData; |
| | | import com.ruoyi.integration.mongodb.model.MotorAbort; |
| | | import com.ruoyi.integration.mongodb.service.MotorAbortService; |
| | | import com.ruoyi.integration.rocket.model.MotorAbortMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class EnhanceMemberMessageListener extends EnhanceMessageHandler<MemberMessage> implements RocketMQListener<MemberMessage> { |
| | | public class MotorAbortMessageListener extends EnhanceMessageHandler<MotorAbortMessage> implements RocketMQListener<MotorAbortMessage> { |
| | | |
| | | @Autowired |
| | | private MotorAbortService motorAbortService; |
| | | @Override |
| | | protected void handleMessage(MemberMessage message) throws Exception { |
| | | protected void handleMessage(MotorAbortMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | System.out.println("业务消息处理:"+message.getUserName()); |
| | | log.info("充电阶段充电机中止-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | MotorAbort motorAbort = new MotorAbort(); |
| | | BeanUtils.copyProperties(message,motorAbort); |
| | | motorAbortService.create(motorAbort); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(MemberMessage message) { |
| | | protected void handleMaxRetriesExceeded(MotorAbortMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(MemberMessage message) { |
| | | protected boolean filter(MotorAbortMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(MemberMessage memberMessage) { |
| | | super.dispatchMessage(memberMessage); |
| | | public void onMessage(MotorAbortMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
File was renamed from ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/listener/EnhanceMemberMessageListener.java |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.rocket.test.MemberMessage; |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.service.OnlineService; |
| | | import com.ruoyi.integration.rocket.model.OnlineMessage; |
| | | import com.ruoyi.integration.rocket.model.OnlineMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class EnhanceMemberMessageListener extends EnhanceMessageHandler<MemberMessage> implements RocketMQListener<MemberMessage> { |
| | | public class OnlineMessageListener extends EnhanceMessageHandler<OnlineMessage> implements RocketMQListener<OnlineMessage> { |
| | | |
| | | @Autowired |
| | | private OnlineService onlineService; |
| | | |
| | | @Override |
| | | protected void handleMessage(MemberMessage message) throws Exception { |
| | | protected void handleMessage(OnlineMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | System.out.println("业务消息处理:"+message.getUserName()); |
| | | log.info("充电桩登录认证业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | Online online = new Online(); |
| | | BeanUtils.copyProperties(message,online); |
| | | onlineService.create(online); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(MemberMessage message) { |
| | | protected void handleMaxRetriesExceeded(OnlineMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(MemberMessage message) { |
| | | protected boolean filter(OnlineMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(MemberMessage memberMessage) { |
| | | super.dispatchMessage(memberMessage); |
| | | public void onMessage(OnlineMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.model.ParameterSetting; |
| | | import com.ruoyi.integration.mongodb.service.ParameterSettingService; |
| | | import com.ruoyi.integration.rocket.model.ParameterSettingMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class ParameterSettingMessageListener extends EnhanceMessageHandler<ParameterSettingMessage> implements RocketMQListener<ParameterSettingMessage> { |
| | | |
| | | @Autowired |
| | | private ParameterSettingService parameterSettingService; |
| | | |
| | | @Override |
| | | protected void handleMessage(ParameterSettingMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | ParameterSetting parameterSetting = new ParameterSetting(); |
| | | BeanUtils.copyProperties(message,parameterSetting); |
| | | parameterSettingService.create(parameterSetting); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(ParameterSettingMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(ParameterSettingMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(ParameterSettingMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
copy from ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/listener/EnhanceMemberMessageListener.java
copy to ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/listener/PingMessageListener.java
File was copied from ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/listener/EnhanceMemberMessageListener.java |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.rocket.test.MemberMessage; |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.model.Ping; |
| | | import com.ruoyi.integration.mongodb.service.OnlineService; |
| | | import com.ruoyi.integration.mongodb.service.PingService; |
| | | import com.ruoyi.integration.rocket.model.PingMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class EnhanceMemberMessageListener extends EnhanceMessageHandler<MemberMessage> implements RocketMQListener<MemberMessage> { |
| | | public class PingMessageListener extends EnhanceMessageHandler<PingMessage> implements RocketMQListener<PingMessage> { |
| | | |
| | | @Autowired |
| | | private PingService pingService; |
| | | |
| | | @Override |
| | | protected void handleMessage(MemberMessage message) throws Exception { |
| | | protected void handleMessage(PingMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | System.out.println("业务消息处理:"+message.getUserName()); |
| | | log.info("充电桩心跳包-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | Ping ping = new Ping(); |
| | | BeanUtils.copyProperties(message,ping); |
| | | pingService.create(ping); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(MemberMessage message) { |
| | | protected void handleMaxRetriesExceeded(PingMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(MemberMessage message) { |
| | | protected boolean filter(PingMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(MemberMessage memberMessage) { |
| | | super.dispatchMessage(memberMessage); |
| | | public void onMessage(PingMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.model.PlatformRemoteUpdateReply; |
| | | import com.ruoyi.integration.mongodb.service.PlatformRemoteUpdateReplyService; |
| | | import com.ruoyi.integration.rocket.model.PlatformRemoteUpdateReplyMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class PlatformRemoteUpdateReplyMessageListener extends EnhanceMessageHandler<PlatformRemoteUpdateReplyMessage> implements RocketMQListener<PlatformRemoteUpdateReplyMessage> { |
| | | |
| | | @Autowired |
| | | private PlatformRemoteUpdateReplyService platformRemoteUpdateReplyService; |
| | | |
| | | @Override |
| | | protected void handleMessage(PlatformRemoteUpdateReplyMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("远程更新应答-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | PlatformRemoteUpdateReply platformRemoteUpdateReply = new PlatformRemoteUpdateReply(); |
| | | BeanUtils.copyProperties(message,platformRemoteUpdateReply); |
| | | platformRemoteUpdateReplyService.create(platformRemoteUpdateReply); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(PlatformRemoteUpdateReplyMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(PlatformRemoteUpdateReplyMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(PlatformRemoteUpdateReplyMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.model.PlatformRestartReply; |
| | | import com.ruoyi.integration.mongodb.service.PlatformRestartReplyService; |
| | | import com.ruoyi.integration.rocket.model.PlatformRestartReplyMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class PlatformRestartReplyMessageListener extends EnhanceMessageHandler<PlatformRestartReplyMessage> implements RocketMQListener<PlatformRestartReplyMessage> { |
| | | |
| | | @Autowired |
| | | private PlatformRestartReplyService platformRestartReplyService; |
| | | |
| | | @Override |
| | | protected void handleMessage(PlatformRestartReplyMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("远程重启应答-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | PlatformRestartReply platformRestartReply = new PlatformRestartReply(); |
| | | BeanUtils.copyProperties(message,platformRestartReply); |
| | | platformRestartReplyService.create(platformRestartReply); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(PlatformRestartReplyMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(PlatformRestartReplyMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(PlatformRestartReplyMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.model.PlatformStartChargingReply; |
| | | import com.ruoyi.integration.mongodb.service.PlatformStartChargingReplyService; |
| | | import com.ruoyi.integration.rocket.model.PlatformStartChargingReplyMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class PlatformStartChargingReplyMessageListener extends EnhanceMessageHandler<PlatformStartChargingReplyMessage> implements RocketMQListener<PlatformStartChargingReplyMessage> { |
| | | |
| | | @Autowired |
| | | private PlatformStartChargingReplyService platformStartChargingReplyService; |
| | | |
| | | @Override |
| | | protected void handleMessage(PlatformStartChargingReplyMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("远程启机命令回复-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | PlatformStartChargingReply platformStartChargingReply = new PlatformStartChargingReply(); |
| | | BeanUtils.copyProperties(message,platformStartChargingReply); |
| | | platformStartChargingReplyService.create(platformStartChargingReply); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(PlatformStartChargingReplyMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(PlatformStartChargingReplyMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(PlatformStartChargingReplyMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.model.PlatformStopChargingReply; |
| | | import com.ruoyi.integration.mongodb.service.PlatformStopChargingReplyService; |
| | | import com.ruoyi.integration.rocket.model.PlatformStopChargingReplyMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class PlatformStopChargingReplyMessageListener extends EnhanceMessageHandler<PlatformStopChargingReplyMessage> implements RocketMQListener<PlatformStopChargingReplyMessage> { |
| | | @Autowired |
| | | private PlatformStopChargingReplyService platformStopChargingReplyService; |
| | | |
| | | @Override |
| | | protected void handleMessage(PlatformStopChargingReplyMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("远程停机命令回复-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | PlatformStopChargingReply platformStopChargingReply = new PlatformStopChargingReply(); |
| | | BeanUtils.copyProperties(message,platformStopChargingReply); |
| | | platformStopChargingReplyService.create(platformStopChargingReply); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(PlatformStopChargingReplyMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(PlatformStopChargingReplyMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(PlatformStopChargingReplyMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.model.QueryOfflineCardReply; |
| | | import com.ruoyi.integration.mongodb.service.QueryOfflineCardReplyService; |
| | | import com.ruoyi.integration.rocket.model.QueryOfflineCardReplyMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class QueryOfflineCardReplyMessageListener extends EnhanceMessageHandler<QueryOfflineCardReplyMessage> implements RocketMQListener<QueryOfflineCardReplyMessage> { |
| | | |
| | | @Autowired |
| | | private QueryOfflineCardReplyService queryOfflineCardReplyService; |
| | | @Override |
| | | protected void handleMessage(QueryOfflineCardReplyMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("离线卡数据查询应答-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | QueryOfflineCardReply queryOfflineCardReply = new QueryOfflineCardReply(); |
| | | BeanUtils.copyProperties(message,queryOfflineCardReply); |
| | | queryOfflineCardReplyService.create(queryOfflineCardReply); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(QueryOfflineCardReplyMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(QueryOfflineCardReplyMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(QueryOfflineCardReplyMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.model.SetupBillingModelReply; |
| | | import com.ruoyi.integration.mongodb.service.SetupBillingModelReplyService; |
| | | import com.ruoyi.integration.rocket.model.SetupBillingModelReplyMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class SetupBillingModelReplyMessageListener extends EnhanceMessageHandler<SetupBillingModelReplyMessage> implements RocketMQListener<SetupBillingModelReplyMessage> { |
| | | |
| | | @Autowired |
| | | private SetupBillingModelReplyService setupBillingModelReplyService; |
| | | |
| | | @Override |
| | | protected void handleMessage(SetupBillingModelReplyMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("计费模型应答-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | SetupBillingModelReply setupBillingModelReply = new SetupBillingModelReply(); |
| | | BeanUtils.copyProperties(message,setupBillingModelReply); |
| | | setupBillingModelReplyService.create(setupBillingModelReply); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(SetupBillingModelReplyMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(SetupBillingModelReplyMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(SetupBillingModelReplyMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.model.SynchronizeOfflineCardReply; |
| | | import com.ruoyi.integration.mongodb.service.SynchronizeOfflineCardReplyService; |
| | | import com.ruoyi.integration.rocket.model.SynchronizeOfflineCardReplyMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class SynchronizeOfflineCardReplyMessageListener extends EnhanceMessageHandler<SynchronizeOfflineCardReplyMessage> implements RocketMQListener<SynchronizeOfflineCardReplyMessage> { |
| | | |
| | | @Autowired |
| | | private SynchronizeOfflineCardReplyService synchronizeOfflineCardReplyService; |
| | | @Override |
| | | protected void handleMessage(SynchronizeOfflineCardReplyMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("卡数据同步应答-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | SynchronizeOfflineCardReply synchronizeOfflineCardReply = new SynchronizeOfflineCardReply(); |
| | | BeanUtils.copyProperties(message,synchronizeOfflineCardReply); |
| | | synchronizeOfflineCardReplyService.create(synchronizeOfflineCardReply); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(SynchronizeOfflineCardReplyMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(SynchronizeOfflineCardReplyMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(SynchronizeOfflineCardReplyMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.model.TimingSettingReply; |
| | | import com.ruoyi.integration.mongodb.service.TimingSettingReplyService; |
| | | import com.ruoyi.integration.rocket.model.TimingSettingReplyMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class TimingSettingReplyMessageListener extends EnhanceMessageHandler<TimingSettingReplyMessage> implements RocketMQListener<TimingSettingReplyMessage> { |
| | | |
| | | @Autowired |
| | | private TimingSettingReplyService timingSettingReplyService; |
| | | @Override |
| | | protected void handleMessage(TimingSettingReplyMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("对时设置应答-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | TimingSettingReply timingSettingReply = new TimingSettingReply(); |
| | | BeanUtils.copyProperties(message,timingSettingReply); |
| | | timingSettingReplyService.create(timingSettingReply); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(TimingSettingReplyMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(TimingSettingReplyMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(TimingSettingReplyMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.model.TransactionRecord; |
| | | import com.ruoyi.integration.mongodb.service.TransactionRecordService; |
| | | import com.ruoyi.integration.rocket.model.TransactionRecordMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class TransactionRecordMessageListener extends EnhanceMessageHandler<TransactionRecordMessage> implements RocketMQListener<TransactionRecordMessage> { |
| | | |
| | | @Autowired |
| | | private TransactionRecordService transactionRecordService; |
| | | @Override |
| | | protected void handleMessage(TransactionRecordMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("交易记录-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | TransactionRecord transactionRecord = new TransactionRecord(); |
| | | BeanUtils.copyProperties(message,transactionRecord); |
| | | transactionRecordService.create(transactionRecord); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(TransactionRecordMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(TransactionRecordMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(TransactionRecordMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.model.UpdateBalanceReply; |
| | | import com.ruoyi.integration.mongodb.service.UpdateBalanceReplyService; |
| | | import com.ruoyi.integration.rocket.model.UpdateBalanceReplyMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class UpdateBalanceReplyMessageListener extends EnhanceMessageHandler<UpdateBalanceReplyMessage> implements RocketMQListener<UpdateBalanceReplyMessage> { |
| | | |
| | | @Autowired |
| | | private UpdateBalanceReplyService updateBalanceReplyService; |
| | | @Override |
| | | protected void handleMessage(UpdateBalanceReplyMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("余额更新应答-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | UpdateBalanceReply updateBalanceReply = new UpdateBalanceReply(); |
| | | BeanUtils.copyProperties(message,updateBalanceReply); |
| | | updateBalanceReplyService.create(updateBalanceReply); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(UpdateBalanceReplyMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(UpdateBalanceReplyMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(UpdateBalanceReplyMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.model.UploadRealTimeMonitoringData; |
| | | import com.ruoyi.integration.mongodb.service.UploadRealTimeMonitoringDataService; |
| | | import com.ruoyi.integration.rocket.model.UploadRealTimeMonitoringDataMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class UploadRealTimeMonitoringDataMessageListener extends EnhanceMessageHandler<UploadRealTimeMonitoringDataMessage> implements RocketMQListener<UploadRealTimeMonitoringDataMessage> { |
| | | |
| | | @Autowired |
| | | private UploadRealTimeMonitoringDataService uploadRealTimeMonitoringDataService; |
| | | @Override |
| | | protected void handleMessage(UploadRealTimeMonitoringDataMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("上传实时监测数据-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | UploadRealTimeMonitoringData uploadRealTimeMonitoringData = new UploadRealTimeMonitoringData(); |
| | | BeanUtils.copyProperties(message,uploadRealTimeMonitoringData); |
| | | uploadRealTimeMonitoringDataService.create(uploadRealTimeMonitoringData); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(UploadRealTimeMonitoringDataMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(UploadRealTimeMonitoringDataMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(UploadRealTimeMonitoringDataMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.listener; |
| | | |
| | | import com.ruoyi.integration.mongodb.model.Online; |
| | | import com.ruoyi.integration.mongodb.model.WorkingParameterSettingReply; |
| | | import com.ruoyi.integration.mongodb.service.WorkingParameterSettingReplyService; |
| | | import com.ruoyi.integration.rocket.model.WorkingParameterSettingReplyMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class WorkingParameterSettingReplyMessageListener extends EnhanceMessageHandler<WorkingParameterSettingReplyMessage> implements RocketMQListener<WorkingParameterSettingReplyMessage> { |
| | | |
| | | @Autowired |
| | | private WorkingParameterSettingReplyService workingParameterSettingReplyService; |
| | | @Override |
| | | protected void handleMessage(WorkingParameterSettingReplyMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | | log.info("充电桩工作参数设置应答-业务消息处理:{}",message); |
| | | // 持久化消息 |
| | | WorkingParameterSettingReply workingParameterSettingReply = new WorkingParameterSettingReply(); |
| | | BeanUtils.copyProperties(message,workingParameterSettingReply); |
| | | workingParameterSettingReplyService.create(workingParameterSettingReply); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(WorkingParameterSettingReplyMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |
| | | // 生产中可以进行回退或其他业务操作 |
| | | log.error("消息消费失败,请执行后续处理"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否执行重试机制 |
| | | */ |
| | | @Override |
| | | protected boolean isRetry() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean throwException() { |
| | | // 是否抛出异常,false搭配retry自行处理异常 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 若需要处理消息过滤,在父级中进行统一处理,或者在此处实现之后,自行处理 |
| | | * @param message 待处理消息 |
| | | * @return true: 本次消息被过滤,false:不过滤 |
| | | */ |
| | | @Override |
| | | protected boolean filter(WorkingParameterSettingReplyMessage message) { |
| | | // 此处可做消息过滤 |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 监听消费消息,不需要执行业务处理,委派给父类做基础操作,父类做完基础操作后会调用子类的实际处理类型 |
| | | */ |
| | | @Override |
| | | public void onMessage(WorkingParameterSettingReplyMessage message) { |
| | | super.dispatchMessage(message); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 充电桩计费模型请求 |
| | | **/ |
| | | |
| | | @Data |
| | | public class AcquisitionBillingModeMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code;// 桩编码 |
| | | |
| | | } |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 计费模型验证请求 |
| | | **/ |
| | | |
| | | @Data |
| | | public class BillingModeVerifyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code;// 桩编码 |
| | | private String billing_model_code;// "计费模型编号,首次连接到平台时置零 |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 充电阶段BMS中止 |
| | | **/ |
| | | |
| | | @Data |
| | | public class BmsAbortMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer bms_stop_charging_reason; // BMS 中止充电原因(1-2 位——所需求的 SOC 目标值,3-4 位——达到总电压的设定值,5-6 位——达到单体电压设定值,7-8 位——充电机主动中止) |
| | | private Integer bms_aborted_charging_fault_cause; // BMS 中止充电故障原因(1-2 位——绝缘故障,3-4 位——输出连接器过温故障,5-6 位——BMS 元件、输出连接器过温,7-8 位——充电连接器故障,9-10 位——电池组温度过高故障,11-12 位——高压继电器故障,13 位-14 位——检测点 2 电压检测故障,15-16 位——其他故障) |
| | | private Integer bms_aborted_charging_error_cause; // BMS 中止充电错误原因(1-2 位——电流过大,3-4 位——电压异常,5-8 位——预留位) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 充电过程BMS需求、充电机输出 |
| | | **/ |
| | | |
| | | @Data |
| | | public class BmsDemandAndChargerExportationMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private BigDecimal bms_voltage_requirements; // BMS 电压需求 |
| | | private BigDecimal bms_current_requirements; // BMS 电流需求 |
| | | private Integer bms_charging_mode; // BMS 充电模式(1:恒压充电;2:恒流充电) |
| | | private BigDecimal bms_voltage_measurement_value; // BMS 充电电压测量值 |
| | | private BigDecimal bms_current_measurement_value; // BMS 充电电流测量值 |
| | | private Integer bms_battery_voltage_and_group_number; // BMS 最高单体动力蓄电池电压及组号(1-12 位:最高单体动力蓄电池电压,数据分辨率:0.01 V/位,0 V 偏移量;数据范围:0~24 V;13-16 位:最高单体动力蓄电池电压所在组号,数据分辨率:1/位,0 偏移量;数据范围:0~15) |
| | | private BigDecimal bms_charged_status; // BMS 当前荷电状态 SOC( %) |
| | | private Integer bms_remaining_charging_time; // BMS 估算剩余充电时间 |
| | | private BigDecimal voltage_output_value; // 电桩电压输出值 |
| | | private BigDecimal current_output_value; // 电桩电流输出值 |
| | | private Integer cumulative_charging_time; // 累计充电时间 |
| | | |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 充电过程BMS信息 |
| | | **/ |
| | | |
| | | @Data |
| | | public class BmsInformationMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer bms_highest_voltage_number; // BMS 最高单体动力蓄电池电压所在编号 |
| | | private String bms_maximum_battery_temperature; // BMS 最高动力蓄电池温度 |
| | | private Integer maximum_temperature_detection_point_number; // 最高温度检测点编号 |
| | | private String minimum_cell_temperature; // 最低动力蓄电池温度 |
| | | private Integer lowest_temperature_detection_pointt_number; // 最低动力蓄电池温度检测点编号 |
| | | private Integer bms_battery_voltage; // BMS 单体动力蓄电池电压过高 /过低(0:正常,1:过高,10:过低) |
| | | private Integer bms_battery_charging_status; // BMS 整车动力蓄电池荷电状态SOC 过高/过低(0:正常,1:过高,10:过低) |
| | | private Integer bms_charging_overcurrent; // BMS 动力蓄电池充电过电流(0:正常,1:过流,10:不可信状态) |
| | | private Integer bms_high_battery_temperature; // BMS 动力蓄电池温度过高(0:正常,1:过流,10:不可信状态) |
| | | private Integer bms_battery_insulation_status; // BMS 动力蓄电池绝缘状态(0:正常,1:过流,10:不可信状态) |
| | | private Integer bms_output_connector_connection_status; // BMS 动力蓄电池组输出连接器连接状态(0:正常,1:过流,10:不可信状态) |
| | | private Integer charge_prohibition; // 充电禁止(0:禁止,1:允许) |
| | | private Integer reserve; // 预留位 |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 充电握手 |
| | | **/ |
| | | |
| | | @Data |
| | | public class ChargingHandshakeMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number;// 交易流水号 |
| | | private String charging_pile_code;// 桩编码 |
| | | private String charging_gun_code;// 抢号 |
| | | private String bms_protocol_version;// BMS 通信协议版本号 |
| | | private Integer bms_battery_type;// BMS 电池类型(1:铅酸电池;2:氢:电池;3:磷酸铁锂电池;4:锰酸锂电池;5:钴酸锂电池;6:三元材料电池;7:聚合物锂离子电池;8:钛酸锂电池;FFH:其他) |
| | | private BigDecimal bms_battery_capacity;// BMS 整车动力蓄电池系统额定容量 |
| | | private BigDecimal bms_total_battery_voltage;// BMS 整车动力蓄电池系统额定总电压 |
| | | private String bms_battery_manufacturer;// BMS 电池生产厂商名称 |
| | | private String bms_battery_serial_number;// BMS 电池组序号 |
| | | private Integer bms_battery_production_year;// BMS 电池组生产日期年 |
| | | private Integer bms_battery_production_month;// BMS 电池组生产日期月 |
| | | private Integer bms_battery_production_day;// BMS 电池组生产日期日 |
| | | private Integer bms_battery_charging_times;// BMS 电池组充电次数 |
| | | private Integer bms_battery_property_rights;// BMS 电池组产权标识 |
| | | private Integer reserved;// 预留位 |
| | | private String vim;// BMS 车辆识别码 |
| | | private Integer bms_software_version;// BMS 软件版本号 |
| | | |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 充电桩返回数据(上行) |
| | | **/ |
| | | |
| | | @Data |
| | | public class ChargingPileReturnsGroundLockDataMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer control_state; // 地锁控制返回标志(1:鉴权成功,0:鉴权失败) |
| | | private String reserve; // 预留位 |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 充电桩主动申请启动充电 |
| | | **/ |
| | | |
| | | @Data |
| | | public class ChargingPileStartsChargingMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer start_method; // 启动方式(1:表示通过刷卡启动充电,2:表示通过帐号启动充电(暂不支持),3:表示vin码启动充电) |
| | | private Integer need_password; // 是否需要密码(0:不需要,1:需要) |
| | | private String account; // 账号或者物理卡号 |
| | | private String password; // 输入密码 |
| | | private String vin; // "VIN 码,启动方式为vin码启动充电时上送,其他方式置零( ASCII码),VIN码需要反序上送 |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 离线卡数据清除应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class ClearOfflineCardReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String physical_card1; // 第 1 个卡物理卡号,离线卡物理卡号 |
| | | private String physical_card2; |
| | | private String physical_card3; |
| | | private String physical_card4; |
| | | private String physical_card5; |
| | | private String physical_card6; |
| | | private String physical_card7; |
| | | private String physical_card8; |
| | | private String physical_card9; |
| | | private String physical_card10; |
| | | private String physical_card11; |
| | | private String physical_card12; |
| | | private String physical_card13; |
| | | private String physical_card14; |
| | | private String physical_card15; |
| | | private String physical_card16; |
| | | private String physical_card17; |
| | | private String physical_card18; |
| | | private String physical_card19; |
| | | private String physical_card20; |
| | | private String physical_card21; |
| | | private String physical_card22; |
| | | private String physical_card23; |
| | | private String physical_card24; |
| | | private Integer clear_result1; // 清除标记(0:清除失败,1:清除成功) |
| | | private Integer clear_result2; |
| | | private Integer clear_result3; |
| | | private Integer clear_result4; |
| | | private Integer clear_result5; |
| | | private Integer clear_result6; |
| | | private Integer clear_result7; |
| | | private Integer clear_result8; |
| | | private Integer clear_result9; |
| | | private Integer clear_result10; |
| | | private Integer clear_result11; |
| | | private Integer clear_result12; |
| | | private Integer clear_result13; |
| | | private Integer clear_result14; |
| | | private Integer clear_result15; |
| | | private Integer clear_result16; |
| | | private Integer clear_result17; |
| | | private Integer clear_result18; |
| | | private Integer clear_result19; |
| | | private Integer clear_result20; |
| | | private Integer clear_result21; |
| | | private Integer clear_result22; |
| | | private Integer clear_result23; |
| | | private Integer clear_result24; |
| | | private Integer failure_cause1; // 失败原因(1:卡号格式错误,2:清除成功) |
| | | private Integer failure_cause2; |
| | | private Integer failure_cause3; |
| | | private Integer failure_cause4; |
| | | private Integer failure_cause5; |
| | | private Integer failure_cause6; |
| | | private Integer failure_cause7; |
| | | private Integer failure_cause8; |
| | | private Integer failure_cause9; |
| | | private Integer failure_cause10; |
| | | private Integer failure_cause11; |
| | | private Integer failure_cause12; |
| | | private Integer failure_cause13; |
| | | private Integer failure_cause14; |
| | | private Integer failure_cause15; |
| | | private Integer failure_cause16; |
| | | private Integer failure_cause17; |
| | | private Integer failure_cause18; |
| | | private Integer failure_cause19; |
| | | private Integer failure_cause20; |
| | | private Integer failure_cause21; |
| | | private Integer failure_cause22; |
| | | private Integer failure_cause23; |
| | | private Integer failure_cause24; |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 地锁数据上送(充电桩上送) |
| | | **/ |
| | | |
| | | @Data |
| | | public class GroundLockRealTimeDataMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer parking_lock_status; // 车位锁状态(0:未到位状态,1:升锁到位状态,2:降锁到位状态) |
| | | private Integer parking_status; // 车位状态(0:无车辆,1:停放车辆) |
| | | private Integer ground_locking_capacity; // 地锁电量状态 |
| | | private Integer alarm_status; // 报警状态(0:正常无报警,1:待机状态摇臂破坏,2:摇臂升降异常(未到位)) |
| | | private String reserve; // 预留位 |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 充电阶段充电机中止 |
| | | **/ |
| | | |
| | | @Data |
| | | public class MotorAbortMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer charger_stops_charging_reason; // 充电机中止充电原因(1-2 位——达到充电机设定的条件中止,3-4 位——人工中止,5-6 位——异常中止) |
| | | private Integer charging_failure_cause; // 充电机中止充电故障原因(1-2 位——充电机过温故障,3-4 位——充电连接器故障,5-6 位——充电机内部过温故障,7-8 位——所需电量不能传送,9-10 位——充电机急停故障,11-12 位——其他故障,13-16 位——预留位) |
| | | private Integer charging_machine_stopped_charging_error_cause; // 充电机中止充电错误原因(1-2 位——电流不匹配,3-4 位——电压异常,5-8 位——预留位) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 充电桩登录认证 |
| | | **/ |
| | | |
| | | @Data |
| | | public class OnlineMessage extends BaseMessage { |
| | | private String charging_pile_code;// 充电桩编号 |
| | | private Integer charging_pile_type;// 充电桩类型(0 表示直流桩,1 表示交流桩) |
| | | private Integer charging_gun_number;// 充电枪数量 |
| | | private String protocol_version;// 通信协议版本 |
| | | private String program_version;// 程序版本 |
| | | private Integer network_link_type;// 网络链接类型(0:SIM 卡,1:LAN,2:WAN,3:其他) |
| | | private String sim;// Sim 卡 |
| | | private Integer operator;// 运营商(0: 移动,2:电信,3:联通,4:其他) |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 参数配置 |
| | | **/ |
| | | |
| | | @Data |
| | | public class ParameterSettingMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private BigDecimal bms_maximum_charging_voltage; // BMS 单体动力蓄电池最高允许充电电压 |
| | | private BigDecimal bms_maximum_charging_current; // BMS 最高允许充电电流 |
| | | private BigDecimal bms_battery_total_energy; // BMS 动力蓄电池标称总能量 |
| | | private BigDecimal bms_total_charging_voltage; // BMS 最高允许充电总电压 |
| | | private Integer bms_maximum_temperature; // BMS 最高允许温度 |
| | | private BigDecimal bms_battery_charging_status; // BMS 整车动力蓄电池荷电状态 (soc) |
| | | private BigDecimal bms_battery_voltage; // BMS 整车动力蓄电池当前电池 电压 |
| | | private BigDecimal maximum_output_voltage; // 电桩最高输出电压 |
| | | private BigDecimal minimum_output_voltage; // 电桩最低输出电压 |
| | | private BigDecimal maximum_output_current; // 电桩最大输出电流 |
| | | private BigDecimal minimum_output_current; // 电桩最小输出电流 |
| | | |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 充电桩心跳包 |
| | | **/ |
| | | |
| | | @Data |
| | | public class PingMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code;// 桩编码 |
| | | private String charging_gun_code;// 抢号 |
| | | private Integer charging_gun_status;// 抢状态(0:正常,1:故障) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 远程更新应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class PlatformRemoteUpdateReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private Integer escalation_state; // 升级状态(0:成功,1:编码错误,2:程序与桩型号不符,3:下载更新文件超时) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 远程重启应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class PlatformRestartReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private Integer set_result; // 设置结果(0:失败,1:成功) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 远程启机命令回复 |
| | | **/ |
| | | |
| | | @Data |
| | | public class PlatformStartChargingReplyMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer startup_result; // 启动结果(0:失败,1:成功) |
| | | private Integer failure_cause; // "失败原因(0:无,1:设备编号不匹配,2:枪已在充电,3:设备故障,4:设备离线,5:未插枪桩在收到启充命令后,检测到未插枪则发送 0x33 报文回复充电失败。若在 60 秒(以收到 0x34 时间开始计算)内检测到枪重新连接,则补送 0x33 成功报文;超时或者离线等其他异常,桩不启充、不补发 0x33 报文)" |
| | | |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 远程停机命令回复 |
| | | **/ |
| | | |
| | | @Data |
| | | public class PlatformStopChargingReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer stop_result; // 停止结果(0:失败,1:成功) |
| | | private Integer failure_cause; // 失败原因(0:无,1:设备编号不匹配,2:枪未处于充电状态,3:其他) |
| | | |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 离线卡数据查询应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class QueryOfflineCardReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String physical_card1; // 第 1 个卡物理卡号,离线卡物理卡号 |
| | | private String physical_card2; |
| | | private String physical_card3; |
| | | private String physical_card4; |
| | | private String physical_card5; |
| | | private String physical_card6; |
| | | private String physical_card7; |
| | | private String physical_card8; |
| | | private String physical_card9; |
| | | private String physical_card10; |
| | | private String physical_card11; |
| | | private String physical_card12; |
| | | private String physical_card13; |
| | | private String physical_card14; |
| | | private String physical_card15; |
| | | private String physical_card16; |
| | | private String physical_card17; |
| | | private String physical_card18; |
| | | private String physical_card19; |
| | | private String physical_card20; |
| | | private String physical_card21; |
| | | private String physical_card22; |
| | | private String physical_card23; |
| | | private String physical_card24; |
| | | private Integer query_result1; // 查询结果(0:不存在,1:存在) |
| | | private Integer query_result2; |
| | | private Integer query_result3; |
| | | private Integer query_result4; |
| | | private Integer query_result5; |
| | | private Integer query_result6; |
| | | private Integer query_result7; |
| | | private Integer query_result8; |
| | | private Integer query_result9; |
| | | private Integer query_result10; |
| | | private Integer query_result11; |
| | | private Integer query_result12; |
| | | private Integer query_result13; |
| | | private Integer query_result14; |
| | | private Integer query_result15; |
| | | private Integer query_result16; |
| | | private Integer query_result17; |
| | | private Integer query_result18; |
| | | private Integer query_result19; |
| | | private Integer query_result20; |
| | | private Integer query_result21; |
| | | private Integer query_result22; |
| | | private Integer query_result23; |
| | | private Integer query_result24; |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 计费模型应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class SetupBillingModelReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String set_result; //设置结果(0:失败,1:成功) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 卡数据同步应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class SynchronizeOfflineCardReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private Integer save_result; // 保存结果(0:失败,1:成功) |
| | | private Integer failure_cause; // 失败原因(1:卡号格式错误,2:储存空间不足) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 对时设置应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class TimingSettingReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String current_time; //当前时间 |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 交易记录 |
| | | **/ |
| | | |
| | | @Data |
| | | public class TransactionRecordMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number;// 交易流水号 |
| | | private String charging_pile_code;// 桩编码 |
| | | private String charging_gun_code;// 抢号 |
| | | private String start_time;// 开始时间 |
| | | private String end_time;// 结束时间 |
| | | private BigDecimal sharp_peak_unit_price;// 尖单价 |
| | | private BigDecimal sharp_peak_charge;// 尖电量 |
| | | private BigDecimal loss_sharp_peak_charge;// 计损尖电量 |
| | | private BigDecimal sharp_peak_amount;// 尖金额 |
| | | private BigDecimal peak_unit_price;// 峰单价 |
| | | private BigDecimal peak_charge;// 峰电量 |
| | | private BigDecimal loss_peak_charge;// 计损峰电量 |
| | | private BigDecimal peak_amount;// 峰金额 |
| | | private BigDecimal flat_peak_unit_price;// 平单价 |
| | | private BigDecimal flat_peak_charge;// 平电量 |
| | | private BigDecimal loss_flat_peak_charge;// 计损平电量 |
| | | private BigDecimal flat_peak_amount;// 平金额 |
| | | private BigDecimal low_peak_unit_price;// 谷单价 |
| | | private BigDecimal low_peak_charge;// 谷电量 |
| | | private BigDecimal loss_low_peak_charge;// 计损谷电量 |
| | | private BigDecimal low_peak_amount;// 谷金额 |
| | | private BigDecimal total_initial_value;// 电表总起值 |
| | | private BigDecimal total_stop_value;// 电表总止值 |
| | | private BigDecimal total_electricity;// 总电量 |
| | | private BigDecimal loss_total_electricity;// 计损总电量 |
| | | private BigDecimal payment_amount;// 消费金额 |
| | | private String vin;// 电动汽车唯一标识 |
| | | private Integer start_method;// 交易标识(1:app 启动,2:卡启动,4:离线卡启动,5: vin 码启动充电) |
| | | private String trade_date;// 交易日期、时间 |
| | | private Integer stop_reason;// 停止原因 |
| | | private String physical_card_number;// 物理卡号 |
| | | |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 余额更新应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class UpdateBalanceReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private String physical_card_number; //物理卡号 |
| | | private BigDecimal account_balance; //修改结果(:0:修改成功,1:设备编号错误,2:卡号错误) |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 上传实时监测数据 |
| | | **/ |
| | | |
| | | @Data |
| | | public class UploadRealTimeMonitoringDataMessage extends BaseMessage { |
| | | |
| | | private String transaction_serial_number; // 交易流水号 |
| | | private String charging_pile_code; // 桩编码 |
| | | private String charging_gun_code; // 抢号 |
| | | private Integer charging_gun_status; // 状态(0:离线,1:故障,2:空闲,3:充电) |
| | | private Integer homing_status; // 枪是否归位(0:否,1:是,2:未知) |
| | | private Integer insertion_status; // 是否插枪(0:否,1:是) |
| | | private BigDecimal output_voltage; // 输出电压,精确到小数点后一位;待机置零 |
| | | private BigDecimal output_current; // 输出电流,精确到小数点后一位;待机置零 |
| | | private Integer gun_line_temperature; // 枪线温度,整形,偏移量-50;待机置零 |
| | | private String gun_line_code; // 枪线编码,没有置零 |
| | | private Integer soc; // SOC待机置零;交流桩置零 |
| | | private Integer battery_temperature; // 电池组最高温度,整形,偏移量-50 ºC;待机置零;交流桩置零 |
| | | private Integer cumulative_charging_time; // 累计充电时间,单位:min;待机置零 |
| | | private Integer time_remaining; // 剩余时间,单位:min;待机置零、交流桩置零 |
| | | private BigDecimal charging_degree; // 充电度数,精确到小数点后四位;待机置零 |
| | | private BigDecimal loss_of_charging_degree; // 计损充电度数,精确到小数点后四位;待机置零,未设置计损比例时等于充电度数 |
| | | private BigDecimal paid_amount; // 已充金额,精确到小数点后四位;待机置零(电费+服务费)*计损充电度数 |
| | | private Integer hardware_fault; // 硬件故障(1:急停按钮动作故障;2:无可用整流模块;3:出风口温度过高;4:交流防雷故障;5:交直流模块 DC20 通信中断;6:绝缘检测模块 FC08 通信中断;7:电度表通信中断;8:读卡器通信中断;9:RC10 通信中断;10:风扇调速板故障;11:直流熔断器故障;12:高压接触器故障;13:门打开) |
| | | |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.integration.rocket.model; |
| | | |
| | | import com.ruoyi.integration.rocket.base.BaseMessage; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.data.mongodb.core.mapping.Document; |
| | | |
| | | /** |
| | | * 充电桩工作参数设置应答 |
| | | **/ |
| | | |
| | | @Data |
| | | public class WorkingParameterSettingReplyMessage extends BaseMessage { |
| | | |
| | | private String charging_pile_code; //桩编码 |
| | | private Integer set_result; //设置结果(0:失败,1:成功) |
| | | } |
| | | |
| | | |
| | |
| | | package com.ruoyi.integration.rocket.produce; |
| | | |
| | | import com.ruoyi.integration.rocket.test.MemberMessage; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.integration.iotda.enums.SendTagMenu; |
| | | 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.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.UUID; |
| | | |
| | | @RestController |
| | |
| | | @Setter(onMethod_ = @Autowired) |
| | | private RocketMQEnhanceTemplate rocketMQEnhanceTemplate; |
| | | |
| | | private static final String topic = "rocket_enhance"; |
| | | private static final String tag = "member"; |
| | | private static final String TOPIC = "rocket_enhance"; |
| | | |
| | | /** |
| | | * 发送实体消息 |
| | | * 充电桩登录认证 |
| | | */ |
| | | @GetMapping("/member") |
| | | public SendResult member() { |
| | | String key = UUID.randomUUID().toString(); |
| | | MemberMessage message = new MemberMessage(); |
| | | public SendResult onlineMessage(JSONObject jsonObject) { |
| | | OnlineMessage message = JSON.parseObject(jsonObject.toJSONString(),OnlineMessage.class); |
| | | // 设置业务key |
| | | message.setKey(key); |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource("MEMBER"); |
| | | // 业务消息内容 |
| | | message.setUserName("Java日知录"); |
| | | message.setBirthday(LocalDate.now()); |
| | | message.setSource(SendTagMenu.ONLINE.getValue()); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.ONLINE.getValue(), message); |
| | | } |
| | | |
| | | return rocketMQEnhanceTemplate.send(topic, tag, message); |
| | | /** |
| | | * 充电桩心跳包 |
| | | */ |
| | | public SendResult pingMessage(JSONObject jsonObject) { |
| | | PingMessage message = JSON.parseObject(jsonObject.toJSONString(),PingMessage.class); |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagMenu.PING.getValue()); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.PING.getValue(), message); |
| | | } |
| | | |
| | | /** |
| | | * 计费模型验证请求 |
| | | */ |
| | | public SendResult billingModeVerifyMessage(JSONObject jsonObject) { |
| | | BillingModeVerifyMessage message = JSON.parseObject(jsonObject.toJSONString(),BillingModeVerifyMessage.class); |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagMenu.BILLING_MODE_VERIFY.getValue()); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.BILLING_MODE_VERIFY.getValue(), message); |
| | | } |
| | | |
| | | /** |
| | | * 充电桩计费模型请求 |
| | | */ |
| | | public SendResult acquisitionBillingModeMessage(JSONObject jsonObject) { |
| | | AcquisitionBillingModeMessage message = JSON.parseObject(jsonObject.toJSONString(),AcquisitionBillingModeMessage.class); |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagMenu.ACQUISITION_BILLING_MODE.getValue()); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.ACQUISITION_BILLING_MODE.getValue(), message); |
| | | } |
| | | |
| | | /** |
| | | * 上传实时监测数据 |
| | | */ |
| | | public SendResult uploadRealTimeMonitoringDataMessage(JSONObject jsonObject) { |
| | | UploadRealTimeMonitoringDataMessage message = JSON.parseObject(jsonObject.toJSONString(),UploadRealTimeMonitoringDataMessage.class); |
| | | // 设置业务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); |
| | | } |
| | | |
| | | /** |
| | | * 充电握手 |
| | | */ |
| | | public SendResult chargingHandshakeMessage(JSONObject jsonObject) { |
| | | ChargingHandshakeMessage message = JSON.parseObject(jsonObject.toJSONString(),ChargingHandshakeMessage.class); |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagMenu.CHARGING_HANDSHAKE.getValue()); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.CHARGING_HANDSHAKE.getValue(), message); |
| | | } |
| | | |
| | | /** |
| | | * 充电阶段BMS中止 |
| | | */ |
| | | public SendResult bmsAbortMessage(JSONObject jsonObject) { |
| | | BmsAbortMessage message = JSON.parseObject(jsonObject.toJSONString(),BmsAbortMessage.class); |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagMenu.BMS_ABORT.getValue()); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.BMS_ABORT.getValue(), message); |
| | | } |
| | | |
| | | /** |
| | | * 充电阶段充电机中止 |
| | | */ |
| | | public SendResult motorAbortMessage(JSONObject jsonObject) { |
| | | MotorAbortMessage message = JSON.parseObject(jsonObject.toJSONString(),MotorAbortMessage.class); |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagMenu.MOTOR_ABORT.getValue()); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.MOTOR_ABORT.getValue(), message); |
| | | } |
| | | |
| | | /** |
| | | * 充电过程BMS需求、充电机输出 |
| | | */ |
| | | public SendResult bmsDemandAndChargerExportationMessage(JSONObject jsonObject) { |
| | | BmsDemandAndChargerExportationMessage message = JSON.parseObject(jsonObject.toJSONString(),BmsDemandAndChargerExportationMessage.class); |
| | | // 设置业务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); |
| | | } |
| | | |
| | | /** |
| | | * 充电过程BMS信息 |
| | | */ |
| | | public SendResult bmsInformationMessage(JSONObject jsonObject) { |
| | | BmsInformationMessage message = JSON.parseObject(jsonObject.toJSONString(),BmsInformationMessage.class); |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagMenu.BMS_INFORMATION.getValue()); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.BMS_INFORMATION.getValue(), message); |
| | | } |
| | | |
| | | /** |
| | | * 充电桩主动申请启动充电 |
| | | */ |
| | | public SendResult chargingPileStartsChargingMessage(JSONObject jsonObject) { |
| | | ChargingPileStartsChargingMessage message = JSON.parseObject(jsonObject.toJSONString(),ChargingPileStartsChargingMessage.class); |
| | | // 设置业务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); |
| | | } |
| | | |
| | | /** |
| | | * 远程启机命令回复 |
| | | */ |
| | | public SendResult platformStartChargingReplyMessage(JSONObject jsonObject) { |
| | | PlatformStartChargingReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),PlatformStartChargingReplyMessage.class); |
| | | // 设置业务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); |
| | | } |
| | | |
| | | /** |
| | | * 远程停机命令回复 |
| | | */ |
| | | public SendResult platformStopChargingReplyMessage(JSONObject jsonObject) { |
| | | PlatformStopChargingReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),PlatformStopChargingReplyMessage.class); |
| | | // 设置业务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); |
| | | } |
| | | |
| | | /** |
| | | * 交易记录 |
| | | */ |
| | | public SendResult transactionRecordMessage(JSONObject jsonObject) { |
| | | TransactionRecordMessage message = JSON.parseObject(jsonObject.toJSONString(),TransactionRecordMessage.class); |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagMenu.TRANSACTION_RECORD.getValue()); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.TRANSACTION_RECORD.getValue(), message); |
| | | } |
| | | |
| | | /** |
| | | * 余额更新应答 |
| | | */ |
| | | public SendResult updateBalanceReplyMessage(JSONObject jsonObject) { |
| | | UpdateBalanceReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),UpdateBalanceReplyMessage.class); |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagMenu.UPDATE_BALANCE_REPLY.getValue()); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.UPDATE_BALANCE_REPLY.getValue(), message); |
| | | } |
| | | |
| | | /** |
| | | * 卡数据同步应答 |
| | | */ |
| | | public SendResult synchronizeOfflineCardReplyMessage(JSONObject jsonObject) { |
| | | SynchronizeOfflineCardReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),SynchronizeOfflineCardReplyMessage.class); |
| | | // 设置业务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); |
| | | } |
| | | |
| | | /** |
| | | * 离线卡数据清除应答 |
| | | */ |
| | | public SendResult clearOfflineCardReplyMessage(JSONObject jsonObject) { |
| | | ClearOfflineCardReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),ClearOfflineCardReplyMessage.class); |
| | | // 设置业务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); |
| | | } |
| | | |
| | | /** |
| | | * 充电桩工作参数设置应答 |
| | | */ |
| | | public SendResult workingParameterSettingReplyMessage(JSONObject jsonObject) { |
| | | WorkingParameterSettingReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),WorkingParameterSettingReplyMessage.class); |
| | | // 设置业务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); |
| | | } |
| | | |
| | | /** |
| | | * 对时设置应答 |
| | | */ |
| | | public SendResult timingSettingReplyMessage(JSONObject jsonObject) { |
| | | TimingSettingReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),TimingSettingReplyMessage.class); |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagMenu.TIMING_SETTING_REPLY.getValue()); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.TIMING_SETTING_REPLY.getValue(), message); |
| | | } |
| | | |
| | | /** |
| | | * 计费模型应答 |
| | | */ |
| | | public SendResult setupBillingModelReplyMessage(JSONObject jsonObject) { |
| | | SetupBillingModelReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),SetupBillingModelReplyMessage.class); |
| | | // 设置业务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); |
| | | } |
| | | |
| | | /** |
| | | * 地锁数据上送(充电桩上送) |
| | | */ |
| | | public SendResult groundLockRealTimeDataMessage(JSONObject jsonObject) { |
| | | GroundLockRealTimeDataMessage message = JSON.parseObject(jsonObject.toJSONString(),GroundLockRealTimeDataMessage.class); |
| | | // 设置业务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); |
| | | } |
| | | |
| | | /** |
| | | * 充电桩返回数据(上行) |
| | | */ |
| | | public SendResult chargingPileReturnsGroundLockDataMessage(JSONObject jsonObject) { |
| | | ChargingPileReturnsGroundLockDataMessage message = JSON.parseObject(jsonObject.toJSONString(),ChargingPileReturnsGroundLockDataMessage.class); |
| | | // 设置业务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); |
| | | } |
| | | |
| | | /** |
| | | * 远程重启应答 |
| | | */ |
| | | public SendResult platformRestartReplyMessage(JSONObject jsonObject) { |
| | | PlatformRestartReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),PlatformRestartReplyMessage.class); |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagMenu.PLATFORM_RESTART_REPLY.getValue()); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagMenu.PLATFORM_RESTART_REPLY.getValue(), message); |
| | | } |
| | | |
| | | /** |
| | | * 远程更新应答 |
| | | */ |
| | | public SendResult platformRemoteUpdateReplyMessage(JSONObject jsonObject) { |
| | | PlatformRemoteUpdateReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),PlatformRemoteUpdateReplyMessage.class); |
| | | // 设置业务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); |
| | | } |
| | | } |