This commit is contained in:
Guoqs
2024-08-12 15:32:53 +08:00

View File

@@ -1105,9 +1105,10 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
} }
// 用户选中某日期 // 用户选中某日期
if (dateTime != null) { if (dateTime != null) {
String orderNumRateGrowthRate = ""; String orderNumRateGrowthRate = "0%";
String format = ""; String format = "";
if (StringUtils.equals(Constants.ONE, type)) { if (StringUtils.equals(Constants.ONE, type) ||
StringUtils.equals(Constants.TWO, type)) {
// 7天 // 7天
format = DateUtils.YYYY_MM_DD; format = DateUtils.YYYY_MM_DD;
}else { }else {
@@ -1124,6 +1125,8 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
if (yesterdayOrderNum.compareTo(BigDecimal.ZERO) != 0) { if (yesterdayOrderNum.compareTo(BigDecimal.ZERO) != 0) {
BigDecimal orderNumRate = todayOrderNum.subtract(yesterdayOrderNum).divide(yesterdayOrderNum, 2, BigDecimal.ROUND_HALF_UP); BigDecimal orderNumRate = todayOrderNum.subtract(yesterdayOrderNum).divide(yesterdayOrderNum, 2, BigDecimal.ROUND_HALF_UP);
orderNumRateGrowthRate = orderNumRate.multiply(new BigDecimal("100")) + "%"; orderNumRateGrowthRate = orderNumRate.multiply(new BigDecimal("100")) + "%";
}else {
orderNumRateGrowthRate = todayOrderNum.multiply(new BigDecimal("100")) + "%";
} }
vo.setOrderAmountGrowthRate(orderNumRateGrowthRate); vo.setOrderAmountGrowthRate(orderNumRateGrowthRate);
} }