Commit 0c3d053a by 王璐琦

feat(report): 新增今日成交金额统计功能

- 在统计服务中添加今日成交金额累计逻辑,排除全额退款订单
- 计算今日成交金额时只统计售前类型订单
- 设置今日成交金额统计结果到统计对象中
- 汇总今日成交金额并设置到总计统计对象中
- 更新导出DTO中相关Excel合并列索引以适配新增字段
- 在统计VO添加今日成交金额字段及其注释与排列顺序调整
1 parent aece5d16
...@@ -17,21 +17,21 @@ public class ExtendedWarrantyOtherDeliveryStatisticsExportVO implements Serializ ...@@ -17,21 +17,21 @@ public class ExtendedWarrantyOtherDeliveryStatisticsExportVO implements Serializ
/** 交付部行数据列表 */ /** 交付部行数据列表 */
private List<ExtendedWarrantyOtherDeliveryStatisticsVO> list; private List<ExtendedWarrantyOtherDeliveryStatisticsVO> list;
@ExcelMergeRow(columIndex = 18) @ExcelMergeRow(columIndex = 19)
private String ewReferralRateTotalOfMonth; private String ewReferralRateTotalOfMonth;
@ExcelMergeRow(columIndex = 19) @ExcelMergeRow(columIndex = 20)
private String ewPresalesCustomerContactRateOfMonth; private String ewPresalesCustomerContactRateOfMonth;
@ExcelMergeRow(columIndex = 20) @ExcelMergeRow(columIndex = 21)
private String ewSalesOrderCountOfMonth; private String ewSalesOrderCountOfMonth;
@ExcelMergeRow(columIndex = 21) @ExcelMergeRow(columIndex = 22)
private String eqReferralRateTotalOfMonth; private String eqReferralRateTotalOfMonth;
@ExcelMergeRow(columIndex = 22) @ExcelMergeRow(columIndex = 23)
private String eqPresalesCustomerContactRateOfMonth; private String eqPresalesCustomerContactRateOfMonth;
@ExcelMergeRow(columIndex = 23) @ExcelMergeRow(columIndex = 24)
private String eqSalesOrderCountOfMonth; private String eqSalesOrderCountOfMonth;
} }
...@@ -36,33 +36,36 @@ public class ExtendedWarrantyOtherDeliveryStatisticsVO implements Serializable { ...@@ -36,33 +36,36 @@ public class ExtendedWarrantyOtherDeliveryStatisticsVO implements Serializable {
/** 今日售前权益成交数 (H) */ /** 今日售前权益成交数 (H) */
private Integer eqDeliveryCountOfToday; private Integer eqDeliveryCountOfToday;
/** 本月交付数 (I) */ /** 今日成交金额 (I) */
private BigDecimal salesAmountOfToday;
/** 本月交付数 (J) */
private Integer deliveryCountOfMonth; private Integer deliveryCountOfMonth;
/** 本月售前延保触客数 (J) */ /** 本月售前延保触客数 (K) */
private Integer ewPresalesCustomerContactCountOfMonth; private Integer ewPresalesCustomerContactCountOfMonth;
/** 本月售前权益触客数 (K) */ /** 本月售前权益触客数 (L) */
private Integer eqPresalesCustomerContactCountOfMonth; private Integer eqPresalesCustomerContactCountOfMonth;
/** 本月售前延保成交数 (L) */ /** 本月售前延保成交数 (M) */
private Integer ewDeliveryCountOfMonth; private Integer ewDeliveryCountOfMonth;
/** 本月售前权益成交数 (M) */ /** 本月售前权益成交数 (N) */
private Integer eqDeliveryCountOfMonth; private Integer eqDeliveryCountOfMonth;
/** 本月成交金额 (N) */ /** 本月成交金额 (O) */
private BigDecimal salesAmountOfMonth; private BigDecimal salesAmountOfMonth;
/** 本月售前延保推荐率 (O) */ /** 本月售前延保推荐率 (P) */
private String ewReferralRateOfMonth; private String ewReferralRateOfMonth;
/** 本月售前延保渗透率 (P) */ /** 本月售前延保渗透率 (Q) */
private String ewPenetrationRateOfMonth; private String ewPenetrationRateOfMonth;
/** 本月售前权益推荐率 (Q) */ /** 本月售前权益推荐率 (R) */
private String eqReferralRateOfMonth; private String eqReferralRateOfMonth;
/** 本月售前权益渗透率 (R) */ /** 本月售前权益渗透率 (S) */
private String eqPenetrationRateOfMonth; private String eqPenetrationRateOfMonth;
} }
...@@ -2019,12 +2019,14 @@ public class DailyReportDataService { ...@@ -2019,12 +2019,14 @@ public class DailyReportDataService {
int todayDelivery = 0, todayEwReferral = 0, todayEwTalk = 0, todayEqReferral = 0, todayEqTalk = 0; int todayDelivery = 0, todayEwReferral = 0, todayEwTalk = 0, todayEqReferral = 0, todayEqTalk = 0;
int todayEwDeal = 0, todayEqDeal = 0; int todayEwDeal = 0, todayEqDeal = 0;
BigDecimal todaySalesAmount = BigDecimal.ZERO;
Set<String> todayDeliveryPhoneSet = new HashSet<>(), todayEwReferralPhoneSet = new HashSet<>(), todayEwTalkPhoneSet = new HashSet<>(); Set<String> todayDeliveryPhoneSet = new HashSet<>(), todayEwReferralPhoneSet = new HashSet<>(), todayEwTalkPhoneSet = new HashSet<>();
Set<String> todayEqReferralPhoneSet = new HashSet<>(), todayEqTalkPhoneSet = new HashSet<>(); Set<String> todayEqReferralPhoneSet = new HashSet<>(), todayEqTalkPhoneSet = new HashSet<>();
for (GoodsOrderDTO order : st) { for (GoodsOrderDTO order : st) {
if (isOrderFullyRefunded(order)) continue; if (isOrderFullyRefunded(order)) continue;
GoodsOrderCustomer customer = order.getCustomer(); GoodsOrderCustomer customer = order.getCustomer();
if (customer == null || customer.getSalesType() == null || customer.getSalesType() != SalesTypeEnum.BEFORE_SALE.getValue()) continue; if (customer == null || customer.getSalesType() == null || customer.getSalesType() != SalesTypeEnum.BEFORE_SALE.getValue()) continue;
todaySalesAmount = todaySalesAmount.add(calcOrderNetAmount(order));
// 业务列:延保仅统计延保基础场景;权益 and 延保不追加基础场景限制。 // 业务列:延保仅统计延保基础场景;权益 and 延保不追加基础场景限制。
boolean ewBusiness = isOtherBrandExtendedWarrantyOrder(order, goodsTypeOriginalFactoryEquity); boolean ewBusiness = isOtherBrandExtendedWarrantyOrder(order, goodsTypeOriginalFactoryEquity);
boolean eqBusiness = isOtherBrandEquityOrder(order, goodsTypeOriginalFactoryExtWarranty, goodsTypeGlExtWarranty); boolean eqBusiness = isOtherBrandEquityOrder(order, goodsTypeOriginalFactoryExtWarranty, goodsTypeGlExtWarranty);
...@@ -2093,6 +2095,7 @@ public class DailyReportDataService { ...@@ -2093,6 +2095,7 @@ public class DailyReportDataService {
vo.setEqPresalesCustomerContactCountOfToday(todayEqTalk); vo.setEqPresalesCustomerContactCountOfToday(todayEqTalk);
vo.setEwDeliveryCountOfToday(todayEwDeal); vo.setEwDeliveryCountOfToday(todayEwDeal);
vo.setEqDeliveryCountOfToday(todayEqDeal); vo.setEqDeliveryCountOfToday(todayEqDeal);
vo.setSalesAmountOfToday(todaySalesAmount);
vo.setDeliveryCountOfMonth(monthDelivery); vo.setDeliveryCountOfMonth(monthDelivery);
vo.setEwPresalesCustomerContactCountOfMonth(monthEwTalk); vo.setEwPresalesCustomerContactCountOfMonth(monthEwTalk);
vo.setEqPresalesCustomerContactCountOfMonth(monthEqTalk); vo.setEqPresalesCustomerContactCountOfMonth(monthEqTalk);
...@@ -2115,6 +2118,8 @@ public class DailyReportDataService { ...@@ -2115,6 +2118,8 @@ public class DailyReportDataService {
total.setEqPresalesCustomerContactCountOfToday(rows.stream().mapToInt(v -> nz(v.getEqPresalesCustomerContactCountOfToday())).sum()); total.setEqPresalesCustomerContactCountOfToday(rows.stream().mapToInt(v -> nz(v.getEqPresalesCustomerContactCountOfToday())).sum());
total.setEwDeliveryCountOfToday(rows.stream().mapToInt(v -> nz(v.getEwDeliveryCountOfToday())).sum()); total.setEwDeliveryCountOfToday(rows.stream().mapToInt(v -> nz(v.getEwDeliveryCountOfToday())).sum());
total.setEqDeliveryCountOfToday(rows.stream().mapToInt(v -> nz(v.getEqDeliveryCountOfToday())).sum()); total.setEqDeliveryCountOfToday(rows.stream().mapToInt(v -> nz(v.getEqDeliveryCountOfToday())).sum());
total.setSalesAmountOfToday(rows.stream().map(ExtendedWarrantyOtherDeliveryStatisticsVO::getSalesAmountOfToday)
.filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
total.setDeliveryCountOfMonth(rows.stream().mapToInt(v -> nz(v.getDeliveryCountOfMonth())).sum()); total.setDeliveryCountOfMonth(rows.stream().mapToInt(v -> nz(v.getDeliveryCountOfMonth())).sum());
total.setEwPresalesCustomerContactCountOfMonth(rows.stream().mapToInt(v -> nz(v.getEwPresalesCustomerContactCountOfMonth())).sum()); total.setEwPresalesCustomerContactCountOfMonth(rows.stream().mapToInt(v -> nz(v.getEwPresalesCustomerContactCountOfMonth())).sum());
total.setEqPresalesCustomerContactCountOfMonth(rows.stream().mapToInt(v -> nz(v.getEqPresalesCustomerContactCountOfMonth())).sum()); total.setEqPresalesCustomerContactCountOfMonth(rows.stream().mapToInt(v -> nz(v.getEqPresalesCustomerContactCountOfMonth())).sum());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!