From 69ca35a26a61e02022941933ed217ad5322eccb5 Mon Sep 17 00:00:00 2001 From: Guoqs <123456@jsowell.com> Date: Thu, 18 Jun 2026 15:53:59 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=A2=84=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/YKCPushCommandServiceImpl.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java index cf016e8f3..aa3d0e13e 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java @@ -850,8 +850,13 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { byte[] chargingStrategyByteArr = BytesUtil.intToBytes(0x00, 1); byte[] chargingParamByteArr = YKCUtils.getPriceByte(BigDecimal.ZERO.toString(), 2); byte[] systemTimeByteArr = Cp56Time2aUtil.date2Hbyte(new Date()); - byte[] reservedStartTimeByteArr = Cp56Time2aUtil.date2Hbyte(getYuxinReservedStartDate(command.getReservedStartTime())); + Date reservedStartDate = getYuxinReservedStartDate(command); + byte[] reservedStartTimeByteArr = Cp56Time2aUtil.date2Hbyte(reservedStartDate); byte[] reservationTimeoutByteArr = BytesUtil.intToBytes(getYuxinReservationTimeout(command), 1); + log.info("羽信预约充电组包, pileSn:{}, connectorCode:{}, operation:{}, reservationType:{}, reservedStartTime:{}, reservedStartDate:{}, reservationTimeout:{}", + command.getPileSn(), command.getConnectorCode(), command.getOperation(), + BytesUtil.bin2HexStr(reservationTypeByteArr), command.getReservedStartTime(), + DateUtils.formatDateTime(reservedStartDate), getYuxinReservationTimeout(command)); return Bytes.concat(transactionCodeArr, pileSnByteArr, connectorCodeByteArr, accountBalanceByteArr, reservationTypeByteArr, chargingStrategyByteArr, chargingParamByteArr, systemTimeByteArr, @@ -862,9 +867,13 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { return command.getAmount() == null ? BigDecimal.ZERO : command.getAmount(); } - private Date getYuxinReservedStartDate(LocalTime reservedStartTime) { + private Date getYuxinReservedStartDate(ReservationChargingCommand command) { LocalDateTime now = LocalDateTime.now(); + LocalTime reservedStartTime = command.getReservedStartTime(); LocalDateTime reservedStartDateTime = now.toLocalDate().atTime(reservedStartTime); + if (StringUtils.equals(command.getOperation(), "02")) { + return DateUtils.localDateTime2Date(reservedStartDateTime); + } if (!reservedStartDateTime.isAfter(now)) { reservedStartDateTime = reservedStartDateTime.plusDays(1); }