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)