张延森 5 年之前
父節點
當前提交
01ec36825f
共有 1 個檔案被更改,包括 8 行新增3 行删除
  1. 8
    3
      src/main/java/com/huiju/estateagents/service/impl/TaPersonServiceImpl.java

+ 8
- 3
src/main/java/com/huiju/estateagents/service/impl/TaPersonServiceImpl.java 查看文件

881
 
881
 
882
         // 3. 处理推广人
882
         // 3. 处理推广人
883
         TaPerson recPerson = taPersonMapper.getById(promoter);
883
         TaPerson recPerson = taPersonMapper.getById(promoter);
884
-        if (CommConstant.STATUS_DELETE.equals(recPerson.getStatus())) {
884
+        if (recPerson != null && CommConstant.STATUS_DELETE.equals(recPerson.getStatus())) {
885
             recPerson = null;
885
             recPerson = null;
886
         }
886
         }
887
 
887
 
916
             }
916
             }
917
         }
917
         }
918
 
918
 
919
+        // 没有置业, 也没楼盘
920
+        if (recPerson == null || taBuilding == null) {
921
+            return ;
922
+        }
923
+
919
         // 3. 处理客户, 没有新增一条记录, 有就依据手机号建立关联
924
         // 3. 处理客户, 没有新增一条记录, 有就依据手机号建立关联
920
         TaRecommendCustomer customer = mergeCustomerByPhone(person, taUser, taBuilding, isAssociated, now);
925
         TaRecommendCustomer customer = mergeCustomerByPhone(person, taUser, taBuilding, isAssociated, now);
921
 
926
 
974
                 customer.setRealtyConsultant(taUser.getUserId().toString());
979
                 customer.setRealtyConsultant(taUser.getUserId().toString());
975
             }
980
             }
976
 
981
 
977
-            if (isAssociated || null == taUser) {
982
+            if (null != building && (isAssociated || null == taUser)) {
978
                 customer.setBuildingId(building.getBuildingId());
983
                 customer.setBuildingId(building.getBuildingId());
979
                 customer.setIntention(building.getBuildingName());
984
                 customer.setIntention(building.getBuildingName());
980
             }
985
             }
992
                     customer.setRealtyConsultant(taUser.getUserId().toString());
997
                     customer.setRealtyConsultant(taUser.getUserId().toString());
993
                 }
998
                 }
994
 
999
 
995
-                if (isAssociated || null == taUser) {
1000
+                if (building != null && (isAssociated || null == taUser)) {
996
                     if (StringUtils.isEmpty(customer.getBuildingId())) {
1001
                     if (StringUtils.isEmpty(customer.getBuildingId())) {
997
                         customer.setBuildingId(building.getBuildingId());
1002
                         customer.setBuildingId(building.getBuildingId());
998
                     }
1003
                     }