mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 03:55:17 +08:00
update 电单车协议
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
package com.jsowell.pile.domain.ebike;
|
||||
|
||||
import com.jsowell.pile.domain.ebike.deviceupload.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 友电电单车协议指令
|
||||
*/
|
||||
@Slf4j
|
||||
public enum EBikeCommandEnum {
|
||||
// HEARTBEAT("01", "设备心跳包"),
|
||||
REGISTRATION("20", "设备注册包", EBikeMessageCmd20.class),
|
||||
GET_SERVER_TIME("22", "设备获取服务器时间", EBikeMessageCmd22.class),
|
||||
HEARTBEAT_2("21", "设备心跳包", EBikeMessageCmd21.class),
|
||||
CARD_OPERATION("02", "刷卡操作", EBikeMessageCmd02.class),
|
||||
SETTLEMENT_UPLOAD("03", "结算消费信息上传", EBikeMessageCmd03.class),
|
||||
CHARGE_PORT_CONFIRMATION("04", "充电端口订单确认", EBikeMessageCmd04.class),
|
||||
POWER_HEARTBEAT("06", "端口充电时功率心跳包", EBikeMessageCmd06.class),
|
||||
// CHARGER_HEARTBEAT("41", "充电柜专有心跳包", EBikeMessageCmd41.class),
|
||||
// ALARM_PUSH("42", "报警推送指令", EBikeMessageCmd20.class),
|
||||
// CHARGE_COMPLETE("43", "充电完成通知,但不结算", EBikeMessageCmd20.class),
|
||||
// PORT_PUSH("44", "端口推送指令", EBikeMessageCmd20.class);
|
||||
|
||||
;
|
||||
|
||||
EBikeCommandEnum(String code, String desc, Class<? extends AbsEBikeMessage> msgClass) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
this.msgClass = msgClass;
|
||||
}
|
||||
|
||||
private final String code; // 帧类型code
|
||||
private final String desc; // 帧类型名称
|
||||
private final Class<? extends AbsEBikeMessage> msgClass;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public Class<? extends AbsEBikeMessage> getMsgClass() {
|
||||
return msgClass;
|
||||
}
|
||||
|
||||
public static Class<? extends AbsEBikeMessage> getMsgClassByCode(String code) {
|
||||
for (EBikeCommandEnum e : EBikeCommandEnum.values()) {
|
||||
if (e.getCode().equals(code)) {
|
||||
return e.getMsgClass();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2121,7 +2121,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
} catch (BaseAdaPayException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
logger.info("根据订单号:{}, 查询到支付信息:{}", orderCode, JSON.toJSONString(paymentInfoSet));
|
||||
logger.info("根据订单号:{}, 查询到支付信息:{}, ", orderCode, JSON.toJSONString(paymentInfoSet));
|
||||
if (CollectionUtils.isNotEmpty(paymentInfoSet)) {
|
||||
for (PaymentInfo paymentInfo : paymentInfoSet) {
|
||||
String paymentId = paymentInfo.getPaymentId();
|
||||
|
||||
@@ -207,7 +207,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
});
|
||||
|
||||
// 等待获取结果
|
||||
byte[] rpcResponse = syncPromise.get2(timeout, unit);
|
||||
byte[] rpcResponse = syncPromise.get(timeout, unit);
|
||||
|
||||
if(rpcResponse == null) {
|
||||
if(syncPromise.isTimeout()) {
|
||||
|
||||
Reference in New Issue
Block a user