diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/rpc/WccServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/rpc/WccServiceImpl.java index f85c48e6c..5bb7bafb4 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/rpc/WccServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/rpc/WccServiceImpl.java @@ -42,6 +42,8 @@ import java.util.Map; @Slf4j public class WccServiceImpl implements WccService { + // ==================== 依赖注入部分 ==================== + // Service 依赖 @Autowired private PileBasicInfoService pileBasicInfoService; @@ -72,12 +74,6 @@ public class WccServiceImpl implements WccService { @Autowired private PileModelInfoService pileModelInfoService; - @Autowired - private ThirdPartyStationRelationMapper thirdPartyStationRelationMapper; - - @Autowired - private OrderDetailMapper orderDetailMapper; - @Autowired private ThirdPartyStationRelationService thirdPartyStationRelationService; @@ -87,6 +83,14 @@ public class WccServiceImpl implements WccService { @Autowired private PileBillingTemplateService billingTemplateService; + // Mapper 依赖 + @Autowired + private ThirdPartyStationRelationMapper thirdPartyStationRelationMapper; + + @Autowired + private OrderDetailMapper orderDetailMapper; + + // ==================== 基础测试方法 ==================== /** * 测试接口 * @param name @@ -97,68 +101,7 @@ public class WccServiceImpl implements WccService { return "hello " + name + " from wcc-server"; } -// /** -// * 查询充电桩详情 -// * -// * @param pileCode -// */ -// @Override -// public PileInfoVO getPileDetail(String pileCode) { -// return null; -// } -// -// /** -// * 查询计费模板 -// * -// * @param pileCode -// */ -// @Override -// public BillingTemplateVO getBillingTemplate(String pileCode) { -// return null; -// } -// -// /** -// * 启动充电callback -// * -// * @param pileCode -// * @param result -// */ -// @Override -// public void startChargeCallback(String pileCode, String result) { -// -// } -// -// /** -// * 停止充电callback -// * -// * @param pileCode -// * @param result -// */ -// @Override -// public void stopChargeCallback(String pileCode, String result) { -// -// } -// -// /** -// * 接收交易记录接口 -// * -// * @param transactionRecordsData -// */ -// @Override -// public void receiveTradeRecord(TransactionRecordsData transactionRecordsData) { -// -// } -// -// /** -// * 接收实时监测数据接口 -// * -// * @param realTimeMonitorData -// */ -// @Override -// public void receiveRealTimeData(JCTRealTimeMonitorData realTimeMonitorData) { -// -// } - + // ==================== 使用 PileBasicInfoService 的方法 ==================== /** * 查询充电桩基本信息 * @param pileSn @@ -190,6 +133,52 @@ public class WccServiceImpl implements WccService { return build; } + @Override + public List getPileListByStationId(String pileSn) { + List pileListByStationId = pileBasicInfoService.getPileListByStationId(pileSn); + if (pileListByStationId == null || pileListByStationId.isEmpty()) { + return Collections.emptyList(); + } + List jctPileBasicInfos = new ArrayList<>(); + for (PileBasicInfo pileBasicInfo : pileListByStationId) { + JCTPileBasicInfo jctPileBasicInfo = new JCTPileBasicInfo(); + BeanUtils.copyProperties(pileBasicInfo, jctPileBasicInfo); + jctPileBasicInfos.add(jctPileBasicInfo); + } + return jctPileBasicInfos; + } + + @Override + public List getPileListForLianLian(String stationId) { + List pileListForLianLian = pileBasicInfoService.getPileListForLianLian(stationId); + if (pileListForLianLian == null || pileListForLianLian.isEmpty()) { + return Collections.emptyList(); + } + List jctEquipmentInfos = new ArrayList<>(); + for (EquipmentInfo equipmentInfo : pileListForLianLian) { + JCTEquipmentInfo jctEquipmentInfo = new JCTEquipmentInfo(); + BeanUtils.copyProperties(equipmentInfo, jctEquipmentInfo); + jctEquipmentInfos.add(jctEquipmentInfo); + } + return jctEquipmentInfos; + } + + @Override + public List queryPileDetailList(List stationIdList) { + List pileInfoVOS = pileBasicInfoService.queryPileDetailList(stationIdList); + if (pileInfoVOS == null || pileInfoVOS.isEmpty()) { + return Collections.emptyList(); + } + List jctPileInfoVOS = new ArrayList<>(); + for (PileInfoVO pileInfoVO : pileInfoVOS) { + JCTPileInfoVO jctPileInfoVO = new JCTPileInfoVO(); + BeanUtils.copyProperties(pileInfoVO, jctPileInfoVO); + jctPileInfoVOS.add(jctPileInfoVO); + } + return jctPileInfoVOS; + } + + // ==================== 使用 ThirdpartySecretInfoService 的方法 ==================== /** * 查询第三方平台配置信息列表 * @param stationId @@ -226,6 +215,29 @@ public class WccServiceImpl implements WccService { return Collections.emptyList(); } + @Override + public JCTThirdPartySecretInfoVO queryByOperatorId(String operatorId) { + ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByOperatorId(operatorId); + if (thirdPartySecretInfoVO == null) { + return null; + } + JCTThirdPartySecretInfoVO jctThirdPartySecretInfoVO = new JCTThirdPartySecretInfoVO(); + BeanUtils.copyProperties(thirdPartySecretInfoVO, jctThirdPartySecretInfoVO); + return jctThirdPartySecretInfoVO; + } + + @Override + public JCTThirdPartySecretInfoVO queryByThirdPlatformType(String thirdPlatformType) { + ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType); + if (thirdPartySecretInfoVO == null) { + return null; + } + JCTThirdPartySecretInfoVO jctThirdPartySecretInfoVO = new JCTThirdPartySecretInfoVO(); + BeanUtils.copyProperties(thirdPartySecretInfoVO, jctThirdPartySecretInfoVO); + return jctThirdPartySecretInfoVO; + } + + // ==================== 使用 OrderBasicInfoService 的方法 ==================== /** * 根据交易流水号查询订单信息 * @param transactionCode @@ -242,87 +254,6 @@ public class WccServiceImpl implements WccService { return jctOrderBasicInfo; } - /** - * 根据充电桩枪口号查询充电站信息 - * - * @param pileConnectorCode - * @return - */ - @Override - public JCTPileStationVO getStationInfoByPileConnectorCode(String pileConnectorCode) { - PileStationVO stationInfoByPileConnectorCode = pileStationInfoService.getStationInfoByPileConnectorCode(pileConnectorCode); - if (stationInfoByPileConnectorCode == null) { - return null; - } - JCTPileStationVO jctPileStationVO = new JCTPileStationVO(); - BeanUtils.copyProperties(stationInfoByPileConnectorCode, jctPileStationVO); - return jctPileStationVO; - } - - @Override - public JCTThirdPartySecretInfoVO queryByOperatorId(String operatorId) { - ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByOperatorId(operatorId); - if (thirdPartySecretInfoVO == null) { - return null; - } - JCTThirdPartySecretInfoVO jctThirdPartySecretInfoVO = new JCTThirdPartySecretInfoVO(); - BeanUtils.copyProperties(thirdPartySecretInfoVO, jctThirdPartySecretInfoVO); - return jctThirdPartySecretInfoVO; - } - - @Override - public JCTPileStationInfo selectPileStationInfoById(Long id) { - PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(id); - if (pileStationInfo == null) { - return null; - } - JCTPileStationInfo jctPileStationInfo = new JCTPileStationInfo(); - BeanUtils.copyProperties(pileStationInfo, jctPileStationInfo); - return jctPileStationInfo; - } - - @Override - public JCTMerchantInfoVO getMerchantInfoVO(String merchantId) { - MerchantInfoVO merchantInfoVO = pileMerchantInfoService.getMerchantInfoVO(merchantId); - if (merchantInfoVO == null) { - return null; - } - JCTMerchantInfoVO jctMerchantInfoVO = new JCTMerchantInfoVO(); - BeanUtils.copyProperties(merchantInfoVO, jctMerchantInfoVO); - return jctMerchantInfoVO; - } - - @Override - public List selectStationInfosByThirdParty(JCTQueryStationInfoDTO queryStationInfoDTO) { - if (queryStationInfoDTO == null) { - return Collections.emptyList(); - } - QueryStationInfoDTO dto = new QueryStationInfoDTO(); - BeanUtils.copyProperties(queryStationInfoDTO, dto); - List thirdPartyStationInfoVOS = pileStationInfoService.selectStationInfosByThirdParty(dto); - if (thirdPartyStationInfoVOS == null || thirdPartyStationInfoVOS.isEmpty()) { - return Collections.emptyList(); - } - List jctThirdPartyStationInfoVOS = new ArrayList<>(); - for (ThirdPartyStationInfoVO thirdPartyStationInfoVO : thirdPartyStationInfoVOS) { - JCTThirdPartyStationInfoVO jctThirdPartyStationInfoVO = new JCTThirdPartyStationInfoVO(); - BeanUtils.copyProperties(thirdPartyStationInfoVO, jctThirdPartyStationInfoVO); - jctThirdPartyStationInfoVOS.add(jctThirdPartyStationInfoVO); - } - return jctThirdPartyStationInfoVOS; - } - - @Override - public JCTThirdPartySecretInfoVO queryByThirdPlatformType(String thirdPlatformType) { - ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType); - if (thirdPartySecretInfoVO == null) { - return null; - } - JCTThirdPartySecretInfoVO jctThirdPartySecretInfoVO = new JCTThirdPartySecretInfoVO(); - BeanUtils.copyProperties(thirdPartySecretInfoVO, jctThirdPartySecretInfoVO); - return jctThirdPartySecretInfoVO; - } - @Override public List getAccumulativeInfoForLianLian(JCTQueryStationInfoDTO queryStationInfoDTO) { if (queryStationInfoDTO == null){ @@ -343,21 +274,6 @@ public class WccServiceImpl implements WccService { return jctAccumulativeInfoVOS; } - @Override - public List getConnectorListForLianLian(Long stationId) { - List connectorListForLianLian = pileConnectorInfoService.getConnectorListForLianLian(stationId); - if (connectorListForLianLian == null || connectorListForLianLian.isEmpty()) { - return Collections.emptyList(); - } - List jctConnectorInfoVOS = new ArrayList<>(); - for (ConnectorInfoVO connectorInfoVO : connectorListForLianLian) { - JCTConnectorInfoVO jctConnectorInfoVO = new JCTConnectorInfoVO(); - BeanUtils.copyProperties(connectorInfoVO, jctConnectorInfoVO); - jctConnectorInfoVOS.add(jctConnectorInfoVO); - } - return jctConnectorInfoVOS; - } - @Override public JCTOrderBasicInfo queryChargingByPileConnectorCode(String pileConnectorCode) { OrderBasicInfo orderBasicInfo = orderBasicInfoService.queryChargingByPileConnectorCode(pileConnectorCode); @@ -409,17 +325,6 @@ public class WccServiceImpl implements WccService { return jctOrderDetail; } - @Override - public JCTPileConnectorInfoVO getPileConnectorInfoByConnectorCode(String pileConnectorCode) { - PileConnectorInfoVO info = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(pileConnectorCode); - if (info == null) { - return null; - } - JCTPileConnectorInfoVO jctPileConnectorInfoVO = new JCTPileConnectorInfoVO(); - BeanUtils.copyProperties(info, jctPileConnectorInfoVO); - return jctPileConnectorInfoVO; - } - @Override public Map generateOrderForThirdParty(JCTQueryStartChargeDTO dto) { if (dto == null){ @@ -430,86 +335,6 @@ public class WccServiceImpl implements WccService { return orderBasicInfoService.generateOrderForThirdParty(queryStartChargeDTO); } - @Override - public void pushStartChargingCommand(JCTStartChargingCommand command) { - if (command == null){ - return; - } - StartChargingCommand startChargingCommand = new StartChargingCommand(); - BeanUtils.copyProperties(command, startChargingCommand); - try { - ykCPushCommandService.pushStartChargingCommand(startChargingCommand); - }catch (Exception e){ - log.error("第三方服务发送启动充电失败", e); - } - - } - - @Override - public List queryBillingPrice(String s) { - List billingPriceVOS = pileBillingTemplateService.queryBillingPrice(s); - if (billingPriceVOS == null || billingPriceVOS.isEmpty()) { - return Collections.emptyList(); - } - List jctBillingPriceVOS = new ArrayList<>(); - for (BillingPriceVO billingPriceVO : billingPriceVOS) { - JCTBillingPriceVO jctBillingPriceVO = new JCTBillingPriceVO(); - BeanUtils.copyProperties(billingPriceVO, jctBillingPriceVO); - jctBillingPriceVOS.add(jctBillingPriceVO); - } - return jctBillingPriceVOS; - } - - @Override - public void remoteStopCharging(String pileSn , String connectorCode , String transactionCode) { - try { - pileRemoteService.remoteStopCharging(pileSn, connectorCode, transactionCode); - }catch (Exception e){ - log.error("第三方服务远程停止充电失败", e); - } - } - - @Override - public List getPileListByStationId(String pileSn) { - List pileListByStationId = pileBasicInfoService.getPileListByStationId(pileSn); - if (pileListByStationId == null || pileListByStationId.isEmpty()) { - return Collections.emptyList(); - } - List jctPileBasicInfos = new ArrayList<>(); - for (PileBasicInfo pileBasicInfo : pileListByStationId) { - JCTPileBasicInfo jctPileBasicInfo = new JCTPileBasicInfo(); - BeanUtils.copyProperties(pileBasicInfo, jctPileBasicInfo); - jctPileBasicInfos.add(jctPileBasicInfo); - } - return jctPileBasicInfos; - } - - @Override - public JCTPileModelInfoVO getPileModelInfoByPileSn(String pileSn) { - PileModelInfoVO pileModelInfoByPileSn = pileModelInfoService.getPileModelInfoByPileSn(pileSn); - if (pileModelInfoByPileSn == null) { - return null; - } - JCTPileModelInfoVO jctPileModelInfoVO = new JCTPileModelInfoVO(); - BeanUtils.copyProperties(pileModelInfoByPileSn, jctPileModelInfoVO); - return jctPileModelInfoVO; - } - - @Override - public List selectPileConnectorInfoList(String sn) { - List selectPileConnectorInfoList = pileConnectorInfoService.selectPileConnectorInfoList(sn); - if (selectPileConnectorInfoList == null || selectPileConnectorInfoList.isEmpty()) { - return Collections.emptyList(); - } - List jctPileConnectorInfos = new ArrayList<>(); - for (PileConnectorInfo pileConnectorInfo : selectPileConnectorInfoList) { - JCTPileConnectorInfo jctPileConnectorInfo = new JCTPileConnectorInfo(); - BeanUtils.copyProperties(pileConnectorInfo, jctPileConnectorInfo); - jctPileConnectorInfos.add(jctPileConnectorInfo); - } - return jctPileConnectorInfos; - } - @Override public List tempGetOrderCodes(JCTQueryOrderDTO dto) { if (dto == null){ @@ -520,67 +345,6 @@ public class WccServiceImpl implements WccService { return orderBasicInfoService.tempGetOrderCodes(queryOrderDTO); } - @Override - public List getPileListForLianLian(String stationId) { - List pileListForLianLian = pileBasicInfoService.getPileListForLianLian(stationId); - if (pileListForLianLian == null || pileListForLianLian.isEmpty()) { - return Collections.emptyList(); - } - List jctEquipmentInfos = new ArrayList<>(); - for (EquipmentInfo equipmentInfo : pileListForLianLian) { - JCTEquipmentInfo jctEquipmentInfo = new JCTEquipmentInfo(); - BeanUtils.copyProperties(equipmentInfo, jctEquipmentInfo); - jctEquipmentInfos.add(jctEquipmentInfo); - } - return jctEquipmentInfos; - } - - @Override - public List selectStationList(String thirdPlatformType) { - List stationInfoVOS = thirdPartyStationRelationMapper.selectStationList(thirdPlatformType); - if (stationInfoVOS == null || stationInfoVOS.isEmpty()) { - return Collections.emptyList(); - } - List jctStationInfoVOS = new ArrayList<>(); - for (StationInfoVO stationInfoVO : stationInfoVOS) { - JCTStationInfoVO jctStationInfoVO = new JCTStationInfoVO(); - BeanUtils.copyProperties(stationInfoVO, jctStationInfoVO); - jctStationInfoVOS.add(jctStationInfoVO); - } - return jctStationInfoVOS; - } - - - @Override - public List selectByStationId(String stationId) { - List tempVOS = orderDetailMapper.selectByStationId(stationId); - if (tempVOS == null || tempVOS.isEmpty()) { - return Collections.emptyList(); - } - List jctOrderTempVOS = new ArrayList<>(); - for (OrderTempVO tempVO : tempVOS) { - JCTOrderTempVO jctOrderTempVO = new JCTOrderTempVO(); - BeanUtils.copyProperties(tempVO, jctOrderTempVO); - jctOrderTempVOS.add(jctOrderTempVO); - } - return jctOrderTempVOS; - } - - @Override - public List queryPileDetailList(List stationIdList) { - List pileInfoVOS = pileBasicInfoService.queryPileDetailList(stationIdList); - if (pileInfoVOS == null || pileInfoVOS.isEmpty()) { - return Collections.emptyList(); - } - List jctPileInfoVOS = new ArrayList<>(); - for (PileInfoVO pileInfoVO : pileInfoVOS) { - JCTPileInfoVO jctPileInfoVO = new JCTPileInfoVO(); - BeanUtils.copyProperties(pileInfoVO, jctPileInfoVO); - jctPileInfoVOS.add(jctPileInfoVO); - } - return jctPileInfoVOS; - } - @Override public int updateOrderDetail(JCTOrderDetail orderDetail) { OrderDetail orderDetail1 = new OrderDetail(); @@ -588,65 +352,6 @@ public class WccServiceImpl implements WccService { return orderBasicInfoService.updateOrderDetail(orderDetail1); } - /** - * 根据站点idList批量查询枪口数据 - * - * @param stationIds - * @return - */ - @Override - public List batchSelectConnectorList(List stationIds) { - List resultList = new ArrayList<>(); - List connectorInfoVOS = pileConnectorInfoService.batchSelectConnectorList(stationIds); - if (CollectionUtils.isNotEmpty(connectorInfoVOS)) { - for (ConnectorInfoVO connectorInfoVO : connectorInfoVOS) { - // connectorInfoVO复制到JCTConnectorInfoVO - JCTConnectorInfoVO jctConnectorInfoVO = new JCTConnectorInfoVO(); - BeanUtils.copyProperties(connectorInfoVO, jctConnectorInfoVO); - resultList.add(jctConnectorInfoVO); - } - } - return resultList; - } - - /** - * 根据第三方平台类型查询对接第三方平台的运营商列表 - * - * @param thirdPlatformType - * @return - */ - @Override - public List selectMerchantList(String thirdPlatformType) { - List merchantInfoVOS = thirdPartyStationRelationService.selectMerchantList(thirdPlatformType); - List jctMerchantInfoVOS = new ArrayList<>(); - if (CollectionUtils.isNotEmpty(merchantInfoVOS)) { - for (MerchantInfoVO merchantInfoVO : merchantInfoVOS) { - JCTMerchantInfoVO jctMerchantInfoVO = new JCTMerchantInfoVO(); - BeanUtils.copyProperties(merchantInfoVO, jctMerchantInfoVO); - jctMerchantInfoVOS.add(jctMerchantInfoVO); - } - } - return jctMerchantInfoVOS; - } - - - @Override - public List selectAreaCodeInfoList(JCTAreaCodeInfo areaCodeInfo) { - AreaCodeInfo areaCodeInfo1 = new AreaCodeInfo(); - BeanUtils.copyProperties(areaCodeInfo, areaCodeInfo1); - List areaCodeInfos = areaCodeInfoService.selectAreaCodeInfoList(areaCodeInfo1); - if (areaCodeInfos == null || areaCodeInfos.isEmpty()) { - return Collections.emptyList(); - } - List jctAreaCodeInfos = new ArrayList<>(); - for (AreaCodeInfo areaCodeInfo2 : areaCodeInfos) { - JCTAreaCodeInfo jctAreaCodeInfo = new JCTAreaCodeInfo(); - BeanUtils.copyProperties(areaCodeInfo2, jctAreaCodeInfo); - jctAreaCodeInfos.add(jctAreaCodeInfo); - } - return jctAreaCodeInfos; - } - @Override public List selectThirdPartyOrderList(JCTQueryStartChargeDTO dto) { QueryStartChargeDTO queryStationInfoDTO = new QueryStartChargeDTO(); @@ -664,29 +369,6 @@ public class WccServiceImpl implements WccService { return jctOrderVOS; } - - @Override - public JCTPileMerchantInfoVO queryMerchantInfoByStationId(String stationId) { - PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(stationId); - if (pileMerchantInfoVO == null) { - return null; - } - JCTPileMerchantInfoVO jctPileMerchantInfoVO = new JCTPileMerchantInfoVO(); - BeanUtils.copyProperties(pileMerchantInfoVO, jctPileMerchantInfoVO); - return jctPileMerchantInfoVO; - } - - @Override - public JCTPileStationVO getStationInfo(String stationId) { - PileStationVO stationInfo = pileStationInfoService.getStationInfo(stationId); - if (stationInfo == null) { - return null; - } - JCTPileStationVO jctPileStationVO = new JCTPileStationVO(); - BeanUtils.copyProperties(stationInfo, jctPileStationVO); - return jctPileStationVO; - } - @Override public List queryOrderListByStationId(String stationId) { List supStationStatsVOS = orderBasicInfoService.queryOrderListByStationId(stationId); @@ -702,6 +384,116 @@ public class WccServiceImpl implements WccService { return jctSupStationStatsVOs; } + // ==================== 使用 PileStationInfoService 的方法 ==================== + /** + * 根据充电桩枪口号查询充电站信息 + * + * @param pileConnectorCode + * @return + */ + @Override + public JCTPileStationVO getStationInfoByPileConnectorCode(String pileConnectorCode) { + PileStationVO stationInfoByPileConnectorCode = pileStationInfoService.getStationInfoByPileConnectorCode(pileConnectorCode); + if (stationInfoByPileConnectorCode == null) { + return null; + } + JCTPileStationVO jctPileStationVO = new JCTPileStationVO(); + BeanUtils.copyProperties(stationInfoByPileConnectorCode, jctPileStationVO); + return jctPileStationVO; + } + + @Override + public JCTPileStationInfo selectPileStationInfoById(Long id) { + PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(id); + if (pileStationInfo == null) { + return null; + } + JCTPileStationInfo jctPileStationInfo = new JCTPileStationInfo(); + BeanUtils.copyProperties(pileStationInfo, jctPileStationInfo); + return jctPileStationInfo; + } + + @Override + public List selectStationInfosByThirdParty(JCTQueryStationInfoDTO queryStationInfoDTO) { + if (queryStationInfoDTO == null) { + return Collections.emptyList(); + } + QueryStationInfoDTO dto = new QueryStationInfoDTO(); + BeanUtils.copyProperties(queryStationInfoDTO, dto); + List thirdPartyStationInfoVOS = pileStationInfoService.selectStationInfosByThirdParty(dto); + if (thirdPartyStationInfoVOS == null || thirdPartyStationInfoVOS.isEmpty()) { + return Collections.emptyList(); + } + List jctThirdPartyStationInfoVOS = new ArrayList<>(); + for (ThirdPartyStationInfoVO thirdPartyStationInfoVO : thirdPartyStationInfoVOS) { + JCTThirdPartyStationInfoVO jctThirdPartyStationInfoVO = new JCTThirdPartyStationInfoVO(); + BeanUtils.copyProperties(thirdPartyStationInfoVO, jctThirdPartyStationInfoVO); + jctThirdPartyStationInfoVOS.add(jctThirdPartyStationInfoVO); + } + return jctThirdPartyStationInfoVOS; + } + + @Override + public JCTPileStationVO getStationInfo(String stationId) { + PileStationVO stationInfo = pileStationInfoService.getStationInfo(stationId); + if (stationInfo == null) { + return null; + } + JCTPileStationVO jctPileStationVO = new JCTPileStationVO(); + BeanUtils.copyProperties(stationInfo, jctPileStationVO); + return jctPileStationVO; + } + + // ==================== 使用 PileMerchantInfoService 的方法 ==================== + @Override + public JCTMerchantInfoVO getMerchantInfoVO(String merchantId) { + MerchantInfoVO merchantInfoVO = pileMerchantInfoService.getMerchantInfoVO(merchantId); + if (merchantInfoVO == null) { + return null; + } + JCTMerchantInfoVO jctMerchantInfoVO = new JCTMerchantInfoVO(); + BeanUtils.copyProperties(merchantInfoVO, jctMerchantInfoVO); + return jctMerchantInfoVO; + } + + @Override + public JCTPileMerchantInfoVO queryMerchantInfoByStationId(String stationId) { + PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(stationId); + if (pileMerchantInfoVO == null) { + return null; + } + JCTPileMerchantInfoVO jctPileMerchantInfoVO = new JCTPileMerchantInfoVO(); + BeanUtils.copyProperties(pileMerchantInfoVO, jctPileMerchantInfoVO); + return jctPileMerchantInfoVO; + } + + // ==================== 使用 PileConnectorInfoService 的方法 ==================== + @Override + public List getConnectorListForLianLian(Long stationId) { + List connectorListForLianLian = pileConnectorInfoService.getConnectorListForLianLian(stationId); + if (connectorListForLianLian == null || connectorListForLianLian.isEmpty()) { + return Collections.emptyList(); + } + List jctConnectorInfoVOS = new ArrayList<>(); + for (ConnectorInfoVO connectorInfoVO : connectorListForLianLian) { + JCTConnectorInfoVO jctConnectorInfoVO = new JCTConnectorInfoVO(); + BeanUtils.copyProperties(connectorInfoVO, jctConnectorInfoVO); + jctConnectorInfoVOS.add(jctConnectorInfoVO); + } + return jctConnectorInfoVOS; + } + + @Override + public JCTPileConnectorInfoVO getPileConnectorInfoByConnectorCode(String pileConnectorCode) { + PileConnectorInfoVO info = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(pileConnectorCode); + if (info == null) { + return null; + } + JCTPileConnectorInfoVO jctPileConnectorInfoVO = new JCTPileConnectorInfoVO(); + BeanUtils.copyProperties(info, jctPileConnectorInfoVO); + return jctPileConnectorInfoVO; + } + @Override public List getConnectorInfoListByParams(JCTQueryConnectorListDTO dto) { QueryConnectorListDTO queryConnectorListDTO = new QueryConnectorListDTO(); @@ -719,6 +511,67 @@ public class WccServiceImpl implements WccService { return jctPileConnectorInfoVOs; } + @Override + public List batchSelectConnectorList(List stationIds) { + List resultList = new ArrayList<>(); + List connectorInfoVOS = pileConnectorInfoService.batchSelectConnectorList(stationIds); + if (CollectionUtils.isNotEmpty(connectorInfoVOS)) { + for (ConnectorInfoVO connectorInfoVO : connectorInfoVOS) { + // connectorInfoVO复制到JCTConnectorInfoVO + JCTConnectorInfoVO jctConnectorInfoVO = new JCTConnectorInfoVO(); + BeanUtils.copyProperties(connectorInfoVO, jctConnectorInfoVO); + resultList.add(jctConnectorInfoVO); + } + } + return resultList; + } + + @Override + public List selectPileConnectorInfoList(String sn) { + List pileConnectorInfoList = pileConnectorInfoService.selectPileConnectorInfoList(sn); + if (pileConnectorInfoList == null || pileConnectorInfoList.isEmpty()) { + return Collections.emptyList(); + } + List jctPileConnectorInfos = new ArrayList<>(); + for (PileConnectorInfo pileConnectorInfo : pileConnectorInfoList) { + JCTPileConnectorInfo jctPileConnectorInfo = new JCTPileConnectorInfo(); + BeanUtils.copyProperties(pileConnectorInfo, jctPileConnectorInfo); + jctPileConnectorInfos.add(jctPileConnectorInfo); + } + return jctPileConnectorInfos; + } + + // ==================== 使用 YKCPushCommandService 的方法 ==================== + @Override + public void pushStartChargingCommand(JCTStartChargingCommand command) { + if (command == null){ + return; + } + StartChargingCommand startChargingCommand = new StartChargingCommand(); + BeanUtils.copyProperties(command, startChargingCommand); + try { + ykCPushCommandService.pushStartChargingCommand(startChargingCommand); + }catch (Exception e){ + log.error("第三方服务发送启动充电失败", e); + } + } + + // ==================== 使用 PileBillingTemplateService 的方法 ==================== + @Override + public List queryBillingPrice(String s) { + List billingPriceVOS = pileBillingTemplateService.queryBillingPrice(s); + if (billingPriceVOS == null || billingPriceVOS.isEmpty()) { + return Collections.emptyList(); + } + List jctBillingPriceVOS = new ArrayList<>(); + for (BillingPriceVO billingPriceVO : billingPriceVOS) { + JCTBillingPriceVO jctBillingPriceVO = new JCTBillingPriceVO(); + BeanUtils.copyProperties(billingPriceVO, jctBillingPriceVO); + jctBillingPriceVOS.add(jctBillingPriceVO); + } + return jctBillingPriceVOS; + } + @Override public JCTEchoBillingTemplateVO queryPileBillingTemplateById(Long id) { EchoBillingTemplateVO echoBillingTemplateVO = pileBillingTemplateService.queryPileBillingTemplateById(id); @@ -741,6 +594,44 @@ public class WccServiceImpl implements WccService { return billingTemplateVO1; } + // ==================== 使用 PileRemoteService 的方法 ==================== + @Override + public void remoteStopCharging(String pileSn , String connectorCode , String transactionCode) { + try { + pileRemoteService.remoteStopCharging(pileSn, connectorCode, transactionCode); + }catch (Exception e){ + log.error("第三方服务远程停止充电失败", e); + } + } + + // ==================== 使用 PileModelInfoService 的方法 ==================== + @Override + public JCTPileModelInfoVO getPileModelInfoByPileSn(String pileSn) { + PileModelInfoVO pileModelInfoByPileSn = pileModelInfoService.getPileModelInfoByPileSn(pileSn); + if (pileModelInfoByPileSn == null) { + return null; + } + JCTPileModelInfoVO jctPileModelInfoVO = new JCTPileModelInfoVO(); + BeanUtils.copyProperties(pileModelInfoByPileSn, jctPileModelInfoVO); + return jctPileModelInfoVO; + } + + + // ==================== 使用 ThirdPartyStationRelationService 的方法 ==================== + @Override + public List selectMerchantList(String thirdPlatformType) { + List merchantInfoVOS = thirdPartyStationRelationService.selectMerchantList(thirdPlatformType); + List jctMerchantInfoVOS = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(merchantInfoVOS)) { + for (MerchantInfoVO merchantInfoVO : merchantInfoVOS) { + JCTMerchantInfoVO jctMerchantInfoVO = new JCTMerchantInfoVO(); + BeanUtils.copyProperties(merchantInfoVO, jctMerchantInfoVO); + jctMerchantInfoVOS.add(jctMerchantInfoVO); + } + } + return jctMerchantInfoVOS; + } + @Override public JCTThirdPartyStationRelationVO selectRelationInfo(JCTThirdPartyStationRelation thirdPartyStationRelation) { com.jsowell.pile.domain.ThirdPartyStationRelation thirdPartyStationRelation1 = new com.jsowell.pile.domain.ThirdPartyStationRelation(); @@ -754,4 +645,53 @@ public class WccServiceImpl implements WccService { return jctThirdPartyStationRelationVO; } + // ==================== 使用 IAreaCodeInfoService 的方法 ==================== + @Override + public List selectAreaCodeInfoList(JCTAreaCodeInfo areaCodeInfo) { + AreaCodeInfo areaCodeInfo1 = new AreaCodeInfo(); + BeanUtils.copyProperties(areaCodeInfo, areaCodeInfo1); + List areaCodeInfos = areaCodeInfoService.selectAreaCodeInfoList(areaCodeInfo1); + if (areaCodeInfos == null || areaCodeInfos.isEmpty()) { + return Collections.emptyList(); + } + List jctAreaCodeInfos = new ArrayList<>(); + for (AreaCodeInfo areaCodeInfo2 : areaCodeInfos) { + JCTAreaCodeInfo jctAreaCodeInfo = new JCTAreaCodeInfo(); + BeanUtils.copyProperties(areaCodeInfo2, jctAreaCodeInfo); + jctAreaCodeInfos.add(jctAreaCodeInfo); + } + return jctAreaCodeInfos; + } + + // ==================== 使用 Mapper 的方法 ==================== + @Override + public List selectStationList(String thirdPlatformType) { + List stationInfoVOS = thirdPartyStationRelationMapper.selectStationList(thirdPlatformType); + if (stationInfoVOS == null || stationInfoVOS.isEmpty()) { + return Collections.emptyList(); + } + List jctStationInfoVOS = new ArrayList<>(); + for (StationInfoVO stationInfoVO : stationInfoVOS) { + JCTStationInfoVO jctStationInfoVO = new JCTStationInfoVO(); + BeanUtils.copyProperties(stationInfoVO, jctStationInfoVO); + jctStationInfoVOS.add(jctStationInfoVO); + } + return jctStationInfoVOS; + } + + @Override + public List selectByStationId(String stationId) { + List tempVOS = orderDetailMapper.selectByStationId(stationId); + if (tempVOS == null || tempVOS.isEmpty()) { + return Collections.emptyList(); + } + List jctOrderTempVOS = new ArrayList<>(); + for (OrderTempVO tempVO : tempVOS) { + JCTOrderTempVO jctOrderTempVO = new JCTOrderTempVO(); + BeanUtils.copyProperties(tempVO, jctOrderTempVO); + jctOrderTempVOS.add(jctOrderTempVO); + } + return jctOrderTempVOS; + } + }