mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-20 07:16:00 +08:00
update 扫描二维码充电时判断是否为个人桩
This commit is contained in:
@@ -176,7 +176,7 @@ public class JumpController extends BaseController {
|
||||
memberId = getMemberIdByAuthorization(request);
|
||||
}
|
||||
|
||||
AppletPileDetailVO vo = pileService.getConnectorDetail(pileConnectorCode);
|
||||
AppletPileDetailVO vo = pileService.getConnectorDetail(pileConnectorCode, memberId);
|
||||
logger.info("查询充电枪口详情, pileConnectorCode:{}, vo:{}", pileConnectorCode, JSON.toJSONString(vo));
|
||||
if (StringUtils.isNotBlank(memberId)) {
|
||||
addMember2MemberGroup(memberId, vo);
|
||||
|
||||
@@ -220,7 +220,7 @@ public class PileService {
|
||||
return vo;
|
||||
}
|
||||
|
||||
public AppletPileDetailVO getPileDetailByPileSn(String param) throws Exception {
|
||||
public AppletPileDetailVO getPileDetailByPileSn(String param, String memberId) throws Exception {
|
||||
AppletPileDetailVO vo = null;
|
||||
log.info("查询充电枪口详情-getPileDetailByPileSn, param:{}", param);
|
||||
if (StringUtils.isBlank(param)) {
|
||||
@@ -253,6 +253,19 @@ public class PileService {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_STATION_IS_NOT_OPEN);
|
||||
}
|
||||
|
||||
// 判断该桩是否为个人桩
|
||||
List<MemberVO> memberVOS = pileMemberRelationService.selectMemberList(pileSn);
|
||||
if (CollectionUtils.isNotEmpty(memberVOS)) {
|
||||
// 说明为个人桩, 判断会员信息
|
||||
// 将memberId收集成list
|
||||
List<String> memberIdList = memberVOS.stream()
|
||||
.map(MemberVO::getMemberId)
|
||||
.collect(Collectors.toList());
|
||||
// 如果会员没有绑定该桩,说明没有权限进行操作
|
||||
if (!memberIdList.contains(memberId)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_MEMBER_NOT_HAVE_PILE_PERMISSION);
|
||||
}
|
||||
|
||||
// 查询充电桩下枪口信息
|
||||
CompletableFuture<List<ConnectorInfoVO>> connectorInfoListFuture = CompletableFuture.supplyAsync(() -> pileConnectorInfoService.selectConnectorInfoList(pileSn), executor);
|
||||
// log.info("查询充电枪口详情-supplyAsync-selectConnectorInfoList:{}", connectorInfoListFuture);
|
||||
@@ -299,7 +312,7 @@ public class PileService {
|
||||
* @throws ExecutionException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public AppletPileDetailVO getConnectorDetail(String pileConnectorCode) throws Exception {
|
||||
public AppletPileDetailVO getConnectorDetail(String pileConnectorCode, String memberId) throws Exception {
|
||||
log.info("查询充电枪口详情, pileConnectorCode:{}", pileConnectorCode);
|
||||
PileConnectorDetailVO pileConnectorDetailVO = queryPileConnectorDetail(pileConnectorCode);
|
||||
log.info("查询充电枪口详情, pileConnectorDetailVO:{}", JSON.toJSONString(pileConnectorDetailVO));
|
||||
@@ -314,7 +327,7 @@ public class PileService {
|
||||
}
|
||||
}
|
||||
String pileSn = pileConnectorDetailVO.getPileSn();
|
||||
AppletPileDetailVO resultVO = getPileDetailByPileSn(pileSn);
|
||||
AppletPileDetailVO resultVO = getPileDetailByPileSn(pileSn, memberId);
|
||||
log.info("查询充电枪口详情getConnectorDetail, pileSn:{}, pileConnectorDetailVO:{}, resultVO:{}", pileSn, JSON.toJSONString(pileConnectorDetailVO), JSON.toJSONString(resultVO));
|
||||
List<ConnectorInfoVO> connectorInfoList = resultVO.getConnectorInfoList();
|
||||
if (connectorInfoList.size() > 1 && !StringUtils.equals(pileConnectorDetailVO.getChargePortType(), "3")) {
|
||||
|
||||
Reference in New Issue
Block a user