删除Strategy逻辑

This commit is contained in:
jsowell
2026-06-10 16:41:40 +08:00
parent c32622659a
commit b0049ffc85
2 changed files with 1 additions and 20 deletions

View File

@@ -2,7 +2,6 @@ package com.jsowell.netty.service.yunkuaichong;
import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelId;
/**
* 云快充处理service
@@ -12,12 +11,10 @@ public interface YKCBusinessService {
/**
* 处理桩发来的请求
* 不需要应答的返回null
* @param msg 请求报文
* @param ykcDataProtocol 请求报文
* @param ctx 通道信息
* @return 结果
*/
byte[] process(byte[] msg, ChannelHandlerContext ctx);
byte[] process(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext ctx);
/**

View File

@@ -10,11 +10,9 @@ import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.YKCUtils;
import com.jsowell.netty.factory.YKCOperateFactory;
import com.jsowell.netty.factory.YKCOperateFactoryV2;
import com.jsowell.netty.handler.yunkuaichong.AbstractYkcHandler;
import com.jsowell.netty.server.yunkuaichong.NettyServerHandler;
import com.jsowell.netty.service.yunkuaichong.YKCBusinessService;
import com.jsowell.netty.strategy.ykc.AbstractYkcStrategy;
import com.jsowell.pile.dto.SavePileMsgDTO;
import com.jsowell.pile.service.OrderBasicInfoService;
import com.jsowell.pile.service.PileConnectorInfoService;
@@ -47,26 +45,12 @@ public class YKCBusinessServiceImpl implements YKCBusinessService {
@Autowired
private OrderBasicInfoService orderBasicInfoService;
@Autowired
private YKCOperateFactoryV2 ykcOperateFactoryV2;
@Autowired
private RedisCache redisCache;
@Resource(name = "scheduledExecutorService")
private ScheduledExecutorService scheduledExecutorService;
@Override
public byte[] process(byte[] msg, ChannelHandlerContext ctx) {
if (!YKCUtils.checkMsg(msg)) {
return null;
}
YKCDataProtocol ykcDataProtocol = new YKCDataProtocol(msg);
String frameType = YKCUtils.frameType2Str(ykcDataProtocol.getFrameType());
AbstractYkcStrategy invokeStrategy = ykcOperateFactoryV2.getInvokeStrategy(frameType);
return invokeStrategy.supplyProcess(ykcDataProtocol, ctx);
}
@Override
public byte[] process(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext ctx) {
if (!YKCUtils.checkMsg(ykcDataProtocol)) {