Commit b4480c58 by 范富荣

优化轻改客户档案推送逻辑

1 parent c2e3c616
...@@ -219,15 +219,15 @@ public class ReceptionCustomerFileGenerateService { ...@@ -219,15 +219,15 @@ public class ReceptionCustomerFileGenerateService {
} }
// 获取所有门店名称 // 获取所有门店名称
Set<String> merchantIds = summaryList.stream().map(ReceptionCustomerFileSummaryDTO::getMerchantName).collect(Collectors.toSet()); Set<String> merchantNos = summaryList.stream()
.map(ReceptionCustomerFileSummaryDTO::getMerchantName)
.filter(StringUtils::isNotBlank)
.collect(Collectors.toSet());
Map<String, String> merchantNameMap = new HashMap<>(); Map<String, String> merchantNameMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(merchantIds)) { if (CollectionUtils.isNotEmpty(merchantNos)) {
try { try {
// 假设 merchantService 有通过 IDs 获取详情的方法,根据之前的 SearchCodebase 结果
// 这里我们简化处理,如果 merchantService 比较复杂,我们直接在循环中转换或批量转换
// 参考 SearchCodebase 结果 L1647,使用了 findMerchantListByCondition
ListMerchantRequest merchantRequest = new ListMerchantRequest(); ListMerchantRequest merchantRequest = new ListMerchantRequest();
merchantRequest.setMerchantNoStrSet(String.join(",", merchantIds)); merchantRequest.setMerchantNoStrSet(String.join(",", merchantNos));
List<MerchantRopResponse> merchantList = merchantService.findMerchantListByCondition(merchantRequest); List<MerchantRopResponse> merchantList = merchantService.findMerchantListByCondition(merchantRequest);
if (CollectionUtils.isNotEmpty(merchantList)) { if (CollectionUtils.isNotEmpty(merchantList)) {
merchantNameMap = merchantList.stream().collect(Collectors.toMap(MerchantRopResponse::getMerchantNo, MerchantRopResponse::getMerchantName, (k1, k2) -> k1)); merchantNameMap = merchantList.stream().collect(Collectors.toMap(MerchantRopResponse::getMerchantNo, MerchantRopResponse::getMerchantName, (k1, k2) -> k1));
...@@ -247,28 +247,30 @@ public class ReceptionCustomerFileGenerateService { ...@@ -247,28 +247,30 @@ public class ReceptionCustomerFileGenerateService {
e.setFileUrl(s.getFileUrl()); e.setFileUrl(s.getFileUrl());
e.setPhoneNumber(s.getPhoneNumber()); e.setPhoneNumber(s.getPhoneNumber());
e.setCarModel(s.getCarModel()); e.setCarModel(s.getCarModel());
e.setReceptionResultStr(s.getReceptionResult() == 0 ? "成交" : "战败"); e.setReceptionResultStr(Objects.equals(s.getReceptionResult(), 0) ? "成交" : "战败");
// 结果归因 // 结果归因
if (s.getReceptionResult() == 0) { if (Objects.equals(s.getReceptionResult(), 0)) {
e.setResultAttributionStr(mapDealAttribution(s.getDealAttribution())); e.setResultAttributionStr(mapDealAttribution(s.getDealAttribution()));
} else { } else if (Objects.equals(s.getReceptionResult(), 1)) {
e.setResultAttributionStr(mapLoseReason(s.getLoseReason())); e.setResultAttributionStr(mapLoseReason(s.getLoseReason()));
} else {
e.setResultAttributionStr("");
} }
e.setCarUserTypeStr(mapCarUserType(s.getCarUserType())); e.setCarUserTypeStr(mapCarUserType(s.getCarUserType()));
e.setCustomerBackgroundStr(mapCustomerBackground(s.getCustomerBackground())); e.setCustomerBackgroundStr(mapCustomerBackground(s.getCustomerBackground()));
e.setEasyCommunicationStr(s.getEasyCommunication() == 0 ? "是" : "否"); e.setEasyCommunicationStr(Objects.equals(s.getEasyCommunication(), 0) ? "是" : "否");
e.setIsMortgageStr(s.getIsMortgage() == 0 ? "是" : "否"); e.setIsMortgageStr(Objects.equals(s.getIsMortgage(), 0) ? "是" : "否");
e.setDownPaymentRatioStr(mapDownPaymentRatio(s.getDownPaymentRatio())); e.setDownPaymentRatioStr(mapDownPaymentRatio(s.getDownPaymentRatio()));
e.setPurchaseBackgroundStr(s.getPurchaseBackground() == 0 ? "首购" : "增购"); e.setPurchaseBackgroundStr(Objects.equals(s.getPurchaseBackground(), 0) ? "首购" : "增购");
e.setIsLocalUseStr(s.getIsLocalUse() == 0 ? "本地" : "外地"); e.setIsLocalUseStr(Objects.equals(s.getIsLocalUse(), 0) ? "本地" : "外地");
e.setPurchasePurposeStr(s.getPurchasePurpose() == 0 ? "公司车" : "家庭用车"); e.setPurchasePurposeStr(Objects.equals(s.getPurchasePurpose(), 0) ? "公司车" : "家庭用车");
e.setInstallItemsStr(mapMultiSelectItems(s.getInstallItems(), new String[]{"零重力座椅", "轮毂", "内饰", "玻璃"})); e.setInstallItemsStr(mapMultiSelectItems(s.getInstallItems(), new String[]{"零重力座椅", "轮毂", "内饰", "玻璃"}));
e.setGiftItemsStr(mapMultiSelectItems(s.getGiftItems(), new String[]{"脚垫", "车衣", "底盘护板", "电动踏板", "小桌板"})); e.setGiftItemsStr(mapMultiSelectItems(s.getGiftItems(), new String[]{"脚垫", "车衣", "底盘护板", "电动踏板", "小桌板"}));
e.setFilmBrand(s.getFilmBrand()); e.setFilmBrand(s.getFilmBrand());
e.setKnowOtherBrandGoodsStr(s.getKnowOtherBrandGoods() == 0 ? "是" : "否"); e.setKnowOtherBrandGoodsStr(Objects.equals(s.getKnowOtherBrandGoods(), 0) ? "是" : "否");
return e; return e;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!