fuxingfan преди 3 години
родител
ревизия
8bccee4c25

+ 3
- 0
src/main/java/com/yunzhi/marketing/base/BaseController.java Целия файл

@@ -116,6 +116,9 @@ public class BaseController {
116 116
      */
117 117
     public String getInstitutionId(String buildingId) {
118 118
         TaBuilding building = taBuildingService.getById(buildingId);
119
+        if (null == building){
120
+            return null;
121
+        }
119 122
         return building.getInstitutionId();
120 123
     }
121 124
 

+ 7
- 0
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java Целия файл

@@ -266,6 +266,7 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
266 266
 
267 267
                 taRecommendCustomer = copyFromPerosn(person, taRecommendCustomer);
268 268
                 taRecommendCustomer.setRealtyConsultant(consultant.getUserId().toString());
269
+                taRecommendCustomer.setInstitutionId(getInstitutionId(taBuilding.getBuildingId()));
269 270
                 taRecommendCustomerMapper.updateById(taRecommendCustomer);
270 271
                 result.add(taRecommendCustomer);
271 272
             } else {
@@ -275,6 +276,7 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
275 276
                 customer.setBuildingId(taBuilding.getBuildingId());
276 277
                 customer.setBuildingName(taBuilding.getBuildingName());
277 278
                 customer.setRealtyConsultant(consultant.getUserId().toString());
279
+                customer.setInstitutionId(getInstitutionId(taBuilding.getBuildingId()));
278 280
                 taRecommendCustomerMapper.insert(customer);
279 281
                 result.add(customer);
280 282
 
@@ -323,6 +325,7 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
323 325
             TaRecommendCustomer customer = copyFromPerosn(person, new TaRecommendCustomer());
324 326
             fillSomeFieldsOfCustomer(customer, recommender, now);
325 327
             customer.setBuildingId(building.getBuildingId());
328
+            customer.setInstitutionId(getInstitutionId(building.getBuildingId()));
326 329
             taRecommendCustomerMapper.insert(customer);
327 330
             result.add(customer);
328 331
 
@@ -351,6 +354,7 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
351 354
         if (!hasOrgCust && null == consultant) {
352 355
             TaRecommendCustomer customer = copyFromPerosn(person, new TaRecommendCustomer());
353 356
             fillSomeFieldsOfCustomer(customer, recommender, now);
357
+            customer.setInstitutionId(getInstitutionId(building.getBuildingId()));
354 358
             taRecommendCustomerMapper.insert(customer);
355 359
             result.add(customer);
356 360
 
@@ -679,6 +683,9 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
679 683
      */
680 684
     public String getInstitutionId(String buildingId) {
681 685
         TaBuilding building = taBuildingMapper.selectById(buildingId);
686
+        if (null == building){
687
+            return null;
688
+        }
682 689
         return building.getInstitutionId();
683 690
     }
684 691