!21 绿能109,103,102,101,203,201指令提交

* 合并后代码修改
* 合并后代码修改
* Merge remote-tracking branch 'refs/remotes/upstream/master' into maste…
* PR后代码修改
* 109)充电桩状态信息包上报
* 109)充电桩状态信息包上报
This commit is contained in:
红中
2025-08-20 11:21:10 +00:00
committed by 三丙
parent 6b054c31a9
commit babd1696f6
12 changed files with 1541 additions and 2 deletions

View File

@@ -6,6 +6,7 @@
*/
package sanbing.jcpp.app.service.impl;
import com.fasterxml.jackson.databind.node.ObjectNode;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -21,6 +22,7 @@ import sanbing.jcpp.infrastructure.proto.model.PricingModel;
import sanbing.jcpp.infrastructure.proto.model.PricingModel.FlagPrice;
import sanbing.jcpp.infrastructure.proto.model.PricingModel.Period;
import sanbing.jcpp.infrastructure.queue.Callback;
import sanbing.jcpp.infrastructure.util.jackson.JacksonUtil;
import sanbing.jcpp.proto.gen.ProtocolProto.*;
import sanbing.jcpp.protocol.domain.DownlinkCmdEnum;
@@ -254,6 +256,7 @@ public class DefaultPileProtocolService implements PileProtocolService {
@Override
public void onTransactionRecordRequest(UplinkQueueMessage uplinkQueueMessage, Callback callback) {
log.info("接收到充电桩交易记录上报 {}", uplinkQueueMessage);
ObjectNode additionalInfo = JacksonUtil.newObjectNode();
TransactionRecordRequest transactionRecordRequest = uplinkQueueMessage.getTransactionRecordRequest();
@@ -262,10 +265,12 @@ public class DefaultPileProtocolService implements PileProtocolService {
// 构造下行计费
DownlinkRequestMessage.Builder downlinkMessageBuilder = createDownlinkMessageBuilder(uplinkQueueMessage, pileCode);
downlinkMessageBuilder.setDownlinkCmd(DownlinkCmdEnum.TRANSACTION_RECORD_ACK.name());
downlinkMessageBuilder.setTransactionRecordResponse(TransactionRecordResponse.newBuilder()
.setTradeNo(tradeNo)
.setSuccess(true)
.setAdditionalInfo(additionalInfo.toString())
.build());
downlinkCallService.sendDownlinkMessage(downlinkMessageBuilder, pileCode);