From ecc75395fffec16ac48883ca049ccc0e0ea43c27 Mon Sep 17 00:00:00 2001 From: jsowell <123@jsowell.com> Date: Mon, 22 Jun 2026 16:36:28 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=9F=A5=E8=AF=A2=E5=85=85=E7=94=B5?= =?UTF-8?q?=E6=A1=A9=E9=A2=84=E7=BA=A6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pile/service/PileReservationInfoService.java | 2 +- .../impl/PileReservationInfoServiceImpl.java | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileReservationInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileReservationInfoService.java index ce3678fe8..79956da59 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileReservationInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileReservationInfoService.java @@ -74,7 +74,7 @@ public interface PileReservationInfoService { PileReservationInfoVO queryReservationInfo(PileReservationDTO dto); - void initPersonalPileReservation(String pileConnectorCode); + PileReservationInfo initPersonalPileReservation(String pileConnectorCode); void initPersonalPileReservation(String pileSn, String connectorCode); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileReservationInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileReservationInfoServiceImpl.java index eed63a5a9..056e2c6af 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileReservationInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileReservationInfoServiceImpl.java @@ -521,9 +521,7 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic String pileSn = StringUtils.substring(dto.getPileConnectorCode(), 0, 14); if (pileReservationInfo == null) { // 初始化预约信息 - this.initPersonalPileReservation(dto.getPileConnectorCode()); - // 重新查询 - pileReservationInfo = pileReservationInfoMapper.selectByPileConnectorCode(dto.getPileConnectorCode()); + pileReservationInfo = this.initPersonalPileReservation(dto.getPileConnectorCode()); } PileReservationInfoVO build = PileReservationInfoVO.builder() .reservedId(pileReservationInfo.getId() + "") @@ -540,15 +538,18 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic /** * 初始化个人桩预约信息 + * * @param pileConnectorCode 充电桩枪口编号 + * @return */ @Override - public void initPersonalPileReservation(String pileConnectorCode) { + public PileReservationInfo initPersonalPileReservation(String pileConnectorCode) { if (StringUtils.isBlank(pileConnectorCode)) { log.error("初始化个人桩预约信息, pileConnectorCode不能为空"); - return; + return null; } - String pileSn = pileConnectorCode.substring(0, pileConnectorCode.length() - 2); + // String pileSn = pileConnectorCode.substring(0, pileConnectorCode.length() - 2); + String pileSn = YKCUtils.getPileSn(pileConnectorCode); // 查询个人桩预约信息 PileReservationInfo pileReservationInfo = pileReservationInfoMapper.selectByPileConnectorCode(pileConnectorCode); // 新建预约 @@ -569,6 +570,7 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic pileReservationInfoMapper.insert(pileReservationInfo); log.info("未查询到个人桩预约信息, 初始化个人桩预约信息:{}", JSON.toJSONString(pileReservationInfo)); } + return pileReservationInfo; } /**