mirror of
https://gitee.com/san-bing/JChargePointProtocol
synced 2026-05-03 17:39:55 +08:00
0x31 测试
This commit is contained in:
@@ -11,6 +11,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.google.common.util.concurrent.ListenableFuture;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import sanbing.jcpp.app.dal.config.ibatis.enums.GunRunStatusEnum;
|
||||
import sanbing.jcpp.app.dal.config.ibatis.enums.PileStatusEnum;
|
||||
@@ -395,7 +396,6 @@ public class DefaultPileProtocolService implements PileProtocolService {
|
||||
callback.onSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartChargeRequest(UplinkQueueMessage uplinkQueueMessage, Callback callback) {
|
||||
log.info("接收到充电桩启动充电请求 {}", uplinkQueueMessage);
|
||||
|
||||
@@ -403,28 +403,29 @@ public class DefaultPileProtocolService implements PileProtocolService {
|
||||
String pileCode = startChargeRequest.getPileCode();
|
||||
String gunCode = startChargeRequest.getGunCode();
|
||||
// TODO 处理相关业务逻辑
|
||||
String orderNo = "ORD" + RandomStringUtils.secure().nextNumeric(20);
|
||||
String logicalCardNo = RandomStringUtils.secure().nextNumeric(12);
|
||||
|
||||
// 构造下行回复
|
||||
DownlinkRequestMessage.Builder downlinkMessageBuilder = createDownlinkMessageBuilder(uplinkQueueMessage, startChargeRequest.getPileCode());
|
||||
|
||||
downlinkMessageBuilder.setDownlinkCmd(DownlinkCmdEnum.START_CHARGE_ACK.name());
|
||||
downlinkMessageBuilder.setStartChargeResponse(StartChargeResponse.newBuilder()
|
||||
.setTradeNo("")
|
||||
.setPileCode(startChargeRequest.getPileCode())
|
||||
.setGunCode(startChargeRequest.getGunCode())
|
||||
.setLogicalCardNo("")
|
||||
.setLimitYuan("0")
|
||||
.setAuthSuccess(false)
|
||||
.setFailReason(FailReason.ACCOUNT_NOT_ALLOWED_ON_PILE.name())
|
||||
.setTradeNo(orderNo)
|
||||
.setPileCode(startChargeRequest.getPileCode())
|
||||
.setGunCode(startChargeRequest.getGunCode())
|
||||
.setLogicalCardNo(logicalCardNo)
|
||||
.setLimitYuan("50")
|
||||
.setAuthSuccess(true)
|
||||
.setFailReason(FailReason.ACCOUNT_NOT_ALLOWED_ON_PILE.name())
|
||||
);
|
||||
|
||||
|
||||
log.info("业务[充电桩启动充电请求应答] 发送下行消息到充电桩: {}, 充电枪: {}", pileCode, gunCode);
|
||||
downlinkCallService.sendDownlinkMessage(downlinkMessageBuilder,pileCode);
|
||||
|
||||
callback.onSuccess();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void startCharge(String pileCode, String gunCode, BigDecimal limitYuan, String orderNo,
|
||||
String logicalCardNo, String physicalCardNo, String parallelNo) {
|
||||
|
||||
Reference in New Issue
Block a user