mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 12:05:05 +08:00
update 电单车协议
This commit is contained in:
@@ -76,7 +76,9 @@ public class EBikeMessageCmd82 extends AbsEBikeMessage {
|
||||
|
||||
// 告知设备的充电时长/电量, 如是0x0000则说明是充满自停, 其他数值则按照时长/电量充电, 且充满不会自停,
|
||||
private int chargeDurationOrPower; // 充电时长/电量 (2字节)
|
||||
private String orderNumber; // 订单编号 (16字节)
|
||||
|
||||
// 生成给桩的交易流水号, 桩协议叫订单编号
|
||||
private String transactionCode; // 订单编号 (16字节)
|
||||
|
||||
// 最大充电时长、过载功率:(只对当前端口当前订单有效,不影响其他端口)动态设置此参数,如果参数为0表示不修改,会使用设备的设置值,默认10小时
|
||||
private int maxChargeDuration; // 最大充电时长 (2字节)
|
||||
@@ -113,7 +115,7 @@ public class EBikeMessageCmd82 extends AbsEBikeMessage {
|
||||
this.chargeDurationOrPower = BytesUtil.bytesToIntLittle(chargeDurationOrPowerBytes);
|
||||
|
||||
byte[] orderNumberBytes = Arrays.copyOfRange(dataBytes, 9, 25);
|
||||
this.orderNumber = BytesUtil.bcd2StrLittle(orderNumberBytes);
|
||||
this.transactionCode = BytesUtil.bcd2StrLittle(orderNumberBytes);
|
||||
|
||||
byte[] maxChargeDurationBytes = Arrays.copyOfRange(dataBytes, 25, 27);
|
||||
this.maxChargeDuration = BytesUtil.bytesToIntLittle(maxChargeDurationBytes);
|
||||
@@ -159,7 +161,7 @@ public class EBikeMessageCmd82 extends AbsEBikeMessage {
|
||||
// 充电时长/电量
|
||||
byte[] chargeDurationOrPowerBytes = BytesUtil.intToBytesLittle(chargeDurationOrPower, 2);
|
||||
// 订单编号
|
||||
byte[] orderNumberBytes = BytesUtil.ensureLength(BytesUtil.str2Bcd(orderNumber), 16);
|
||||
byte[] orderNumberBytes = BytesUtil.ensureLength(BytesUtil.str2Bcd(transactionCode), 16);
|
||||
// 最大充电时长
|
||||
byte[] maxChargeDurationBytes = BytesUtil.intToBytesLittle(maxChargeDuration, 2);
|
||||
// 过载功率
|
||||
|
||||
@@ -20,6 +20,11 @@ import java.util.Objects;
|
||||
@Service
|
||||
public class EBikeSendCommandServiceImpl implements EBikeSendCommandService {
|
||||
|
||||
/**
|
||||
* 电单车发送启动充电指令
|
||||
* @param pileSn 电单车桩号
|
||||
* @param connectorCode 枪口号
|
||||
*/
|
||||
@Override
|
||||
public void startCharging(String pileSn, String connectorCode) {
|
||||
EBikeMessageCmd82 message = new EBikeMessageCmd82();
|
||||
@@ -42,8 +47,8 @@ public class EBikeSendCommandServiceImpl implements EBikeSendCommandService {
|
||||
data.setChargeDurationOrPower(chargeDurationOrPower);
|
||||
|
||||
// 订单编号
|
||||
String orderNumber = IdUtils.generateTransactionCode(pileSn, connectorCode);
|
||||
data.setOrderNumber(orderNumber);
|
||||
String transactionCode = IdUtils.generateTransactionCode(pileSn, connectorCode);
|
||||
data.setTransactionCode(transactionCode);
|
||||
|
||||
// 最大充电时长
|
||||
data.setMaxChargeDuration(0);
|
||||
|
||||
Reference in New Issue
Block a user