mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
电单车发送停止充电指令 处理异常
This commit is contained in:
@@ -125,9 +125,15 @@ public class EBikeSendCommandServiceImpl implements EBikeSendCommandService {
|
||||
message.setForceAutoStopWhenFull(1);
|
||||
message.setFullChargePower(0);
|
||||
message.setMaxFullChargePowerCheckTime(0);
|
||||
byte[] response = this.send(message);
|
||||
log.info("电单车发送停止充电指令response:{}", BytesUtil.binary(response, 16));
|
||||
return new ChargingOperationResponse(response);
|
||||
// send方法有可能抛异常,所以这里用try-catch, 避免异常
|
||||
try {
|
||||
byte[] response = this.send(message);
|
||||
log.info("电单车发送停止充电指令response:{}", BytesUtil.binary(response, 16));
|
||||
return new ChargingOperationResponse(response);
|
||||
} catch (Exception e) {
|
||||
log.error("电单车发送停止充电指令异常:{}", e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user