diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/xindiantu/service/impl/XDTServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/xindiantu/service/impl/XDTServiceImpl.java index 2fd6d0dbc..9a56b8fc1 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/xindiantu/service/impl/XDTServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/xindiantu/service/impl/XDTServiceImpl.java @@ -1,18 +1,24 @@ package com.jsowell.thirdparty.xindiantu.service.impl; +import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum; +import com.jsowell.pile.domain.ThirdPartyStationRelation; import com.jsowell.pile.dto.QueryEquipChargeStatusDTO; import com.jsowell.pile.dto.QueryEquipmentDTO; import com.jsowell.pile.dto.QueryStartChargeDTO; import com.jsowell.pile.dto.QueryStationInfoDTO; +import com.jsowell.pile.service.ThirdPartyStationRelationService; import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO; import com.jsowell.thirdparty.xindiantu.service.XDTService; import com.jsowell.thirdparty.zhongdianlian.dto.ZDLGetTokenDTO; import com.jsowell.thirdparty.zhongdianlian.service.ZDLService; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.io.UnsupportedEncodingException; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 新电途Service @@ -25,6 +31,9 @@ public class XDTServiceImpl implements XDTService { @Autowired private ZDLService zdlService; + @Autowired + private ThirdPartyStationRelationService relationService; + /** * 获取令牌 * @param dto @@ -57,6 +66,16 @@ public class XDTServiceImpl implements XDTService { */ @Override public Map queryStationsInfo(QueryStationInfoDTO dto) { + // 查询出要查询的充电站id并set进 dto 的stationIds + ThirdPartyStationRelation relation = new ThirdPartyStationRelation(); + relation.setThirdPartyType(ThirdPlatformTypeEnum.XIN_DIAN_TU.getCode()); + List xdtList = relationService.selectThirdPartyStationRelationList(relation); + if (CollectionUtils.isNotEmpty(xdtList)) { + List stationList = xdtList.stream() + .map(x -> String.valueOf(x.getStationId())) + .collect(Collectors.toList()); + dto.setStationIds(stationList); + } return zdlService.queryStationsInfo(dto); }