mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-16 05:10:04 +08:00
删除Strategy逻辑
This commit is contained in:
@@ -2,7 +2,6 @@ package com.jsowell.netty.service.yunkuaichong;
|
|||||||
|
|
||||||
import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
|
import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 云快充处理service
|
* 云快充处理service
|
||||||
@@ -12,12 +11,10 @@ public interface YKCBusinessService {
|
|||||||
/**
|
/**
|
||||||
* 处理桩发来的请求
|
* 处理桩发来的请求
|
||||||
* 不需要应答的返回null
|
* 不需要应答的返回null
|
||||||
* @param msg 请求报文
|
* @param ykcDataProtocol 请求报文
|
||||||
* @param ctx 通道信息
|
* @param ctx 通道信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
byte[] process(byte[] msg, ChannelHandlerContext ctx);
|
|
||||||
|
|
||||||
byte[] process(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext ctx);
|
byte[] process(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext ctx);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,11 +10,9 @@ import com.jsowell.common.util.DateUtils;
|
|||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.common.util.YKCUtils;
|
import com.jsowell.common.util.YKCUtils;
|
||||||
import com.jsowell.netty.factory.YKCOperateFactory;
|
import com.jsowell.netty.factory.YKCOperateFactory;
|
||||||
import com.jsowell.netty.factory.YKCOperateFactoryV2;
|
|
||||||
import com.jsowell.netty.handler.yunkuaichong.AbstractYkcHandler;
|
import com.jsowell.netty.handler.yunkuaichong.AbstractYkcHandler;
|
||||||
import com.jsowell.netty.server.yunkuaichong.NettyServerHandler;
|
import com.jsowell.netty.server.yunkuaichong.NettyServerHandler;
|
||||||
import com.jsowell.netty.service.yunkuaichong.YKCBusinessService;
|
import com.jsowell.netty.service.yunkuaichong.YKCBusinessService;
|
||||||
import com.jsowell.netty.strategy.ykc.AbstractYkcStrategy;
|
|
||||||
import com.jsowell.pile.dto.SavePileMsgDTO;
|
import com.jsowell.pile.dto.SavePileMsgDTO;
|
||||||
import com.jsowell.pile.service.OrderBasicInfoService;
|
import com.jsowell.pile.service.OrderBasicInfoService;
|
||||||
import com.jsowell.pile.service.PileConnectorInfoService;
|
import com.jsowell.pile.service.PileConnectorInfoService;
|
||||||
@@ -47,26 +45,12 @@ public class YKCBusinessServiceImpl implements YKCBusinessService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OrderBasicInfoService orderBasicInfoService;
|
private OrderBasicInfoService orderBasicInfoService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private YKCOperateFactoryV2 ykcOperateFactoryV2;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisCache redisCache;
|
private RedisCache redisCache;
|
||||||
|
|
||||||
@Resource(name = "scheduledExecutorService")
|
@Resource(name = "scheduledExecutorService")
|
||||||
private ScheduledExecutorService 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
|
@Override
|
||||||
public byte[] process(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext ctx) {
|
public byte[] process(YKCDataProtocol ykcDataProtocol, ChannelHandlerContext ctx) {
|
||||||
if (!YKCUtils.checkMsg(ykcDataProtocol)) {
|
if (!YKCUtils.checkMsg(ykcDataProtocol)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user