update 预约充电

This commit is contained in:
Guoqs
2024-05-30 15:08:21 +08:00
parent 45d1fd04ff
commit 39d7eb40c3
4 changed files with 39 additions and 4 deletions

View File

@@ -1,9 +1,11 @@
package com.jsowell.pile.domain.ykcCommond;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@@ -40,11 +42,15 @@ public class ReservedChargingCommand {
/**
* 开始时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reservedStartTime;
/**
* 结束时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reservedEndTime;
/**

View File

@@ -3114,7 +3114,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
ReservedChargingCommand command = ReservedChargingCommand.builder()
.transactionCode(orderInfo.getTransactionCode())
.pileSn(orderInfo.getPileSn())
.connectorCode(orderInfo.getPileConnectorCode())
.connectorCode(orderInfo.getConnectorCode())
.operation(BytesUtil.bcd2Str(new byte[]{0x01}))
.reservedStartTime(orderInfo.getReservedStartTime())
.reservedEndTime(orderInfo.getReservedEndTime())

View File

@@ -56,7 +56,8 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
private final List<String> frameTypeList = Lists.newArrayList(
YKCUtils.frameType2Str(YKCFrameTypeCode.REMOTE_RESTART_CODE.getBytes()),
YKCUtils.frameType2Str(YKCFrameTypeCode.REMOTE_CONTROL_START_CODE.getBytes()),
YKCUtils.frameType2Str(YKCFrameTypeCode.REMOTE_STOP_CHARGING_CODE.getBytes())
YKCUtils.frameType2Str(YKCFrameTypeCode.REMOTE_STOP_CHARGING_CODE.getBytes()),
YKCUtils.frameType2Str(YKCFrameTypeCode.RESERVE_CHARGING_CODE.getBytes())
);
/**
@@ -108,12 +109,12 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
channelFuture.addListener((ChannelFutureListener) channelFutureListener -> {
// 检查操作的状态
if (channelFutureListener.isSuccess()) {
log.info("push结果成功】, pileSn:{}, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}",
log.info("push结果===>成功】, pileSn:{}, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}",
pileSn, channel.remoteAddress(), channel.id(), value, wholeMsg);
} else {
// 如果发生错误则访问描述原因的Throwable
Throwable cause = channelFutureListener.cause();
log.info("push结果失败】, pileSn:{}, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}",
log.info("push结果===>失败】, pileSn:{}, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}",
pileSn, channel.remoteAddress(), channel.id(), value, wholeMsg);
log.error("push发送命令失败, pileSn:{}", pileSn, cause);
}