mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-05 02:20:12 +08:00
充电桩退出加详细信息
This commit is contained in:
@@ -57,7 +57,7 @@ public class YKCBusinessServiceImpl implements YKCBusinessService {
|
|||||||
if (StringUtils.isBlank(pileSn)) {
|
if (StringUtils.isBlank(pileSn)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
log.info("充电桩退出:{}, channelId:{}", pileSn, PileChannelEntity.getChannelByPileSn(pileSn).channel().id());
|
log.info("充电桩退出:{}, 类型:主动断开链接, channelId:{}", pileSn, PileChannelEntity.getChannelByPileSn(pileSn).channel().id());
|
||||||
|
|
||||||
// 充电桩断开连接,所有枪口都设置为【离线】
|
// 充电桩断开连接,所有枪口都设置为【离线】
|
||||||
pileConnectorInfoService.updateConnectorStatusByPileSn(pileSn, PileConnectorDataBaseStatusEnum.OFF_NETWORK.getValue());
|
pileConnectorInfoService.updateConnectorStatusByPileSn(pileSn, PileConnectorDataBaseStatusEnum.OFF_NETWORK.getValue());
|
||||||
@@ -68,7 +68,7 @@ public class YKCBusinessServiceImpl implements YKCBusinessService {
|
|||||||
// 记录充电桩退出msg
|
// 记录充电桩退出msg
|
||||||
// 保存报文
|
// 保存报文
|
||||||
String type = YKCFrameTypeCode.PILE_LOG_OUT.getCode() + "";
|
String type = YKCFrameTypeCode.PILE_LOG_OUT.getCode() + "";
|
||||||
String jsonMsg = YKCFrameTypeCode.PILE_LOG_OUT.getValue();
|
String jsonMsg = YKCFrameTypeCode.PILE_LOG_OUT.getValue() + ": 充电桩主动断开链接";
|
||||||
pileMsgRecordService.save(pileSn, pileSn, type, jsonMsg, "");
|
pileMsgRecordService.save(pileSn, pileSn, type, jsonMsg, "");
|
||||||
|
|
||||||
// 删除桩编号和channel的关系
|
// 删除桩编号和channel的关系
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.jsowell.common.constant.CacheConstants;
|
|||||||
import com.jsowell.common.constant.Constants;
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.core.domain.ykc.GroundLockData;
|
import com.jsowell.common.core.domain.ykc.GroundLockData;
|
||||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||||
|
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
|
||||||
import com.jsowell.common.core.page.PageResponse;
|
import com.jsowell.common.core.page.PageResponse;
|
||||||
import com.jsowell.common.core.redis.RedisCache;
|
import com.jsowell.common.core.redis.RedisCache;
|
||||||
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
|
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
|
||||||
@@ -82,6 +83,9 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ThirdPartyStationRelationService thirdPartyStationRelationService;
|
private ThirdPartyStationRelationService thirdPartyStationRelationService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PileMsgRecordService pileMsgRecordService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PileStationInfoService pileStationInfoService;
|
private PileStationInfoService pileStationInfoService;
|
||||||
|
|
||||||
@@ -863,14 +867,25 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean checkPileOffLine(String pileSn) {
|
public boolean checkPileOffLine(String pileSn) {
|
||||||
|
boolean flag = false;
|
||||||
// 获取桩最后连接时间,最后连接到平台的时间在3分钟之前,判定为离线
|
// 获取桩最后连接时间,最后连接到平台的时间在3分钟之前,判定为离线
|
||||||
String lastConnectionTime = redisCache.getCacheObject(CacheConstants.PILE_LAST_CONNECTION + pileSn);
|
String lastConnectionTime = redisCache.getCacheObject(CacheConstants.PILE_LAST_CONNECTION + pileSn);
|
||||||
if (StringUtils.isBlank(lastConnectionTime)) {
|
if (StringUtils.isBlank(lastConnectionTime)) {
|
||||||
// 没有最后连接时间,返回离线
|
// 没有最后连接时间,返回离线
|
||||||
return true;
|
flag = true;
|
||||||
}
|
} else {
|
||||||
long l = DateUtils.intervalTime(lastConnectionTime, DateUtils.getDateTime());
|
long l = DateUtils.intervalTime(lastConnectionTime, DateUtils.getDateTime());
|
||||||
return l > 3L;
|
if (l > 3L) {
|
||||||
|
// 超过3分钟,返回离线
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
|
String type = YKCFrameTypeCode.PILE_LOG_OUT.getCode() + "";
|
||||||
|
String jsonMsg = YKCFrameTypeCode.PILE_LOG_OUT.getValue() + ": 超过3分钟无通信, 判断离线!";
|
||||||
|
pileMsgRecordService.save(pileSn, pileSn, type, jsonMsg, "");
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user