update 电单车

This commit is contained in:
Guoqs
2024-09-30 15:49:55 +08:00
parent ff459818ce
commit a8d7e76d25
3 changed files with 34 additions and 5 deletions

View File

@@ -2,6 +2,7 @@ package com.jsowell.api.uniapp.customer;
import com.alibaba.fastjson2.JSON;
import com.jsowell.common.UserAgentUtils;
import com.jsowell.common.YouDianUtils;
import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.core.domain.AjaxResult;
@@ -100,6 +101,11 @@ public class JumpController extends BaseController {
logger.error("修改第三方平台枪口状态 error", e);
}
// 如果pileSN长度为8位需要解析一下
if (pileSn.length() == 8) {
pileSn = YouDianUtils.resolvePhysicalId(pileSn);
}
try {
// 进入充电桩详情做一下鉴权
String memberId = getMemberIdByAuthorization(request);
@@ -113,7 +119,7 @@ public class JumpController extends BaseController {
logger.error("app-xcx-h5查询充电桩详情 error", e);
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PILE_DETAIL_ERROR);
}
logger.info("app-xcx-h5查询充电桩详情 param:{}, result:{}", pileSn, JSON.toJSONString(response));
logger.info("app-xcx-h5查询充电桩详情withConnectorCode param:{}, result:{}", pileSn, JSON.toJSONString(response));
return response;
}

View File

@@ -232,10 +232,13 @@ public class PileService {
// 判断桩是否在线
boolean onLineStatus = pileConnectorInfoService.checkPileOffLine(pileInfoVO.getPileSn());
log.info("查询充电枪口详情-判断桩是否在线:{}, onLineStatus:{}", pileInfoVO.getPileSn(), onLineStatus);
if (onLineStatus) {
// true为离线
throw new BusinessException(ReturnCodeEnum.CODE_PILE_CONNECTOR_STATUS_OFF_LINE);
String activeProfile = SpringUtils.getActiveProfile();
log.info("查询充电枪口详情-判断桩是否在线:{}, onLineStatus:{}, activeProfile:{}", pileInfoVO.getPileSn(), onLineStatus, activeProfile);
if ("prd".equals(activeProfile)) {
if (onLineStatus) {
// true为离线
throw new BusinessException(ReturnCodeEnum.CODE_PILE_CONNECTOR_STATUS_OFF_LINE);
}
}
// 查询站点信息