update 电单车协议

This commit is contained in:
Guoqs
2024-09-18 16:44:24 +08:00
parent 502488166c
commit c0e981cdb8
12 changed files with 88 additions and 41 deletions

View File

@@ -7,7 +7,7 @@ import com.jsowell.common.util.id.IdUtils;
import com.jsowell.pile.domain.ebike.AbsEBikeMessage2;
import com.jsowell.pile.domain.ebike.deviceupload.ChargingOperationResponse;
import com.jsowell.pile.domain.ebike.serversend.EBikeMessageCmd82;
import com.jsowell.pile.domain.ykcCommond.StartChargingCommand;
import com.jsowell.pile.domain.ykcCommond.EBikeStartChargingCommand;
import com.jsowell.pile.domain.ykcCommond.StopChargingCommand;
import com.jsowell.pile.service.EBikeSendCommandService;
import io.netty.buffer.ByteBuf;
@@ -32,7 +32,7 @@ public class EBikeSendCommandServiceImpl implements EBikeSendCommandService {
* 电单车发送启动充电指令
*/
@Override
public ChargingOperationResponse sendStartChargingCommand(StartChargingCommand command) throws Exception {
public ChargingOperationResponse sendStartChargingCommand(EBikeStartChargingCommand command) throws Exception {
String pileSn = command.getPileSn();
String connectorCode = command.getConnectorCode();
String transactionCode = command.getTransactionCode();
@@ -47,12 +47,12 @@ public class EBikeSendCommandServiceImpl implements EBikeSendCommandService {
message.setCommand("82");
// 充电模式
message.setRateMode(3);
message.setRateMode(command.getRateMode());
// 余额(分)或有效期
int balance = command.getChargeAmount().multiply(new BigDecimal("100")).intValue();
message.setBalanceOrValidity(balance);
// 端口号
message.setPortNumber(Integer.parseInt(connectorCode));
message.setConnectorCode(connectorCode);
// 充电命令
message.setChargeCommand(1);
// 充电时长/功率
@@ -96,11 +96,11 @@ public class EBikeSendCommandServiceImpl implements EBikeSendCommandService {
message.setCommand("82");
// 充电模式
message.setRateMode(3);
message.setRateMode(2);
// 余额或有效期
message.setBalanceOrValidity(1234);
message.setBalanceOrValidity(1000);
// 端口号
message.setPortNumber(Integer.parseInt(connectorCode));
message.setConnectorCode(connectorCode);
// 充电命令
message.setChargeCommand(0);
// 充电时长/功率