mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
生成占桩订单
This commit is contained in:
@@ -3,6 +3,7 @@ package com.jsowell.netty.handler;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
|
||||
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
|
||||
import com.jsowell.common.enums.uniapp.OccupyOrderStatusEnum;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
@@ -71,18 +72,28 @@ public class RemoteControlGroundLockResponseHandler extends AbstractHandler{
|
||||
|
||||
if (StringUtils.equals(controlResult, "01")) {
|
||||
// 鉴权成功
|
||||
updateOrder(pileSn, connectorCode);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 降锁成功的时候调用
|
||||
* @param pileSn
|
||||
* @param connectorCode
|
||||
*/
|
||||
private void updateOrder(String pileSn, String connectorCode) {
|
||||
// 查出占桩订单,将开始时间set进订单信息
|
||||
OrderPileOccupy orderInfo = orderPileOccupyService.getOrderInfoByPile(pileSn, connectorCode);
|
||||
|
||||
if (orderInfo == null) {
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
if (Objects.isNull(orderInfo.getStartTime())) {
|
||||
orderInfo.setStatus(OccupyOrderStatusEnum.OCCUPIED.getValue());
|
||||
orderInfo.setStartTime(DateUtils.getNowDate());
|
||||
// 修改数据库
|
||||
orderPileOccupyService.updateByPrimaryKey(orderInfo);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user