Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile
| | |
| | | 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:门打开) |
| | | |
| | | private String createTime; // 格式化时间格式 |
| | | private BigDecimal electrovalence_all;// @ApiModelProperty("时段电价") |
| | | |
| | | private BigDecimal service_charge;//@ApiModelProperty("时段服务费单价") |
New file |
| | |
| | | package com.ruoyi.order.api.model; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("充电时段统计DTO") |
| | | public class ExportUidDto { |
| | | |
| | | @ApiModelProperty("uid") |
| | | private String uid; |
| | | @ApiModelProperty("时间") |
| | | private String time; |
| | | |
| | | } |
| | |
| | | @TableField("refund_code") |
| | | private String refundCode; |
| | | @ApiModelProperty(value = "退款原因") |
| | | @TableField("refund_reason") |
| | | @TableField(exist = false) |
| | | private String refundReason; |
| | | |
| | | @ApiModelProperty(value = "退款金额") |
| | |
| | | public class ChargingOrderListVO { |
| | | @ApiModelProperty(value = "电站名称") |
| | | private String siteName; |
| | | @ApiModelProperty(value = "订单状态") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "电站id") |
| | | private Integer siteId; |
| | | @ApiModelProperty(value = "充电桩id") |
| | |
| | | private Integer pageSize = 10; |
| | | |
| | | public Integer getPageCurr() { |
| | | if(null != pageCurr){ |
| | | pageCurr = (pageCurr - 1) * pageSize; |
| | | } |
| | | return pageCurr; |
| | | } |
| | | |
| | |
| | | case 2: |
| | | throw new ServiceException("账号被冻结,请联系管理员"); |
| | | case 3: |
| | | throw new ServiceException("账号已注销,请重新注册使用"); |
| | | // throw new ServiceException("账号已注销,请重新注册使用"); |
| | | default: |
| | | break; |
| | | } |
| | |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.common.core.utils.WebUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.api.model.ExportUidDto; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TSettlementConfirm; |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "下载-已出账", tags = {"管理后台-充电算账单"}) |
| | | @GetMapping("/downloadBill") |
| | | public R downloadBill(String uid,HttpServletResponse response) |
| | | @PutMapping("/downloadBill") |
| | | public R downloadBill(@RequestBody ExportUidDto uid, HttpServletResponse response) |
| | | { |
| | | ChargingListQuery chargingListQuery = new ChargingListQuery(); |
| | | chargingListQuery.setUid(uid); |
| | | chargingListQuery.setUid(uid.getUid()); |
| | | chargingListQuery.setPageCurr(1); |
| | | chargingListQuery.setPageSize(99999); |
| | | ChargingBillVO data = chargingOrderClient.chargingBillListR(chargingListQuery).getData(); |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "导出", tags = {"管理后台-结算汇总表"}) |
| | | @GetMapping("/downloadSettlementTotal") |
| | | public R downloadSettlementTotal(String time,HttpServletResponse response) |
| | | @PutMapping("/downloadSettlementTotal") |
| | | public R downloadSettlementTotal(@RequestBody ExportUidDto uid,HttpServletResponse response) |
| | | { |
| | | SettlementTotalVO data = chargingOrderClient.settlementTotalR(time).getData(); |
| | | SettlementTotalVO data = chargingOrderClient.settlementTotalR(uid.getTime()).getData(); |
| | | |
| | | |
| | | try { |
| | | response.setCharacterEncoding(Constants.UTF8); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "下载", tags = {"管理后台-结算表记录"}) |
| | | @GetMapping("/downloadSettlement") |
| | | public R downloadSettlement(String uid,HttpServletResponse response) |
| | | @PutMapping("/downloadSettlement") |
| | | public R downloadSettlement(@RequestBody ExportUidDto uid,HttpServletResponse response) |
| | | { |
| | | TSettlementConfirm data = chargingOrderClient.downloadSettlement(uid).getData(); |
| | | TSettlementConfirm data = chargingOrderClient.downloadSettlement(uid.getUid()).getData(); |
| | | List<Site> data1 = siteClient.getSiteByIds(Arrays.asList(data.getSiteId())).getData(); |
| | | if (!data1.isEmpty()){ |
| | | data.setSiteName(data1.get(0).getName()); |
| | |
| | | |
| | | |
| | | @ApiOperation(value = "下载-未出账", tags = {"管理后台-充电算账单"}) |
| | | @GetMapping("/download") |
| | | @PutMapping("/download") |
| | | public R download(String uid,HttpServletResponse response) |
| | | { |
| | | ChargingListQuery chargingListQuery = new ChargingListQuery(); |
| | |
| | | // 查询站点的停车场id |
| | | if(Objects.nonNull(query.getSiteId())){ |
| | | Site site = siteMapper.selectById(query.getSiteId()); |
| | | if (site!=null){ |
| | | List<TParkingLot> tParkingLots = parkingLotMapper.selectList(Wrappers.lambdaQuery(TParkingLot.class) |
| | | .eq(TParkingLot::getSiteId, site.getId())); |
| | | List<Integer> lotIds = tParkingLots.stream().map(TParkingLot::getId).collect(Collectors.toList()); |
| | | query.setLotIds(lotIds); |
| | | } |
| | | |
| | | } |
| | | PageInfo<TParkingRecordVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize()); |
| | | List<TParkingRecordVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | // 查询总数 |
| | | TParkingRecordPageInfoVO infoVO = this.baseMapper.getParkingRecordCount(query); |
| | | if (infoVO==null){ |
| | | infoVO = new TParkingRecordPageInfoVO(); |
| | | infoVO.setTimeoutAmountSum(new BigDecimal("0")); |
| | | infoVO.setOrderCount(0); |
| | | infoVO.setParkingDurationSum(0); |
| | | infoVO.setFeeDurationSum(0); |
| | | } |
| | | infoVO.setParkingRecordVOS(pageInfo); |
| | | return infoVO; |
| | | } |
| | |
| | | </if> |
| | | AND status = 3 |
| | | </where> |
| | | group by create_time |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | |
| | |
| | | package com.ruoyi.integration.iotda.utils.listener; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.chargingPile.api.dto.CheckChargingStrategyDTO; |
| | | import com.ruoyi.chargingPile.api.feignClient.AccountingStrategyDetailClient; |
| | | import com.ruoyi.chargingPile.api.model.TAccountingStrategyDetail; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.integration.api.model.*; |
| | | import com.ruoyi.integration.iotda.constant.SendTagConstant; |
| | | import com.ruoyi.integration.iotda.enums.ServiceIdMenu; |
| | | import com.ruoyi.integration.iotda.utils.produce.IotMessageProduce; |
| | | import com.ruoyi.integration.iotda.utils.tools.CP56Time2aConverter; |
| | | 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.EnhanceProduce; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.client.producer.SendResult; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * iotda消息监听 |
| | |
| | | |
| | | @Autowired |
| | | private EnhanceProduce enhanceProduce; |
| | | |
| | | @Autowired |
| | | private MessageUtil messageUtil; |
| | | @Autowired |
| | | private IotMessageProduce iotMessageProduce; |
| | | @Autowired |
| | | private AccountingStrategyDetailClient accountingStrategyDetailClient; |
| | | /** |
| | | * 设备消息监听 |
| | | * @param jsonObject |
| | |
| | | log.info("服务id:{}",service_id); |
| | | SendResult sendResult; |
| | | // 设备消息下发 |
| | | String result; |
| | | switch (service_id){ |
| | | case SendTagConstant.ONLINE: |
| | | sendResult = enhanceProduce.onlineMessage(content); |
| | | OnlineMessage onlineMessage = JSON.parseObject(jsonObject.toJSONString(),OnlineMessage.class); |
| | | sendResult = enhanceProduce.onlineMessage(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); |
| | | break; |
| | | case SendTagConstant.PING: |
| | | sendResult = enhanceProduce.pingMessage(content); |
| | | PingMessage pingMessage = JSON.parseObject(jsonObject.toJSONString(),PingMessage.class); |
| | | sendResult = enhanceProduce.pingMessage(pingMessage); |
| | | // 响应硬件 |
| | | 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); |
| | | result = iotMessageProduce.sendMessage(pong.getCharging_pile_code(), ServiceIdMenu.PONG.getKey(), messageUtil.pong(pong)); |
| | | log.info("充电桩心跳包-返回结果:{}",result); |
| | | break; |
| | | case SendTagConstant.END_CHARGE: |
| | | sendResult = enhanceProduce.endChargeMessage(content); |
| | | EndChargeMessage endChargeMessage = JSON.parseObject(jsonObject.toJSONString(),EndChargeMessage.class); |
| | | sendResult = enhanceProduce.endChargeMessage(endChargeMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.BILLING_MODE_VERIFY: |
| | | sendResult = enhanceProduce.billingModeVerifyMessage(content); |
| | | BillingModeVerifyMessage billingModeVerifyMessage = JSON.parseObject(jsonObject.toJSONString(),BillingModeVerifyMessage.class); |
| | | sendResult = enhanceProduce.billingModeVerifyMessage(billingModeVerifyMessage); |
| | | // 响应硬件 |
| | | 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.getBilling_model_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)); |
| | | break; |
| | | case SendTagConstant.ACQUISITION_BILLING_MODE: |
| | | sendResult = enhanceProduce.acquisitionBillingModeMessage(content); |
| | | AcquisitionBillingModeMessage acquisitionBillingModeMessage = JSON.parseObject(jsonObject.toJSONString(),AcquisitionBillingModeMessage.class); |
| | | sendResult = enhanceProduce.acquisitionBillingModeMessage(acquisitionBillingModeMessage); |
| | | // 响应硬件 计费模型请求应答 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); |
| | | iotMessageProduce.sendMessage(acquisitionBillingModeReply.getCharging_pile_code(), ServiceIdMenu.ACQUISITION_BILLING_MODE_REPLY.getKey(),messageUtil.acquisitionBillingModeReply(acquisitionBillingModeReply)); |
| | | break; |
| | | case SendTagConstant.UPLOAD_REAL_TIME_MONITORING_DATA: |
| | | sendResult = enhanceProduce.uploadRealTimeMonitoringDataMessage(content); |
| | | UploadRealTimeMonitoringDataMessage uploadRealTimeMonitoringDataMessage = JSON.parseObject(jsonObject.toJSONString(),UploadRealTimeMonitoringDataMessage.class); |
| | | sendResult = enhanceProduce.uploadRealTimeMonitoringDataMessage(uploadRealTimeMonitoringDataMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.CHARGING_HANDSHAKE: |
| | | sendResult = enhanceProduce.chargingHandshakeMessage(content); |
| | | ChargingHandshakeMessage chargingHandshakeMessage = JSON.parseObject(jsonObject.toJSONString(),ChargingHandshakeMessage.class); |
| | | sendResult = enhanceProduce.chargingHandshakeMessage(chargingHandshakeMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.BMS_ABORT: |
| | | sendResult = enhanceProduce.bmsAbortMessage(content); |
| | | BmsAbortMessage bmsAbortMessage = JSON.parseObject(jsonObject.toJSONString(),BmsAbortMessage.class); |
| | | sendResult = enhanceProduce.bmsAbortMessage(bmsAbortMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.MOTOR_ABORT: |
| | | sendResult = enhanceProduce.motorAbortMessage(content); |
| | | MotorAbortMessage motorAbortMessage = JSON.parseObject(jsonObject.toJSONString(),MotorAbortMessage.class); |
| | | sendResult = enhanceProduce.motorAbortMessage(motorAbortMessage); |
| | | break; |
| | | case SendTagConstant.BMS_DEMAND_AND_CHARGER_EXPORTATION: |
| | | sendResult = enhanceProduce.bmsDemandAndChargerExportationMessage(content); |
| | | BmsDemandAndChargerExportationMessage bmsDemandAndChargerExportationMessage = JSON.parseObject(jsonObject.toJSONString(),BmsDemandAndChargerExportationMessage.class); |
| | | sendResult = enhanceProduce.bmsDemandAndChargerExportationMessage(bmsDemandAndChargerExportationMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.BMS_INFORMATION: |
| | | sendResult = enhanceProduce.bmsInformationMessage(content); |
| | | BmsInformationMessage bmsInformationMessage = JSON.parseObject(jsonObject.toJSONString(),BmsInformationMessage.class); |
| | | sendResult = enhanceProduce.bmsInformationMessage(bmsInformationMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.CHARGING_PILE_STARTS_CHARGING: |
| | | sendResult = enhanceProduce.chargingPileStartsChargingMessage(content); |
| | | ChargingPileStartsChargingMessage chargingPileStartsChargingMessage = JSON.parseObject(jsonObject.toJSONString(),ChargingPileStartsChargingMessage.class); |
| | | sendResult = enhanceProduce.chargingPileStartsChargingMessage(chargingPileStartsChargingMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.PLATFORM_START_CHARGING_REPLY: |
| | | sendResult = enhanceProduce.platformStartChargingReplyMessage(content); |
| | | PlatformStartChargingReplyMessage platformStartChargingReplyMessage = JSON.parseObject(jsonObject.toJSONString(),PlatformStartChargingReplyMessage.class); |
| | | sendResult = enhanceProduce.platformStartChargingReplyMessage(platformStartChargingReplyMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.PLATFORM_STOP_CHARGING_REPLY: |
| | | sendResult = enhanceProduce.platformStopChargingReplyMessage(content); |
| | | PlatformStopChargingReplyMessage platformStopChargingReplyMessage = JSON.parseObject(jsonObject.toJSONString(),PlatformStopChargingReplyMessage.class); |
| | | sendResult = enhanceProduce.platformStopChargingReplyMessage(platformStopChargingReplyMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.TRANSACTION_RECORD: |
| | | sendResult = enhanceProduce.transactionRecordMessage(content); |
| | | TransactionRecordMessage transactionRecordMessage = JSON.parseObject(jsonObject.toJSONString(),TransactionRecordMessage.class); |
| | | sendResult = enhanceProduce.transactionRecordMessage(transactionRecordMessage); |
| | | // 响应硬件 |
| | | ConfirmTransactionRecord confirmTransactionRecord = new ConfirmTransactionRecord(); |
| | | confirmTransactionRecord.setTransaction_serial_number(transactionRecordMessage.getTransaction_serial_number()); |
| | | confirmTransactionRecord.setConfirm_result(0); |
| | | iotMessageProduce.sendMessage(confirmTransactionRecord.getTransaction_serial_number(), ServiceIdMenu.CONFIRM_TRANSACTION_RECORD.getKey(),messageUtil.confirmTransactionRecord(confirmTransactionRecord)); |
| | | break; |
| | | case SendTagConstant.UPDATE_BALANCE_REPLY: |
| | | sendResult = enhanceProduce.updateBalanceReplyMessage(content); |
| | | UpdateBalanceReplyMessage updateBalanceReplyMessage = JSON.parseObject(jsonObject.toJSONString(),UpdateBalanceReplyMessage.class); |
| | | sendResult = enhanceProduce.updateBalanceReplyMessage(updateBalanceReplyMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.SYNCHRONIZE_OFFLINE_CARD_REPLY: |
| | | sendResult = enhanceProduce.synchronizeOfflineCardReplyMessage(content); |
| | | SynchronizeOfflineCardReplyMessage synchronizeOfflineCardReplyMessage = JSON.parseObject(jsonObject.toJSONString(),SynchronizeOfflineCardReplyMessage.class); |
| | | sendResult = enhanceProduce.synchronizeOfflineCardReplyMessage(synchronizeOfflineCardReplyMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.CLEAR_OFFLINE_CARD_REPLY: |
| | | sendResult = enhanceProduce.clearOfflineCardReplyMessage(content); |
| | | ClearOfflineCardReplyMessage clearOfflineCardReplyMessage = JSON.parseObject(jsonObject.toJSONString(),ClearOfflineCardReplyMessage.class); |
| | | sendResult = enhanceProduce.clearOfflineCardReplyMessage(clearOfflineCardReplyMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.WORKING_PARAMETER_SETTING_REPLY: |
| | | sendResult = enhanceProduce.workingParameterSettingReplyMessage(content); |
| | | WorkingParameterSettingReplyMessage workingParameterSettingReplyMessage = JSON.parseObject(jsonObject.toJSONString(),WorkingParameterSettingReplyMessage.class); |
| | | sendResult = enhanceProduce.workingParameterSettingReplyMessage(workingParameterSettingReplyMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.TIMING_SETTING: |
| | | sendResult = enhanceProduce.timingSettingMessage(content); |
| | | TimingSettingMessage timingSettingMessage = JSON.parseObject(jsonObject.toJSONString(),TimingSettingMessage.class); |
| | | sendResult = enhanceProduce.timingSettingMessage(timingSettingMessage); |
| | | // 响应硬件 对时设置应答 |
| | | 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)); |
| | | break; |
| | | case SendTagConstant.SETUP_BILLING_MODEL_REPLY: |
| | | sendResult = enhanceProduce.setupBillingModelReplyMessage(content); |
| | | SetupBillingModelReplyMessage setupBillingModelReplyMessage = JSON.parseObject(jsonObject.toJSONString(),SetupBillingModelReplyMessage.class); |
| | | sendResult = enhanceProduce.setupBillingModelReplyMessage(setupBillingModelReplyMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.GROUND_LOCK_REAL_TIME_DATA: |
| | | sendResult = enhanceProduce.groundLockRealTimeDataMessage(content); |
| | | GroundLockRealTimeDataMessage groundLockRealTimeDataMessage = JSON.parseObject(jsonObject.toJSONString(),GroundLockRealTimeDataMessage.class); |
| | | sendResult = enhanceProduce.groundLockRealTimeDataMessage(groundLockRealTimeDataMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.CHARGING_PILE_RETURNS_GROUND_LOCK_DATA: |
| | | sendResult = enhanceProduce.chargingPileReturnsGroundLockDataMessage(content); |
| | | ChargingPileReturnsGroundLockDataMessage chargingPileReturnsGroundLockDataMessage = JSON.parseObject(jsonObject.toJSONString(),ChargingPileReturnsGroundLockDataMessage.class); |
| | | sendResult = enhanceProduce.chargingPileReturnsGroundLockDataMessage(chargingPileReturnsGroundLockDataMessage); |
| | | // 响应硬件 |
| | | break; |
| | | case SendTagConstant.PLATFORM_RESTART_REPLY: |
| | | sendResult = enhanceProduce.platformRestartReplyMessage(content); |
| | | PlatformRestartReplyMessage platformRestartReplyMessage = JSON.parseObject(jsonObject.toJSONString(),PlatformRestartReplyMessage.class); |
| | | sendResult = enhanceProduce.platformRestartReplyMessage(platformRestartReplyMessage); |
| | | // 响应硬件 |
| | | break; |
| | | default: |
| | | sendResult = enhanceProduce.platformRemoteUpdateReplyMessage(content); |
| | | PlatformRemoteUpdateReplyMessage platformRemoteUpdateReplyMessage = JSON.parseObject(jsonObject.toJSONString(),PlatformRemoteUpdateReplyMessage.class); |
| | | sendResult = enhanceProduce.platformRemoteUpdateReplyMessage(platformRemoteUpdateReplyMessage); |
| | | // 响应硬件 |
| | | break; |
| | | } |
| | | log.info("rocketmq消息下发结果:{}",sendResult); |
| | |
| | | |
| | | /** |
| | | * 解决RocketMQ Jackson不支持Java时间类型配置 |
| | | * 源码参考:{@link org.apache.rocketmq.spring.autoconfigure.MessageConverterConfiguration} |
| | | * 源码参考:{@link org.apache.rocketmq.spring.autoconfigure} |
| | | */ |
| | | @Bean |
| | | @Primary |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_acquisition_billing_mode", |
| | | topic = "charge_acquisition_billing_mode", |
| | | selectorExpression = "acquisition_billing_mode", // 明确指定标签 |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class AcquisitionBillingModeMessageListener extends EnhanceMessageHandler<AcquisitionBillingModeMessage> implements RocketMQListener<AcquisitionBillingModeMessage> { |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_billing_mode_verify", |
| | | topic = "charge_billing_mode_verify", |
| | | selectorExpression = "billing_mode_verify", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class BillingModeVerifyMessageListener extends EnhanceMessageHandler<BillingModeVerifyMessage> implements RocketMQListener<BillingModeVerifyMessage> { |
| | | |
| | | @Autowired |
| | | private BillingModeVerifyService billingModeVerifyService; |
| | | @Autowired |
| | | private IotMessageProduce iotMessageProduce; |
| | | @Autowired |
| | | private MessageUtil messageUtil; |
| | | @Autowired |
| | | private AccountingStrategyDetailClient accountingStrategyDetailClient; |
| | | |
| | | @Override |
| | | protected void handleMessage(BillingModeVerifyMessage message) throws Exception { |
| | |
| | | BeanUtils.copyProperties(message,billingModeVerify); |
| | | billingModeVerifyService.create(billingModeVerify); |
| | | // 业务处理 |
| | | BillingModeVerifyReply billingModeVerifyReply = new BillingModeVerifyReply(); |
| | | if(message.getBilling_model_code().equals("0")){ |
| | | // 首次 |
| | | billingModeVerifyReply.setCharging_pile_code(billingModeVerify.getCharging_pile_code()); |
| | | billingModeVerifyReply.setBilling_model_code("0"); |
| | | billingModeVerifyReply.setBilling_model_result(1); |
| | | }else { |
| | | // 查询桩使用的模版 |
| | | CheckChargingStrategyDTO dto = new CheckChargingStrategyDTO(); |
| | | dto.setCode(message.getBilling_model_code()); |
| | | dto.setStrategyDetailId(Integer.valueOf(message.getBilling_model_code())); |
| | | Boolean check = accountingStrategyDetailClient.checkChargingStrategy(dto).getData(); |
| | | // 校验计费模版是否准确 |
| | | billingModeVerifyReply.setCharging_pile_code(billingModeVerify.getCharging_pile_code()); |
| | | billingModeVerifyReply.setBilling_model_code(message.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)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_bms_abort", |
| | | topic = "charge_bms_abort", |
| | | selectorExpression = "bms_abort", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class BmsAbortMessageListener extends EnhanceMessageHandler<BmsAbortMessage> implements RocketMQListener<BmsAbortMessage> { |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_bms_demand_and_charger_exportation", |
| | | topic = "charge_bms_demand_and_charger_exportation", |
| | | selectorExpression = "bms_demand_and_charger_exportation", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class BmsDemandAndChargerExportationMessageListener extends EnhanceMessageHandler<BmsDemandAndChargerExportationMessage> implements RocketMQListener<BmsDemandAndChargerExportationMessage> { |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_bms_information", |
| | | topic = "charge_bms_information", |
| | | selectorExpression = "bms_information", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class BmsInformationMessageListener extends EnhanceMessageHandler<BmsInformationMessage> implements RocketMQListener<BmsInformationMessage> { |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_charging_handshake", |
| | | topic = "charge_charging_handshake", |
| | | selectorExpression = "charging_handshake", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class ChargingHandshakeMessageListener extends EnhanceMessageHandler<ChargingHandshakeMessage> implements RocketMQListener<ChargingHandshakeMessage> { |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_charging_pile_returns_ground_lock_data", |
| | | topic = "charge_charging_pile_returns_ground_lock_data", |
| | | selectorExpression = "charging_pile_returns_ground_lock_data", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class ChargingPileReturnsGroundLockDataMessageListener extends EnhanceMessageHandler<ChargingPileReturnsGroundLockDataMessage> implements RocketMQListener<ChargingPileReturnsGroundLockDataMessage> { |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_charging_pile_starts_charging", |
| | | topic = "charge_charging_pile_starts_charging", |
| | | selectorExpression = "charging_pile_starts_charging", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class ChargingPileStartsChargingMessageListener extends EnhanceMessageHandler<ChargingPileStartsChargingMessage> implements RocketMQListener<ChargingPileStartsChargingMessage> { |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_clear_offline_card_reply", |
| | | topic = "charge_clear_offline_card_reply", |
| | | selectorExpression = "clear_offline_card_reply", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class ClearOfflineCardReplyMessageListener extends EnhanceMessageHandler<ClearOfflineCardReplyMessage> implements RocketMQListener<ClearOfflineCardReplyMessage> { |
| | |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_end_charge", |
| | | topic = "charge_end_charge", |
| | | selectorExpression = "end_charge", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class EndChargeMessageListener extends EnhanceMessageHandler<EndChargeMessage> implements RocketMQListener<EndChargeMessage> { |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_ground_lock_real_time_data", |
| | | topic = "charge_ground_lock_real_time_data", |
| | | selectorExpression = "ground_lock_real_time_data", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class GroundLockRealTimeDataMessageListener extends EnhanceMessageHandler<GroundLockRealTimeDataMessage> implements RocketMQListener<GroundLockRealTimeDataMessage> { |
| | |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_motor_abort", |
| | | topic = "charge_motor_abort", |
| | | selectorExpression = "motor_abort", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class MotorAbortMessageListener extends EnhanceMessageHandler<MotorAbortMessage> implements RocketMQListener<MotorAbortMessage> { |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_online", |
| | | topic = "charge_online", |
| | | selectorExpression = "online", // 明确指定标签 |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class OnlineMessageListener extends EnhanceMessageHandler<OnlineMessage> implements RocketMQListener<OnlineMessage> { |
| | | |
| | | @Autowired |
| | | private OnlineService onlineService; |
| | | @Autowired |
| | | private MessageUtil messageUtil; |
| | | @Autowired |
| | | private IotMessageProduce iotMessageProduce; |
| | | |
| | | @Override |
| | | protected void handleMessage(OnlineMessage message) throws Exception { |
| | |
| | | Online online = new Online(); |
| | | BeanUtils.copyProperties(message,online); |
| | | onlineService.create(online); |
| | | // 业务处理 登录认证应答 |
| | | OnlineReply onlineReply = new OnlineReply(); |
| | | onlineReply.setCharging_pile_code(message.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); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_ping", |
| | | topic = "charge_ping", |
| | | selectorExpression = "ping", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class PingMessageListener extends EnhanceMessageHandler<PingMessage> implements RocketMQListener<PingMessage> { |
| | | |
| | | @Autowired |
| | | private PingService pingService; |
| | | @Autowired |
| | | private MessageUtil messageUtil; |
| | | @Autowired |
| | | private IotMessageProduce iotMessageProduce; |
| | | @Override |
| | | protected void handleMessage(PingMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | |
| | | BeanUtils.copyProperties(message,ping); |
| | | pingService.create(ping); |
| | | // 业务处理 |
| | | Pong pong = new Pong(); |
| | | pong.setCharging_pile_code(message.getCharging_pile_code()); |
| | | pong.setCharging_gun_code(message.getCharging_gun_code()); |
| | | pong.setCharging_gun_status(0); |
| | | String result = iotMessageProduce.sendMessage(pong.getCharging_pile_code(), ServiceIdMenu.PONG.getKey(), messageUtil.pong(pong)); |
| | | log.info("充电桩心跳包-返回结果:{}",result); |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_platform_remote_update_reply", |
| | | topic = "charge_platform_remote_update_reply", |
| | | selectorExpression = "platform_remote_update_reply", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class PlatformRemoteUpdateReplyMessageListener extends EnhanceMessageHandler<PlatformRemoteUpdateReplyMessage> implements RocketMQListener<PlatformRemoteUpdateReplyMessage> { |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_platform_restart_reply", |
| | | topic = "charge_platform_restart_reply", |
| | | selectorExpression = "platform_restart_reply", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class PlatformRestartReplyMessageListener extends EnhanceMessageHandler<PlatformRestartReplyMessage> implements RocketMQListener<PlatformRestartReplyMessage> { |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_platform_start_charging_reply", |
| | | topic = "charge_platform_start_charging_reply", |
| | | selectorExpression = "platform_start_charging_reply", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class PlatformStartChargingReplyMessageListener extends EnhanceMessageHandler<PlatformStartChargingReplyMessage> implements RocketMQListener<PlatformStartChargingReplyMessage> { |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_platform_stop_charging_reply", |
| | | topic = "charge_platform_stop_charging_reply", |
| | | selectorExpression = "platform_stop_charging_reply", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class PlatformStopChargingReplyMessageListener extends EnhanceMessageHandler<PlatformStopChargingReplyMessage> implements RocketMQListener<PlatformStopChargingReplyMessage> { |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_setup_billing_model_reply", |
| | | topic = "charge_setup_billing_model_reply", |
| | | selectorExpression = "setup_billing_model_reply", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class SetupBillingModelReplyMessageListener extends EnhanceMessageHandler<SetupBillingModelReplyMessage> implements RocketMQListener<SetupBillingModelReplyMessage> { |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_synchronize_offline_card_reply", |
| | | topic = "charge_synchronize_offline_card_reply", |
| | | selectorExpression = "synchronize_offline_card_reply", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class SynchronizeOfflineCardReplyMessageListener extends EnhanceMessageHandler<SynchronizeOfflineCardReplyMessage> implements RocketMQListener<SynchronizeOfflineCardReplyMessage> { |
| | |
| | | import com.ruoyi.integration.rocket.model.TimingSettingMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_timing_setting", |
| | | topic = "charge_timing_setting", |
| | | selectorExpression = "timing_setting", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class TimingSettingMessageListener extends EnhanceMessageHandler<TimingSettingMessage> implements RocketMQListener<TimingSettingMessage> { |
| | |
| | | TimingSetting timingSetting = new TimingSetting(); |
| | | BeanUtils.copyProperties(message,timingSetting); |
| | | timingSettingService.create(timingSetting); |
| | | // 业务处理 对时设置应答 |
| | | TimingSettingReply timingSettingReply = new TimingSettingReply(); |
| | | timingSettingReply.setCharging_pile_code(message.getCharging_pile_code()); |
| | | timingSettingReply.setCurrent_time(CP56Time2aConverter.convertToCP56Time2a(new Date())); |
| | | iotMessageProduce.sendMessage(timingSettingReply.getCharging_pile_code(), ServiceIdMenu.TIMING_SETTING_REPLY.getKey(),messageUtil.timingSettingReply(timingSettingReply)); |
| | | // 业务处理 |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_transaction_record", |
| | | topic = "charge_transaction_record", |
| | | selectorExpression = "transaction_record", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class TransactionRecordMessageListener extends EnhanceMessageHandler<TransactionRecordMessage> implements RocketMQListener<TransactionRecordMessage> { |
| | |
| | | BeanUtils.copyProperties(message,transactionRecord); |
| | | transactionRecordService.create(transactionRecord); |
| | | // 业务处理 |
| | | ConfirmTransactionRecord confirmTransactionRecord = new ConfirmTransactionRecord(); |
| | | confirmTransactionRecord.setTransaction_serial_number(message.getTransaction_serial_number()); |
| | | confirmTransactionRecord.setConfirm_result(0); |
| | | iotMessageProduce.sendMessage(confirmTransactionRecord.getTransaction_serial_number(), ServiceIdMenu.CONFIRM_TRANSACTION_RECORD.getKey(),messageUtil.confirmTransactionRecord(confirmTransactionRecord)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_update_balance_reply", |
| | | topic = "charge_update_balance_reply", |
| | | selectorExpression = "update_balance_reply", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class UpdateBalanceReplyMessageListener extends EnhanceMessageHandler<UpdateBalanceReplyMessage> implements RocketMQListener<UpdateBalanceReplyMessage> { |
| | |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.query.UploadRealTimeMonitoringDataQuery; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_upload_real_time_monitoring_data", |
| | | topic = "charge_upload_real_time_monitoring_data", |
| | | selectorExpression = "upload_real_time_monitoring_data", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class UploadRealTimeMonitoringDataMessageListener extends EnhanceMessageHandler<UploadRealTimeMonitoringDataMessage> implements RocketMQListener<UploadRealTimeMonitoringDataMessage> { |
| | |
| | | BeanUtils.copyProperties(uploadRealTimeMonitoringData, query); |
| | | chargingOrderClient.chargeMonitoring(query); |
| | | |
| | | // 存储状态信息 |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | | import org.apache.rocketmq.spring.core.RocketMQListener; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | @Slf4j |
| | | @Component |
| | | @RocketMQMessageListener( |
| | | consumerGroup = "enhance_consumer_group", |
| | | topic = "rocket_enhance", |
| | | selectorExpression = "*", |
| | | messageModel = MessageModel.CLUSTERING, |
| | | consumerGroup = "charge_working_parameter_setting_reply", |
| | | topic = "charge_working_parameter_setting_reply", |
| | | selectorExpression = "working_parameter_setting_reply", |
| | | consumeThreadMax = 5 //默认是64个线程并发消息,配置 consumeThreadMax 参数指定并发消费线程数,避免太大导致资源不够 |
| | | ) |
| | | public class WorkingParameterSettingReplyMessageListener extends EnhanceMessageHandler<WorkingParameterSettingReplyMessage> implements RocketMQListener<WorkingParameterSettingReplyMessage> { |
| | |
| | | import org.apache.rocketmq.client.producer.SendResult; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.UUID; |
| | | |
| | |
| | | @Setter(onMethod_ = @Autowired) |
| | | private RocketMQEnhanceTemplate rocketMQEnhanceTemplate; |
| | | |
| | | private static final String TOPIC = "rocket_enhance"; |
| | | private static final String TOPIC = "charge_"; |
| | | |
| | | /** |
| | | * 充电桩登录认证 |
| | | */ |
| | | public SendResult onlineMessage(JSONObject jsonObject) { |
| | | OnlineMessage message = JSON.parseObject(jsonObject.toJSONString(),OnlineMessage.class); |
| | | public SendResult onlineMessage(OnlineMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.ONLINE); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.ONLINE, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.ONLINE, SendTagConstant.ONLINE, message); |
| | | } |
| | | |
| | | /** |
| | | * 充电桩心跳包 |
| | | */ |
| | | public SendResult pingMessage(JSONObject jsonObject) { |
| | | PingMessage message = JSON.parseObject(jsonObject.toJSONString(),PingMessage.class); |
| | | public SendResult pingMessage(PingMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.PING); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.PING, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.PING, SendTagConstant.PING, message); |
| | | } |
| | | /** |
| | | * 充电结束 |
| | | */ |
| | | public SendResult endChargeMessage(JSONObject jsonObject) { |
| | | PingMessage message = JSON.parseObject(jsonObject.toJSONString(),PingMessage.class); |
| | | public SendResult endChargeMessage(EndChargeMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.END_CHARGE); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.END_CHARGE, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.END_CHARGE, SendTagConstant.END_CHARGE, message); |
| | | } |
| | | |
| | | /** |
| | | * 计费模型验证请求 |
| | | */ |
| | | public SendResult billingModeVerifyMessage(JSONObject jsonObject) { |
| | | BillingModeVerifyMessage message = JSON.parseObject(jsonObject.toJSONString(),BillingModeVerifyMessage.class); |
| | | public SendResult billingModeVerifyMessage(BillingModeVerifyMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.BILLING_MODE_VERIFY); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.BILLING_MODE_VERIFY, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.BILLING_MODE_VERIFY, SendTagConstant.BILLING_MODE_VERIFY, message); |
| | | } |
| | | |
| | | /** |
| | | * 充电桩计费模型请求 |
| | | */ |
| | | public SendResult acquisitionBillingModeMessage(JSONObject jsonObject) { |
| | | AcquisitionBillingModeMessage message = JSON.parseObject(jsonObject.toJSONString(),AcquisitionBillingModeMessage.class); |
| | | public SendResult acquisitionBillingModeMessage(AcquisitionBillingModeMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.ACQUISITION_BILLING_MODE); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.ACQUISITION_BILLING_MODE, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.ACQUISITION_BILLING_MODE, SendTagConstant.ACQUISITION_BILLING_MODE, message); |
| | | } |
| | | |
| | | /** |
| | | * 上传实时监测数据 |
| | | */ |
| | | public SendResult uploadRealTimeMonitoringDataMessage(JSONObject jsonObject) { |
| | | UploadRealTimeMonitoringDataMessage message = JSON.parseObject(jsonObject.toJSONString(),UploadRealTimeMonitoringDataMessage.class); |
| | | public SendResult uploadRealTimeMonitoringDataMessage(UploadRealTimeMonitoringDataMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.UPLOAD_REAL_TIME_MONITORING_DATA); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.UPLOAD_REAL_TIME_MONITORING_DATA, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.UPLOAD_REAL_TIME_MONITORING_DATA, SendTagConstant.UPLOAD_REAL_TIME_MONITORING_DATA, message); |
| | | } |
| | | |
| | | /** |
| | | * 充电握手 |
| | | */ |
| | | public SendResult chargingHandshakeMessage(JSONObject jsonObject) { |
| | | ChargingHandshakeMessage message = JSON.parseObject(jsonObject.toJSONString(),ChargingHandshakeMessage.class); |
| | | public SendResult chargingHandshakeMessage(ChargingHandshakeMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.CHARGING_HANDSHAKE); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.CHARGING_HANDSHAKE, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.CHARGING_HANDSHAKE, SendTagConstant.CHARGING_HANDSHAKE, message); |
| | | } |
| | | |
| | | /** |
| | | * 充电阶段BMS中止 |
| | | */ |
| | | public SendResult bmsAbortMessage(JSONObject jsonObject) { |
| | | BmsAbortMessage message = JSON.parseObject(jsonObject.toJSONString(),BmsAbortMessage.class); |
| | | public SendResult bmsAbortMessage(BmsAbortMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.BMS_ABORT); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.BMS_ABORT, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.BMS_ABORT, SendTagConstant.BMS_ABORT, message); |
| | | } |
| | | |
| | | /** |
| | | * 充电阶段充电机中止 |
| | | */ |
| | | public SendResult motorAbortMessage(JSONObject jsonObject) { |
| | | MotorAbortMessage message = JSON.parseObject(jsonObject.toJSONString(),MotorAbortMessage.class); |
| | | public SendResult motorAbortMessage(MotorAbortMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.MOTOR_ABORT); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.MOTOR_ABORT, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.MOTOR_ABORT, SendTagConstant.MOTOR_ABORT, message); |
| | | } |
| | | |
| | | /** |
| | | * 充电过程BMS需求、充电机输出 |
| | | */ |
| | | public SendResult bmsDemandAndChargerExportationMessage(JSONObject jsonObject) { |
| | | BmsDemandAndChargerExportationMessage message = JSON.parseObject(jsonObject.toJSONString(),BmsDemandAndChargerExportationMessage.class); |
| | | public SendResult bmsDemandAndChargerExportationMessage(BmsDemandAndChargerExportationMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.BMS_DEMAND_AND_CHARGER_EXPORTATION); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.BMS_DEMAND_AND_CHARGER_EXPORTATION, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.BMS_DEMAND_AND_CHARGER_EXPORTATION, SendTagConstant.BMS_DEMAND_AND_CHARGER_EXPORTATION, message); |
| | | } |
| | | |
| | | /** |
| | | * 充电过程BMS信息 |
| | | */ |
| | | public SendResult bmsInformationMessage(JSONObject jsonObject) { |
| | | BmsInformationMessage message = JSON.parseObject(jsonObject.toJSONString(),BmsInformationMessage.class); |
| | | public SendResult bmsInformationMessage(BmsInformationMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.BMS_INFORMATION); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.BMS_INFORMATION, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.BMS_INFORMATION, SendTagConstant.BMS_INFORMATION, message); |
| | | } |
| | | |
| | | /** |
| | | * 充电桩主动申请启动充电 |
| | | */ |
| | | public SendResult chargingPileStartsChargingMessage(JSONObject jsonObject) { |
| | | ChargingPileStartsChargingMessage message = JSON.parseObject(jsonObject.toJSONString(),ChargingPileStartsChargingMessage.class); |
| | | public SendResult chargingPileStartsChargingMessage(ChargingPileStartsChargingMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.CHARGING_PILE_STARTS_CHARGING); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.CHARGING_PILE_STARTS_CHARGING, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.CHARGING_PILE_STARTS_CHARGING, SendTagConstant.CHARGING_PILE_STARTS_CHARGING, message); |
| | | } |
| | | |
| | | /** |
| | | * 远程启机命令回复 |
| | | */ |
| | | public SendResult platformStartChargingReplyMessage(JSONObject jsonObject) { |
| | | PlatformStartChargingReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),PlatformStartChargingReplyMessage.class); |
| | | public SendResult platformStartChargingReplyMessage(PlatformStartChargingReplyMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.PLATFORM_START_CHARGING_REPLY); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.PLATFORM_START_CHARGING_REPLY, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.PLATFORM_START_CHARGING_REPLY, SendTagConstant.PLATFORM_START_CHARGING_REPLY, message); |
| | | } |
| | | |
| | | /** |
| | | * 远程停机命令回复 |
| | | */ |
| | | public SendResult platformStopChargingReplyMessage(JSONObject jsonObject) { |
| | | PlatformStopChargingReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),PlatformStopChargingReplyMessage.class); |
| | | public SendResult platformStopChargingReplyMessage(PlatformStopChargingReplyMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.PLATFORM_STOP_CHARGING_REPLY); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.PLATFORM_STOP_CHARGING_REPLY, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.PLATFORM_STOP_CHARGING_REPLY, SendTagConstant.PLATFORM_STOP_CHARGING_REPLY, message); |
| | | } |
| | | |
| | | /** |
| | | * 交易记录 |
| | | */ |
| | | public SendResult transactionRecordMessage(JSONObject jsonObject) { |
| | | TransactionRecordMessage message = JSON.parseObject(jsonObject.toJSONString(),TransactionRecordMessage.class); |
| | | public SendResult transactionRecordMessage(TransactionRecordMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.TRANSACTION_RECORD); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.TRANSACTION_RECORD, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.TRANSACTION_RECORD, SendTagConstant.TRANSACTION_RECORD, message); |
| | | } |
| | | |
| | | /** |
| | | * 余额更新应答 |
| | | */ |
| | | public SendResult updateBalanceReplyMessage(JSONObject jsonObject) { |
| | | UpdateBalanceReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),UpdateBalanceReplyMessage.class); |
| | | public SendResult updateBalanceReplyMessage(UpdateBalanceReplyMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.UPDATE_BALANCE_REPLY); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.UPDATE_BALANCE_REPLY, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.UPDATE_BALANCE_REPLY, SendTagConstant.UPDATE_BALANCE_REPLY, message); |
| | | } |
| | | |
| | | /** |
| | | * 卡数据同步应答 |
| | | */ |
| | | public SendResult synchronizeOfflineCardReplyMessage(JSONObject jsonObject) { |
| | | SynchronizeOfflineCardReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),SynchronizeOfflineCardReplyMessage.class); |
| | | public SendResult synchronizeOfflineCardReplyMessage(SynchronizeOfflineCardReplyMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.SYNCHRONIZE_OFFLINE_CARD_REPLY); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.SYNCHRONIZE_OFFLINE_CARD_REPLY, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.SYNCHRONIZE_OFFLINE_CARD_REPLY, SendTagConstant.SYNCHRONIZE_OFFLINE_CARD_REPLY, message); |
| | | } |
| | | |
| | | /** |
| | | * 离线卡数据清除应答 |
| | | */ |
| | | public SendResult clearOfflineCardReplyMessage(JSONObject jsonObject) { |
| | | ClearOfflineCardReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),ClearOfflineCardReplyMessage.class); |
| | | public SendResult clearOfflineCardReplyMessage(ClearOfflineCardReplyMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.CLEAR_OFFLINE_CARD_REPLY); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.CLEAR_OFFLINE_CARD_REPLY, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.CLEAR_OFFLINE_CARD_REPLY, SendTagConstant.CLEAR_OFFLINE_CARD_REPLY, message); |
| | | } |
| | | |
| | | /** |
| | | * 充电桩工作参数设置应答 |
| | | */ |
| | | public SendResult workingParameterSettingReplyMessage(JSONObject jsonObject) { |
| | | WorkingParameterSettingReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),WorkingParameterSettingReplyMessage.class); |
| | | public SendResult workingParameterSettingReplyMessage(WorkingParameterSettingReplyMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.WORKING_PARAMETER_SETTING_REPLY); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.WORKING_PARAMETER_SETTING_REPLY, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.WORKING_PARAMETER_SETTING_REPLY, SendTagConstant.WORKING_PARAMETER_SETTING_REPLY, message); |
| | | } |
| | | |
| | | /** |
| | | * 对时设置 |
| | | */ |
| | | public SendResult timingSettingMessage(JSONObject jsonObject) { |
| | | TimingSettingMessage message = JSON.parseObject(jsonObject.toJSONString(),TimingSettingMessage.class); |
| | | public SendResult timingSettingMessage(TimingSettingMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.TIMING_SETTING); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.TIMING_SETTING, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.TIMING_SETTING, SendTagConstant.TIMING_SETTING, message); |
| | | } |
| | | |
| | | /** |
| | | * 计费模型应答 |
| | | */ |
| | | public SendResult setupBillingModelReplyMessage(JSONObject jsonObject) { |
| | | SetupBillingModelReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),SetupBillingModelReplyMessage.class); |
| | | public SendResult setupBillingModelReplyMessage(SetupBillingModelReplyMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.SETUP_BILLING_MODEL_REPLY); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.SETUP_BILLING_MODEL_REPLY, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.SETUP_BILLING_MODEL_REPLY, SendTagConstant.SETUP_BILLING_MODEL_REPLY, message); |
| | | } |
| | | |
| | | /** |
| | | * 地锁数据上送(充电桩上送) |
| | | */ |
| | | public SendResult groundLockRealTimeDataMessage(JSONObject jsonObject) { |
| | | GroundLockRealTimeDataMessage message = JSON.parseObject(jsonObject.toJSONString(),GroundLockRealTimeDataMessage.class); |
| | | public SendResult groundLockRealTimeDataMessage(GroundLockRealTimeDataMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.GROUND_LOCK_REAL_TIME_DATA); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.GROUND_LOCK_REAL_TIME_DATA, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.GROUND_LOCK_REAL_TIME_DATA, SendTagConstant.GROUND_LOCK_REAL_TIME_DATA, message); |
| | | } |
| | | |
| | | /** |
| | | * 充电桩返回数据(上行) |
| | | */ |
| | | public SendResult chargingPileReturnsGroundLockDataMessage(JSONObject jsonObject) { |
| | | ChargingPileReturnsGroundLockDataMessage message = JSON.parseObject(jsonObject.toJSONString(),ChargingPileReturnsGroundLockDataMessage.class); |
| | | public SendResult chargingPileReturnsGroundLockDataMessage(ChargingPileReturnsGroundLockDataMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.CHARGING_PILE_RETURNS_GROUND_LOCK_DATA); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.CHARGING_PILE_RETURNS_GROUND_LOCK_DATA, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.CHARGING_PILE_RETURNS_GROUND_LOCK_DATA, SendTagConstant.CHARGING_PILE_RETURNS_GROUND_LOCK_DATA, message); |
| | | } |
| | | |
| | | /** |
| | | * 远程重启应答 |
| | | */ |
| | | public SendResult platformRestartReplyMessage(JSONObject jsonObject) { |
| | | PlatformRestartReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),PlatformRestartReplyMessage.class); |
| | | public SendResult platformRestartReplyMessage(PlatformRestartReplyMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.PLATFORM_RESTART_REPLY); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.PLATFORM_RESTART_REPLY, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.PLATFORM_RESTART_REPLY, SendTagConstant.PLATFORM_RESTART_REPLY, message); |
| | | } |
| | | |
| | | /** |
| | | * 远程更新应答 |
| | | */ |
| | | public SendResult platformRemoteUpdateReplyMessage(JSONObject jsonObject) { |
| | | PlatformRemoteUpdateReplyMessage message = JSON.parseObject(jsonObject.toJSONString(),PlatformRemoteUpdateReplyMessage.class); |
| | | public SendResult platformRemoteUpdateReplyMessage(PlatformRemoteUpdateReplyMessage message) { |
| | | // 设置业务key |
| | | message.setKey(UUID.randomUUID().toString()); |
| | | // 设置消息来源,便于查询 |
| | | message.setSource(SendTagConstant.PLATFORM_REMOTE_UPDATE_REPLY); |
| | | return rocketMQEnhanceTemplate.send(TOPIC, SendTagConstant.PLATFORM_REMOTE_UPDATE_REPLY, message); |
| | | return rocketMQEnhanceTemplate.send(TOPIC+SendTagConstant.PLATFORM_REMOTE_UPDATE_REPLY, SendTagConstant.PLATFORM_REMOTE_UPDATE_REPLY, message); |
| | | } |
| | | } |
| | |
| | | private RocketEnhanceProperties rocketEnhanceProperties; |
| | | |
| | | public RocketMQTemplate getTemplate() { |
| | | // DefaultMQProducer producer = new DefaultMQProducer(); |
| | | // producer.setProducerGroup("enhance_consumer_group"); |
| | | // template.setProducer(producer); |
| | | return template; |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.order.api.model.ExportUidDto; |
| | | import com.ruoyi.order.api.model.TChargingBill; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.query.TOrderInvoiceQuery; |
| | |
| | | return R.ok(null); |
| | | } |
| | | @ApiOperation(value = "导出", tags = {"管理后台-充电算账单"}) |
| | | @PostMapping("/export") |
| | | @PutMapping("/export") |
| | | public void export(@RequestBody ChargingListQuery dto) |
| | | { |
| | | ChargingBillVO res = chargingBillService.chargingBillList(dto); |
| | |
| | | } |
| | | } |
| | | @ApiOperation(value = "下载-未出账", tags = {"管理后台-充电算账单"}) |
| | | @GetMapping("/download") |
| | | public void download(String uid) |
| | | @PutMapping("/download") |
| | | public void download(@RequestBody ExportUidDto uid) |
| | | { |
| | | List<ChargingBillExport> chargingBillExports = new ArrayList<>(); |
| | | List<ChargingBillRefundExport> chargingBillRefundExports = new ArrayList<>(); |
| | | List<ChargingBillPayExport> chargingBillPayExports = new ArrayList<>(); |
| | | TChargingBill byId = chargingBillService.getById(uid); |
| | | TChargingBill byId = chargingBillService.getById(uid.getUid()); |
| | | ChargingBillExport chargingBillExport = new ChargingBillExport(); |
| | | chargingBillExport.setCode(byId.getCode()); |
| | | // todo 确认商户类型 |
| | |
| | | return AjaxResult.success(res); |
| | | } |
| | | @ApiOperation(value = "充电时段统计-导出", tags = {"管理后台-财务结算"}) |
| | | @PostMapping("/export") |
| | | @PutMapping("/export") |
| | | public void export(@RequestBody ChargingListQuery dto) |
| | | { |
| | | ChargingOrderTimeVO res = chargingOrderService.chargingList(dto); |
| | |
| | | List<Map<String, Object>> getYearData(List<Long> chargingOrderIds); |
| | | |
| | | List<ChargingOrderListVO> chargingList(@Param("pageInfo")PageInfo<ChargingOrderListVO> pageInfo, @Param("req") ChargingListQuery dto, @Param("startTime1")String startTime1, @Param("startTime2")String startTime2, @Param("endTime1")String endTime1, @Param("endTime2")String endTime2); |
| | | List<ChargingOrderListVO> chargingList1( @Param("req")ChargingListQuery dto, @Param("startTime1")String startTime1, @Param("startTime2")String startTime2, @Param("endTime1")String endTime1, @Param("endTime2")String endTime2); |
| | | List<ChargingOrderListVO> chargingListNoPage( @Param("req")ChargingListQuery dto, @Param("startTime1")String startTime1, @Param("startTime2")String startTime2, @Param("endTime1")String endTime1, @Param("endTime2")String endTime2); |
| | | |
| | | List<Map<String, Object>> getByDate(List<Long> chargingOrderIds); |
| | | |
| | |
| | | if (!data.isEmpty()) { |
| | | chargingOrderListVO.setSiteName(data.get(0).getName()); |
| | | } |
| | | if (chargingOrderListVO.getChargingGunId()!=null && chargingOrderListVO.getChargingPileId()!=null){ |
| | | TChargingGun data1 = chargingGunClient.getChargingGunById(chargingOrderListVO.getChargingGunId()).getData(); |
| | | TChargingPile data2 = chargingPileClient.getChargingPileById(chargingOrderListVO.getChargingPileId()).getData(); |
| | | if (data2 != null && data1 != null) { |
| | | chargingOrderListVO.setTerminalName(data2.getName() + "-" + data1.getName()); |
| | | } |
| | | } |
| | | // 获取充电时间 |
| | | UploadRealTimeMonitoringData data5 = uploadRealTimeMonitoringDataClient.chargingOrderInfo(chargingOrderListVO.getCode()).getData(); |
| | |
| | | } |
| | | } |
| | | // 获取开始SOC 结束soc |
| | | if (chargingOrderListVO.getCode()!=null){ |
| | | List<UploadRealTimeMonitoringData> data6 = uploadRealTimeMonitoringDataClient.getDataByOrderCode(chargingOrderListVO.getCode()).getData(); |
| | | if (!data6.isEmpty()){ |
| | | // 第一条数据soc为开始 最后一条数据soc为结束soc |
| | | chargingOrderListVO.setStartSoc(data6.get(0).getSoc().toString()); |
| | | chargingOrderListVO.setEndSoc(data6.get(data6.size()-1).getSoc().toString()); |
| | | } |
| | | } |
| | | |
| | | if (chargingOrderListVO.getAppUserId()!=null){ |
| | | TAppUser data3 = appUserClient.getUserById(chargingOrderListVO.getAppUserId()).getData(); |
| | | List<Long> carId = new ArrayList<>(); |
| | | if (data3!=null){ |
| | | if (chargingOrderListVO.getAppUserCarId() != null) { |
| | | carId.add(chargingOrderListVO.getAppUserCarId()); |
| | | if (!carId.isEmpty()){ |
| | | List<TAppUserCar> data4 = appUserCarClient.getCarByIds(carId).getData(); |
| | | if (!data4.isEmpty()) chargingOrderListVO.setLicensePlate(data4.get(0).getLicensePlate()); |
| | | if (data4!=null && !data4.isEmpty()) chargingOrderListVO.setLicensePlate(data4.get(0).getLicensePlate()); |
| | | } |
| | | } |
| | | if (data3 != null) chargingOrderListVO.setPhone(data3.getPhone()); |
| | | |
| | | } |
| | | } |
| | | List<TChargingOrderAccountingStrategy> list2 = chargingOrderAccountingStrategyService.lambdaQuery() |
| | | .eq(TChargingOrderAccountingStrategy::getChargingOrderId, chargingOrderListVO.getId()).list(); |
| | | // 尖峰平谷充电量 度数 |
| | |
| | | } |
| | | } |
| | | total = total.add(jian).add(feng).add(ping).add(gu); |
| | | if (total.compareTo(new BigDecimal("0")) != 0){ |
| | | chargingOrderListVO.setElectronicProportion( |
| | | jian.divide(total,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%(尖)/" |
| | | +feng.divide(total,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%(峰)/" |
| | | +ping.divide(total,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%(平)/" |
| | | +gu.divide(total,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%(谷)"); |
| | | }else{ |
| | | chargingOrderListVO.setElectronicProportion( |
| | | "0"+"%(尖)/"+ |
| | | "0"+"%(峰)/"+ |
| | | "0"+"%(平)/"+ |
| | | "0"+"%(谷)"); |
| | | } |
| | | |
| | | } |
| | | // 不分页 |
| | | List<ChargingOrderListVO> list1 = this.baseMapper.chargingList1(dto,startTime1,startTime2,endTime1,endTime2); |
| | | PageInfo<ChargingOrderListVO> pageInfo1 = new PageInfo<>(1,999999999); |
| | | List<ChargingOrderListVO> list1 = this.baseMapper.chargingList(pageInfo1,dto,startTime1,startTime2,endTime1,endTime2); |
| | | chargingOrderTimeVO.setExportList(list1); |
| | | chargingOrderTimeVO.setOrderCount(list1.size()); |
| | | // 计算充电总度数 |
| | |
| | | BigDecimal ping = new BigDecimal("0"); |
| | | BigDecimal gu = new BigDecimal("0"); |
| | | for (ChargingOrderListVO chargingOrderListVO : list1) { |
| | | electronic = electronic.add(chargingOrderListVO.getChargingCapacity()); |
| | | paymentAmount = paymentAmount.add(chargingOrderListVO.getPaymentAmount()); |
| | | electrovalence = electrovalence.add(chargingOrderListVO.getElectrovalence()); |
| | | serviceCharge = serviceCharge.add(chargingOrderListVO.getServiceCharge()); |
| | | if (chargingOrderListVO.getChargingCapacity()!=null)electronic = electronic.add(chargingOrderListVO.getChargingCapacity()); |
| | | |
| | | if (chargingOrderListVO.getPaymentAmount()!=null)paymentAmount = paymentAmount.add(chargingOrderListVO.getPaymentAmount()); |
| | | if (chargingOrderListVO.getElectrovalence()!=null)electrovalence = electrovalence.add(chargingOrderListVO.getElectrovalence()); |
| | | if (chargingOrderListVO.getServiceCharge()!=null)serviceCharge = serviceCharge.add(chargingOrderListVO.getServiceCharge()); |
| | | List<TChargingOrderAccountingStrategy> list2 = chargingOrderAccountingStrategyService.lambdaQuery() |
| | | .eq(TChargingOrderAccountingStrategy::getChargingOrderId, chargingOrderListVO.getId()).list(); |
| | | for (TChargingOrderAccountingStrategy temp : list2) { |
| | | switch (temp.getType()){ |
| | | case 1: |
| | | jian = jian.add(temp.getChargingCapacity()); |
| | | jianElectronic = jianElectronic.add(temp.getChargingCapacity()); |
| | | jianService = jianService.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)jian = jian.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)jianElectronic = jianElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getChargingCapacity()!=null)jianService = jianService.add(temp.getServiceCharge()); |
| | | break; |
| | | case 2: |
| | | feng = feng.add(temp.getChargingCapacity()); |
| | | fengElectronic = fengElectronic.add(temp.getChargingCapacity()); |
| | | fengService = fengService.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)feng = feng.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)fengElectronic = fengElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getChargingCapacity()!=null)fengService = fengService.add(temp.getServiceCharge()); |
| | | break; |
| | | case 3: |
| | | ping = ping.add(temp.getChargingCapacity()); |
| | | pingElectronic = pingElectronic.add(temp.getChargingCapacity()); |
| | | pingService = pingService.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)ping = ping.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)pingElectronic = pingElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getChargingCapacity()!=null)pingService = pingService.add(temp.getServiceCharge()); |
| | | break; |
| | | case 4: |
| | | gu = gu.add(temp.getChargingCapacity()); |
| | | guElectronic = guElectronic.add(temp.getChargingCapacity()); |
| | | guService = guService.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)gu = gu.add(temp.getChargingCapacity()); |
| | | if (temp.getChargingCapacity()!=null)guElectronic = guElectronic.add(temp.getElectrovalence()); |
| | | if (temp.getChargingCapacity()!=null)guService = guService.add(temp.getServiceCharge()); |
| | | break; |
| | | } |
| | | } |
| | |
| | | BigDecimal add1 = jianService.add(fengService).add(pingService).add(guService); |
| | | // 计算尖峰平谷充电到账占比 |
| | | BigDecimal add2 = jian.add(feng).add(ping).add(gu); |
| | | if (add.compareTo(new BigDecimal("0"))!=0){ |
| | | chargingOrderTimeVO.setCapacityProportion(jianElectronic+"度/"+fengElectronic+"度/"+pingElectronic+"度/"+guElectronic+"度-" |
| | | +jianElectronic.divide(add,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%/" |
| | | +fengElectronic.divide(add,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%/" |
| | |
| | | +feng.divide(add2,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%/" |
| | | +ping.divide(add2,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%/" |
| | | +gu.divide(add2,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%"); |
| | | }else{ |
| | | chargingOrderTimeVO.setCapacityProportion(jianElectronic+"度/"+fengElectronic+"度/"+pingElectronic+"度/"+guElectronic+"度-" |
| | | +"0"+"%/" |
| | | +"0"+"%/" |
| | | +"0"+"%/" |
| | | +"0"+"%"); |
| | | chargingOrderTimeVO.setServiceProportion(jianService+"元/"+fengService+"元/"+pingService+"元/"+guService+"元-" |
| | | +"0"+"%/" |
| | | +"0"+"%/" |
| | | +"0"+"%/" |
| | | +"0"+"%"); |
| | | chargingOrderTimeVO.setElectronicProportion(jian+"元/"+feng+"元/"+ping+"元/"+gu+"元-" |
| | | +"0"+"%/" |
| | | +"0"+"%/" |
| | | +"0"+"%/" |
| | | +"0"+"%"); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | chargingOrderTimeVO.setList(pageInfo); |
| | | return chargingOrderTimeVO; |
| | | } |
| | |
| | | chargingOrderListInfoVO.setSiteName(data.get(0).getName()); |
| | | chargingOrderListInfoVO.setSiteAddress(data.get(0).getAddress()); |
| | | } |
| | | if (chargingOrder.getChargingGunId()!=null){ |
| | | TChargingGun data1 = chargingGunClient.getChargingGunById(chargingOrder.getChargingGunId()).getData(); |
| | | TChargingPile data2 = chargingPileClient.getChargingPileById(data1.getChargingPileId()).getData(); |
| | | |
| | | if (data1!=null){ |
| | | TChargingPile data2 = chargingPileClient.getChargingPileById(data1.getChargingPileId()).getData(); |
| | | if (data2!=null){ |
| | | chargingOrderListInfoVO.setGunCode(data1.getCode()); |
| | | chargingOrderListInfoVO.setTerminalName(data2.getName()+data1.getName()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | chargingOrderListInfoVO.setEndMode(chargingOrder.getEndMode()); |
| | | |
| | | // 获取开始SOC 结束soc |
| | | if (chargingOrder.getCode()!=null){ |
| | | List<UploadRealTimeMonitoringData> data6 = uploadRealTimeMonitoringDataClient.getDataByOrderCode(chargingOrder.getCode()).getData(); |
| | | if (data6!=null){ |
| | | if (!data6.isEmpty()){ |
| | | // 第一条数据soc为开始 最后一条数据soc为结束soc |
| | | chargingOrderListInfoVO.setStartSoc(data6.get(0).getSoc().toString()); |
| | | chargingOrderListInfoVO.setEndSoc(data6.get(data6.size()-1).getSoc().toString()); |
| | | chargingOrderListInfoVO.setChargingCapacity(data6.get(data6.size()-1).getCharging_degree()); |
| | | chargingOrderListInfoVO.setChargingSecond(data6.get(data6.size()-1).getCumulative_charging_time()*60+""); |
| | | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | for (UploadRealTimeMonitoringData uploadRealTimeMonitoringData : data6) { |
| | | uploadRealTimeMonitoringData.setCreateTime(simpleDateFormat.format(uploadRealTimeMonitoringData.getCreate_time())); |
| | | } |
| | | } |
| | | } |
| | | chargingOrderListInfoVO.setList(data6); |
| | | } |
| | | |
| | | |
| | | if (chargingOrder.getAppUserCarId()!=null){ |
| | | List<TAppUserCar> data3 = appUserCarClient.getCarByIds(Collections.singletonList(chargingOrder.getAppUserCarId())).getData(); |
| | | if (!data3.isEmpty())chargingOrderListInfoVO.setLicensePlate(data3.get(0).getLicensePlate()); |
| | | if (data3!=null && !data3.isEmpty())chargingOrderListInfoVO.setLicensePlate(data3.get(0).getLicensePlate()); |
| | | } |
| | | chargingOrderListInfoVO.setStartTime(chargingOrder.getStartTime()); |
| | | chargingOrderListInfoVO.setEndTime(chargingOrder.getEndTime()); |
| | | chargingOrderListInfoVO.setId(chargingOrder.getId()); |
| | | chargingOrderListInfoVO.setUid(chargingOrder.getId().toString()); |
| | | chargingOrderListInfoVO.setList(data6); |
| | | chargingOrderListInfoVO.setCouponDiscountAmount(chargingOrder.getCouponDiscountAmount()); |
| | | chargingOrderListInfoVO.setVipDiscountAmount(chargingOrder.getVipDiscountAmount()); |
| | | chargingOrderListInfoVO.setSharingAmount(chargingOrder.getSharingAmount()); |
| | |
| | | private String terminalName; |
| | | @ApiModelProperty(value = "结束原因 (0=异常终止,1=主动终止,2=满电终止,3=费用不足终止)") |
| | | private Integer endMode; |
| | | @ApiModelProperty(value = "状态(-1=启动失败,取消订单,0=未知,1=等待中,2=启动中,3=充电中,4=停止中,5=已结束)") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "开始soc") |
| | | private String startSoc; |
| | | @ApiModelProperty(value = "结束soc") |
| | |
| | | and t1.status = #{req.state} |
| | | </if> |
| | | <if test="startTime1 != null and startTime1!=''"> |
| | | and (t1.bill_time between #{startTime1} and #{startTime2} |
| | | and (t1.bill_time between #{startTime1} and #{startTime2}) |
| | | </if> |
| | | <if test="req.uid != null and req.uid!=''"> |
| | | and t1.id = #{req.uid} |
| | |
| | | AND create_time >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND create_time <= #{statisticsQueryDto.endTime} |
| | | AND create_time <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | |
| | |
| | | AND create_time >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND create_time <= #{statisticsQueryDto.endTime} |
| | | AND create_time <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | GROUP BY |
| | |
| | | AND create_time >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND create_time <= #{statisticsQueryDto.endTime} |
| | | AND create_time <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | GROUP BY |
| | |
| | | AND co.create_time >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND co.create_time <= #{statisticsQueryDto.endTime} |
| | | AND co.create_time <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | </where> |
| | |
| | | and t1.order_type = #{req.orderType} |
| | | </if> |
| | | <if test="req.status != null "> |
| | | and t1.status = #{status} |
| | | and t1.status = #{req.status} |
| | | </if> |
| | | <if test="req.status != null "> |
| | | and t1.status = #{req.status} |
| | |
| | | and (t1.end_time between #{endTime1} and #{endTime2}) |
| | | </if> |
| | | </select> |
| | | <select id="chargingList1" resultType="com.ruoyi.order.api.vo.ChargingOrderListVO"> |
| | | <select id="chargingListNoPage" resultType="com.ruoyi.order.api.vo.ChargingOrderListVO"> |
| | | select t1.* from t_charging_order t1 |
| | | where 1=1 |
| | | <if test="null != req.code and req.code!=''"> |
| | |
| | | and t1.order_type = #{req.orderType} |
| | | </if> |
| | | <if test="req.status != null "> |
| | | and t1.status = #{status} |
| | | and t1.status = #{req.status} |
| | | </if> |
| | | <if test="req.status != null "> |
| | | and t1.status = #{req.status} |
| | |
| | | payPrice = orderPrice.subtract(coupon.getDiscountAmount()); |
| | | discountPrice = coupon.getDiscountAmount(); |
| | | } |
| | | exchangeDto.setPayPrice(payPrice); |
| | | exchangeDto.setPayPrice(orderPrice); |
| | | exchangeDto.setDiscountPrice(discountPrice); |
| | | exchangeDto.setVipDiscount(vipDiscount); |
| | | exchangeDto.setUserId(userId); |
| | |
| | | //调起支付 |
| | | PaymentOrder paymentOrder = new PaymentOrder(); |
| | | paymentOrder.setCode(shopOrder.getCode()); |
| | | paymentOrder.setAmount(shopOrder.getPaymentAmount()); |
| | | paymentOrder.setAmount(exchangeDto.getOrderPrice()); |
| | | paymentOrder.setOpenId(user.getWxOpenid()); |
| | | paymentOrder.setDescription("购买商品"); |
| | | return wxPaymentClient.orderPay(paymentOrder); |
| | | R<Map<String, Object>> mapR = wxPaymentClient.orderPay(paymentOrder); |
| | | return mapR; |
| | | }else { |
| | | //todo 罗 支付宝支付 |
| | | return R.ok(); |
| | |
| | | switch (substring){ |
| | | //购物订单 |
| | | case "GW": |
| | | |
| | | System.err.println("----收到购物回调"); |
| | | break; |
| | | case "HY": |
| | | break; |