mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-10 10:19:54 +08:00
小程序扫二维码时判断桩、枪口状态并返回对应的信息
This commit is contained in:
@@ -190,6 +190,13 @@ public class PileService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 判断桩是否在线
|
||||||
|
boolean onLineStatus = pileConnectorInfoService.checkPileOffLine(pileInfoVO.getPileSn());
|
||||||
|
if (!onLineStatus) {
|
||||||
|
// 离线
|
||||||
|
throw new BusinessException(ReturnCodeEnum.CODE_PILE_CONNECTOR_STATUS_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
// 查询站点信息
|
// 查询站点信息
|
||||||
PileStationVO stationInfo = pileStationInfoService.getStationInfo(pileInfoVO.getStationId());
|
PileStationVO stationInfo = pileStationInfoService.getStationInfo(pileInfoVO.getStationId());
|
||||||
if (stationInfo == null || StringUtils.equals(stationInfo.getOpenFlag(), Constants.ZERO)) {
|
if (stationInfo == null || StringUtils.equals(stationInfo.getOpenFlag(), Constants.ZERO)) {
|
||||||
|
|||||||
@@ -131,4 +131,6 @@ public interface IPileConnectorInfoService {
|
|||||||
* @param pileConnectorInfo
|
* @param pileConnectorInfo
|
||||||
*/
|
*/
|
||||||
int updateConnectorParkNo(UpdateConnectorParkNoDTO dto);
|
int updateConnectorParkNo(UpdateConnectorParkNoDTO dto);
|
||||||
|
|
||||||
|
boolean checkPileOffLine(String pileSn);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -663,7 +663,7 @@ public class PileConnectorInfoServiceImpl implements IPileConnectorInfoService {
|
|||||||
* @param pileSn 桩编号
|
* @param pileSn 桩编号
|
||||||
* @return true离线
|
* @return true离线
|
||||||
*/
|
*/
|
||||||
private boolean checkPileOffLine(String pileSn) {
|
public boolean checkPileOffLine(String pileSn) {
|
||||||
// 获取桩最后连接时间,最后连接到平台的时间在1分钟之前,判定为离线
|
// 获取桩最后连接时间,最后连接到平台的时间在1分钟之前,判定为离线
|
||||||
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)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user