From b8a7569f3d5058fa5cce1b83fc53b6d22f4e3e49 Mon Sep 17 00:00:00 2001 From: Lemon Date: Sun, 4 Jan 2026 10:18:28 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=9F=A5=E8=AF=A2=E7=AB=99=E7=82=B9?= =?UTF-8?q?=E6=9E=AA=E5=8F=A3=E5=88=97=E8=A1=A8=20=E5=85=A5=E5=8F=82statio?= =?UTF-8?q?nId=20---->=20merchantId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/business/QueryConnectorInfoDTO.java | 12 +++++++++ .../impl/PileConnectorInfoServiceImpl.java | 26 +++++++++++++++---- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/business/QueryConnectorInfoDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/business/QueryConnectorInfoDTO.java index 0221487c8..309eb77d3 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/dto/business/QueryConnectorInfoDTO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/business/QueryConnectorInfoDTO.java @@ -5,6 +5,8 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.List; + /** * 运营端小程序查询枪口信息DTO * @@ -40,4 +42,14 @@ public class QueryConnectorInfoDTO { * 枪口编号 */ private String pileConnectorCode; + + /** + * 站点Id List + */ + private List stationIds; + + /** + * 运营商id + */ + private String merchantId; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java index f6c5902ea..4f1d1a068 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java @@ -25,6 +25,7 @@ import com.jsowell.common.util.spring.SpringUtils; import com.jsowell.pile.domain.OrderBasicInfo; import com.jsowell.pile.domain.PileBasicInfo; import com.jsowell.pile.domain.PileConnectorInfo; +import com.jsowell.pile.domain.PileStationInfo; import com.jsowell.pile.dto.QueryConnectorDTO; import com.jsowell.pile.dto.QueryConnectorListDTO; import com.jsowell.pile.dto.UpdateConnectorParkNoDTO; @@ -1056,15 +1057,30 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { */ @Override public BusinessConnectorInfoVO getConnectorListByStationAndStatus(QueryConnectorInfoDTO dto) { - String stationId = dto.getStationId(); + // String stationId = dto.getStationId(); + String merchantId = dto.getMerchantId(); + // List stationIds = dto.getStationIds(); String connectorStatus = dto.getConnectorStatus(); int pageNum = dto.getPageNum(); int pageSize = dto.getPageSize(); BusinessConnectorInfoVO vo = new BusinessConnectorInfoVO(); - // 根据站点id查询枪口列表(有缓存) - List uniAppConnectorList = getUniAppConnectorList(Long.parseLong(stationId)); + // 通过merchantId查询站点ids + List pileStationInfos = pileStationInfoService.selectStationListByMerchantIdWithAuth(Long.parseLong(merchantId)); + // 收集站点ids + List longStationIds = pileStationInfos.stream() + .map(PileStationInfo::getId) + .collect(Collectors.toList()); + if (CollectionUtils.isEmpty(longStationIds)) { + return vo; + } + List StationIds = longStationIds.stream() + .map(String::valueOf) // 或 s -> Long.parseLong(s) + .collect(Collectors.toList()); + // 根据站点ids查询枪口列表(有缓存) + // List uniAppConnectorList = getUniAppConnectorList(Long.parseLong(stationId)); + List connectorInfoVOS = batchSelectConnectorList(StationIds); // 筛选出枪口编号 - List pileConnectorCodeList = uniAppConnectorList.stream() + List pileConnectorCodeList = connectorInfoVOS.stream() .map(ConnectorInfoVO::getPileConnectorCode) .collect(Collectors.toList()); // 批量获取某状态的枪口数量 @@ -1086,7 +1102,7 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { QueryConnectorListDTO queryConnectorListDTO = QueryConnectorListDTO.builder() .pageNum(pageNum) .pageSize(pageSize) - .stationIdList(Lists.newArrayList(Long.parseLong(stationId))) + .stationIdList(longStationIds) .build(); List pileConnectorInfoVOList = getConnectorInfoListByParams(queryConnectorListDTO); if (connectorStatus != null) {