From 68f7e75538350a844907b38f4b07e548a0a3b276 Mon Sep 17 00:00:00 2001 From: Lemon Date: Mon, 15 Dec 2025 11:02:10 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=20=20=E4=BF=AE=E5=A4=8D=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E9=A6=96=E9=A1=B5=E7=94=B5=E5=8D=95=E8=BD=A6?= =?UTF-8?q?=E8=AE=A1=E8=B4=B9=E6=A8=A1=E6=9D=BF=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PileBillingTemplateServiceImpl.java | 28 ++----------------- .../impl/PileStationInfoServiceImpl.java | 15 +++++++++- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java index fc183aaf8..d3cc93e52 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java @@ -433,34 +433,12 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic */ @Override public CurrentTimePriceDetails getCurrentTimePriceDetailsForEBike(String stationId) { - CurrentTimePriceDetails result = null; - // 查询当前时段电费 - LocalTime localTime = LocalTime.now(); - String now = LocalTime.of(localTime.getHour(), localTime.getMinute(), localTime.getSecond()).toString(); + CurrentTimePriceDetails result = new CurrentTimePriceDetails(); // 通过站点id查询计费模板 BillingTemplateVO billingTemplateVO = queryUsedBillingTemplateForEBike(stationId); if (Objects.nonNull(billingTemplateVO)) { - result = new CurrentTimePriceDetails(); - result.setTemplateCode(billingTemplateVO.getTemplateCode()); - result.setStationId(stationId); - result.setDateTime(localTime.toString()); - result.setFreeTime(billingTemplateVO.getFreeTime()); - result.setOccupyFee(billingTemplateVO.getOccupyFee()); - List billingDetailList = billingTemplateVO.getBillingDetailList(); - for (BillingDetailVO detailVO : billingDetailList) { - List applyTimeList = detailVO.getApplyTime(); - for (String applyTime : applyTimeList) { - boolean b = DateUtils.checkTime(now + "-" + now, applyTime); - if (b) { - // 将桩的费率存入stationVO - BigDecimal electricityPrice = detailVO.getElectricityPrice(); - BigDecimal servicePrice = detailVO.getServicePrice(); - result.setElectricityPrice(electricityPrice.toString()); - result.setServicePrice(servicePrice.toString()); - result.setTotalPrice(electricityPrice.add(servicePrice).toString()); - } - } - } + // 电单车直接取平时段费用 + result.setTotalPrice(billingTemplateVO.getFlatElectricityPrice().toString()); } return result; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java index 3f33428ff..445a7540c 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java @@ -36,6 +36,7 @@ import com.jsowell.pile.vo.uniapp.business.StationBusinessAnalyzeInfoVO; import com.jsowell.pile.vo.uniapp.business.StationOrderQuantityInfoVO; import com.jsowell.pile.vo.uniapp.business.StationStatisticsInfosVO; import com.jsowell.pile.vo.uniapp.customer.CurrentTimePriceDetails; +import com.jsowell.pile.vo.web.BillingTemplateVO; import com.jsowell.pile.vo.web.PileStationVO; import com.jsowell.pile.vo.web.StationSelectVO; import com.jsowell.system.service.SysDeptService; @@ -611,6 +612,12 @@ public class PileStationInfoServiceImpl implements PileStationInfoService { stationVO.setVipElectricityPrice(currentTimePriceDetails.getVipElectricityPrice()); stationVO.setVipServicePrice(currentTimePriceDetails.getVipServicePrice()); stationVO.setVipTotalPrice(currentTimePriceDetails.getVipTotalPrice()); + }else { + // 如果为空,查询一下电动车计费 + currentTimePriceDetails = pileBillingTemplateService.getCurrentTimePriceDetailsForEBike(stationVO.getStationId()); + if (currentTimePriceDetails != null) { + stationVO.setTotalPrice(currentTimePriceDetails.getTotalPrice()); + } } //根据站点id查询订单最后一次交易时间 @@ -737,7 +744,7 @@ public class PileStationInfoServiceImpl implements PileStationInfoService { stationVO.setSlowFree(map.get("slowFree")); stationVO.setTotalFree(stationVO.getFastFree() + stationVO.getSlowFree()); - // 查询当前时段电费 + // 查询当前时段电动汽车电费 CurrentTimePriceDetails currentTimePriceDetails = pileBillingTemplateService.getCurrentTimePriceDetails(stationVO.getStationId()); if (currentTimePriceDetails != null) { stationVO.setElectricityPrice(currentTimePriceDetails.getElectricityPrice()); @@ -749,6 +756,12 @@ public class PileStationInfoServiceImpl implements PileStationInfoService { stationVO.setVipElectricityPrice(currentTimePriceDetails.getVipElectricityPrice()); stationVO.setVipServicePrice(currentTimePriceDetails.getVipServicePrice()); stationVO.setVipTotalPrice(currentTimePriceDetails.getVipTotalPrice()); + }else { + // 如果为空,查询一下电动车计费 + currentTimePriceDetails = pileBillingTemplateService.getCurrentTimePriceDetailsForEBike(stationVO.getStationId()); + if (currentTimePriceDetails != null) { + stationVO.setTotalPrice(currentTimePriceDetails.getTotalPrice()); + } } // 站点基础设施 stationVO.setParkFree(pileStationVO.getParkFree());