소스 검색

报备客户

傅行帆 5 년 전
부모
커밋
9b41ec6408
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 12
    0
      src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java

+ 12
- 0
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java 파일 보기

64
     @Autowired
64
     @Autowired
65
     private TaCustomerFollowUpRecordMapper customerFollowUpRecordMapper;
65
     private TaCustomerFollowUpRecordMapper customerFollowUpRecordMapper;
66
 
66
 
67
+    @Autowired
68
+    private TaPersonBuildingMapper taPersonBuildingMapper;
69
+
67
     @Override
70
     @Override
68
     public ResponseBean getMyCustList(String openid, String keywords, int pageNumber, int pageSize) {
71
     public ResponseBean getMyCustList(String openid, String keywords, int pageNumber, int pageSize) {
69
         List<TaPerson> taPersons = getPersonsByOpenId(openid);
72
         List<TaPerson> taPersons = getPersonsByOpenId(openid);
297
         taRecommendCustomer.setSex(null == taPerson.getGender() ? null : ("1".equals(taPerson.getGender()) ? 1 : 2));
300
         taRecommendCustomer.setSex(null == taPerson.getGender() ? null : ("1".equals(taPerson.getGender()) ? 1 : 2));
298
 //        taRecommendCustomer.setDescribe(params.getString("describe"));
301
 //        taRecommendCustomer.setDescribe(params.getString("describe"));
299
         taRecommendCustomer.setRealtyConsultant(params.getString("realtyConsultant"));
302
         taRecommendCustomer.setRealtyConsultant(params.getString("realtyConsultant"));
303
+        //如果没有传building_id的情况构造building_id
304
+        if (StringUtils.isEmpty(params.getString("buildingId")) && !StringUtils.isEmpty(params.getString("realtyConsultant"))){
305
+            QueryWrapper<TaPersonBuilding> taPersonBuildingQueryWrapper = new QueryWrapper<>();
306
+            taPersonBuildingQueryWrapper.eq("person_id",params.getString("realtyConsultant")).or().eq("user_id",params.getString("realtyConsultant"));
307
+            List<TaPersonBuilding> taPersonBuildingList = taPersonBuildingMapper.selectList(taPersonBuildingQueryWrapper);
308
+            if (taPersonBuildingList.size() > 0){
309
+                params.put("buildingId",taPersonBuildingList.get(0).getBuildingId());
310
+            }
311
+        }
300
         taRecommendCustomer.setBuildingId(params.getString("buildingId"));
312
         taRecommendCustomer.setBuildingId(params.getString("buildingId"));
301
         TaBuilding building = taBuildingMapper.selectById(params.getString("buildingId"));
313
         TaBuilding building = taBuildingMapper.selectById(params.getString("buildingId"));
302
         taRecommendCustomer.setIntention(building.getBuildingName());
314
         taRecommendCustomer.setIntention(building.getBuildingName());