From b8a7569f3d5058fa5cce1b83fc53b6d22f4e3e49 Mon Sep 17 00:00:00 2001 From: Lemon Date: Sun, 4 Jan 2026 10:18:28 +0800 Subject: [PATCH 1/2] =?UTF-8?q?update=20=E6=9F=A5=E8=AF=A2=E7=AB=99?= =?UTF-8?q?=E7=82=B9=E6=9E=AA=E5=8F=A3=E5=88=97=E8=A1=A8=20=E5=85=A5?= =?UTF-8?q?=E5=8F=82stationId=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) { From c2e5e900b0cfcb7bb669db2610277334d16078c4 Mon Sep 17 00:00:00 2001 From: Lemon Date: Sun, 4 Jan 2026 14:28:00 +0800 Subject: [PATCH 2/2] update --- .../impl/PileConnectorInfoServiceImpl.java | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) 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 4f1d1a068..7a51ab997 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 @@ -20,6 +20,7 @@ import com.jsowell.common.enums.ykc.PileStatusEnum; import com.jsowell.common.enums.ykc.ReturnCodeEnum; import com.jsowell.common.exception.BusinessException; import com.jsowell.common.util.DateUtils; +import com.jsowell.common.util.SecurityUtils; import com.jsowell.common.util.StringUtils; import com.jsowell.common.util.spring.SpringUtils; import com.jsowell.pile.domain.OrderBasicInfo; @@ -82,7 +83,7 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { private OrderBasicInfoService orderBasicInfoService; @Autowired - private ThirdPartyStationRelationService thirdPartyStationRelationService; + private PileMerchantInfoService pileMerchantInfoService; @Autowired private PileMsgRecordService pileMsgRecordService; @@ -1057,28 +1058,15 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { */ @Override public BusinessConnectorInfoVO getConnectorListByStationAndStatus(QueryConnectorInfoDTO dto) { - // String stationId = dto.getStationId(); - String merchantId = dto.getMerchantId(); - // List stationIds = dto.getStationIds(); + // 获取登录账号信息 + Long deptId = SecurityUtils.getDeptId(); + List stationIds = pileMerchantInfoService.queryByMerchantDeptIds(Lists.newArrayList(String.valueOf(deptId))); String connectorStatus = dto.getConnectorStatus(); int pageNum = dto.getPageNum(); int pageSize = dto.getPageSize(); BusinessConnectorInfoVO vo = new BusinessConnectorInfoVO(); - // 通过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 connectorInfoVOS = batchSelectConnectorList(stationIds); // 筛选出枪口编号 List pileConnectorCodeList = connectorInfoVOS.stream() .map(ConnectorInfoVO::getPileConnectorCode) @@ -1098,6 +1086,10 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { vo.setChargingConnectorNum(chargingNum); vo.setFaultConnectorNum(faultNum); + List longStationIds = stationIds.stream() + .map(Long::parseLong) // 或 s -> Long.parseLong(s) + .collect(Collectors.toList()); + // 根据站点id和枪口状态查询枪口列表 QueryConnectorListDTO queryConnectorListDTO = QueryConnectorListDTO.builder() .pageNum(pageNum)