mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 电单车
This commit is contained in:
@@ -4,7 +4,9 @@ import com.jsowell.common.core.domain.ebike.EBikeDataProtocol;
|
||||
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
|
||||
import com.jsowell.common.enums.ykc.PileChannelEntity;
|
||||
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
|
||||
import com.jsowell.common.protocol.SyncPromise;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
import com.jsowell.common.util.RpcUtil;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.YKCUtils;
|
||||
import com.jsowell.netty.factory.EBikeOperateFactory;
|
||||
@@ -40,6 +42,19 @@ public class EBikeBusinessServiceImpl implements EBikeBusinessService {
|
||||
String command = YKCUtils.frameType2Str(eBikeDataProtocol.getCommand());
|
||||
log.info("电单车===>收到消息, channelId:{}, 指令:{}, 指令名称:{}, msg:{}", ctx.channel().id().toString(), command,
|
||||
EBikeCommandEnum.getDescByCode(BytesUtil.bytesToIntLittle(eBikeDataProtocol.getCommand())), BytesUtil.binary(msg, 16));
|
||||
|
||||
// 根据请求id,在集合中找到与外部线程通信的SyncPromise对象
|
||||
String msgId = ctx.channel().id().toString() + "_" + command;
|
||||
log.info("同步获取响应数据-收到消息, msgId:{}", msgId);
|
||||
SyncPromise syncPromise = RpcUtil.getSyncPromiseMap().get(msgId);
|
||||
if(syncPromise != null) {
|
||||
// 设置响应结果
|
||||
syncPromise.setRpcResult(msg);
|
||||
// 唤醒外部线程
|
||||
// log.info("同步获取响应数据-唤醒外部线程, SyncPromise:{}", JSON.toJSONString(syncPromise));
|
||||
syncPromise.wake();
|
||||
}
|
||||
|
||||
// 获取业务处理handler
|
||||
AbstractEBikeHandler invokeStrategy = EBikeOperateFactory.getInvokeStrategy(command);
|
||||
if (invokeStrategy != null) {
|
||||
|
||||
Reference in New Issue
Block a user