mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
update 运营端小程序 查询订单数量趋势信息接口
This commit is contained in:
@@ -1044,6 +1044,7 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
|
||||
public StationBusinessAnalyzeInfoVO getStationOrderQuantityInfo(StationBusinessAnalyzeInfoDTO dto) {
|
||||
StationBusinessAnalyzeInfoVO vo = new StationBusinessAnalyzeInfoVO();
|
||||
List<String> 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;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,11 @@ public class StationBusinessAnalyzeInfoVO {
|
||||
*/
|
||||
private String serviceAmountGrowthRate;
|
||||
|
||||
/**
|
||||
* 订单数量增长率
|
||||
*/
|
||||
private String orderNumRateGrowthRate;
|
||||
|
||||
/**
|
||||
* 运营端小程序订单详情VO
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user