魏超 5 vuotta sitten
vanhempi
commit
56f35c4cfb

+ 21
- 0
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java Näytä tiedosto

@@ -216,6 +216,17 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
216 216
                 taBuilding = consultBuildings.get(0);
217 217
             }
218 218
 
219
+            //如果公客绑定的项目和分享活动关联的项目相同,从公客列表移除该人员
220
+            QueryWrapper<TaRecommendCustomer> taRecommendCustomerQueryWrapper = new QueryWrapper<>();
221
+            taRecommendCustomerQueryWrapper.eq("building_id", taBuilding.getBuildingId());
222
+            taRecommendCustomerQueryWrapper.isNull("realty_consultant");
223
+            List<TaRecommendCustomer> taRecommendCustomers = taRecommendCustomerMapper.selectList(taRecommendCustomerQueryWrapper);
224
+            for (TaRecommendCustomer customer : taRecommendCustomers){
225
+                if (customer.getBuildingId().equals(taBuilding.getBuildingId()) && person.getPersonId().equals(customer.getPersonId())){
226
+                    delPubCust(customer.getPersonId(), customer.getBuildingId());
227
+                }
228
+            }
229
+
219 230
             TaRecommendCustomer customer = copyFromPerosn(person, new TaRecommendCustomer());
220 231
             fillSomeFieldsOfCustomer(customer, recommender, now);
221 232
             customer.setBuildingId(taBuilding.getBuildingId());
@@ -308,6 +319,16 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
308 319
         return to;
309 320
     }
310 321
 
322
+    public void delPubCust(String personId, String buildingId){
323
+        TaRecommendCustomer recommendCustomer = new TaRecommendCustomer();
324
+        recommendCustomer.setStatus(CommConstant.STATUS_DELETE);
325
+
326
+        QueryWrapper<TaRecommendCustomer> taRecommendCustomerQueryWrapper = new QueryWrapper<>();
327
+        taRecommendCustomerQueryWrapper.eq("building_id", buildingId);
328
+        taRecommendCustomerQueryWrapper.eq("person_id", personId);
329
+        taRecommendCustomerMapper.update(recommendCustomer, taRecommendCustomerQueryWrapper);
330
+    }
331
+
311 332
     @Override
312 333
     public ResponseBean getCustDetail(String id) {
313 334
         TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectById(id);