| | |
| | | package com.ruoyi.jianguan.rocket.produce; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.chargingPile.api.feignClient.AccountingStrategyDetailClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingGunClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingPileClient; |
| | |
| | | import com.ruoyi.jianguan.rocket.base.GunStatusMessage; |
| | | import com.ruoyi.jianguan.rocket.base.JianGuanMessage; |
| | | import com.ruoyi.jianguan.rocket.util.EnhanceMessageHandler; |
| | | import com.ruoyi.jianguan.util.ChuanYiChongSuperviseUtil; |
| | | import com.ruoyi.jianguan.util.SendTagConstant; |
| | | import com.ruoyi.jianguan.util.TCECSuperviseUtil; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | |
| | |
| | | private RedisTemplate redisTemplate; |
| | | @Resource |
| | | private TCECSuperviseUtil tcecSuperviseUtil; |
| | | @Resource |
| | | private ChuanYiChongSuperviseUtil chuanYiChongSuperviseUtil; |
| | | |
| | | private final static String operatorId = "906171535"; |
| | | |
| | |
| | | supEquipChargeStatus.setEndTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); |
| | | supEquipChargeStatus.setTotalPower(chargingOrder2.getElectrovalence()); |
| | | tcecSuperviseUtil.notificationSupEquipChargeStatus(new Operator(), supEquipChargeStatus); |
| | | // 川逸充 |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("StartChargeSeq",chargingOrder2.getCode()); |
| | | jsonObject.put("ConnectorID",chargingGun2.getFullNumber()); |
| | | //状态(0=未知,1=等待中/已插枪,2=启动中,3=充电中,4=停止中,5=已结束) |
| | | int tempStatus = 0; |
| | | switch (chargingOrder2.getStatus()){ |
| | | case 1: |
| | | tempStatus=1; |
| | | |
| | | case 2: |
| | | tempStatus=1; |
| | | jsonObject.put("StartChargeSeqStat",tempStatus); |
| | | LocalDateTime startTime = chargingOrder2.getStartTime(); |
| | | if (startTime!=null){ |
| | | jsonObject.put("StartTime",startTime.format(java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | }else{ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | // 转化为yyyy-MM-dd HH:mm:ss格式字符串 |
| | | jsonObject.put("StartTime",now.format(java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | } |
| | | chuanYiChongSuperviseUtil.notificationStationStatus(new Operator(), jsonObject); |
| | | break; |
| | | case 4: |
| | | |
| | | case 5: |
| | | jsonObject.put("StartChargeSeqStat",4); |
| | | int temp = 0; |
| | | //充电枪状态(1=离线,2=空闲,3=占用(未充电),4=占用(充电中),5=占用(已充满),6=占用(预约锁定),7=故障) |
| | | switch (chargingGun2.getStatus()){ |
| | | case 1: |
| | | temp = 0; |
| | | break; |
| | | case 2: |
| | | temp=1; |
| | | break; |
| | | case 3: |
| | | temp=2; |
| | | break; |
| | | case 4: |
| | | temp=3; |
| | | break; |
| | | case 5: |
| | | temp=4; |
| | | break; |
| | | case 6: |
| | | temp=4; |
| | | break; |
| | | case 7: |
| | | temp = 255; |
| | | break; |
| | | } |
| | | jsonObject.put("ConnectorStatus",temp); |
| | | |
| | | jsonObject.put("CurrentA",chargingOrder2.getCurrent()); |
| | | jsonObject.put("VoltageA",chargingOrder2.getVoltage()); |
| | | LocalDateTime startTime2 = chargingOrder2.getStartTime(); |
| | | |
| | | if (startTime2!=null){ |
| | | jsonObject.put("StartTime",startTime2.format(java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | }else{ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | // 转化为yyyy-MM-dd HH:mm:ss格式字符串 |
| | | jsonObject.put("StartTime",now.format(java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | } |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | // 转化为yyyy-MM-dd HH:mm:ss格式字符串 |
| | | jsonObject.put("EndTime",now.format(java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | jsonObject.put("TotalPower",chargingOrder2.getElectricity()); |
| | | jsonObject.put("TotalMoney",chargingOrder2.getOrderAmount()); |
| | | chuanYiChongSuperviseUtil.notificationSupEquipChargeStatus(new Operator(), jsonObject); |
| | | break; |
| | | } |
| | | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected void handleMaxRetriesExceeded(JianGuanMessage message) { |
| | | // 当超过指定重试次数消息时此处方法会被调用 |