|
|
@@ -1,6 +1,7 @@
|
|
|
package com.zsElectric.boot.charging.service.impl;
|
|
|
|
|
|
import cn.hutool.core.util.ObjUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
@@ -109,8 +110,13 @@ public class ChargingReceptionServiceImpl implements ChargingReceptionService {
|
|
|
if (startChargeSeqStat == 2) {
|
|
|
// 充电中
|
|
|
log.info("充电中 - StartChargeSeq: {}", startChargeSeq);
|
|
|
- chargeOrderInfo.setStatus(SystemConstants.STATUS_ONE);
|
|
|
- chargeOrderInfoService.updateById(chargeOrderInfo);
|
|
|
+ //修改订单状态
|
|
|
+ if (ObjectUtil.isNotEmpty(chargeOrderInfo)) {
|
|
|
+ if (Objects.equals(chargeOrderInfo.getStatus(), SystemConstants.STATUS_ZERO)){
|
|
|
+ chargeOrderInfo.setStatus(SystemConstants.STATUS_ONE);
|
|
|
+ chargeOrderInfoService.updateById(chargeOrderInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
if (startChargeSeqStat == 3) {
|
|
|
// 停止中
|
|
|
@@ -161,8 +167,12 @@ public class ChargingReceptionServiceImpl implements ChargingReceptionService {
|
|
|
// 已结束
|
|
|
log.info("已结束 - StartChargeSeq: {}", startChargeSeq);
|
|
|
//修改订单状态结算中
|
|
|
- chargeOrderInfo.setStatus(SystemConstants.STATUS_TWO);
|
|
|
- chargeOrderInfoService.updateById(chargeOrderInfo);
|
|
|
+ if (ObjectUtil.isNotEmpty(chargeOrderInfo)) {
|
|
|
+ if (Objects.equals(chargeOrderInfo.getStatus(), SystemConstants.STATUS_ONE)){
|
|
|
+ chargeOrderInfo.setStatus(SystemConstants.STATUS_TWO);
|
|
|
+ chargeOrderInfoService.updateById(chargeOrderInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
if (startChargeSeqStat == 5) {
|
|
|
// 未知
|
|
|
@@ -178,9 +188,13 @@ public class ChargingReceptionServiceImpl implements ChargingReceptionService {
|
|
|
log.info("接收推送充电订单信息请求参数:{}", requestDTO);
|
|
|
return processChargeRequest(requestDTO, jsonNode -> {
|
|
|
// 充电订单信息业务处理
|
|
|
+ //订单结算:平台实际收取金额 = 互联互通金额 + 中数电动金额(平台总服务费)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//账户余额扣减
|
|
|
- //chargeOrderInfoService.orderSettlement();
|
|
|
+// chargeOrderInfoService.orderSettlement();
|
|
|
log.debug("充电订单信息 - StartChargeSeq: {}", getTextValue(jsonNode, "StartChargeSeq"));
|
|
|
});
|
|
|
}
|