|
@@ -2912,7 +2912,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
}else {
|
|
}else {
|
|
item.setTenantId(item.getCustomerId());
|
|
item.setTenantId(item.getCustomerId());
|
|
}
|
|
}
|
|
- if (item.getMoney().compareTo(BigDecimal.ZERO) == 0){
|
|
|
|
|
|
+ if (item.getMoney().compareTo(BigDecimal.ZERO) == 0 && (ObjectUtils.isNull(item.getOrderNum()) || item.getOrderNum() == 0)){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
//订单金额
|
|
//订单金额
|
|
@@ -2971,13 +2971,19 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
}
|
|
}
|
|
|
|
|
|
//金额占比
|
|
//金额占比
|
|
- BigDecimal divide = item.getMoney().divide(totalVo.getMoneyTotal(), 2, RoundingMode.HALF_UP);
|
|
|
|
- String s = divide.multiply(new BigDecimal("100")).toString();
|
|
|
|
- item.setMoneyOccupationRate(s+"%");
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(totalVo.getMoneyTotal()) && totalVo.getMoneyTotal().compareTo(BigDecimal.ZERO )> 0){
|
|
|
|
+ BigDecimal divide = item.getMoney().divide(totalVo.getMoneyTotal(), 2, RoundingMode.HALF_UP);
|
|
|
|
+ String s = divide.multiply(new BigDecimal("100")).toString();
|
|
|
|
+ item.setMoneyOccupationRate(s+"%");
|
|
|
|
+ }else {
|
|
|
|
+ item.setMoneyOccupationRate("0%");
|
|
|
|
+ }
|
|
//数量占比
|
|
//数量占比
|
|
- BigDecimal divide2 = new BigDecimal(item.getOrderNum()).divide(new BigDecimal(totalVo.getOrderNumTotal()), 2, RoundingMode.HALF_UP);
|
|
|
|
- String s2 = divide2.multiply(new BigDecimal("100")).toString();
|
|
|
|
- item.setOccupationRate(s2+"%");
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(totalVo.getOrderNumTotal()) && totalVo.getOrderNumTotal() > 0){
|
|
|
|
+ BigDecimal divide2 = new BigDecimal(item.getOrderNum()).divide(new BigDecimal(totalVo.getOrderNumTotal()), 2, RoundingMode.HALF_UP);
|
|
|
|
+ String s2 = divide2.multiply(new BigDecimal("100")).toString();
|
|
|
|
+ item.setOccupationRate(s2+"%");
|
|
|
|
+ }
|
|
});
|
|
});
|
|
return detailVos;
|
|
return detailVos;
|
|
}
|
|
}
|