update 预约充电update 预约充电

This commit is contained in:
Guoqs
2024-07-30 14:52:12 +08:00
parent 3308554a70
commit 3a11992904
9 changed files with 100 additions and 34 deletions

View File

@@ -184,7 +184,7 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
.reservedEndTime(pileReservationInfo.getEndTime().toLocalTime())
.amount(Constants.WHITELIST_DEFAULT_AMOUNT)
.build();
pileRemoteService.reservationCharging(command);
// pileRemoteService.reservationCharging(command);
}
}
@@ -235,7 +235,7 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
.reservedEndTime(pileReservationInfo.getEndTime().toLocalTime())
.amount(Constants.WHITELIST_DEFAULT_AMOUNT)
.build();
pileRemoteService.reservationCharging(command);
// pileRemoteService.reservationCharging(command);
}
}
@@ -413,12 +413,8 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
return;
}
/**
* 操作
* 0x01:启动 0x02:取消 0x03:修改
*/
// 操作 0x01:启动 0x02:取消 0x03:修改
String operation = "03";
if (StringUtils.isNotBlank(dto.getStartTime())) {
pileReservationInfo.setStartTime(Time.valueOf(dto.getStartTime()));
operation = "03";
@@ -427,6 +423,10 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
pileReservationInfo.setEndTime(Time.valueOf(dto.getEndTime()));
operation = "03";
}
if (StringUtils.isNotBlank(dto.getVerifyIdentity())) {
pileReservationInfo.setVerifyIdentity(dto.getVerifyIdentity());
operation = "03";
}
if (StringUtils.isNotBlank(dto.getStatus())) {
pileReservationInfo.setStatus(dto.getStatus());
if (StringUtils.equals(dto.getStatus(), Constants.ZERO)) {
@@ -437,12 +437,11 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
operation = "01";
}
}
if (StringUtils.isNotBlank(dto.getVerifyIdentity())) {
pileReservationInfo.setVerifyIdentity(dto.getVerifyIdentity());
}
pileReservationInfo.setUpdateBy(dto.getMemberId());
this.insertOrUpdateSelective(pileReservationInfo);
/*
先发送指令, 收到回复更新数据库
*/
// 查询会员的绑定vin列表 2024年7月30日11点04分 以当前请求会员的VIN为准
List<MemberPlateNumberVO> plateNumberVOList = memberPlateNumberRelationService.selectMemberPlateNumberRelation(dto.getMemberId());
List<String> vinCodes = Lists.newArrayList();
@@ -457,10 +456,7 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
while (vinCodes.size() < 3) {
vinCodes.add("");
}
String type = StringUtils.equals(pileReservationInfo.getReservationType(), "single") ? "00" : "01";
// 发送指令
ReservationChargingCommand command = ReservationChargingCommand.builder()
.transactionCode(Constants.ILLEGAL_TRANSACTION_CODE)
.pileSn(pileReservationInfo.getPileSn())
@@ -476,6 +472,11 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
.amount(Constants.WHITELIST_DEFAULT_AMOUNT)
.build();
pileRemoteService.reservationCharging(command);
// 从redis中获取回复, 3秒没有获取到判为超时
this.insertOrUpdateSelective(pileReservationInfo);
}
/**

View File

@@ -58,7 +58,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
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.RESERVATION_CHARGING_CODE.getBytes())
YKCUtils.frameType2Str(YKCFrameTypeCode.RESERVATION_CHARGING_SETUP_CODE.getBytes())
);
/**
@@ -539,7 +539,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
reservationTypeByteArr, verifyIdentityByteArr, vin1ByteArr, vin2ByteArr, vin3ByteArr,
reservedStartTimeByteArr, reservedEndTimeByteArr, amountByteArr);
this.push(msg, pileSn, YKCFrameTypeCode.RESERVATION_CHARGING_CODE);
this.push(msg, pileSn, YKCFrameTypeCode.RESERVATION_CHARGING_SETUP_CODE);
log.info("【=====平台下发指令=====】: 预约充电指令, 交易流水号:{}, 桩编号:{}, 枪口号:{}, 操作:{}, 身份验证:{}, 开始时间:{}, 结束时间:{}, 启动金额:{}",
transactionCode, pileSn, connectorCode, operation, verifyIdentity, DateUtils.formatDateTime(reservedStartTime), DateUtils.formatDateTime(reservedEndTime), amount);