| | |
| | | import com.ruoyi.integration.iotda.utils.tools.MessageUtil; |
| | | import com.ruoyi.integration.iotda.utils.tools.StrategyUtil; |
| | | import com.ruoyi.integration.rocket.model.*; |
| | | import com.ruoyi.integration.rocket.produce.ChargingMessageUtil; |
| | | import com.ruoyi.integration.rocket.produce.EnhanceProduce; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private IotMessageProduce iotMessageProduce; |
| | | @Resource |
| | | private AccountingStrategyDetailClient accountingStrategyDetailClient; |
| | | |
| | | @Resource |
| | | private ChargingMessageUtil chargingMessageUtil; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 设备消息监听 |
| | | * @param jsonObject |
| | |
| | | case SendTagConstant.ONLINE: |
| | | OnlineMessage onlineMessage = JSON.parseObject(content.toJSONString(),OnlineMessage.class); |
| | | chargingMessage.setOnlineMessage(onlineMessage); |
| | | // 响应硬件 |
| | | // 业务处理 登录认证应答 |
| | | OnlineReply onlineReply = new OnlineReply(); |
| | | onlineReply.setCharging_pile_code(onlineMessage.getCharging_pile_code()); |
| | | onlineReply.setOnline_result(0); |
| | | result = iotMessageProduce.sendMessage(onlineReply.getCharging_pile_code(), ServiceIdMenu.ONLINE_REPLY.getKey(), messageUtil.onlineReply(onlineReply)); |
| | | log.info("充电桩登录认证-返回结果:{}",result); |
| | | // 响应硬件 对时设置应答 |
| | | TimingSettingReply timingSettingReplyOnline = new TimingSettingReply(); |
| | | timingSettingReplyOnline.setCharging_pile_code(onlineMessage.getCharging_pile_code()); |
| | | timingSettingReplyOnline.setCurrent_time(CP56Time2aConverter.convertToCP56Time2a(new Date())); |
| | | iotMessageProduce.sendMessage(timingSettingReplyOnline.getCharging_pile_code(), ServiceIdMenu.TIMING_SETTING_REPLY.getKey(),messageUtil.timingSettingReply(timingSettingReplyOnline)); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | // 响应硬件 |
| | | // 业务处理 登录认证应答 |
| | | OnlineReply onlineReply = new OnlineReply(); |
| | | onlineReply.setCharging_pile_code(onlineMessage.getCharging_pile_code()); |
| | | onlineReply.setOnline_result(0); |
| | | String result = iotMessageProduce.sendMessage(onlineReply.getCharging_pile_code(), ServiceIdMenu.ONLINE_REPLY.getKey(), messageUtil.onlineReply(onlineReply)); |
| | | log.info("充电桩登录认证-返回结果:{}",result); |
| | | // 响应硬件 对时设置应答 |
| | | TimingSettingReply timingSettingReplyOnline = new TimingSettingReply(); |
| | | timingSettingReplyOnline.setCharging_pile_code(onlineMessage.getCharging_pile_code()); |
| | | timingSettingReplyOnline.setCurrent_time(CP56Time2aConverter.convertToCP56Time2a(new Date())); |
| | | iotMessageProduce.sendMessage(timingSettingReplyOnline.getCharging_pile_code(), ServiceIdMenu.TIMING_SETTING_REPLY.getKey(),messageUtil.timingSettingReply(timingSettingReplyOnline)); |
| | | } |
| | | }).start(); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.PING: |
| | | PingMessage pingMessage = JSON.parseObject(content.toJSONString(),PingMessage.class); |
| | | chargingMessage.setPingMessage(pingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // 响应硬件 |
| | | Pong pong = new Pong(); |
| | | pong.setCharging_pile_code(pingMessage.getCharging_pile_code()); |
| | | pong.setCharging_gun_code(pingMessage.getCharging_gun_code()); |
| | | pong.setCharging_gun_status(0); |
| | | iotMessageProduce.sendMessage(pong.getCharging_pile_code(), ServiceIdMenu.PONG.getKey(), messageUtil.pong(pong)); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | Pong pong = new Pong(); |
| | | pong.setCharging_pile_code(pingMessage.getCharging_pile_code()); |
| | | pong.setCharging_gun_code(pingMessage.getCharging_gun_code()); |
| | | pong.setCharging_gun_status(0); |
| | | iotMessageProduce.sendMessage(pong.getCharging_pile_code(), ServiceIdMenu.PONG.getKey(), messageUtil.pong(pong)); |
| | | } |
| | | }).start(); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.END_CHARGE: |
| | | EndChargeMessage endChargeMessage = JSON.parseObject(content.toJSONString(),EndChargeMessage.class); |
| | | chargingMessage.setEndChargeMessage(endChargeMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.ERROR_MESSAGE: |
| | | ErrorMessageMessage errorMessageMessage = JSON.parseObject(content.toJSONString(),ErrorMessageMessage.class); |
| | | chargingMessage.setErrorMessageMessage(errorMessageMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.BILLING_MODE_VERIFY: |
| | | BillingModeVerifyMessage billingModeVerifyMessage = JSON.parseObject(content.toJSONString(),BillingModeVerifyMessage.class); |
| | | chargingMessage.setBillingModeVerifyMessage(billingModeVerifyMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // 响应硬件 |
| | | BillingModeVerifyReply billingModeVerifyReply = new BillingModeVerifyReply(); |
| | | if(billingModeVerifyMessage.getBilling_model_code().equals("0")){ |
| | | // 首次 |
| | | billingModeVerifyReply.setCharging_pile_code(billingModeVerifyMessage.getCharging_pile_code()); |
| | | billingModeVerifyReply.setBilling_model_code("0"); |
| | | billingModeVerifyReply.setBilling_model_result(1); |
| | | }else { |
| | | // 查询桩使用的模版 |
| | | CheckChargingStrategyDTO dto = new CheckChargingStrategyDTO(); |
| | | dto.setCode(billingModeVerifyMessage.getCharging_pile_code()); |
| | | dto.setStrategyDetailId(Integer.valueOf(billingModeVerifyMessage.getBilling_model_code())); |
| | | Boolean check = accountingStrategyDetailClient.checkChargingStrategy(dto).getData(); |
| | | // 校验计费模版是否准确 |
| | | billingModeVerifyReply.setCharging_pile_code(billingModeVerifyMessage.getCharging_pile_code()); |
| | | billingModeVerifyReply.setBilling_model_code(billingModeVerifyMessage.getBilling_model_code()); |
| | | if(check){ |
| | | billingModeVerifyReply.setBilling_model_result(0); |
| | | }else { |
| | | billingModeVerifyReply.setBilling_model_result(1); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | BillingModeVerifyReply billingModeVerifyReply = new BillingModeVerifyReply(); |
| | | if(billingModeVerifyMessage.getBilling_model_code().equals("0")){ |
| | | // 首次 |
| | | billingModeVerifyReply.setCharging_pile_code(billingModeVerifyMessage.getCharging_pile_code()); |
| | | billingModeVerifyReply.setBilling_model_code("0"); |
| | | billingModeVerifyReply.setBilling_model_result(1); |
| | | }else { |
| | | // 查询桩使用的模版 |
| | | CheckChargingStrategyDTO dto = new CheckChargingStrategyDTO(); |
| | | dto.setCode(billingModeVerifyMessage.getCharging_pile_code()); |
| | | dto.setStrategyDetailId(Integer.valueOf(billingModeVerifyMessage.getBilling_model_code())); |
| | | Boolean check = accountingStrategyDetailClient.checkChargingStrategy(dto).getData(); |
| | | // 校验计费模版是否准确 |
| | | billingModeVerifyReply.setCharging_pile_code(billingModeVerifyMessage.getCharging_pile_code()); |
| | | billingModeVerifyReply.setBilling_model_code(billingModeVerifyMessage.getBilling_model_code()); |
| | | if(check){ |
| | | billingModeVerifyReply.setBilling_model_result(0); |
| | | }else { |
| | | billingModeVerifyReply.setBilling_model_result(1); |
| | | } |
| | | } |
| | | iotMessageProduce.sendMessage(billingModeVerifyReply.getCharging_pile_code(), ServiceIdMenu.BILLING_MODE_VERIFY_REPLY.getKey(),messageUtil.billingModeVerifyReply(billingModeVerifyReply)); |
| | | } |
| | | } |
| | | iotMessageProduce.sendMessage(billingModeVerifyReply.getCharging_pile_code(), ServiceIdMenu.BILLING_MODE_VERIFY_REPLY.getKey(),messageUtil.billingModeVerifyReply(billingModeVerifyReply)); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | }).start(); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.ACQUISITION_BILLING_MODE: |
| | | AcquisitionBillingModeMessage acquisitionBillingModeMessage = JSON.parseObject(content.toJSONString(),AcquisitionBillingModeMessage.class); |
| | | chargingMessage.setAcquisitionBillingModeMessage(acquisitionBillingModeMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // 响应硬件 计费模型请求应答 1=尖阶段,2=峰阶段,3=平阶段,4=谷阶段 |
| | | List<TAccountingStrategyDetail> accountingStrategyDetails = accountingStrategyDetailClient.getDetailListByCode(acquisitionBillingModeMessage.getCharging_pile_code()).getData(); |
| | | Map<Integer, TAccountingStrategyDetail> strategyPrice = StrategyUtil.getStrategyPrice(accountingStrategyDetails); |
| | | // 价格设置 |
| | | AcquisitionBillingModeReply acquisitionBillingModeReply = new AcquisitionBillingModeReply(); |
| | | StrategyUtil.setStrategyPrice(strategyPrice,acquisitionBillingModeReply); |
| | | // 时段设置 |
| | | StrategyUtil.setTime(accountingStrategyDetails,acquisitionBillingModeReply); |
| | | TAccountingStrategyDetail accountingStrategyDetail = accountingStrategyDetailClient.getDetailByCode(acquisitionBillingModeMessage.getCharging_pile_code()).getData(); |
| | | acquisitionBillingModeReply.setBilling_model_code(accountingStrategyDetail.getId().toString()); |
| | | acquisitionBillingModeReply.setCharging_pile_code(acquisitionBillingModeMessage.getCharging_pile_code()); |
| | | acquisitionBillingModeReply.setLoss_ratio(BigDecimal.ZERO); |
| | | iotMessageProduce.sendMessage(acquisitionBillingModeReply.getCharging_pile_code(), ServiceIdMenu.ACQUISITION_BILLING_MODE_REPLY.getKey(),messageUtil.acquisitionBillingModeReply(acquisitionBillingModeReply)); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | List<TAccountingStrategyDetail> accountingStrategyDetails = accountingStrategyDetailClient.getDetailListByCode(acquisitionBillingModeMessage.getCharging_pile_code()).getData(); |
| | | Map<Integer, TAccountingStrategyDetail> strategyPrice = StrategyUtil.getStrategyPrice(accountingStrategyDetails); |
| | | // 价格设置 |
| | | AcquisitionBillingModeReply acquisitionBillingModeReply = new AcquisitionBillingModeReply(); |
| | | StrategyUtil.setStrategyPrice(strategyPrice,acquisitionBillingModeReply); |
| | | // 时段设置 |
| | | StrategyUtil.setTime(accountingStrategyDetails,acquisitionBillingModeReply); |
| | | TAccountingStrategyDetail accountingStrategyDetail = accountingStrategyDetailClient.getDetailByCode(acquisitionBillingModeMessage.getCharging_pile_code()).getData(); |
| | | acquisitionBillingModeReply.setBilling_model_code(accountingStrategyDetail.getId().toString()); |
| | | acquisitionBillingModeReply.setCharging_pile_code(acquisitionBillingModeMessage.getCharging_pile_code()); |
| | | acquisitionBillingModeReply.setLoss_ratio(BigDecimal.ZERO); |
| | | iotMessageProduce.sendMessage(acquisitionBillingModeReply.getCharging_pile_code(), ServiceIdMenu.ACQUISITION_BILLING_MODE_REPLY.getKey(),messageUtil.acquisitionBillingModeReply(acquisitionBillingModeReply)); |
| | | } |
| | | }).start(); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.UPLOAD_REAL_TIME_MONITORING_DATA: |
| | | log.info("充电实时数据上传"); |
| | | UploadRealTimeMonitoringDataMessage uploadRealTimeMonitoringDataMessage = JSON.parseObject(content.toJSONString(),UploadRealTimeMonitoringDataMessage.class); |
| | | chargingMessage.setUploadRealTimeMonitoringDataMessage(uploadRealTimeMonitoringDataMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.CHARGING_HANDSHAKE: |
| | | ChargingHandshakeMessage chargingHandshakeMessage = JSON.parseObject(content.toJSONString(),ChargingHandshakeMessage.class); |
| | | chargingMessage.setChargingHandshakeMessage(chargingHandshakeMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.PARAMETER_SETTING: |
| | | ParameterSettingMessage parameterSettingMessage = JSON.parseObject(content.toJSONString(),ParameterSettingMessage.class); |
| | | chargingMessage.setParameterSettingMessage(parameterSettingMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.BMS_ABORT: |
| | | BmsAbortMessage bmsAbortMessage = JSON.parseObject(content.toJSONString(),BmsAbortMessage.class); |
| | | chargingMessage.setBmsAbortMessage(bmsAbortMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.MOTOR_ABORT: |
| | | MotorAbortMessage motorAbortMessage = JSON.parseObject(content.toJSONString(),MotorAbortMessage.class); |
| | | chargingMessage.setMotorAbortMessage(motorAbortMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.BMS_DEMAND_AND_CHARGER_EXPORTATION: |
| | | BmsDemandAndChargerExportationMessage bmsDemandAndChargerExportationMessage = JSON.parseObject(content.toJSONString(),BmsDemandAndChargerExportationMessage.class); |
| | | chargingMessage.setBmsDemandAndChargerExportationMessage(bmsDemandAndChargerExportationMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.BMS_INFORMATION: |
| | | BmsInformationMessage bmsInformationMessage = JSON.parseObject(content.toJSONString(),BmsInformationMessage.class); |
| | | chargingMessage.setBmsInformationMessage(bmsInformationMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.CHARGING_PILE_STARTS_CHARGING: |
| | | ChargingPileStartsChargingMessage chargingPileStartsChargingMessage = JSON.parseObject(content.toJSONString(),ChargingPileStartsChargingMessage.class); |
| | | chargingMessage.setChargingPileStartsChargingMessage(chargingPileStartsChargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // 响应硬件 |
| | | PlatformConfirmationCharging platformConfirmationCharging = new PlatformConfirmationCharging(); |
| | | platformConfirmationCharging.setCharging_pile_code(chargingPileStartsChargingMessage.getCharging_pile_code()); |
| | | platformConfirmationCharging.setCharging_gun_code(chargingPileStartsChargingMessage.getCharging_gun_code()); |
| | | platformConfirmationCharging.setCard_number(chargingPileStartsChargingMessage.getAccount()); |
| | | platformConfirmationCharging.setAccount_balance(BigDecimal.ZERO); |
| | | platformConfirmationCharging.setAuthentication(1); |
| | | // TODO 若是失败,给出失败原因 |
| | | iotMessageProduce.sendMessage(platformConfirmationCharging.getCharging_pile_code(), ServiceIdMenu.PLATFORM_CONFIRMATION_CHARGING.getKey(),messageUtil.platformConfirmationCharging(platformConfirmationCharging)); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | PlatformConfirmationCharging platformConfirmationCharging = new PlatformConfirmationCharging(); |
| | | platformConfirmationCharging.setCharging_pile_code(chargingPileStartsChargingMessage.getCharging_pile_code()); |
| | | platformConfirmationCharging.setCharging_gun_code(chargingPileStartsChargingMessage.getCharging_gun_code()); |
| | | platformConfirmationCharging.setCard_number(chargingPileStartsChargingMessage.getAccount()); |
| | | platformConfirmationCharging.setAccount_balance(BigDecimal.ZERO); |
| | | platformConfirmationCharging.setAuthentication(1); |
| | | // TODO 若是失败,给出失败原因 |
| | | iotMessageProduce.sendMessage(platformConfirmationCharging.getCharging_pile_code(), ServiceIdMenu.PLATFORM_CONFIRMATION_CHARGING.getKey(),messageUtil.platformConfirmationCharging(platformConfirmationCharging)); |
| | | } |
| | | }).start(); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.PLATFORM_START_CHARGING_REPLY: |
| | | PlatformStartChargingReplyMessage platformStartChargingReplyMessage = JSON.parseObject(content.toJSONString(),PlatformStartChargingReplyMessage.class); |
| | | chargingMessage.setPlatformStartChargingReplyMessage(platformStartChargingReplyMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.PLATFORM_STOP_CHARGING_REPLY: |
| | | PlatformStopChargingReplyMessage platformStopChargingReplyMessage = JSON.parseObject(content.toJSONString(),PlatformStopChargingReplyMessage.class); |
| | | chargingMessage.setPlatformStopChargingReplyMessage(platformStopChargingReplyMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.TRANSACTION_RECORD: |
| | | TransactionRecordMessage transactionRecordMessage = JSON.parseObject(content.toJSONString(),TransactionRecordMessage.class); |
| | | transactionRecordMessage.setResult(content.toJSONString()); |
| | | chargingMessage.setTransactionRecordMessage(transactionRecordMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // 响应硬件 |
| | | ConfirmTransactionRecord confirmTransactionRecord = new ConfirmTransactionRecord(); |
| | | confirmTransactionRecord.setTransaction_serial_number(transactionRecordMessage.getTransaction_serial_number()); |
| | | confirmTransactionRecord.setConfirm_result(0); |
| | | iotMessageProduce.sendMessage(transactionRecordMessage.getCharging_pile_code(), ServiceIdMenu.CONFIRM_TRANSACTION_RECORD.getKey(),messageUtil.confirmTransactionRecord(confirmTransactionRecord)); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | ConfirmTransactionRecord confirmTransactionRecord = new ConfirmTransactionRecord(); |
| | | confirmTransactionRecord.setTransaction_serial_number(transactionRecordMessage.getTransaction_serial_number()); |
| | | confirmTransactionRecord.setConfirm_result(0); |
| | | iotMessageProduce.sendMessage(transactionRecordMessage.getCharging_pile_code(), ServiceIdMenu.CONFIRM_TRANSACTION_RECORD.getKey(),messageUtil.confirmTransactionRecord(confirmTransactionRecord)); |
| | | } |
| | | }).start(); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.UPDATE_BALANCE_REPLY: |
| | | UpdateBalanceReplyMessage updateBalanceReplyMessage = JSON.parseObject(content.toJSONString(),UpdateBalanceReplyMessage.class); |
| | | chargingMessage.setUpdateBalanceReplyMessage(updateBalanceReplyMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.SYNCHRONIZE_OFFLINE_CARD_REPLY: |
| | | SynchronizeOfflineCardReplyMessage synchronizeOfflineCardReplyMessage = JSON.parseObject(content.toJSONString(),SynchronizeOfflineCardReplyMessage.class); |
| | | chargingMessage.setSynchronizeOfflineCardReplyMessage(synchronizeOfflineCardReplyMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.CLEAR_OFFLINE_CARD_REPLY: |
| | | ClearOfflineCardReplyMessage clearOfflineCardReplyMessage = JSON.parseObject(content.toJSONString(),ClearOfflineCardReplyMessage.class); |
| | | chargingMessage.setClearOfflineCardReplyMessage(clearOfflineCardReplyMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.WORKING_PARAMETER_SETTING_REPLY: |
| | | WorkingParameterSettingReplyMessage workingParameterSettingReplyMessage = JSON.parseObject(content.toJSONString(),WorkingParameterSettingReplyMessage.class); |
| | | chargingMessage.setWorkingParameterSettingReplyMessage(workingParameterSettingReplyMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.TIMING_SETTING: |
| | | TimingSettingMessage timingSettingMessage = JSON.parseObject(content.toJSONString(),TimingSettingMessage.class); |
| | | chargingMessage.setTimingSettingMessage(timingSettingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // 响应硬件 对时设置应答 |
| | | TimingSettingReply timingSettingReply = new TimingSettingReply(); |
| | | timingSettingReply.setCharging_pile_code(timingSettingMessage.getCharging_pile_code()); |
| | | timingSettingReply.setCurrent_time(CP56Time2aConverter.convertToCP56Time2a(new Date())); |
| | | iotMessageProduce.sendMessage(timingSettingReply.getCharging_pile_code(), ServiceIdMenu.TIMING_SETTING_REPLY.getKey(),messageUtil.timingSettingReply(timingSettingReply)); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | TimingSettingReply timingSettingReply = new TimingSettingReply(); |
| | | timingSettingReply.setCharging_pile_code(timingSettingMessage.getCharging_pile_code()); |
| | | timingSettingReply.setCurrent_time(CP56Time2aConverter.convertToCP56Time2a(new Date())); |
| | | iotMessageProduce.sendMessage(timingSettingReply.getCharging_pile_code(), ServiceIdMenu.TIMING_SETTING_REPLY.getKey(),messageUtil.timingSettingReply(timingSettingReply)); |
| | | } |
| | | }).start(); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | break; |
| | | case SendTagConstant.SETUP_BILLING_MODEL_REPLY: |
| | | SetupBillingModelReplyMessage setupBillingModelReplyMessage = JSON.parseObject(content.toJSONString(),SetupBillingModelReplyMessage.class); |
| | | chargingMessage.setSetupBillingModelReplyMessage(setupBillingModelReplyMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.GROUND_LOCK_REAL_TIME_DATA: |
| | | GroundLockRealTimeDataMessage groundLockRealTimeDataMessage = JSON.parseObject(content.toJSONString(),GroundLockRealTimeDataMessage.class); |
| | | chargingMessage.setGroundLockRealTimeDataMessage(groundLockRealTimeDataMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.CHARGING_PILE_RETURNS_GROUND_LOCK_DATA: |
| | | ChargingPileReturnsGroundLockDataMessage chargingPileReturnsGroundLockDataMessage = JSON.parseObject(content.toJSONString(),ChargingPileReturnsGroundLockDataMessage.class); |
| | | chargingMessage.setChargingPileReturnsGroundLockDataMessage(chargingPileReturnsGroundLockDataMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.PLATFORM_RESTART_REPLY: |
| | | PlatformRestartReplyMessage platformRestartReplyMessage = JSON.parseObject(content.toJSONString(),PlatformRestartReplyMessage.class); |
| | | chargingMessage.setPlatformRestartReplyMessage(platformRestartReplyMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.QR_CODE_DELIVERY_REPLY: |
| | | QrCodeDeliveryReplyMessage qrCodeDeliveryReplyMessage = JSON.parseObject(content.toJSONString(),QrCodeDeliveryReplyMessage.class); |
| | | chargingMessage.setQrCodeDeliveryReplyMessage(qrCodeDeliveryReplyMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.SECURITY_DETECTION: |
| | | SecurityDetectionMessage securityDetectionMessage = JSON.parseObject(content.toJSONString(),SecurityDetectionMessage.class); |
| | | chargingMessage.setSecurityDetectionMessage(securityDetectionMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | default: |
| | | PlatformRemoteUpdateReplyMessage platformRemoteUpdateReplyMessage = JSON.parseObject(content.toJSONString(),PlatformRemoteUpdateReplyMessage.class); |
| | | chargingMessage.setPlatformRemoteUpdateReplyMessage(platformRemoteUpdateReplyMessage); |
| | | sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | chargingMessageUtil.handleMessage(chargingMessage); |
| | | // sendResult = enhanceProduce.chargingMessage(chargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | } |
| | | log.info("rocketmq消息下发结果:{}",sendResult); |
| | | // log.info("rocketmq消息下发结果:{}",sendResult); |
| | | return AjaxResult.success(); |
| | | } |
| | | |