From b76a3b11668f243463468af4c13dd3e82718f93b Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期一, 17 三月 2025 10:46:58 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/drainage/TCECController.java | 435 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 428 insertions(+), 7 deletions(-) diff --git a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/drainage/TCECController.java b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/drainage/TCECController.java index 1992e6b..5f4ca19 100644 --- a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/drainage/TCECController.java +++ b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/drainage/TCECController.java @@ -22,6 +22,7 @@ import com.ruoyi.order.api.model.TChargingOrderAccountingStrategy; import com.ruoyi.other.api.domain.Operator; import com.ruoyi.other.api.feignClient.OperatorClient; +import com.ruoyi.other.api.feignClient.SystemConfigurationClient; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.*; @@ -78,6 +79,9 @@ @Resource private ParkingRecordClient parkingRecordClient; + + @Resource + private SystemConfigurationClient systemConfigurationClient; @@ -240,7 +244,7 @@ if(null == pageSize){ pageSize = 10; } - PageInfo<Site> siteListPaging = siteClient.getSiteListPaging(pageNo, pageSize); + PageInfo<Site> siteListPaging = siteClient.getSiteListPaging(pageNo, pageSize, new ArrayList<>()); List<TParkingLot> parkingLots = parkingLotClient.getAllParkingLot().getData(); QueryStationsInfoResult queryStationsInfoResult = new QueryStationsInfoResult(); queryStationsInfoResult.setPageNo(pageNo); @@ -268,10 +272,49 @@ List<TChargingPile> tChargingPiles = chargingPileClient.getChargingPileBySiteIds(siteIds).getData(); List<Integer> collect1 = tChargingPiles.stream().map(TChargingPile::getId).collect(Collectors.toList()); List<TChargingGun> chargingGunList = chargingGunClient.getChargingGunByChargingPileIds(collect1).getData(); - + String serviceTel = systemConfigurationClient.getServerPhone().getData(); List<StationInfo> StationInfos = new ArrayList<>(); for (Site datum : sites) { StationInfo stationInfo = new StationInfo(); + stationInfo.setAreaCodeCountryside(datum.getAreaCodeCountryside()); + stationInfo.setStationClassification(datum.getStationClassification()); + stationInfo.setGeneralApplicationType(datum.getGeneralApplicationType()); + if (org.springframework.util.StringUtils.hasLength(datum.getSwapMatchCars())){ + stationInfo.setSwapMatchCars(Arrays.asList(datum.getSwapMatchCars().split(","))); + } + stationInfo.setBusineHours(datum.getStartServiceTime()); + stationInfo.setRoundTheClock(datum.getRoundTheClock()); + stationInfo.setParkType(datum.getParkType()); + stationInfo.setElectricityFee("{"+datum.getElectricityFee()+"}"); + stationInfo.setServiceFee("{"+datum.getServiceFee()+"}"); + stationInfo.setParkFee("{\"rules\":"+datum.getParkFee()+","+"\"freeDuration\":"+datum.getParkFeeFree()+"}"); + stationInfo.setElectricityType(datum.getElectricityType()); + stationInfo.setBusinessExpandType(datum.getBusinessExpandType()); + stationInfo.setCapacity(datum.getCapacity()); + stationInfo.setRatedPower(datum.getRatedPower()); + stationInfo.setPeriodFee(datum.getPeriodFee()); + stationInfo.setOfficialRunTime(datum.getOfficialRunTime()); + stationInfo.setStationOrientation(datum.getStationOrientation()); + stationInfo.setStationArea(datum.getStationArea()); + stationInfo.setHavePerson(datum.getHavePerson()); + stationInfo.setVideoMonitor(datum.getVideoMonitor()); + if (StringUtils.isNotEmpty(datum.getSupportingFacilities())){ + String[] split = datum.getSupportingFacilities().split(","); + List<Integer> collect = Arrays.stream(split).map(Integer::parseInt).collect(Collectors.toList()); + stationInfo.setSupportingFacilities(collect); + } + stationInfo.setPrinterFlag(datum.getPrinterFlag()); + stationInfo.setBarrierFlag(datum.getBarrierFlag()); + stationInfo.setParkingLockFlag(datum.getParkingLockFlag()); + stationInfo.setEquipmentOwnerName(datum.getEquipmentOwnerName()); + stationInfo.setResidentNo(datum.getResidentNo()); + stationInfo.setSupplyType(datum.getSupplyType()); + stationInfo.setWattHourMeterNo(datum.getWattHourMeterNo()); + BigDecimal forwardPower = datum.getForwardPower(); + if (forwardPower!=null){ + stationInfo.setForwardPower(forwardPower.setScale(4, BigDecimal.ROUND_HALF_UP).toString()); + } + stationInfo.setRecordUniqueNo(datum.getRecordUniqueNo()); stationInfo.setStationID(datum.getId().toString()); stationInfo.setOperatorID("906171535"); stationInfo.setEquipmentOwnerID("906171535"); @@ -280,7 +323,7 @@ stationInfo.setAreaCode(datum.getDistrictsCode()); stationInfo.setAddress(datum.getAddress()); stationInfo.setStationTel(datum.getPhone()); - stationInfo.setServiceTel(datum.getServicePhone()); + stationInfo.setServiceTel(serviceTel); switch (datum.getSiteType()){ case 0: stationInfo.setStationType(StationTypeEnum.OTHER.getType()); @@ -320,7 +363,7 @@ stationInfo.setPictures(StringUtils.isNotEmpty(datum.getImgUrl()) ? Arrays.asList(datum.getImgUrl().split(",")) : new ArrayList<>()); stationInfo.setSiteGuide(datum.getGuide()); stationInfo.setMatchCars(datum.getVehicleDescription()); - stationInfo.setBusineHours(datum.getStartServiceTime() + "-" + datum.getEndServiceTime()); +// stationInfo.setBusineHours(datum.getStartServiceTime() + "-" + datum.getEndServiceTime()); stationInfo.setElectricityFee(datum.getRateDescription()); //添加停车费信息 Optional<TParkingLot> first = parkingLots.stream().filter(s -> s.getSiteId().equals(datum.getId())).findFirst(); @@ -328,7 +371,6 @@ TParkingLot tParkingLot = first.get(); buildPlaceHolder(tParkingLot, stationInfo); } - //构建充电设备信息数据 stationInfo.setEquipmentInfos(buildEquipmentInfo(datum.getId(), tChargingPiles, chargingGunList)); StationInfos.add(stationInfo); @@ -375,6 +417,8 @@ equipmentInfo.setManufacturerID(tChargingPile.getManufacturerCode()); equipmentInfo.setManufacturerName(tChargingPile.getManufacturer()); equipmentInfo.setEquipmentModel(tChargingPile.getEquipmentType()); + equipmentInfo.setEquipmentUniqueNumber(tChargingPile.getEquipmentUniqueNumber()); + equipmentInfo.setEquipmentClassification(tChargingPile.getEquipmentClassification()); if(null != tChargingPile.getProductionDate()){ equipmentInfo.setProductionDate(tChargingPile.getProductionDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); } @@ -393,6 +437,12 @@ break; case 4: equipmentInfo.setEquipmentType(EquipmentTypeEnum.WIRELESS_DEVICE.getType()); + break; + case 5: + equipmentInfo.setEquipmentType(EquipmentTypeEnum.ORDER.getType()); + break; + case 6: + equipmentInfo.setEquipmentType(EquipmentTypeEnum.V2G.getType()); break; } @@ -417,6 +467,14 @@ ConnectorInfo connectorInfo = new ConnectorInfo(); connectorInfo.setConnectorID(chargingGun.getFullNumber()); connectorInfo.setConnectorName(chargingGun.getName()); + connectorInfo.setEquipmentClassification(chargingGun.getEquipmentClassification()); + connectorInfo.setConstantVoltageLowerLimits(chargingGun.getConstantVoltageLowerLimits()); + connectorInfo.setConstantVoltageUpperLimits(chargingGun.getConstantVoltageUpperLimits()); + connectorInfo.setConstantCurrentLowerLimits(chargingGun.getConstantCurrentLowerLimits()); + connectorInfo.setConstantCurrentUpperLimits(chargingGun.getConstantCurrentUpperLimits()); + connectorInfo.setAuxPower(chargingGun.getAuxPower()); + connectorInfo.setOpreateStatus(chargingGun.getOpreateStatus()); + connectorInfo.setOpreateHours(chargingGun.getOpreateHours()); switch (chargingGun.getType()){ case 0: connectorInfo.setConnectorType(ConnectorTypeEnum.OTHER.getType()); @@ -437,8 +495,6 @@ connectorInfo.setConnectorType(ConnectorTypeEnum.WIRELESS_CHARGING_STAND.getType()); break; } - connectorInfo.setVoltageUpperLimits(chargingGun.getUpperRatedVoltage().intValue()); - connectorInfo.setVoltageLowerLimits(chargingGun.getLowerLimitOfRatedVoltage().intValue()); connectorInfo.setCurrent(chargingGun.getRatedCurrent().intValue()); connectorInfo.setPower(chargingGun.getRatedPower()); connectorInfo.setParkNo(chargingGun.getParkingNumber()); @@ -1629,4 +1685,369 @@ queryChargeOrderInfoResult.setOrderInfos(orderInfos); return queryChargeOrderInfoResult; } + + + + /*********************数据监管平台接口*********************/ + /** + * 查询运营商信息 + * @param baseRequest + * @param request + * @return + */ + @PostMapping("/supervise_query_operator_info") + public BaseResult superviseQueryOperatorInfo(@RequestBody BaseRequest baseRequest, HttpServletRequest request){ + log.info("监管平台查询充电站信息请求参数:" + JacksonUtils.toJson(baseRequest)); + //校验token和签名 + BaseResult baseResult = requestCheck(true, baseRequest, request); + if(0 != baseResult.getRet()){ + log.info("监管平台查询充电站信息响应Data:"); + baseResult.setData(""); + baseResult.setSig(TCECUtil.ourBuildSign(baseResult)); + log.info("监管平台查询充电站信息响应参数:" + JacksonUtils.toJson(baseResult)); + return baseResult; + } + Operator operator = baseResult.getOperator(); + //解密参数 + String decrypt = AESUtil.decrypt(baseRequest.getData(), operator.getOurDataSecret(), operator.getOurDataSecretIv()); + log.info("监管平台查询充电站信息请求Data:" + decrypt); + SuperviseQueryOperatorInfo superviseQueryOperatorInfo = JSON.parseObject(decrypt, SuperviseQueryOperatorInfo.class); + Integer pageNo = superviseQueryOperatorInfo.getPageNo(); + Integer pageSize = superviseQueryOperatorInfo.getPageSize(); + if(null == pageNo){ + pageNo = 1; + } + if(null == pageSize){ + pageSize = 50; + } + String operatorTel = systemConfigurationClient.getServerPhone().getData(); + SuperviseQueryOperatorInfoResultPage superviseQueryOperatorInfoResultPage = new SuperviseQueryOperatorInfoResultPage(); + superviseQueryOperatorInfoResultPage.setPageNo(1); + superviseQueryOperatorInfoResultPage.setPageCount(1); + superviseQueryOperatorInfoResultPage.setItemSize(1); + + SuperviseQueryOperatorInfoResult superviseQueryOperatorInfoResult = new SuperviseQueryOperatorInfoResult(); + superviseQueryOperatorInfoResult.setOperatorID("906171535"); + superviseQueryOperatorInfoResult.setOperatorUSCID("91510903906171535D"); + superviseQueryOperatorInfoResult.setOperatorName("四川明星新能源科技有限公司"); + superviseQueryOperatorInfoResult.setOperatorTel1(operatorTel); + List<SuperviseQueryOperatorInfoResult> superviseQueryOperatorInfoResults = new ArrayList<>(); + superviseQueryOperatorInfoResults.add(superviseQueryOperatorInfoResult); + // 将superviseQueryOperatorInfoResults转化为json数组 + superviseQueryOperatorInfoResultPage.setOperatorInfos(superviseQueryOperatorInfoResults); + String jsonString = JacksonUtils.toJson(superviseQueryOperatorInfoResultPage); + //参数加密 + log.info("监管平台查询充电站信息响应Data:" + jsonString); + String encrypt = AESUtil.encrypt(jsonString, operator.getOurDataSecret(), operator.getOurDataSecretIv()); + baseResult.setData(encrypt); + baseResult.setSig(TCECUtil.ourBuildSign(baseResult)); + log.info("监管平台查询充电站信息响应参数:" + JacksonUtils.toJson(baseResult)); + return baseResult; + } + + + + /** + * 查询充电站信息 + * @param baseRequest + * @param request + * @return + */ + @PostMapping("/supervise_query_stations_info") + public BaseResult superviseQueryStationsInfo(@RequestBody BaseRequest baseRequest, HttpServletRequest request){ + log.info("监管平台查询充电站信息请求参数:" + JacksonUtils.toJson(baseRequest)); + //校验token和签名 + BaseResult baseResult = requestCheck(true, baseRequest, request); + if(0 != baseResult.getRet()){ + log.info("监管平台查询充电站信息响应Data:"); + baseResult.setData(""); + baseResult.setSig(TCECUtil.ourBuildSign(baseResult)); + log.info("监管平台查询充电站信息响应参数:" + JacksonUtils.toJson(baseResult)); + return baseResult; + } + Operator operator = baseResult.getOperator(); + //解密参数 + String decrypt = AESUtil.decrypt(baseRequest.getData(), operator.getOurDataSecret(), operator.getOurDataSecretIv()); + log.info("监管平台查询充电站信息请求Data:" + decrypt); + QueryStationsInfo queryStationsInfo = JSON.parseObject(decrypt, QueryStationsInfo.class); + Integer pageNo = queryStationsInfo.getPageNo(); + Integer pageSize = queryStationsInfo.getPageSize(); + List<String> stationIDs = queryStationsInfo.getStationIDs(); + if(null == pageNo){ + pageNo = 1; + } + if(null == pageSize){ + pageSize = 50; + } + PageInfo<Site> siteListPaging = siteClient.getSiteListPaging(pageNo, pageSize, stationIDs); + List<TParkingLot> parkingLots = parkingLotClient.getAllParkingLot().getData(); + QueryStationsInfoResult queryStationsInfoResult = new QueryStationsInfoResult(); + queryStationsInfoResult.setPageNo(pageNo); + queryStationsInfoResult.setPageCount((0 == (siteListPaging.getTotal() % pageSize) ? 0 : 1) + Double.valueOf(siteListPaging.getTotal() / pageSize).intValue()); + queryStationsInfoResult.setItemSize(Long.valueOf(siteListPaging.getTotal()).intValue()); + queryStationsInfoResult.setStationInfos(buildSite(parkingLots, siteListPaging.getRecords())); + //参数加密 + String jsonString = JacksonUtils.toJson(queryStationsInfoResult); + log.info("监管平台查询充电站信息响应Data:" + jsonString); + String encrypt = AESUtil.encrypt(jsonString, operator.getOurDataSecret(), operator.getOurDataSecretIv()); + baseResult.setData(encrypt); + baseResult.setSig(TCECUtil.ourBuildSign(baseResult)); + log.info("监管平台查询充电站信息响应参数:" + JacksonUtils.toJson(baseResult)); + return baseResult; + } + /** + * 查询充电站信息 + * @param baseRequest + * @param request + * @return + */ + @PostMapping("/supervise_notification_operation_stats_info") + public BaseResult superviseNotificationOperationStatsInfo(@RequestBody BaseRequest baseRequest, HttpServletRequest request){ + log.info("监管平台查询充电站信息请求参数:" + JacksonUtils.toJson(baseRequest)); + //校验token和签名 + BaseResult baseResult = requestCheck(true, baseRequest, request); + if(0 != baseResult.getRet()){ + log.info("监管平台查询充电站信息响应Data:"); + baseResult.setData(""); + baseResult.setSig(TCECUtil.ourBuildSign(baseResult)); + log.info("监管平台查询充电站信息响应参数:" + JacksonUtils.toJson(baseResult)); + return baseResult; + } + Operator operator = baseResult.getOperator(); + //解密参数 + String decrypt = AESUtil.decrypt(baseRequest.getData(), operator.getOurDataSecret(), operator.getOurDataSecretIv()); + log.info("监管平台查询充电站信息请求Data:" + decrypt); + QueryStationsInfo queryStationsInfo = JSON.parseObject(decrypt, QueryStationsInfo.class); + Integer pageNo = queryStationsInfo.getPageNo(); + Integer pageSize = queryStationsInfo.getPageSize(); + List<String> stationIDs = queryStationsInfo.getStationIDs(); + if(null == pageNo){ + pageNo = 1; + } + if(null == pageSize){ + pageSize = 50; + } + PageInfo<Site> siteListPaging = siteClient.getSiteListPaging(pageNo, pageSize, stationIDs); + List<TParkingLot> parkingLots = parkingLotClient.getAllParkingLot().getData(); + QueryStationsInfoResult queryStationsInfoResult = new QueryStationsInfoResult(); + queryStationsInfoResult.setPageNo(pageNo); + queryStationsInfoResult.setPageCount((0 == (siteListPaging.getTotal() % pageSize) ? 0 : 1) + Double.valueOf(siteListPaging.getTotal() / pageSize).intValue()); + queryStationsInfoResult.setItemSize(Long.valueOf(siteListPaging.getTotal()).intValue()); + queryStationsInfoResult.setStationInfos(buildSite(parkingLots, siteListPaging.getRecords())); + //参数加密 + String jsonString = JacksonUtils.toJson(queryStationsInfoResult); + log.info("监管平台查询充电站信息响应Data:" + jsonString); + String encrypt = AESUtil.encrypt(jsonString, operator.getOurDataSecret(), operator.getOurDataSecretIv()); + baseResult.setData(encrypt); + baseResult.setSig(TCECUtil.ourBuildSign(baseResult)); + log.info("监管平台查询充电站信息响应参数:" + JacksonUtils.toJson(baseResult)); + return baseResult; + } + + /** + * 推送充换电站信息 + * @param site + * @return + */ + @PostMapping("/supervise_notification_station_info") + public BaseResult superviseNotificationStationInfo(@RequestBody Site site){ + BaseResult baseResult = new BaseResult(); + + return baseResult; + } +// +// +// /** +// * 构建站点数据 +// * @param sites +// * @return +// */ +// public List<StationInfo> superviseBuildSite(List<TParkingLot> parkingLots, List<Site> sites){ +// List<Integer> siteIds = sites.stream().map(Site::getId).collect(Collectors.toList()); +// List<TChargingPile> tChargingPiles = chargingPileClient.getChargingPileBySiteIds(siteIds).getData(); +// List<Integer> collect1 = tChargingPiles.stream().map(TChargingPile::getId).collect(Collectors.toList()); +// List<TChargingGun> chargingGunList = chargingGunClient.getChargingGunByChargingPileIds(collect1).getData(); +// String serviceTel = systemConfigurationClient.getServerPhone().getData(); +// List<StationInfo> StationInfos = new ArrayList<>(); +// for (Site datum : sites) { +// StationInfo stationInfo = new StationInfo(); +// stationInfo.setStationID(datum.getId().toString()); +// stationInfo.setStationUniqueNumber(datum.getDistrictsCode() + "906171535" + datum.getId()); +// stationInfo.setOperatorID("906171535"); +// stationInfo.setEquipmentOwnerID("906171535"); +// stationInfo.setStationName(datum.getName()); +// stationInfo.setCountryCode(StringUtils.isNotEmpty(datum.getCountryCode()) ? datum.getCountryCode() : "CN"); +// stationInfo.setAreaCode(datum.getDistrictsCode()); +// stationInfo.setAreaCodeCountryside(); +// stationInfo.setAddress(datum.getAddress()); +// stationInfo.setStationTel(datum.getPhone()); +// stationInfo.setServiceTel(serviceTel); +// switch (datum.getSiteType()){ +// case 0: +// stationInfo.setStationType(StationTypeEnum.OTHER.getType()); +// break; +// case 1: +// stationInfo.setStationType(StationTypeEnum.PUBLIC.getType()); +// break; +// case 2: +// stationInfo.setStationType(StationTypeEnum.PERSONAGE.getType()); +// break; +// case 3: +// stationInfo.setStationType(StationTypeEnum.BUS_SPECIFIC.getType()); +// break; +// case 4: +// stationInfo.setStationType(StationTypeEnum.SANITATION_SPECIFIC.getType()); +// break; +// case 5: +// stationInfo.setStationType(StationTypeEnum.LOGISTICS_SPECIFIC.getType()); +// break; +// case 6: +// stationInfo.setStationType(StationTypeEnum.TEXT_SPECIFIC.getType()); +// break; +// } +// if(datum.getStatus() == 1){ +// stationInfo.setStationStatus(StationStatusEnum.NORMAL_USE.getStatus()); +// } +// if(datum.getStatus() == 2){ +// stationInfo.setStationStatus(StationStatusEnum.MAINTAIN.getStatus()); +// } +// if(datum.getStatus() == 3){ +// stationInfo.setStationStatus(StationStatusEnum.OFF_LINE.getStatus()); +// } +// stationInfo.setParkNums(datum.getParkingSpace()); +// stationInfo.setStationLat(new BigDecimal(datum.getLat()).setScale(6, RoundingMode.DOWN)); +// stationInfo.setStationLng(new BigDecimal(datum.getLon()).setScale(6, RoundingMode.DOWN)); +// stationInfo.setConstruction(datum.getConstructionSite() == 0 ? ConstructionEnum.OTHER.getType() : datum.getConstructionSite()); +// stationInfo.setPictures(StringUtils.isNotEmpty(datum.getImgUrl()) ? Arrays.asList(datum.getImgUrl().split(",")) : new ArrayList<>()); +// stationInfo.setSiteGuide(datum.getGuide()); +// stationInfo.setMatchCars(datum.getVehicleDescription()); +// stationInfo.setBusineHours(datum.getStartServiceTime() + "-" + datum.getEndServiceTime()); +// stationInfo.setElectricityFee(datum.getRateDescription()); +// //添加停车费信息 +// Optional<TParkingLot> first = parkingLots.stream().filter(s -> s.getSiteId().equals(datum.getId())).findFirst(); +// if(first.isPresent()){ +// TParkingLot tParkingLot = first.get(); +// superviseBuildPlaceHolder(tParkingLot, stationInfo); +// } +// +// //构建充电设备信息数据 +// stationInfo.setEquipmentInfos(superviseBuildEquipmentInfo(datum.getId(), tChargingPiles, chargingGunList)); +// StationInfos.add(stationInfo); +// +// } +// return StationInfos; +// } +// +// +// /** +// * 构建停车费信息 +// * @param tParkingLot +// * @param stationInfo +// */ +// public void superviseBuildPlaceHolder(TParkingLot tParkingLot, StationInfo stationInfo){ +// stationInfo.setOvertimeFee(tParkingLot.getName() + "停车费"); +// PlaceHolder placeHolder = new PlaceHolder(); +// placeHolder.setFreeTime(tParkingLot.getChargeFreeDuration()); +// placeHolder.setMaxFee(tParkingLot.getChargeCapping()); +// List<PlaceHolderPrice> PlaceHolderPrices = new ArrayList<>(); +// PlaceHolderPrice placeHolderPrice = new PlaceHolderPrice(); +// placeHolderPrice.setStartTime("00:00"); +// placeHolderPrice.setEndTime("23:59"); +// placeHolderPrice.setPrice(tParkingLot.getChargeRate()); +// PlaceHolderPrices.add(placeHolderPrice); +// placeHolder.setPlaceHolderPrices(PlaceHolderPrices); +// stationInfo.setPlaceHolder(placeHolder); +// } +// +// +// +// +// /** +// * 构建桩数据 +// * @param tChargingPiles +// * @return +// */ +// public List<EquipmentInfo> superviseBuildEquipmentInfo(Integer siteId, List<TChargingPile> tChargingPiles, List<TChargingGun> chargingGunList){ +// List<EquipmentInfo> equipmentInfos = new ArrayList<>(); +// List<TChargingPile> collect = tChargingPiles.stream().filter(s -> s.getSiteId().equals(siteId)).collect(Collectors.toList()); +// for (TChargingPile tChargingPile : collect) { +// EquipmentInfo equipmentInfo = new EquipmentInfo(); +// equipmentInfo.setEquipmentID(tChargingPile.getId().toString()); +// equipmentInfo.setManufacturerID(tChargingPile.getManufacturerCode()); +// equipmentInfo.setManufacturerName(tChargingPile.getManufacturer()); +// equipmentInfo.setEquipmentModel(tChargingPile.getEquipmentType()); +// if(null != tChargingPile.getProductionDate()){ +// equipmentInfo.setProductionDate(tChargingPile.getProductionDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); +// } +// switch (tChargingPile.getType()){ +// case 0: +// equipmentInfo.setEquipmentType(EquipmentTypeEnum.OTHER.getType()); +// break; +// case 1: +// equipmentInfo.setEquipmentType(EquipmentTypeEnum.DIRECT_CURRENT.getType()); +// break; +// case 2: +// equipmentInfo.setEquipmentType(EquipmentTypeEnum.ALTERNATING_CURRENT.getType()); +// break; +// case 3: +// equipmentInfo.setEquipmentType(EquipmentTypeEnum.ALTERNATING_DIRECT.getType()); +// break; +// case 4: +// equipmentInfo.setEquipmentType(EquipmentTypeEnum.WIRELESS_DEVICE.getType()); +// break; +// } +// +// //构建设备接口信息 +// equipmentInfo.setConnectorInfos(superviseBuildConnectorInfos(tChargingPile.getId(), tChargingPile.getCode(), chargingGunList)); +// equipmentInfo.setPower(tChargingPile.getRatedPower()); +// equipmentInfos.add(equipmentInfo); +// } +// return equipmentInfos; +// } +// +// +// /** +// * 构建接口数据 +// * @param chargingGunList +// * @return +// */ +// public List<ConnectorInfo> superviseBuildConnectorInfos(Integer chargingPileId, String code, List<TChargingGun> chargingGunList){ +// List<ConnectorInfo> connectorInfos = new ArrayList<>(); +// List<TChargingGun> collect = chargingGunList.stream().filter(s -> s.getChargingPileId().equals(chargingPileId)).collect(Collectors.toList()); +// for (TChargingGun chargingGun : collect) { +// ConnectorInfo connectorInfo = new ConnectorInfo(); +// connectorInfo.setConnectorID(chargingGun.getFullNumber()); +// connectorInfo.setConnectorName(chargingGun.getName()); +// switch (chargingGun.getType()){ +// case 0: +// connectorInfo.setConnectorType(ConnectorTypeEnum.OTHER.getType()); +// break; +// case 1: +// connectorInfo.setConnectorType(ConnectorTypeEnum.HOUSEHOLD_SOCKET.getType()); +// break; +// case 2: +// connectorInfo.setConnectorType(ConnectorTypeEnum.AC_SOCKET.getType()); +// break; +// case 3: +// connectorInfo.setConnectorType(ConnectorTypeEnum.AC_INTERFACE_PLUG.getType()); +// break; +// case 4: +// connectorInfo.setConnectorType(ConnectorTypeEnum.DC_INTERFACE_GUN_HEAD.getType()); +// break; +// case 5: +// connectorInfo.setConnectorType(ConnectorTypeEnum.WIRELESS_CHARGING_STAND.getType()); +// break; +// } +// connectorInfo.setVoltageUpperLimits(chargingGun.getUpperRatedVoltage().intValue()); +// connectorInfo.setVoltageLowerLimits(chargingGun.getLowerLimitOfRatedVoltage().intValue()); +// connectorInfo.setCurrent(chargingGun.getRatedCurrent().intValue()); +// connectorInfo.setPower(chargingGun.getRatedPower()); +// connectorInfo.setParkNo(chargingGun.getParkingNumber()); +// connectorInfo.setNationalStandard(Integer.valueOf(chargingGun.getNationalStandard())); +// connectorInfo.setQRCode("https://mxcd.zhinenganguan.com?No=" + code + chargingGun.getCode()); +// connectorInfos.add(connectorInfo); +// } +// return connectorInfos; +// } + } -- Gitblit v1.7.1