mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
update 电单车协议
This commit is contained in:
@@ -64,7 +64,7 @@ public class ChargingOperationResponse extends AbsEBikeMessage2 {
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
String s = "444e591d00198bca07da0c8200132738810124091416463569289954500000007907";
|
||||
String s = "444e591d00198bca07f106820013273881052409191439471814850828040000ad06";
|
||||
byte[] messageBytes = BytesUtil.hexStringToByteArray(s);
|
||||
ChargingOperationResponse response = new ChargingOperationResponse(messageBytes);
|
||||
System.out.println(response);
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
|
||||
import com.jsowell.common.constant.CacheConstants;
|
||||
import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.ebike.EBikeChargeCommandResponse;
|
||||
import com.jsowell.common.enums.ykc.ChargingFailedReasonEnum;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
@@ -55,6 +56,9 @@ public class PileRemoteService {
|
||||
@Autowired
|
||||
private EBikeSendCommandService eBikeSendCommandService;
|
||||
|
||||
@Autowired
|
||||
private OrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
@Value("${remoteUpdate.server}")
|
||||
private String serverAddress;
|
||||
|
||||
@@ -131,6 +135,17 @@ public class PileRemoteService {
|
||||
try {
|
||||
ChargingOperationResponse startChargingResponse = eBikeSendCommandService.sendStartChargingCommand(startChargingCommand);
|
||||
log.info("StartChargingResponse:{}", JSON.toJSONString(startChargingResponse));
|
||||
if (startChargingResponse != null) {
|
||||
int result = startChargingResponse.getResult();
|
||||
if (result == 0) {
|
||||
// 启动成功
|
||||
orderBasicInfoService.chargingPileStartedSuccessfully(transactionCode);
|
||||
} else {
|
||||
String failedReasonMsg = EBikeChargeCommandResponse.getDescriptionByCode(result);
|
||||
// 启动失败 682204000001000000000041
|
||||
orderBasicInfoService.chargingPileFailedToStart(transactionCode, failedReasonMsg);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("电单车远程启动充电error", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user