无关风月
15 小时以前 14806141c2afb589b7e0f1a0dfa340e689b5728c
ruoyi-service/ruoyi-jianguan/src/main/java/com/ruoyi/jianguan/rocket/produce/ChargingMessageListener.java
@@ -219,79 +219,82 @@
                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;
                if (chargingOrder2.getRechargePaymentType()==3){
                    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{
                        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("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;
                            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;
        }
    }