update 电单车协议

This commit is contained in:
Guoqs
2024-09-04 11:23:56 +08:00
parent c2a01a917f
commit d72fb131d8
5 changed files with 16 additions and 13 deletions

View File

@@ -64,7 +64,7 @@ public class ElectricBicyclesServerHandler extends ChannelInboundHandlerAdapter
// 处理数据
byte[] response = eBikeService.process(msg, ctx);
if (Objects.nonNull(response)) {
log.info("[响应数据]:{}", BytesUtil.binary(response, 16));
log.info("[电单车===>响应数据]:{}", BytesUtil.binary(response, 16));
// 响应客户端
ByteBuf buffer = ctx.alloc().buffer().writeBytes(response);
// this.channelWrite(channel.id(), buffer);

View File

@@ -37,7 +37,7 @@ public class EBikeBusinessServiceImpl implements EBikeBusinessService {
EBikeDataProtocol eBikeDataProtocol = new EBikeDataProtocol(msg);
// 获取帧类型
String command = YKCUtils.frameType2Str(eBikeDataProtocol.getCommand());
log.info("收到消息, channelId:{}, 指令:{}, msg:{}", ctx.channel().id().toString(), command, BytesUtil.binary(msg, 16));
log.info("电单车===>收到消息, channelId:{}, 指令:{}, msg:{}", ctx.channel().id().toString(), command, BytesUtil.binary(msg, 16));
// 获取业务处理handler
AbstractEBikeHandler invokeStrategy = EBikeOperateFactory.getInvokeStrategy(command);
if (invokeStrategy != null) {

View File

@@ -173,7 +173,6 @@ public class PileRemoteService {
* @return
*/
public boolean publishBillingTemplate(PublishBillingTemplateDTO dto) {
// 获取计费模板信息
BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateByTemplateId(dto.getTemplateId());
if (billingTemplateVO == null) {

View File

@@ -53,6 +53,9 @@ public abstract class AbstractProgramLogic implements InitializingBean {
@Autowired
protected PileBasicInfoService pileBasicInfoService;
@Autowired
protected PileConnectorInfoService pileConnectorInfoService;
@Autowired
protected PileStationInfoService pileStationInfoService;

View File

@@ -30,6 +30,7 @@ import com.jsowell.pile.domain.*;
import com.jsowell.pile.dto.*;
import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
import com.jsowell.pile.vo.uniapp.customer.MemberVO;
import com.jsowell.pile.vo.uniapp.customer.PileConnectorDetailVO;
import com.jsowell.pile.vo.web.BalanceDeductionAmountVO;
import com.jsowell.pile.vo.web.BillingTemplateVO;
import com.jsowell.pile.vo.web.OrderDetailInfoVO;
@@ -72,15 +73,14 @@ public class DelayMerchantProgramLogic extends AbstractProgramLogic {
orderBasicInfoService.analysisPileParameter(dto);
// 判断桩是电动汽车桩还是电单车桩
// 校验充电桩相关的信息
if (StringUtils.isBlank(dto.getTransactionCode())) {
// 无transactionCode, 表示由平台端启动充电, 需要验证充电桩状态
orderBasicInfoService.checkPileInfo(dto);
PileConnectorDetailVO pileConnectorDetailVO = pileBasicInfoService.queryPileConnectorDetail(dto.getPileConnectorCode());
if (!StringUtils.equals(pileConnectorDetailVO.getChargePortType(), "3")) { // 不是3就是电动汽车桩
// 电车桩
return generateOrderForEV(dto);
} else {
// 电动车桩
return generateOrderForEBike(dto);
}
// 保存订单到数据库 saveOrder2Database
return orderBasicInfoService.saveOrder2Database(dto);
}
/**
@@ -90,7 +90,6 @@ public class DelayMerchantProgramLogic extends AbstractProgramLogic {
* @throws ParseException
*/
private OrderBasicInfo generateOrderForEV(GenerateOrderDTO dto) throws ParseException {
// 校验充电桩相关的信息
if (StringUtils.isBlank(dto.getTransactionCode())) {
// 无transactionCode, 表示由平台端启动充电, 需要验证充电桩状态
@@ -104,7 +103,9 @@ public class DelayMerchantProgramLogic extends AbstractProgramLogic {
/**
* 生成电单车订单
*/
private OrderBasicInfo generateOrderForEBike(GenerateOrderDTO dto) throws ParseException {
private OrderBasicInfo generateOrderForEBike(GenerateOrderDTO dto) {
return null;
}