mirror of
https://gitee.com/san-bing/JChargePointProtocol
synced 2026-05-04 09:59:55 +08:00
Merge remote-tracking branch '红中/master-feat-lvneng-0911'
# Conflicts: # jcpp-app/src/main/java/sanbing/jcpp/app/service/PileProtocolService.java # jcpp-infrastructure-proto/src/main/proto/downlink.proto # jcpp-infrastructure-proto/src/main/proto/uplink.proto
This commit is contained in:
@@ -67,6 +67,21 @@ public class TestController extends BaseController {
|
||||
return ResponseEntity.ok("success");
|
||||
}
|
||||
|
||||
@GetMapping("/setQrcode")
|
||||
public ResponseEntity<String> setQrcode() {
|
||||
QrcodeModelProto rcodeModelProto = QrcodeModelProto.newBuilder()
|
||||
.setGunName("1号枪二维码")
|
||||
.setCode("www.baidu.com/rcode=1")
|
||||
.build();
|
||||
SetQrcodeRequest setQrcodeRequest = SetQrcodeRequest.newBuilder()
|
||||
.setPileCode("20231212000010")
|
||||
.setQrcodeModel(rcodeModelProto)
|
||||
.build();
|
||||
|
||||
pileProtocolService.setQrcode(setQrcodeRequest);
|
||||
|
||||
return ResponseEntity.ok("success");
|
||||
}
|
||||
@GetMapping("/restartPile")
|
||||
public ResponseEntity<String> restartPile() {
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ import sanbing.jcpp.proto.gen.DownlinkProto.OfflineCardSyncRequest;
|
||||
import sanbing.jcpp.proto.gen.DownlinkProto.OtaRequest;
|
||||
import sanbing.jcpp.proto.gen.DownlinkProto.SetPricingRequest;
|
||||
import sanbing.jcpp.proto.gen.UplinkProto.UplinkQueueMessage;
|
||||
import sanbing.jcpp.proto.gen.DownlinkProto.SetQrcodeRequest;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -208,4 +210,12 @@ public interface PileProtocolService {
|
||||
*/
|
||||
void postBmsDemandChargerOutput(UplinkQueueMessage uplinkQueueMessage, Callback callback);
|
||||
|
||||
/**
|
||||
* 服务器下发充电桩字符型参数
|
||||
*/
|
||||
void setQrcode( SetQrcodeRequest setQrcodeRequest );
|
||||
/**
|
||||
* 服务器下发充电桩字符型参数反馈
|
||||
*/
|
||||
void onSetQrcodeResponse(UplinkQueueMessage uplinkQueueMsg, Callback callback);
|
||||
}
|
||||
@@ -657,6 +657,33 @@ public class DefaultPileProtocolService implements PileProtocolService {
|
||||
callback.onSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setQrcode(SetQrcodeRequest setQrcodeRequest) {
|
||||
UUID messageId = UUID.randomUUID();
|
||||
UUID requestId = UUID.randomUUID();
|
||||
String pileCode = setQrcodeRequest.getPileCode();
|
||||
|
||||
DownlinkRequestMessage.Builder downlinkRequestMessageBuilder = DownlinkRequestMessage.newBuilder()
|
||||
.setMessageIdMSB(messageId.getMostSignificantBits())
|
||||
.setMessageIdLSB(messageId.getLeastSignificantBits())
|
||||
.setPileCode(pileCode)
|
||||
.setRequestIdMSB(requestId.getMostSignificantBits())
|
||||
.setRequestIdLSB(requestId.getLeastSignificantBits())
|
||||
.setDownlinkCmd(DownlinkCmdEnum.SET_QRCODE.name())
|
||||
.setSetQrcodeRequest(setQrcodeRequest);
|
||||
|
||||
downlinkCallService.sendDownlinkMessage(downlinkRequestMessageBuilder, pileCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetQrcodeResponse(UplinkQueueMessage uplinkQueueMessage, Callback callback) {
|
||||
log.info("下发充电桩字符型应答 {}", uplinkQueueMessage);
|
||||
|
||||
// TODO 处理相关业务逻辑
|
||||
|
||||
callback.onSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postLockStatus(UplinkQueueMessage uplinkQueueMessage, Callback callback) {
|
||||
log.info("接收到地锁状态信息 {}", uplinkQueueMessage);
|
||||
|
||||
@@ -261,6 +261,10 @@ public class ProtocolUplinkConsumerService extends AbstractConsumerService {
|
||||
|
||||
pileProtocolService.onStartChargeRequest(uplinkQueueMsg, callback);
|
||||
|
||||
} else if (uplinkQueueMsg.hasSetQrcodeResponse()) {
|
||||
|
||||
pileProtocolService.onSetQrcodeResponse(uplinkQueueMsg, callback);
|
||||
|
||||
} else {
|
||||
|
||||
callback.onSuccess();
|
||||
|
||||
Reference in New Issue
Block a user