update 电单车协议

This commit is contained in:
Guoqs
2024-08-30 17:23:04 +08:00
parent 07f4f4f76e
commit 0e38ea9e13
9 changed files with 58 additions and 12 deletions

View File

@@ -455,6 +455,17 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
infoVO.setRatedPower(pileModelInfoVO.getRatedPower());
infoVO.setRatedCurrent(pileModelInfoVO.getRatedCurrent());
infoVO.setRatedVoltage(pileModelInfoVO.getRatedVoltage());
String chargePortType;
if (StringUtils.equals(Constants.TWO, pileModelInfoVO.getChargerPileType())) {
chargePortType = Constants.THREE;
} else {
if (StringUtils.equals(Constants.ONE, pileModelInfoVO.getSpeedType())) {
chargePortType = Constants.ONE;
} else {
chargePortType = Constants.TWO;
}
}
infoVO.setChargePortType(chargePortType);
}
connectorInfoList.add(infoVO);
}
@@ -682,14 +693,14 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
* @return true离线
*/
public boolean checkPileOffLine(String pileSn) {
// 获取桩最后连接时间,最后连接到平台的时间在1分钟之前,判定为离线
// 获取桩最后连接时间,最后连接到平台的时间在3分钟之前,判定为离线
String lastConnectionTime = redisCache.getCacheObject(CacheConstants.PILE_LAST_CONNECTION + pileSn);
if (StringUtils.isBlank(lastConnectionTime)) {
// 没有最后连接时间,返回离线
return true;
}
long l = DateUtils.intervalTime(lastConnectionTime, DateUtils.getDateTime());
return l >= 1L;
return l > 3L;
}
/**