mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
0x19充电停止,只更新个别字段
This commit is contained in:
@@ -4,6 +4,7 @@ import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
|
||||
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.DateUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.YKCUtils;
|
||||
import com.jsowell.netty.factory.YKCOperateFactory;
|
||||
@@ -105,14 +106,25 @@ public class ChargeEndHandler extends AbstractHandler{
|
||||
// 查询订单,改为待结算 将结束soc传入
|
||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
|
||||
if (Objects.nonNull(orderInfo)) {
|
||||
Date nowDate = DateUtils.getNowDate(); // 当前时间
|
||||
if (StringUtils.equals(OrderStatusEnum.IN_THE_CHARGING.getValue(), orderInfo.getOrderStatus())) {
|
||||
orderInfo.setOrderStatus(OrderStatusEnum.STAY_SETTLEMENT.getValue());
|
||||
}
|
||||
orderInfo.setEndSoc(stopSoc);
|
||||
if (orderInfo.getChargeEndTime() == null) {
|
||||
orderInfo.setChargeEndTime(new Date()); // 结束充电时间
|
||||
orderInfo.setChargeEndTime(nowDate); // 结束充电时间
|
||||
}
|
||||
orderBasicInfoService.updateOrderBasicInfo(orderInfo);
|
||||
// orderBasicInfoService.updateOrderBasicInfo(orderInfo);
|
||||
|
||||
// 只更新个别字段
|
||||
OrderBasicInfo updateOrder = new OrderBasicInfo();
|
||||
updateOrder.setId(orderInfo.getId());
|
||||
updateOrder.setEndSoc(stopSoc);
|
||||
if (orderInfo.getChargeEndTime() == null) {
|
||||
updateOrder.setChargeEndTime(nowDate); // 结束充电时间
|
||||
}
|
||||
updateOrder.setUpdateTime(nowDate);
|
||||
orderBasicInfoService.updateOrderBasicInfo(updateOrder);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user