mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-26 17:03:41 +08:00
update 预约充电
This commit is contained in:
@@ -40,9 +40,6 @@ public class CommonController {
|
||||
|
||||
private static final String FILE_DELIMETER = ",";
|
||||
|
||||
@Value("${remoteUpdate.path}")
|
||||
private String FIRMWARE_FILEPATH;
|
||||
|
||||
/**
|
||||
* 通用下载请求
|
||||
*
|
||||
|
||||
@@ -3054,7 +3054,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
} else if (StartModeEnum.VIN_CODE.getValue().equals(dto.getStartMode())) {
|
||||
sendStartCharging = false;
|
||||
} else if (StartTypeEnum.RESERVED.getValue().equals(orderInfo.getStartType())) {
|
||||
sendStartCharging = false;
|
||||
// sendStartCharging = false;
|
||||
} else if (OrderStatusEnum.STAY_RETROACTIVE_AMOUNT.getValue().equals(orderInfo.getOrderStatus())) {
|
||||
sendStartCharging = false;
|
||||
}
|
||||
@@ -3107,6 +3107,28 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
logger.info("订单:{}支付成功, 发送启动指令", dto.getOrderCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步发送预约充电指令
|
||||
*/
|
||||
if (StringUtils.equals(orderInfo.getStartType(), StartTypeEnum.RESERVED.getValue())) {
|
||||
ReservedChargingCommand command = ReservedChargingCommand.builder()
|
||||
.transactionCode(orderInfo.getTransactionCode())
|
||||
.pileSn(orderInfo.getPileSn())
|
||||
.connectorCode(orderInfo.getPileConnectorCode())
|
||||
.operation(BytesUtil.bcd2Str(new byte[]{0x01}))
|
||||
.reservedStartTime(orderInfo.getReservedStartTime())
|
||||
.reservedStartTime(orderInfo.getReservedEndTime())
|
||||
.amount(new BigDecimal(Constants.FIVE_HUNDRED))
|
||||
.build();
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
pileRemoteService.reservedCharging(command);
|
||||
} catch (Exception e) {
|
||||
logger.error("异步发送预约充电指令, orderCode:{}", orderInfo.getOrderCode(), e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (OrderStatusEnum.STAY_RETROACTIVE_AMOUNT.getValue().equals(orderInfo.getOrderStatus())) {
|
||||
// 如果订单状态是待补缴,表示已经停止充电了,需要补缴费用,补缴完成订单状态改为订单完成,设置结算时间
|
||||
orderInfo.setOrderStatus(OrderStatusEnum.ORDER_COMPLETE.getValue());
|
||||
@@ -3591,28 +3613,6 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
.orderDetail(orderDetail)
|
||||
.build();
|
||||
pileTransactionService.doCreateOrder(createOrderTransactionDTO);
|
||||
|
||||
/**
|
||||
* 异步发送预约充电指令
|
||||
*/
|
||||
if (StringUtils.equals(dto.getStartType(), StartTypeEnum.RESERVED.getValue())) {
|
||||
ReservedChargingCommand command = ReservedChargingCommand.builder()
|
||||
.transactionCode(orderBasicInfo.getTransactionCode())
|
||||
.pileSn(orderBasicInfo.getPileSn())
|
||||
.connectorCode(orderBasicInfo.getPileConnectorCode())
|
||||
.operation(BytesUtil.bcd2Str(new byte[]{0x01}))
|
||||
.reservedStartTime(DateUtils.parseDate(dto.getReservedStartTime(), DateUtils.YYYY_MM_DD_HH_MM_SS))
|
||||
.reservedStartTime(DateUtils.parseDate(dto.getReservedEndTime(), DateUtils.YYYY_MM_DD_HH_MM_SS))
|
||||
.amount(new BigDecimal(Constants.FIVE_HUNDRED))
|
||||
.build();
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
pileRemoteService.reservedCharging(command);
|
||||
} catch (Exception e) {
|
||||
logger.error("异步发送预约充电指令, orderCode:{}", orderBasicInfo.getOrderCode(), e);
|
||||
}
|
||||
});
|
||||
}
|
||||
return orderBasicInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
|
||||
/**
|
||||
* 发送push消息
|
||||
*
|
||||
* @param msg
|
||||
* @param pileSn
|
||||
* @param frameTypeCode
|
||||
@@ -180,6 +181,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
|
||||
/**
|
||||
* 发送停止ch
|
||||
*
|
||||
* @param command
|
||||
*/
|
||||
@Override
|
||||
@@ -254,6 +256,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
|
||||
/**
|
||||
* 0x56 对时设置
|
||||
*
|
||||
* @param command
|
||||
*/
|
||||
@Override
|
||||
@@ -275,6 +278,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
|
||||
/**
|
||||
* 向充电桩发送计费模板
|
||||
*
|
||||
* @param command
|
||||
*/
|
||||
@Override
|
||||
@@ -387,6 +391,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
|
||||
/**
|
||||
* 平台査询工作参数
|
||||
*
|
||||
* @param command
|
||||
*/
|
||||
@Override
|
||||
@@ -413,6 +418,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
|
||||
/**
|
||||
* 远程账户余额更新
|
||||
*
|
||||
* @param command
|
||||
*/
|
||||
@Override
|
||||
@@ -438,6 +444,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
|
||||
/**
|
||||
* 遥控地锁
|
||||
*
|
||||
* @param command
|
||||
*/
|
||||
@Override
|
||||
@@ -470,6 +477,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
|
||||
/**
|
||||
* 发送预约充电命令
|
||||
*
|
||||
* @param command
|
||||
*/
|
||||
@Override
|
||||
@@ -505,6 +513,10 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
// 拼装msg信息
|
||||
byte[] msg = Bytes.concat(transactionCodeArr, pileSnByteArr, connectorCodeByteArr, operateByteArr,
|
||||
reservedStartTimeByteArr, reservedEndTimeByteArr, amountByteArr);
|
||||
|
||||
this.push(msg, pileSn, YKCFrameTypeCode.RESERVE_CHARGING_CODE);
|
||||
|
||||
log.info("=====平台下发指令=====: 预约充电指令, 交易流水号:{}, 桩编号:{}, 枪口号:{}, 操作:{}, 开始时间:{}, 结束时间:{}, 启动金额:{}",
|
||||
transactionCode, pileSn, connectorCode, operation, DateUtils.formatDateTime(reservedStartTime), DateUtils.formatDateTime(reservedEndTime), amount);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user