From b01a1ebfbd65247abae6f245a1d32064b5633ddb Mon Sep 17 00:00:00 2001 From: Lemon Date: Fri, 9 Aug 2024 08:47:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?update=20=20=E5=8D=A0=E6=A1=A9=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=90=8E=E7=AE=A1=E9=A1=B5=E9=9D=A2=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E7=8A=B6=E6=80=81=E7=AD=9B=E9=80=89=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/pile/OrderPileOccupyMapper.xml | 1 + jsowell-ui/src/views/pile/occupy/index.vue | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/jsowell-pile/src/main/resources/mapper/pile/OrderPileOccupyMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/OrderPileOccupyMapper.xml index e5dfc2605..a73b8aa74 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/OrderPileOccupyMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/OrderPileOccupyMapper.xml @@ -1017,6 +1017,7 @@ and t1.station_id = #{dto.stationId} and t1.plate_number = #{dto.plateNumber} and t1.status = #{dto.status} + and t1.pay_status = #{dto.payStatus} and t1.start_time = #{dto.startTime} and t1.order_amount = #{dto.orderAmount} and t1.pile_sn = #{dto.pileSn} diff --git a/jsowell-ui/src/views/pile/occupy/index.vue b/jsowell-ui/src/views/pile/occupy/index.vue index c5b2f3f51..8dea5df0e 100644 --- a/jsowell-ui/src/views/pile/occupy/index.vue +++ b/jsowell-ui/src/views/pile/occupy/index.vue @@ -7,6 +7,13 @@ + + + + + From 2376f04967d311e07bf7fc23a1bf21ebb651acf4 Mon Sep 17 00:00:00 2001 From: Lemon Date: Fri, 9 Aug 2024 10:49:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?update=20=20=E8=BF=90=E8=90=A5=E7=AB=AF?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=20=E6=9F=A5=E8=AF=A2=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=95=B0=E9=87=8F=E8=B6=8B=E5=8A=BF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/运营小程序接口文档.md | 35 ++++++++++++------- .../impl/PileStationInfoServiceImpl.java | 24 +++++++++++++ .../StationBusinessAnalyzeInfoVO.java | 5 +++ 3 files changed, 52 insertions(+), 12 deletions(-) diff --git a/doc/运营小程序接口文档.md b/doc/运营小程序接口文档.md index 6e57bad69..15a155a09 100644 --- a/doc/运营小程序接口文档.md +++ b/doc/运营小程序接口文档.md @@ -125,23 +125,34 @@ # 站点订单趋势统计图 -接口地址: +```text +接口地址:http://localhost:8080/business/pile/station/getStationOrderQuantityInfo -请求方式: +请求方式:POST +``` -入参 +### 入参 -| 字段名 | 类型 | 是否必传 | 备注 | -| ------ | ---- | -------- | ---- | -| | | | | +| 字段名 | 类型 | 是否必传 | 备注 | +| ---------- | ------------ | -------- | --------------------------------------- | +| stationIds | List | Y | 站点id数组 | +| type | String | Y | 日期类型(1-近7天;2-近30天;3-近一年) | + +### 反参 + +| 字段名 | 类型 | 是否必传 | 备注 | +| ---------------------------- | ------------------------------ | -------- | --------------------------- | +| stationOrderQuantityInfoList | List | Y | 站点订单数量趋势信息 | +| orderNumRateGrowthRate | String | Y | 每天订单数量同比增长率(%) | + +### StationOrderQuantityInfo + +| 字段名 | 类型 | 是否必传 | 备注 | +| ----------- | ------ | -------- | -------- | +| tradeDate | String | Y | 交易日期 | +| orderNumber | int | Y | 订单数量 | -反参 -| 字段名 | 类型 | 是否必传 | 备注 | -| ------ | ---- | -------- | --------------------------- | -| | | Y | 日期 | -| | | Y | 每天订单数量(单) | -| | | Y | 每天订单数量同比增长率(%) | # 站点利用率趋势统计图 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 240fa2618..30262647a 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 @@ -1044,6 +1044,7 @@ public class PileStationInfoServiceImpl implements PileStationInfoService { public StationBusinessAnalyzeInfoVO getStationOrderQuantityInfo(StationBusinessAnalyzeInfoDTO dto) { StationBusinessAnalyzeInfoVO vo = new StationBusinessAnalyzeInfoVO(); List stationIds = dto.getStationIds(); + String dateTime = dto.getDateTime(); String type = dto.getType(); String startTime = ""; String endTime = ""; @@ -1098,7 +1099,30 @@ public class PileStationInfoServiceImpl implements PileStationInfoService { list.add(orderQuantityInfoVO); } + // 用户选中某日期 + if (dateTime != null) { + String orderNumRateGrowthRate = ""; + String format = ""; + if (StringUtils.equals(Constants.ONE, type)) { + // 7天 + format = DateUtils.YYYY_MM_DD; + }else { + format = DateUtils.YYYY_MM; + } + String yesterday = DateUtils.parseDateToStr(format, DateUtils.addDays(DateUtils.parseDate(dateTime), -1)); + SettleOrderReport todayReportInfo = map.get(dateTime); + SettleOrderReport yesterdayReportInfo = map.get(yesterday); + BigDecimal todayOrderNum = new BigDecimal(todayReportInfo.getChargeNum()); + BigDecimal yesterdayOrderNum = new BigDecimal(yesterdayReportInfo.getChargeNum()); + + // 计算增长率 + if (yesterdayOrderNum.compareTo(BigDecimal.ZERO) != 0) { + BigDecimal orderNumRate = todayOrderNum.subtract(yesterdayOrderNum).divide(yesterdayOrderNum, 2, BigDecimal.ROUND_HALF_UP); + orderNumRateGrowthRate = orderNumRate.multiply(new BigDecimal("100")) + "%"; + } + vo.setOrderAmountGrowthRate(orderNumRateGrowthRate); + } vo.setStationOrderQuantityInfoList(list); return vo; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/business/StationBusinessAnalyzeInfoVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/business/StationBusinessAnalyzeInfoVO.java index 9a4cdcbce..5e2b90fbd 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/business/StationBusinessAnalyzeInfoVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/business/StationBusinessAnalyzeInfoVO.java @@ -35,6 +35,11 @@ public class StationBusinessAnalyzeInfoVO { */ private String serviceAmountGrowthRate; + /** + * 订单数量增长率 + */ + private String orderNumRateGrowthRate; + /** * 运营端小程序订单详情VO */