This commit is contained in:
佟明轩 2025-05-20 13:29:27 +08:00
parent e74dcaa922
commit 9b18ad16bf
1 changed files with 5 additions and 1 deletions

View File

@ -113,7 +113,7 @@ public class StatisticsService extends BaseService {
// vipQuery.isNotNull("vip_id");
// List<Map<String, Object>> vipMaps = chargeOrderMapper.selectMaps(vipQuery);
QueryWrapper<ChargeOrder> commonQuery = new QueryWrapper<>();
commonQuery.select("create_date,sum(total_price)");
commonQuery.select("create_date,sum(total_price) as sum");
commonQuery.ge("pay_time", beginTime);
commonQuery.le("pay_time", endTime);
@ -151,6 +151,10 @@ public class StatisticsService extends BaseService {
OrganizationMember organizationMember = organizationMemberMapper.selectById(salePersonId);
vo.setSalePersonName(organizationMember.getName());
}
if (map.get("sum") == null){
continue;
}
vo.setTotalIncome(vo.getTotalIncome().add((BigDecimal) map.get("sum")));
vo.setCount(vo.getCount()+(Long) map.get("count"));
RetailOrderPayTypeEnum payType = RetailOrderPayTypeEnum.getByCode((Integer) map.get("pay_type"));