mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 校验channel是否保存
This commit is contained in:
@@ -4,12 +4,11 @@ import com.google.common.primitives.Bytes;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.core.domain.ykc.YKCDataProtocol;
|
||||
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.ykc.PileChannelEntity;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
import com.jsowell.common.util.YKCUtils;
|
||||
import com.jsowell.netty.factory.YKCOperateFactory;
|
||||
import com.jsowell.pile.service.IPileBasicInfoService;
|
||||
import com.jsowell.pile.service.IPileConnectorInfoService;
|
||||
import io.netty.channel.Channel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -24,15 +23,9 @@ public class HeartbeatRequestHandler extends AbstractHandler {
|
||||
|
||||
private final String type = YKCUtils.frameType2Str(YKCFrameTypeCode.HEART_BEAT_CODE.getBytes());
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Autowired
|
||||
private IPileBasicInfoService pileBasicInfoService;
|
||||
|
||||
@Autowired
|
||||
private IPileConnectorInfoService pileConnectorInfoService;
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
YKCOperateFactory.register(type, this);
|
||||
@@ -54,6 +47,9 @@ public class HeartbeatRequestHandler extends AbstractHandler {
|
||||
// 保存时间
|
||||
saveLastTime(pileSn);
|
||||
|
||||
// 校验channel
|
||||
PileChannelEntity.checkChannel(pileSn, channel);
|
||||
|
||||
// 枪号
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
|
||||
@@ -196,7 +196,7 @@ public class LoginRequestHandler extends AbstractHandler {
|
||||
if (pileInfoVO != null) {
|
||||
flag = Constants.zeroByteArray;
|
||||
// 登录成功,保存桩号和channel的关系
|
||||
PileChannelEntity.put(pileSn, channel);
|
||||
PileChannelEntity.checkChannel(pileSn, channel);
|
||||
// 更改桩和该桩下的枪口状态分别为 在线、空闲 公共方法修改状态
|
||||
pileBasicInfoService.updateStatus(BytesUtil.bcd2Str(ykcDataProtocol.getFrameType()), pileSn, null, null, null);
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||
import com.jsowell.common.enums.ykc.OrderStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.PileChannelEntity;
|
||||
import com.jsowell.common.enums.ykc.StartModeEnum;
|
||||
import com.jsowell.common.enums.ykc.YKCPileFaultReasonEnum;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
@@ -108,6 +109,9 @@ public class UploadRealTimeMonitorHandler extends AbstractHandler {
|
||||
// 保存时间
|
||||
saveLastTime(pileSn);
|
||||
|
||||
// 校验channel
|
||||
PileChannelEntity.checkChannel(pileSn, channel);
|
||||
|
||||
// 枪号
|
||||
startIndex += length;
|
||||
length = 1;
|
||||
|
||||
Reference in New Issue
Block a user