0x19充电停止,只更新个别字段

This commit is contained in:
2024-02-21 16:56:14 +08:00
parent 3990c55d55
commit 8ff5e15a5d

View File

@@ -2,10 +2,8 @@ package com.jsowell.netty.handler;
import com.jsowell.common.core.domain.ykc.YKCDataProtocol; import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode; import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
import com.jsowell.common.enums.ykc.OrderStatusEnum;
import com.jsowell.common.util.BytesUtil; import com.jsowell.common.util.BytesUtil;
import com.jsowell.common.util.DateUtils; import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.YKCUtils; import com.jsowell.common.util.YKCUtils;
import com.jsowell.netty.factory.YKCOperateFactory; import com.jsowell.netty.factory.YKCOperateFactory;
import com.jsowell.pile.domain.OrderBasicInfo; import com.jsowell.pile.domain.OrderBasicInfo;
@@ -107,13 +105,13 @@ public class ChargeEndHandler extends AbstractHandler{
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode); OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
if (Objects.nonNull(orderInfo)) { if (Objects.nonNull(orderInfo)) {
Date nowDate = DateUtils.getNowDate(); // 当前时间 Date nowDate = DateUtils.getNowDate(); // 当前时间
if (StringUtils.equals(OrderStatusEnum.IN_THE_CHARGING.getValue(), orderInfo.getOrderStatus())) { // if (StringUtils.equals(OrderStatusEnum.IN_THE_CHARGING.getValue(), orderInfo.getOrderStatus())) {
orderInfo.setOrderStatus(OrderStatusEnum.STAY_SETTLEMENT.getValue()); // orderInfo.setOrderStatus(OrderStatusEnum.STAY_SETTLEMENT.getValue());
} // }
orderInfo.setEndSoc(stopSoc); // orderInfo.setEndSoc(stopSoc);
if (orderInfo.getChargeEndTime() == null) { // if (orderInfo.getChargeEndTime() == null) {
orderInfo.setChargeEndTime(nowDate); // 结束充电时间 // orderInfo.setChargeEndTime(nowDate); // 结束充电时间
} // }
// orderBasicInfoService.updateOrderBasicInfo(orderInfo); // orderBasicInfoService.updateOrderBasicInfo(orderInfo);
// 只更新个别字段 // 只更新个别字段