Bläddra i källkod

crm导入客户优化

lmx 4 timmar sedan
förälder
incheckning
dc6c27456e

+ 9 - 0
fs-service/src/main/java/com/fs/crm/service/impl/CrmCustomerServiceImpl.java

@@ -562,6 +562,15 @@ public class CrmCustomerServiceImpl extends ServiceImpl<CrmCustomerMapper, CrmCu
             {
                 CrmCustomer crmCustomer = new CrmCustomer();
                 BeanUtils.copyProperties(customer, crmCustomer);
+                // 如果没有客户名称,默认为"客户"+手机号后四位
+                if (StringUtils.isEmpty(crmCustomer.getCustomerName())) {
+                    String mobile = crmCustomer.getMobile();
+                    if (StringUtils.isNotEmpty(mobile) && mobile.length() >= 4) {
+                        crmCustomer.setCustomerName("客户" + mobile.substring(mobile.length() - 4));
+                    } else {
+                        crmCustomer.setCustomerName("客户");
+                    }
+                }
                 crmCustomer.setIsDel(0);
                 crmCustomer.setIsLine(1);
                 crmCustomer.setCompanyId(companyId);