| | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("StartChargeSeq",chargingOrder2.getCode()); |
| | | jsonObject.put("ConnectorID",chargingGun2.getFullNumber()); |
| | | LocalDateTime startTime = chargingOrder2.getStartTime(); |
| | | |
| | | //状态(0=未知,1=等待中/已插枪,2=启动中,3=充电中,4=停止中,5=已结束) |
| | | int tempStatus = 0; |
| | | switch (chargingOrder2.getStatus()){ |
| | |
| | | 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 3: |
| | | tempStatus=2; |
| | | jsonObject.put("StartChargeSeqStat",tempStatus); |
| | | if (startTime!=null){ |
| | | jsonObject.put("StartTime",startTime.format(java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | }else{ |
| | |
| | | chuanYiChongSuperviseUtil.notificationStationStatus(new Operator(), jsonObject); |
| | | break; |
| | | case 4: |
| | | |
| | | tempStatus=3; |
| | | jsonObject.put("StartChargeSeqStat",tempStatus); |
| | | 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 5: |
| | | jsonObject.put("StartChargeSeqStat",4); |
| | | int temp = 0; |