mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 修复离线bug
This commit is contained in:
@@ -168,6 +168,16 @@ public class CacheConstants {
|
||||
*/
|
||||
public static final String PILE_LAST_CONNECTION = "pile_last_connection:";
|
||||
|
||||
/**
|
||||
* 充电桩待确认断链标记
|
||||
*/
|
||||
public static final String PILE_PENDING_DISCONNECT = "pile_pending_disconnect:";
|
||||
|
||||
/**
|
||||
* 充电桩已确认离线标记
|
||||
*/
|
||||
public static final String PILE_OFFLINE_CONFIRMED = "pile_offline_confirmed:";
|
||||
|
||||
/**
|
||||
* 查询枪口信息列表前缀
|
||||
*/
|
||||
|
||||
@@ -137,6 +137,21 @@ public class PileChannelEntity {
|
||||
manager.remove(pileSn);
|
||||
}
|
||||
|
||||
public static boolean removeByPileSnAndChannelId(String pileSn, String expectedChannelId) {
|
||||
if (StringUtils.isBlank(pileSn) || StringUtils.isBlank(expectedChannelId)) {
|
||||
return false;
|
||||
}
|
||||
ChannelHandlerContext currentCtx = manager.get(pileSn);
|
||||
if (currentCtx == null || currentCtx.channel() == null) {
|
||||
return false;
|
||||
}
|
||||
String currentChannelId = currentCtx.channel().id().asLongText();
|
||||
if (!StringUtils.equals(currentChannelId, expectedChannelId)) {
|
||||
return false;
|
||||
}
|
||||
return manager.remove(pileSn, currentCtx);
|
||||
}
|
||||
|
||||
public static void removeByChannelId(String channelId){
|
||||
if (StringUtils.isBlank(channelId)) {
|
||||
return;
|
||||
@@ -147,4 +162,4 @@ public class PileChannelEntity {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user