| | |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.ruoyi.chargingPile.api.feignClient.*; |
| | | import com.ruoyi.chargingPile.api.model.*; |
| | | import com.ruoyi.chargingPile.api.vo.GetChargingGunByChargingPileIdsVo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.ChargingPercentProvinceDto; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | |
| | | if(null == pageSize){ |
| | | pageSize = 10; |
| | | } |
| | | PageInfo<Site> siteListPaging = siteClient.getSiteListPaging(pageNo, pageSize, new ArrayList<>()); |
| | | PageInfo<Site> siteListPaging = siteClient.getSiteListPagingJianGuan(pageNo, pageSize, new ArrayList<>()); |
| | | List<TParkingLot> parkingLots = parkingLotClient.getAllParkingLot().getData(); |
| | | QueryStationsInfoResult queryStationsInfoResult = new QueryStationsInfoResult(); |
| | | queryStationsInfoResult.setPageNo(pageNo); |
| | |
| | | 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(); |
| | | GetChargingGunByChargingPileIdsVo vo = new GetChargingGunByChargingPileIdsVo(); |
| | | vo.setChargingPileIds(collect1); |
| | | List<TChargingGun> chargingGunList = chargingGunClient.getChargingGunByChargingPileIds(vo).getData(); |
| | | String serviceTel = systemConfigurationClient.getServerPhone().getData(); |
| | | List<StationInfo> StationInfos = new ArrayList<>(); |
| | | for (Site datum : sites) { |
| | | StationInfo stationInfo = new StationInfo(); |
| | | stationInfo.setStationUniqueNumber(datum.getCode()); |
| | | stationInfo.setAreaCodeCountryside(datum.getCountryCode()); |
| | | stationInfo.setAreaCodeCountryside(datum.getDistrictsCode()); |
| | | stationInfo.setAreaCode(datum.getDistrictsCode()); |
| | | stationInfo.setStationClassification(datum.getStationClassification()); |
| | | stationInfo.setGeneralApplicationType(datum.getGeneralApplicationType()); |
| | | if (org.springframework.util.StringUtils.hasLength(datum.getSwapMatchCars())){ |
| | |
| | | stationInfo.setEquipmentOwnerID("906171535"); |
| | | stationInfo.setStationName(datum.getName()); |
| | | stationInfo.setCountryCode(StringUtils.isNotEmpty(datum.getCountryCode()) ? datum.getCountryCode() : "CN"); |
| | | stationInfo.setAreaCode(datum.getDistrictsCode()); |
| | | stationInfo.setAddress(datum.getAddress()); |
| | | stationInfo.setStationTel(datum.getPhone()); |
| | | stationInfo.setStationTel(serviceTel); |
| | | stationInfo.setServiceTel(serviceTel); |
| | | switch (datum.getSiteType()){ |
| | | case 0: |
| | |
| | | List<Integer> siteIds = data.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(); |
| | | GetChargingGunByChargingPileIdsVo vo = new GetChargingGunByChargingPileIdsVo(); |
| | | vo.setChargingPileIds(collect1); |
| | | List<TChargingGun> chargingGunList = chargingGunClient.getChargingGunByChargingPileIds(vo).getData(); |
| | | |
| | | QueryStationStatusResult result = new QueryStationStatusResult(); |
| | | result.setTotal(data.size()); |
| | |
| | | if(data.size() > 0){ |
| | | BigDecimal totalElectricity = data.stream().map(TChargingOrderAccountingStrategy::getPeriodElectricPrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal serviceCharge = data.stream().map(TChargingOrderAccountingStrategy::getPeriodServicePrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal totalMoney = totalElectricity.add(serviceCharge).setScale(4, RoundingMode.HALF_EVEN); |
| | | queryEquipChargeStatusResult.setElecMoney(totalElectricity); |
| | | queryEquipChargeStatusResult.setSeviceMoney(serviceCharge); |
| | | queryEquipChargeStatusResult.setTotalMoney(chargingOrder.getPaymentAmount()); |
| | | queryEquipChargeStatusResult.setTotalMoney(totalMoney); |
| | | }else{ |
| | | queryEquipChargeStatusResult.setElecMoney(chargingOrder.getRechargeAmount().subtract(chargingOrder.getResidualAmount())); |
| | | queryEquipChargeStatusResult.setSeviceMoney(BigDecimal.ZERO); |
| | |
| | | |
| | | List<TChargingOrderAccountingStrategy> data = chargingOrderAccountingStrategyClient.getChargingOrderAccountingStrategyByOrderId(chargingOrder.getId()).getData(); |
| | | if(data.size() > 0){ |
| | | BigDecimal totalElectricity = data.stream().map(TChargingOrderAccountingStrategy::getPeriodElectricPrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal serviceCharge = data.stream().map(TChargingOrderAccountingStrategy::getPeriodServicePrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | notificationChargeOrderInfo.setTotalElecMoney(totalElectricity.setScale(2, RoundingMode.HALF_EVEN)); |
| | | notificationChargeOrderInfo.setTotalSeviceMoney(serviceCharge.setScale(2, RoundingMode.HALF_EVEN)); |
| | | notificationChargeOrderInfo.setTotalMoney(chargingOrder.getPaymentAmount()); |
| | | BigDecimal totalElectricity = data.stream().map(TChargingOrderAccountingStrategy::getPeriodElectricPrice).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(4, RoundingMode.HALF_EVEN); |
| | | BigDecimal serviceCharge = data.stream().map(TChargingOrderAccountingStrategy::getPeriodServicePrice).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(4, RoundingMode.HALF_EVEN); |
| | | BigDecimal totalMoney = totalElectricity.add(serviceCharge).setScale(4, RoundingMode.HALF_EVEN); |
| | | notificationChargeOrderInfo.setTotalElecMoney(totalElectricity); |
| | | notificationChargeOrderInfo.setTotalSeviceMoney(serviceCharge); |
| | | notificationChargeOrderInfo.setTotalMoney(totalMoney); |
| | | }else{ |
| | | notificationChargeOrderInfo.setTotalElecMoney(chargingOrder.getRechargeAmount().subtract(chargingOrder.getResidualAmount())); |
| | | notificationChargeOrderInfo.setTotalSeviceMoney(BigDecimal.ZERO); |
| | |
| | | if(stationIDs==null){ |
| | | stationIDs = new ArrayList<String>(); |
| | | } |
| | | PageInfo<Site> siteListPaging = siteClient.getSiteListPaging(pageNo, pageSize, stationIDs); |
| | | PageInfo<Site> siteListPaging = siteClient.getSiteListPagingJianGuan(pageNo, pageSize, stationIDs); |
| | | List<TParkingLot> parkingLots = parkingLotClient.getAllParkingLot().getData(); |
| | | QueryStationsInfoResult queryStationsInfoResult = new QueryStationsInfoResult(); |
| | | queryStationsInfoResult.setPageNo(pageNo); |
| | |
| | | List<TChargingPile> chargingPiles = chargingPileClient.getChargingPileBySiteIds(stationIDList).getData(); |
| | | if(!CollectionUtils.isEmpty(chargingPiles)){ |
| | | List<Integer> pileIds = chargingPiles.stream().map(TChargingPile::getId).collect(Collectors.toList()); |
| | | List<TChargingGun> chargingGuns = chargingGunClient.getChargingGunByChargingPileIds(pileIds).getData(); |
| | | GetChargingGunByChargingPileIdsVo vo = new GetChargingGunByChargingPileIdsVo(); |
| | | vo.setChargingPileIds(pileIds); |
| | | List<TChargingGun> chargingGuns = chargingGunClient.getChargingGunByChargingPileIds(vo).getData(); |
| | | if(!CollectionUtils.isEmpty(chargingGuns)){ |
| | | for (Integer stationID : stationIDList) { |
| | | StationStatusInfo stationStatusInfo = new StationStatusInfo(); |