mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-29 23:50:00 +08:00
update 电单车协议
This commit is contained in:
@@ -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);
|
||||
// 充电时长/功率
|
||||
|
||||
Reference in New Issue
Block a user