Commit 151c297b by zhouhaibao

fix(store): 修复商户品牌数据处理逻辑

- 修改测试数据中的比例值,将流量方比例从5.0调整为0.05
- 修改测试数据中的服务商比例从10.0调整为0.04
- 修改测试数据中的资源费用比例从3.0调整为0.01
- 修改测试数据中的其他费用比例从2.0调整为0.01
- 在测试数据中为复制的分类规则设置OtherFeeProfitType为null
- 将复制的分类规则添加到产品分类规则列表中
- 优化商户品牌数据获取逻辑,合并主品牌和汽车品牌数据
- 添加品牌字符串的空格和分号清理处理
- 实现安全的品牌数据拼接逻辑
1 parent a1121b01
......@@ -354,7 +354,35 @@ public class StorePersonnelCostService {
if (CollectionUtils.isNotEmpty(resp.getList())) {
for (MerchantBasicInfoListResponse merchantInfo : resp.getList()) {
Integer merchantId = merchantInfo.getMerchantId();
String merchantBrandCars = merchantInfo.getMerchantBrandMain();
String mainBrands = merchantInfo.getMerchantBrandMain();
String carBrands = merchantInfo.getMerchantBrandCars();
// 取两个的并集
// 1. 去除首尾空格,并移除末尾可能存在的分号
if (mainBrands != null) {
mainBrands = mainBrands.trim();
if (mainBrands.endsWith(";")) {
mainBrands = mainBrands.substring(0, mainBrands.length() - 1);
}
}
if (carBrands != null) {
carBrands = carBrands.trim();
if (carBrands.endsWith(";")) {
carBrands = carBrands.substring(0, carBrands.length() - 1);
}
}
// 2. 安全拼接
String merchantBrandCars;
if (StringUtils.isNotEmpty(mainBrands) && StringUtils.isNotEmpty(carBrands)) {
merchantBrandCars = mainBrands + ";" + carBrands;
} else if (StringUtils.isNotEmpty(carBrands)) {
merchantBrandCars = carBrands;
} else {
merchantBrandCars = mainBrands;
}
if (merchantId != null && StringUtils.isNotEmpty(merchantBrandCars)) {
result.put(merchantId, merchantBrandCars);
log.debug("商户{}的品牌ID列表:{}", merchantId, merchantBrandCars);
......
......@@ -97,21 +97,21 @@ public class StoreCreateBusinessApproveRemoteTest extends BaseRemoteTest{
categoryRule.setTrafficPartySettlementTarget("流量方");
categoryRule.setTrafficPartyProfitCalculationMode("按品类计算");
categoryRule.setTrafficPartyProfitType("收入");
categoryRule.setTrafficPartyRatio(new BigDecimal("5.0"));
categoryRule.setTrafficPartyRatio(new BigDecimal("0.05"));
categoryRule.setProductCostOwnership("服务商");
categoryRule.setServiceProviderAutoSettlement("是");
categoryRule.setServiceProviderSettlementTarget("服务商2");
categoryRule.setServiceProviderProfitCalculationMode("按品类计算");
categoryRule.setServiceProviderProfitType("收入");
categoryRule.setServiceProviderRatio(new BigDecimal("10.0"));
categoryRule.setServiceProviderRatio(new BigDecimal("0.04"));
categoryRule.setResourceFeeAutoSettlement("是");
categoryRule.setResourceFeeSettlementTarget("平台方");
categoryRule.setResourceFeeProfitCalculationMode("按品类计算");
categoryRule.setResourceFeeProfitType("收入");
categoryRule.setResourceFeeRatio(new BigDecimal("3.0"));
categoryRule.setResourceFeeRatio(new BigDecimal("0.01"));
categoryRule.setOtherFeeProfitCalculationMode("按品类计算");
categoryRule.setOtherFeeProfitType("收入");
categoryRule.setOtherFeeRatio(new BigDecimal("2.0"));
categoryRule.setOtherFeeRatio(new BigDecimal("0.01"));
categoryRule.setOtherFeeSettlementTarget("平台方");
categoryRule.setManagementMarketFeePrepaid("否");
categoryRule.setManagementMarketFee1CalculationMode("按品类计算");
......@@ -133,11 +133,13 @@ public class StoreCreateBusinessApproveRemoteTest extends BaseRemoteTest{
StoreWithProductsDTO.ProductCategoryRuleDTO categoryRule1 = new StoreWithProductsDTO.ProductCategoryRuleDTO();
BeanUtils.copyProperties(categoryRule,categoryRule1);
categoryRule1.setProductCategory("延保类-延保类二级");
categoryRule1.setOtherFeeProfitType(null);
StoreWithProductsDTO.ProductCategoryRuleDTO categoryRule2 = new StoreWithProductsDTO.ProductCategoryRuleDTO();
BeanUtils.copyProperties(categoryRule,categoryRule2);
categoryRule2.setProductCategory("延保类-延保类二级-延保类三级");
productCategoryRules.add(categoryRule);
productCategoryRules.add(categoryRule1);
trafficPartyDetail.setProductCategoryRules(productCategoryRules);
trafficPartyDetails.add(trafficPartyDetail);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!