mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-07 19:40:07 +08:00
update订单状态和枪口状态
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.jsowell.common.enums.ykc;
|
||||
|
||||
import java.util.Objects;
|
||||
/**
|
||||
* order_basic_info表 order_status字段
|
||||
* 订单状态(0-未启动;1-充电中;2-待结算;3-待补缴;4-异常;5-可疑;6-订单完成;7-超时关闭)
|
||||
@@ -48,4 +49,21 @@ public enum OrderStatusEnum {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
// 中电联订单状态转化
|
||||
public static Integer convertToNewStatus(String orderStatus) {
|
||||
if (Objects.equals(orderStatus , IN_THE_CHARGING.value)) {
|
||||
return 2; // 充电中
|
||||
} else if (Objects.equals(orderStatus , ORDER_COMPLETE.value)) {
|
||||
return 4; // 充电完成
|
||||
} else if (Objects.equals(orderStatus , NOT_START.value)) {
|
||||
return 1; // 启动中
|
||||
} else if (Objects.equals(orderStatus , STAY_SETTLEMENT.value) || Objects.equals(orderStatus , STAY_RETROACTIVE_AMOUNT.value)) {
|
||||
return 3; // 停止中
|
||||
} else {
|
||||
return 5; // 未知
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -585,11 +585,17 @@ public class ChangZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
BigDecimal totalElectricityAmount = orderDetail.getTotalElectricityAmount() == null ? BigDecimal.ZERO : orderDetail.getTotalElectricityAmount();
|
||||
BigDecimal totalServiceAmount = orderDetail.getTotalServiceAmount() == null ? BigDecimal.ZERO : orderDetail.getTotalServiceAmount();
|
||||
|
||||
|
||||
Integer orderStatus = OrderStatusEnum.convertToNewStatus(orderInfo.getOrderStatus());
|
||||
Integer connectorStatus = info.getStatus();
|
||||
if (orderStatus ==0) {
|
||||
orderStatus = 5;
|
||||
}
|
||||
QueryChargingStatusVO vo = QueryChargingStatusVO.builder()
|
||||
.startChargeSeq(orderInfo.getOrderCode()) // 订单号
|
||||
.startChargeSeqStat(Integer.parseInt(orderInfo.getOrderStatus())) // 订单状态
|
||||
.startChargeSeqStat(orderStatus) // 订单状态
|
||||
.connectorID(orderInfo.getPileConnectorCode()) // 枪口编码
|
||||
.connectorStatus(info.getStatus()) // 枪口状态
|
||||
.connectorStatus(connectorStatus) // 枪口状态
|
||||
.currentA(current) // 电流
|
||||
.voltageA(voltage) // 电压
|
||||
.soc(new BigDecimal(soc))
|
||||
|
||||
Reference in New Issue
Block a user