Commit 3e1dd547 by 王璐琦

fix(daily-report): 修正交付日期判断和转化率计算逻辑

- 取消交付日期与安装升级时间的同一天校验,简化交付日期匹配判断
- 移除售后客户访问记录中对交付日期范围的限制
- 修改延期保修商品类别匹配,支持多类别判断
- 调整月度触客转化率计算,改为使用前期触客统计数据
- 修复异议详情中交付日期显示,改用客户实际交付日期而非首次订单安装时间
1 parent bbbbad3b
...@@ -2064,8 +2064,7 @@ public class DailyReportDataService { ...@@ -2064,8 +2064,7 @@ public class DailyReportDataService {
boolean eqBusiness = isOtherBrandEquityOrder(order, goodsTypeOriginalFactoryExtWarranty, goodsTypeGlExtWarranty); boolean eqBusiness = isOtherBrandEquityOrder(order, goodsTypeOriginalFactoryExtWarranty, goodsTypeGlExtWarranty);
String phone = customer.getCustomerPhone(); String phone = customer.getCustomerPhone();
Set<Integer> tags = parseCustomerTagSet(customer.getCustomerTags()); Set<Integer> tags = parseCustomerTagSet(customer.getCustomerTags());
boolean deliveryDateMatch = isDateInRange(customer.getActualDeliveryDate(), startDate, endDate) boolean deliveryDateMatch = isDateInRange(customer.getActualDeliveryDate(), startDate, endDate);
&& isSameDay(customer.getActualDeliveryDate(), order.getInstallUpgradeTime());
if (deliveryDateMatch && StringUtils.isNotBlank(phone) && monthDeliveryPhoneSet.add(phone)) monthDelivery++; if (deliveryDateMatch && StringUtils.isNotBlank(phone) && monthDeliveryPhoneSet.add(phone)) monthDelivery++;
if (deliveryDateMatch && tags.contains((int) CustomerTagTypeEnum.DELIVERY_REFERRED.getValue())) { if (deliveryDateMatch && tags.contains((int) CustomerTagTypeEnum.DELIVERY_REFERRED.getValue())) {
if (ewBusiness && StringUtils.isNotBlank(phone) && monthEwReferralPhoneSet.add(phone)) monthEwReferral++; if (ewBusiness && StringUtils.isNotBlank(phone) && monthEwReferralPhoneSet.add(phone)) monthEwReferral++;
...@@ -2646,7 +2645,7 @@ public class DailyReportDataService { ...@@ -2646,7 +2645,7 @@ public class DailyReportDataService {
String phone = customer.getCustomerPhone(); String phone = customer.getCustomerPhone();
if (customer.getSalesType() != null && customer.getSalesType() == SalesTypeEnum.AFTER_SALE.getValue()) { if (customer.getSalesType() != null && customer.getSalesType() == SalesTypeEnum.AFTER_SALE.getValue()) {
oTransaction++; oTransaction++;
if (isDateInRange(customer.getActualDeliveryDate(), startDate, endDate) && StringUtils.isNotBlank(phone) && vPhones.add(phone)) { if (StringUtils.isNotBlank(phone) && vPhones.add(phone)) {
oVisit++; oVisit++;
Set<Integer> tags = parseCustomerTagSet(customer.getCustomerTags()); Set<Integer> tags = parseCustomerTagSet(customer.getCustomerTags());
if (tags.contains((int) CustomerTagTypeEnum.TOUCHED_CUSTOMER.getValue())) { oTalk++; tPhones.add(phone); } if (tags.contains((int) CustomerTagTypeEnum.TOUCHED_CUSTOMER.getValue())) { oTalk++; tPhones.add(phone); }
...@@ -3076,7 +3075,8 @@ public class DailyReportDataService { ...@@ -3076,7 +3075,8 @@ public class DailyReportDataService {
ExtendedWarrantyOtherNegotiationDetailVO vo = new ExtendedWarrantyOtherNegotiationDetailVO(); ExtendedWarrantyOtherNegotiationDetailVO vo = new ExtendedWarrantyOtherNegotiationDetailVO();
vo.setPhone(maskPhone(phone)); vo.setPhone(maskPhone(phone));
if (fromOrder) { if (fromOrder) {
vo.setDeliveryDate(firstOrder.getInstallUpgradeTime() != null ? new java.text.SimpleDateFormat("yyyy-MM-dd").format(firstOrder.getInstallUpgradeTime()) : dateStr(reportDate)); vo.setDeliveryDate(firstCustomer != null && firstCustomer.getActualDeliveryDate() != null
? new java.text.SimpleDateFormat("yyyy-MM-dd").format(firstCustomer.getActualDeliveryDate()) : dateStr(reportDate));
vo.setReferrer(defaultStr(firstOrder.getEmployeeName())); vo.setReferrer(defaultStr(firstOrder.getEmployeeName()));
vo.setCustomerName(defaultStr(firstCustomer != null ? firstCustomer.getCustomerName() : null)); vo.setCustomerName(defaultStr(firstCustomer != null ? firstCustomer.getCustomerName() : null));
vo.setVehicleConfiguration(blankToNone(joinCfg(firstCustomer))); vo.setVehicleConfiguration(blankToNone(joinCfg(firstCustomer)));
...@@ -3093,7 +3093,7 @@ public class DailyReportDataService { ...@@ -3093,7 +3093,7 @@ public class DailyReportDataService {
BigDecimal net = calcSubOrderNet(sub); BigDecimal net = calcSubOrderNet(sub);
addProductName(productNames, sub); addProductName(productNames, sub);
boolean isOriginalFactoryEquity = matchesCategory(sub.getUpgradeGoodsType(), sub.getUpgradeSecondaryGoodsType(), sub.getUpgradeThirdLevelGoodsType(), goodsTypeOriginFactoryEquity); boolean isOriginalFactoryEquity = matchesCategory(sub.getUpgradeGoodsType(), sub.getUpgradeSecondaryGoodsType(), sub.getUpgradeThirdLevelGoodsType(), goodsTypeOriginFactoryEquity);
boolean isExtendedWarranty = matchesCategory(sub.getUpgradeGoodsType(), sub.getUpgradeSecondaryGoodsType(), sub.getUpgradeThirdLevelGoodsType(), goodsTypeOriginFactoryExtWarranty) boolean isExtendedWarranty = matchesCategory(sub.getUpgradeGoodsType(), sub.getUpgradeSecondaryGoodsType(), sub.getUpgradeThirdLevelGoodsType(), goodsTypeOriginFactoryExtWarranty,goodsTypeGlExtWarranty)
|| matchesCategory(sub.getUpgradeGoodsType(), sub.getUpgradeSecondaryGoodsType(), sub.getUpgradeThirdLevelGoodsType(), goodsTypeGlExtWarranty); || matchesCategory(sub.getUpgradeGoodsType(), sub.getUpgradeSecondaryGoodsType(), sub.getUpgradeThirdLevelGoodsType(), goodsTypeGlExtWarranty);
if (!isOriginalFactoryEquity && matchesHmReportBusiness(order, HmReportBusinessType.EXTENDED_WARRANTY)) { if (!isOriginalFactoryEquity && matchesHmReportBusiness(order, HmReportBusinessType.EXTENDED_WARRANTY)) {
ewAmt = ewAmt.add(net); ewAmt = ewAmt.add(net);
...@@ -3852,8 +3852,8 @@ public class DailyReportDataService { ...@@ -3852,8 +3852,8 @@ public class DailyReportDataService {
int totalEqReferral = orderEqReferral + subEqReferral; int totalEqReferral = orderEqReferral + subEqReferral;
int totalEwClosed = orderEwClosed + orderAfterEwClosed; int totalEwClosed = orderEwClosed + orderAfterEwClosed;
int totalEqClosed = orderEqClosed + orderAfterEqClosed; int totalEqClosed = orderEqClosed + orderAfterEqClosed;
int totalEwTalk = orderEwTalk + subEwTalk + orderAfterEwTalk + subAfterEwTalk; int totalPreEwTalk = orderEwTalk + subEwTalk;
int totalEqTalk = orderEqTalk + subEqTalk + orderAfterEqTalk + subAfterEqTalk; int totalPreEqTalk = orderEqTalk + subEqTalk;
ExtendedWarrantyDailyReportData.DailyReportSummary summary = new ExtendedWarrantyDailyReportData.DailyReportSummary(); ExtendedWarrantyDailyReportData.DailyReportSummary summary = new ExtendedWarrantyDailyReportData.DailyReportSummary();
summary.setOtherDeliveryCountOfMonth(totalDelivery); summary.setOtherDeliveryCountOfMonth(totalDelivery);
...@@ -3880,9 +3880,9 @@ public class DailyReportDataService { ...@@ -3880,9 +3880,9 @@ public class DailyReportDataService {
BigDecimal.valueOf(totalEqClosed), BigDecimal.valueOf(totalDelivery)))); BigDecimal.valueOf(totalEqClosed), BigDecimal.valueOf(totalDelivery))));
// 触客转化率 // 触客转化率
summary.setOtherExtendedWarrantyTouchToCloseRateOfMonth(formatPercent(buildRate( summary.setOtherExtendedWarrantyTouchToCloseRateOfMonth(formatPercent(buildRate(
BigDecimal.valueOf(totalEwClosed), BigDecimal.valueOf(totalEwTalk)))); BigDecimal.valueOf(totalEwClosed), BigDecimal.valueOf(totalPreEwTalk))));
summary.setOtherEquityTouchToCloseRateOfMonth(formatPercent(buildRate( summary.setOtherEquityTouchToCloseRateOfMonth(formatPercent(buildRate(
BigDecimal.valueOf(totalEqClosed), BigDecimal.valueOf(totalEqTalk)))); BigDecimal.valueOf(totalEqClosed), BigDecimal.valueOf(totalPreEqTalk))));
log.info("buildExtendedWarrantyOtherMonthSummary end, 交付数:{}, 延保成交:{}, 权益成交:{}", totalDelivery, totalEwClosed, totalEqClosed); log.info("buildExtendedWarrantyOtherMonthSummary end, 交付数:{}, 延保成交:{}, 权益成交:{}", totalDelivery, totalEwClosed, totalEqClosed);
return summary; return summary;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!