| | |
| | | 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){ |
| | |
| | | queryEquipChargeStatusResult.setEndTime((null == chargingOrder.getEndTime() ? LocalDateTime.now() : chargingOrder.getEndTime()).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
| | | queryEquipChargeStatusResult.setTotalPower(chargingOrder.getElectricity()); |
| | | |
| | | |
| | | List<TChargingOrderAccountingStrategy> data = chargingOrderAccountingStrategyClient.getChargingOrderAccountingStrategyByOrderId(chargingOrder.getId()).getData(); |
| | | if(data.size() > 0){ |
| | | BigDecimal totalElectricity = data.stream().map(TChargingOrderAccountingStrategy::getPeriodElectricPrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | |
| | | queryEquipChargeStatusResult.setElecMoney(totalElectricity); |
| | | queryEquipChargeStatusResult.setSeviceMoney(serviceCharge); |
| | | queryEquipChargeStatusResult.setTotalMoney(chargingOrder.getPaymentAmount()); |
| | | }else{ |
| | | }else if(null != chargingOrder.getRechargeAmount() && null != chargingOrder.getResidualAmount()){ |
| | | queryEquipChargeStatusResult.setElecMoney(chargingOrder.getRechargeAmount().subtract(chargingOrder.getResidualAmount())); |
| | | queryEquipChargeStatusResult.setSeviceMoney(BigDecimal.ZERO); |
| | | queryEquipChargeStatusResult.setTotalMoney(chargingOrder.getRechargeAmount().subtract(chargingOrder.getResidualAmount())); |
| | | }else{ |
| | | queryEquipChargeStatusResult.setElecMoney(BigDecimal.ZERO); |
| | | queryEquipChargeStatusResult.setSeviceMoney(BigDecimal.ZERO); |
| | | queryEquipChargeStatusResult.setTotalMoney(BigDecimal.ZERO); |
| | | } |
| | | |
| | | //构建充电明细 |
| | |
| | | } |
| | | 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); |