| | |
| | | @PostMapping("/query_token_jianguan") |
| | | public BaseResult queryTokenJianguan(@RequestBody BaseRequest baseRequest, HttpServletRequest request){ |
| | | log.info("三方平台获取token请求参数:" + JacksonUtils.toJson(baseRequest)); |
| | | BaseResult baseResult = requestCheckJianGuan(false, baseRequest, request); |
| | | BaseResult baseResult = requestCheck(false, baseRequest, request); |
| | | if(0 != baseResult.getRet()){ |
| | | log.info("三方平台获取token响应Data:"); |
| | | baseResult.setData(""); |
| | |
| | | public BaseResult queryStationsInfo(@RequestBody BaseRequest baseRequest, HttpServletRequest request){ |
| | | log.info("三方平台查询充电站信息请求参数:" + JacksonUtils.toJson(baseRequest)); |
| | | //校验token和签名 |
| | | BaseResult baseResult = requestCheckJianGuan(true, baseRequest, request); |
| | | BaseResult baseResult = requestCheck(true, baseRequest, request); |
| | | if(0 != baseResult.getRet()){ |
| | | log.info("三方平台查询充电站信息响应Data:"); |
| | | baseResult.setData(""); |
| | |
| | | stationInfo.setCountryCode(StringUtils.isNotEmpty(datum.getCountryCode()) ? datum.getCountryCode() : "CN"); |
| | | stationInfo.setAreaCode(datum.getDistrictsCode()); |
| | | stationInfo.setAddress(datum.getAddress()); |
| | | stationInfo.setStationTel(datum.getPhone()); |
| | | stationInfo.setServiceTel(serviceTel); |
| | | stationInfo.setStationTel(StringUtils.isNotEmpty(datum.getPhone()) ? datum.getPhone().split(",")[0] : ""); |
| | | stationInfo.setServiceTel(StringUtils.isNotEmpty(serviceTel) ? serviceTel.split(",")[0] : ""); |
| | | switch (datum.getSiteType()){ |
| | | case 0: |
| | | stationInfo.setStationType(StationTypeEnum.OTHER.getType()); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/pushChargingGunStatus") |
| | | public R pushChargingGunStatus(@RequestParam("fullNumber") String fullNumber, @RequestParam("status") Integer status){ |
| | | public R pushChargingGunStatus(@RequestParam(value = "fullNumber") String fullNumber, @RequestParam(value = "status") Integer status){ |
| | | ConnectorStatusInfo connectorStatusInfo = new ConnectorStatusInfo(); |
| | | connectorStatusInfo.setConnectorID(fullNumber); |
| | | switch (status){ |
| | |
| | | } |
| | | chargeDetail.setElecPrice(datum.getElectrovalence()); |
| | | chargeDetail.setSevicePrice(datum.getServiceCharge()); |
| | | chargeDetail.setDetailPower(datum.getChargingCapacity()); |
| | | chargeDetail.setDetailPower(datum.getChargingCapacity().setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | chargeDetail.setDetailElecMoney(datum.getPeriodElectricPrice()); |
| | | chargeDetail.setDetailSeviceMoney(datum.getPeriodServicePrice()); |
| | | chargeDetails.add(chargeDetail); |
| | |
| | | notificationChargeOrderInfo.setStartChargeSeq(startChargeSeq); |
| | | TChargingOrder chargingOrder = chargingOrderClient.getChargingOrderByStartChargeSeq(startChargeSeq).getData(); |
| | | if(null == chargingOrder){ |
| | | log.info("三方平台流水号获取订单失败"); |
| | | return null; |
| | | } |
| | | TChargingGun chargingGun = chargingGunClient.getChargingGunById(chargingOrder.getChargingGunId()).getData(); |
| | |
| | | } |
| | | chargeDetail.setElecPrice(datum.getElectrovalence()); |
| | | chargeDetail.setSevicePrice(datum.getServiceCharge()); |
| | | chargeDetail.setDetailPower(datum.getChargingCapacity()); |
| | | chargeDetail.setDetailPower(datum.getChargingCapacity().setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | chargeDetail.setDetailElecMoney(datum.getPeriodElectricPrice()); |
| | | chargeDetail.setDetailSeviceMoney(datum.getPeriodServicePrice()); |
| | | chargeDetails.add(chargeDetail); |
| | |
| | | } |
| | | chargeDetail.setElecPrice(datum.getElectrovalence()); |
| | | chargeDetail.setSevicePrice(datum.getServiceCharge()); |
| | | chargeDetail.setDetailPower(datum.getChargingCapacity()); |
| | | chargeDetail.setDetailPower(datum.getChargingCapacity().setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | chargeDetail.setDetailElecMoney(datum.getPeriodElectricPrice()); |
| | | chargeDetail.setDetailSeviceMoney(datum.getPeriodServicePrice()); |
| | | chargeDetails.add(chargeDetail); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 推送充换电站信息 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/supervise_notification_station_info") |
| | | public R superviseNotificationStationInfo(@RequestParam("id") Integer id){ |
| | | String serviceTel = systemConfigurationClient.getServerPhone().getData(); |
| | | Site site = siteClient.getSiteAll().getData().stream().filter(e -> e.getId().equals(id)).findFirst().orElse(new Site()); |
| | | |
| | | List<TChargingPile> tChargingPiles = chargingPileClient.getChargingPileBySiteIds(Collections.singletonList(site.getId())).getData(); |
| | | List<Integer> collect1 = tChargingPiles.stream().map(TChargingPile::getId).collect(Collectors.toList()); |
| | | List<TChargingGun> chargingGunList = chargingGunClient.getChargingGunByChargingPileIds(collect1).getData(); |
| | | SupStationInfo supStationInfo = new SupStationInfo(); |
| | | supStationInfo.setStationID(site.getId().toString()); |
| | | supStationInfo.setStationUniqueNumber(site.getDistrictsCode() + "906171535" + site.getId()); |
| | | supStationInfo.setOperatorID("906171535"); |
| | | supStationInfo.setEquipmentOwnerID("906171535"); |
| | | supStationInfo.setStationName(site.getName()); |
| | | supStationInfo.setCountryCode(site.getCountryCode()); |
| | | supStationInfo.setAreaCode(site.getCityCode()); |
| | | supStationInfo.setAddress(site.getAddress()); |
| | | supStationInfo.setAreaCodeCountryside(site.getAreaCodeCountryside()); |
| | | supStationInfo.setStationTel(site.getPhone()); |
| | | |
| | | supStationInfo.setServiceTel(serviceTel); |
| | | supStationInfo.setStationClassification(site.getStationClassification()); |
| | | supStationInfo.setGeneralApplicationType(site.getGeneralApplicationType()); |
| | | supStationInfo.setStationType(site.getSiteType()); |
| | | supStationInfo.setStationStatus(site.getStatus()); |
| | | supStationInfo.setParkNums(site.getParkingSpace()); |
| | | supStationInfo.setStationLat(new BigDecimal(site.getLat()).setScale(6, RoundingMode.DOWN)); |
| | | supStationInfo.setStationLng(new BigDecimal(site.getLon()).setScale(6, RoundingMode.DOWN)); |
| | | supStationInfo.setSiteGuide(site.getGuide()); |
| | | supStationInfo.setConstruction(site.getConstructionSite() == 0 ? ConstructionEnum.OTHER.getType() : site.getConstructionSite()); |
| | | supStationInfo.setPictures(StringUtils.isNotEmpty(site.getImgUrl()) ? Arrays.asList(site.getImgUrl().split(",")) : new ArrayList<>()); |
| | | |
| | | supStationInfo.setMatchCars(site.getVehicleDescription()); |
| | | if (org.springframework.util.StringUtils.hasLength(site.getSwapMatchCars())){ |
| | | supStationInfo.setSwapMatchCars(Arrays.asList(site.getSwapMatchCars().split(","))); |
| | | } |
| | | supStationInfo.setBusineHours(site.getStartServiceTime()); |
| | | supStationInfo.setRoundTheClock(site.getRoundTheClock()); |
| | | supStationInfo.setParkType(site.getParkType()); |
| | | supStationInfo.setParkFee("{\"rules\":"+site.getParkFee()+","+"\"freeDuration\":"+site.getParkFeeFree()+"}"); |
| | | supStationInfo.setElectricityType(site.getElectricityType()); |
| | | supStationInfo.setBusinessExpandType(site.getBusinessExpandType()); |
| | | supStationInfo.setCapacity(site.getCapacity()); |
| | | supStationInfo.setRatedPower(site.getRatedPower()); |
| | | supStationInfo.setPeriodFee(site.getPeriodFee()); |
| | | supStationInfo.setOfficialRunTime(site.getOfficialRunTime()); |
| | | supStationInfo.setStationOrientation(site.getStationOrientation()); |
| | | supStationInfo.setStationArea(site.getStationArea()); |
| | | supStationInfo.setHavePerson(site.getHavePerson()); |
| | | supStationInfo.setVideoMonitor(site.getVideoMonitor()); |
| | | if (StringUtils.isNotEmpty(site.getSupportingFacilities())){ |
| | | String[] split = site.getSupportingFacilities().split(","); |
| | | List<Integer> collect = Arrays.stream(split).map(Integer::parseInt).collect(Collectors.toList()); |
| | | supStationInfo.setSupportingFacilities(collect); |
| | | } |
| | | supStationInfo.setPrinterFlag(site.getPrinterFlag()); |
| | | supStationInfo.setBarrierFlag(site.getBarrierFlag()); |
| | | supStationInfo.setParkingLockFlag(site.getParkingLockFlag()); |
| | | supStationInfo.setEquipmentInfos(buildEquipmentInfo(site.getId(), tChargingPiles, chargingGunList)); |
| | | // supStationInfo.setSwapEquipmentInfos(); |
| | | supStationInfo.setElectricityFee("{"+site.getElectricityFee()+"}"); |
| | | supStationInfo.setEquipmentOwnerName(site.getEquipmentOwnerName()); |
| | | supStationInfo.setResidentNo(site.getResidentNo()); |
| | | supStationInfo.setSupplyType(site.getSupplyType()); |
| | | supStationInfo.setWattHourMeterNo(site.getWattHourMeterNo()); |
| | | supStationInfo.setForwardPower(site.getForwardPower()); |
| | | supStationInfo.setServiceFee("{"+site.getServiceFee()+"}"); |
| | | supStationInfo.setRecordUniqueNo(site.getRecordUniqueNo()); |
| | | BaseResult baseResult = new BaseResult(); |
| | | SupStationInfoResult supStationInfoResult = new SupStationInfoResult(); |
| | | supStationInfoResult.setSupStationInfo(supStationInfo); |
| | | tcecSuperviseUtil.superviseNotificationStationInfo(supStationInfoResult); |
| | | return R.ok(baseResult); |
| | | } |
| | | // |
| | | // |
| | | // /** |