mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 03:55:17 +08:00
实时分账
This commit is contained in:
@@ -31,7 +31,7 @@ public class StartChargingCommand {
|
||||
private String connectorCode;
|
||||
|
||||
/**
|
||||
* 充电金额
|
||||
* 充电金额(元)
|
||||
*/
|
||||
private BigDecimal chargeAmount;
|
||||
|
||||
|
||||
@@ -17,14 +17,15 @@ import io.netty.channel.ChannelHandlerContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class EBikeSendCommandServiceImpl implements EBikeSendCommandService {
|
||||
|
||||
// 过载功率, 单位0.1W, 2450 * 0.1 = 2450W
|
||||
private final int OVER_LOAD_POWER = 2450;
|
||||
// 过载功率, 单位0.1W
|
||||
private final int OVER_LOAD_POWER = 9000;
|
||||
|
||||
/**
|
||||
* 电单车发送启动充电指令
|
||||
@@ -47,8 +48,9 @@ public class EBikeSendCommandServiceImpl implements EBikeSendCommandService {
|
||||
EBikeMessageCmd82.SpecificData data = new EBikeMessageCmd82.SpecificData();
|
||||
// 充电模式
|
||||
data.setRateMode(3);
|
||||
// 余额或有效期
|
||||
data.setBalanceOrValidity(1234);
|
||||
// 余额(分)或有效期
|
||||
int balance = command.getChargeAmount().multiply(new BigDecimal("100")).intValue();
|
||||
data.setBalanceOrValidity(balance);
|
||||
// 端口号
|
||||
data.setPortNumber(Integer.parseInt(connectorCode));
|
||||
// 充电命令
|
||||
|
||||
@@ -3165,24 +3165,6 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
logger.info("订单:{}支付成功, 发送启动指令", dto.getOrderCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步发送预约充电指令
|
||||
*/
|
||||
// if (StringUtils.equals(orderInfo.getStartType(), StartTypeEnum.RESERVED.getValue())) {
|
||||
// ReservationChargingCommand command = ReservationChargingCommand.builder()
|
||||
// .transactionCode(orderInfo.getTransactionCode())
|
||||
// .pileSn(orderInfo.getPileSn())
|
||||
// .connectorCode(orderInfo.getConnectorCode())
|
||||
// .operation(BytesUtil.bcd2Str(new byte[]{0x01}))
|
||||
// .reservedStartTime(orderInfo.getReservedStartTime())
|
||||
// .reservedEndTime(orderInfo.getReservedEndTime())
|
||||
// .amount(new BigDecimal(Constants.FIVE_HUNDRED))
|
||||
// .build();
|
||||
// // 发送预约充电指令
|
||||
// logger.info("订单:{}支付成功, 发送预约充电指令, command:{}", dto.getOrderCode(), JSON.toJSONString(command));
|
||||
// pileRemoteService.reservationCharging(command);
|
||||
// }
|
||||
|
||||
if (OrderStatusEnum.STAY_RETROACTIVE_AMOUNT.getValue().equals(orderInfo.getOrderStatus())) {
|
||||
// 如果订单状态是待补缴,表示已经停止充电了,需要补缴费用,补缴完成订单状态改为订单完成,设置结算时间
|
||||
orderInfo.setOrderStatus(OrderStatusEnum.ORDER_COMPLETE.getValue());
|
||||
|
||||
Reference in New Issue
Block a user