dingxin 5 年前
父节点
当前提交
7771d07c87

+ 21
- 1
src/main/java/com/huiju/estateagents/center/taUser/entity/TaUser.java 查看文件

@@ -84,9 +84,29 @@ public class TaUser implements Serializable {
84 84
     /**
85 85
      * 公司名称
86 86
      */
87
-    @TableField(exist = false)
88 87
     private String orgName;
89 88
 
89
+    /**
90
+     * 部门
91
+     */
92
+    private String department;
93
+
94
+    /**
95
+     * 职位
96
+     */
97
+    private String position;
98
+
99
+    /**
100
+     * 邮箱
101
+     */
102
+    private String email;
103
+
104
+    /**
105
+     * 身份证号
106
+     */
107
+    private String idNo;
108
+
109
+
90 110
     /**
91 111
      * 公司水印
92 112
      */

+ 7
- 3
src/main/java/com/huiju/estateagents/controller/ExtendContentController.java 查看文件

@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestParam;
22 22
 import org.springframework.web.bind.annotation.ResponseBody;
23 23
 import org.springframework.web.bind.annotation.RestController;
24 24
 
25
+import javax.servlet.http.HttpServletRequest;
25 26
 import java.time.LocalDateTime;
26 27
 
27 28
 /**
@@ -60,7 +61,7 @@ public class ExtendContentController extends BaseController {
60 61
                                           @RequestParam(value = "contentType", required = false) String contentType,
61 62
                                           @RequestParam(value = "showPosition", required = false) String showPosition,
62 63
                                           @RequestParam(value = "status", required = false) Integer status,
63
-                                          @RequestParam(value = "showType", required = false) String showType){
64
+                                          @RequestParam(value = "showType", required = false) String showType,HttpServletRequest request){
64 65
         ResponseBean responseBean = new ResponseBean();
65 66
             IPage<ExtendContent> pg = new Page<>(pageNum, pageSize);
66 67
             QueryWrapper<ExtendContent> queryWrapper = new QueryWrapper<>();
@@ -69,6 +70,7 @@ public class ExtendContentController extends BaseController {
69 70
             queryWrapper.eq(StringUtils.isNotBlank(contentType), "content_type", contentType);
70 71
             queryWrapper.eq(StringUtils.isNotBlank(showPosition), "show_position", showPosition);
71 72
             queryWrapper.eq(null!=status, "status", status);
73
+            queryWrapper.eq( "org_id", getOrgId(request));
72 74
             queryWrapper.orderByDesc("create_date");
73 75
             IPage<ExtendContent> result = iExtendContentService.page(pg, queryWrapper);
74 76
             responseBean.addSuccess(result);
@@ -97,10 +99,11 @@ public class ExtendContentController extends BaseController {
97 99
      * @return
98 100
      */
99 101
     @RequestMapping(value="/admin/extendContent",method= RequestMethod.POST)
100
-    public ResponseBean extendContentAdd(@RequestBody ExtendContent extendContent){
102
+    public ResponseBean extendContentAdd(@RequestBody ExtendContent extendContent, HttpServletRequest request){
101 103
         Integer cityId = iTaBuildingService.getCityById(extendContent.getBuildingId());
102 104
         extendContent.setCityId(cityId);
103 105
         extendContent.setCreateDate(LocalDateTime.now());
106
+        extendContent.setOrgId(getOrgId(request));
104 107
         ResponseBean  responseBean= iExtendContentService.extendContentAdd(extendContent);
105 108
           responseBean.addSuccess(extendContent);
106 109
           return responseBean;
@@ -136,12 +139,13 @@ public class ExtendContentController extends BaseController {
136 139
      */
137 140
     @RequestMapping(value="/admin/extendContent/{id}",method= RequestMethod.PUT)
138 141
     public ResponseBean extendContentUpdate(@PathVariable Integer id,
139
-                                        @RequestBody ExtendContent extendContent){
142
+                                        @RequestBody ExtendContent extendContent,HttpServletRequest request){
140 143
         ResponseBean responseBean = new ResponseBean();
141 144
         extendContent.setContentId(id);
142 145
         try {
143 146
             Integer cityId = iTaBuildingService.getCityById(extendContent.getBuildingId());
144 147
             extendContent.setCityId(cityId);
148
+            extendContent.setOrgId(getOrgId(request));
145 149
             if (iExtendContentService.updateById(extendContent)){
146 150
                 responseBean.addSuccess(extendContent);
147 151
             }else {

+ 81
- 0
src/main/java/com/huiju/estateagents/controller/TaPersonController.java 查看文件

@@ -142,10 +142,19 @@ public class TaPersonController extends BaseController {
142 142
             QueryWrapper<TaChannel> queryWrapper = new QueryWrapper();
143 143
             queryWrapper.eq("channel_code",channelCode);
144 144
             TaChannel channel = taChannelService.getOne(queryWrapper);
145
+            QueryWrapper<TaChannelPerson>taChannelPersonQueryWrapper = new QueryWrapper<>();
146
+            taChannelPersonQueryWrapper.eq("person_id",person.getPersonId());
147
+            taChannelPersonQueryWrapper.eq("channel_id",channel.getChannelId());
148
+            taChannelPersonQueryWrapper.eq("status",CommConstant.STATUS_NORMAL);
149
+            int count = taChannelPersonService.count(taChannelPersonQueryWrapper);
150
+            if(count>0){
151
+                return ResponseBean.error("您已绑定过该渠道",ResponseBean.ERROR_UNAVAILABLE);
152
+            }
145 153
             TaChannelPerson channelPerson = new TaChannelPerson();
146 154
             channelPerson.setChannelId(channel.getChannelId());
147 155
             channelPerson.setPersonId(person.getPersonId());
148 156
             channelPerson.setCreateDate(LocalDateTime.now());
157
+            channelPerson.setStatus(CommConstant.STATUS_NORMAL);
149 158
             taChannelPersonService.save(channelPerson);
150 159
         }
151 160
         taPersonService.updateById(person);
@@ -405,6 +414,22 @@ public class TaPersonController extends BaseController {
405 414
         return taPersonService.editConsultant(id, paramStr);
406 415
     }
407 416
 
417
+    @PutMapping("/wx/editConsultant/{id}")
418
+    public ResponseBean editWxConsultant(@PathVariable String id, @RequestBody TaPerson taPerson) {
419
+        ResponseBean responseBean = new ResponseBean();
420
+        try{
421
+            taPerson.setPersonId(id);
422
+            if(taPersonService.updateById(taPerson)){
423
+                responseBean.addSuccess(taPerson);
424
+            }else {
425
+                responseBean.addError("fail");
426
+            }
427
+        }catch (Exception e){
428
+
429
+        }
430
+        return responseBean;
431
+    }
432
+
408 433
     boolean isEmpty(String str) {
409 434
         return null == str || "".equals(str.trim());
410 435
     }
@@ -436,6 +461,62 @@ public class TaPersonController extends BaseController {
436 461
 //        }
437 462
 //
438 463
 //    }
464
+    /**
465
+     * 变更经纪人类型
466
+     * @param channelCode 渠道码
467
+     * @return
468
+     */
469
+    @RequestMapping(value="/wx/customer/recommend/beComeChannel/{channelCode}",method= RequestMethod.PUT)
470
+    public ResponseBean taRecommendAgentBecomeChannel(@PathVariable String channelCode,HttpServletRequest request,@RequestParam("personType")String personType){
471
+        ResponseBean responseBean = new ResponseBean();
472
+        String openid = JWTUtils.getSubject(request);
473
+        List<TaPerson> taPersons = taPersonService.getPersonsByOpenId(openid);
474
+        if (null == taPersons || taPersons.size() != 1) {
475
+            return ResponseBean.error("验证人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
476
+        }
477
+        TaPerson person = taPersons.get(0);
478
+        try {
479
+            if(CommConstant.PERSON_ESTATE_CHANNEL.equals(personType)){
480
+                QueryWrapper<TaChannel>channelQueryWrapper = new QueryWrapper<>();
481
+                channelQueryWrapper.eq("channel_code",channelCode);
482
+                QueryWrapper<TaChannelPerson>channelPersonQueryWrapper = new QueryWrapper<>();
483
+                TaChannel channel = taChannelService.getOne(channelQueryWrapper);
484
+                channelPersonQueryWrapper.eq("person_id",person.getPersonId());
485
+                channelPersonQueryWrapper.eq("channel_id",channel.getChannelId());
486
+                channelPersonQueryWrapper.eq("status",CommConstant.STATUS_NORMAL);
487
+                int count = taChannelPersonService.count(channelPersonQueryWrapper);
488
+                if(count >0){
489
+                    return ResponseBean.error("您已绑定过渠道",ResponseBean.ERROR_UNAVAILABLE);
490
+                }
491
+                TaChannelPerson channelPerson = new TaChannelPerson();
492
+                channelPerson.setCreateDate(LocalDateTime.now());
493
+                channelPerson.setPersonId(person.getPersonId());
494
+                channelPerson.setChannelId(channel.getChannelId());
495
+                channelPerson.setStatus(CommConstant.STATUS_NORMAL);
496
+                taChannelPersonService.save(channelPerson);
497
+            }else {
498
+                QueryWrapper<TaChannelPerson>channelPersonQueryWrapper = new QueryWrapper<>();
499
+                channelPersonQueryWrapper.eq("person_id",person.getPersonId());
500
+                List<TaChannelPerson> taChannelPerson = taChannelPersonService.list(channelPersonQueryWrapper);
501
+                if (taChannelPerson.size()>0){
502
+                    for(int i=0;i<taChannelPerson.size();i++){
503
+                        taChannelPerson.get(i).setStatus(CommConstant.STATUS_DELETE);
504
+                    }
505
+                    taChannelPersonService.updateBatchById(taChannelPerson);
506
+                }
507
+            }
508
+            person.setPersonType(personType);
509
+            if (taPersonService.updateById(person)){
510
+                responseBean.addSuccess(person);
511
+            }else {
512
+                responseBean.addError("fail");
513
+            }
514
+        }catch (Exception e){
515
+            e.printStackTrace();
516
+            responseBean.addError(e.getMessage());
517
+        }
518
+        return responseBean;
519
+    }
439 520
 
440 521
 
441 522
 

+ 121
- 12
src/main/java/com/huiju/estateagents/controller/TaRecommendCustomerController.java 查看文件

@@ -8,11 +8,15 @@ import com.huiju.estateagents.base.ResponseBean;
8 8
 import com.huiju.estateagents.common.CommConstant;
9 9
 import com.huiju.estateagents.common.JWTUtils;
10 10
 import com.huiju.estateagents.common.StringUtils;
11
+import com.huiju.estateagents.entity.TaChannel;
12
+import com.huiju.estateagents.entity.TaChannelPerson;
11 13
 import com.huiju.estateagents.entity.TaPerson;
12 14
 import com.huiju.estateagents.entity.TaRecommendCustomer;
13 15
 import com.huiju.estateagents.event.EventBus;
14 16
 import com.huiju.estateagents.service.ITaPersonService;
15 17
 import com.huiju.estateagents.service.ITaRecommendCustomerService;
18
+import com.huiju.estateagents.service.TaChannelPersonService;
19
+import com.huiju.estateagents.service.TaChannelService;
16 20
 import org.springframework.beans.factory.annotation.Autowired;
17 21
 import org.springframework.context.ApplicationContext;
18 22
 import org.springframework.web.bind.annotation.*;
@@ -21,6 +25,7 @@ import com.huiju.estateagents.base.BaseController;
21 25
 
22 26
 import javax.annotation.Resource;
23 27
 import javax.servlet.http.HttpServletRequest;
28
+import java.time.LocalDateTime;
24 29
 import java.util.List;
25 30
 
26 31
 /**
@@ -44,6 +49,12 @@ public class TaRecommendCustomerController extends BaseController {
44 49
     @Resource
45 50
     private ApplicationContext applicationContext;
46 51
 
52
+    @Autowired
53
+    private TaChannelService taChannelService;
54
+
55
+    @Autowired
56
+    private TaChannelPersonService taChannelPersonService;
57
+
47 58
     /**
48 59
      * 我的客户列表
49 60
      * @param pageNumber
@@ -132,9 +143,61 @@ public class TaRecommendCustomerController extends BaseController {
132 143
     }
133 144
 
134 145
     @GetMapping("/wx/customer/myReport")
135
-    public ResponseBean getCustomerIReport (@RequestParam(value ="personId") String personId,
146
+    public ResponseBean getCustomerIReport (HttpServletRequest request,
136 147
                                          @RequestParam(value ="pageNumber",defaultValue = "1") Integer pageNumber,
137 148
                                          @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
149
+        String openid = JWTUtils.getSubject(request);
150
+        List<TaPerson> taPersons = taPersonService.getPersonsByOpenId(openid);
151
+        if (null == taPersons || taPersons.size() != 1) {
152
+            return ResponseBean.error("验证人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
153
+        }
154
+        TaPerson person = taPersons.get(0);
155
+        try{
156
+            IPage<TaRecommendCustomer>pg = new Page<>(pageNumber,pageSize);
157
+            QueryWrapper<TaRecommendCustomer>queryWrapper = new QueryWrapper<>();
158
+            queryWrapper.eq("realty_consultant",person.getPersonId());
159
+            queryWrapper.eq("report_recommend_status",CommConstant.REPORTED);
160
+            queryWrapper.eq("status",CommConstant.CUSTOMER_REPORT);
161
+            queryWrapper.orderByDesc("create_date");
162
+            IPage<TaRecommendCustomer>result = taRecommendCustomerService.page(pg,queryWrapper);
163
+            return ResponseBean.success(result);
164
+        }catch (Exception e){
165
+            e.printStackTrace();
166
+            return ResponseBean.error(e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);
167
+        }
168
+    }
169
+
170
+    @GetMapping("/wx/customer/myCustomer")
171
+    public ResponseBean getMyCustomer (     @RequestParam(value ="pageNumber",defaultValue = "1") Integer pageNumber,
172
+                                            @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
173
+                                            HttpServletRequest request){
174
+        String openid = JWTUtils.getSubject(request);
175
+        List<TaPerson> taPersons = taPersonService.getPersonsByOpenId(openid);
176
+        if (null == taPersons || taPersons.size() != 1) {
177
+            return ResponseBean.error("验证人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
178
+        }
179
+        TaPerson person = taPersons.get(0);
180
+
181
+        try{
182
+            IPage<TaRecommendCustomer>pg = new Page<>(pageNumber,pageSize);
183
+            QueryWrapper<TaRecommendCustomer>queryWrapper = new QueryWrapper<>();
184
+            queryWrapper.eq("realty_consultant",person.getPersonId());
185
+            queryWrapper.eq("report_recommend_status",CommConstant.REPORTED);
186
+            queryWrapper.gt("status",CommConstant.CUSTOMER_REPORT);
187
+            queryWrapper.orderByDesc("create_date");
188
+            IPage<TaRecommendCustomer>result = taRecommendCustomerService.page(pg,queryWrapper);
189
+            return ResponseBean.success(result);
190
+        }catch (Exception e){
191
+            e.printStackTrace();
192
+            return ResponseBean.error(e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);
193
+        }
194
+    }
195
+
196
+
197
+    @GetMapping("/wx/customer/myInviteAgent")
198
+    public ResponseBean getMyInviteAgent (@RequestParam(value ="personId") String personId,
199
+                                       @RequestParam(value ="pageNumber",defaultValue = "1") Integer pageNumber,
200
+                                       @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
138 201
         try{
139 202
             IPage<TaRecommendCustomer>pg = new Page<>(pageNumber,pageSize);
140 203
             QueryWrapper<TaRecommendCustomer>queryWrapper = new QueryWrapper<>();
@@ -149,6 +212,7 @@ public class TaRecommendCustomerController extends BaseController {
149 212
         }
150 213
     }
151 214
 
215
+
152 216
     // 客户列表 公客/私客
153 217
     @GetMapping("/admin/customer/recommend")
154 218
     public ResponseBean getCustomerList (@RequestParam(value ="name",required = false) String name,
@@ -163,7 +227,7 @@ public class TaRecommendCustomerController extends BaseController {
163 227
                                          @RequestParam(value = "sex",required = false)Integer sex,
164 228
                                          @RequestParam(value = "customerType") String customerType){ // public 公  private 私
165 229
         try{
166
-            return ResponseBean.success(taRecommendCustomerService.getCustomerList(pageNumber,pageSize,buildingId,name,tel,consultName,consultTel,entryType,verifyStatus,sex, customerType));
230
+            return ResponseBean.success(taRecommendCustomerService.getCustomerList(pageNumber,pageSize,buildingId,name,tel,consultName,consultTel,entryType,verifyStatus,sex, customerType, null)); //getOrgId(request)
167 231
         }catch (Exception e){
168 232
             e.printStackTrace();
169 233
             return ResponseBean.error(e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);
@@ -173,7 +237,8 @@ public class TaRecommendCustomerController extends BaseController {
173 237
 
174 238
     //推荐客户列表
175 239
     @GetMapping("/admin/customer/recommend/recommender")
176
-    public ResponseBean getRecCustomerList (@RequestParam(value ="name",required = false) String name,
240
+    public ResponseBean getRecCustomerList (HttpServletRequest request,
241
+                                         @RequestParam(value ="name",required = false) String name,
177 242
                                          @RequestParam(value ="tel",required = false) String tel,
178 243
                                          @RequestParam(value ="buildingId",required = false) String buildingId,
179 244
                                          @RequestParam(value ="recommendName",required = false) String recommendName,
@@ -184,7 +249,7 @@ public class TaRecommendCustomerController extends BaseController {
184 249
                                          @RequestParam(value ="verifyStatus",required = false) String verifyStatus,
185 250
                                          @RequestParam(value = "sex",required = false)Integer sex){
186 251
         try{
187
-            return ResponseBean.success(taRecommendCustomerService.getRecCustomerList(pageNumber,pageSize,buildingId,name,tel,recommendName,recommendTel,entryType,verifyStatus,sex));
252
+            return ResponseBean.success(taRecommendCustomerService.getRecCustomerList(pageNumber,pageSize,buildingId,name,tel,recommendName,recommendTel,entryType,verifyStatus,sex, getOrgId(request)));
188 253
         }catch (Exception e){
189 254
             e.printStackTrace();
190 255
             return ResponseBean.error(e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);
@@ -205,7 +270,7 @@ public class TaRecommendCustomerController extends BaseController {
205 270
                                          @RequestParam(value = "sex",required = false)Integer sex, HttpServletRequest request){
206 271
         Integer orgid = getOrgId(request);
207 272
         try{
208
-            return ResponseBean.success(taRecommendCustomerService.getRepCustomerList(pageNumber,pageSize,buildingId,name,tel,consultName,consultTel,entryType,verifyStatus,sex,orgid));
273
+            return ResponseBean.success(taRecommendCustomerService.getRepCustomerList(pageNumber,pageSize,buildingId,name,tel,consultName,consultTel,entryType,verifyStatus,sex, orgid));
209 274
         }catch (Exception e){
210 275
             e.printStackTrace();
211 276
             return ResponseBean.error(e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);
@@ -222,12 +287,13 @@ public class TaRecommendCustomerController extends BaseController {
222 287
      * @return
223 288
      */
224 289
     @GetMapping("/admin/customer/agents")
225
-    public ResponseBean getIndependentAgents (@RequestParam(value ="name",required = false) String name,
290
+    public ResponseBean getIndependentAgents (HttpServletRequest request,
291
+                                              @RequestParam(value ="name",required = false) String name,
226 292
                                             @RequestParam(value ="tel",required = false) String tel,
227 293
                                             @RequestParam(value ="pageNumber",defaultValue = "1") Integer pageNumber,
228 294
                                             @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
229 295
         try{
230
-            return ResponseBean.success(taRecommendCustomerService.getIndependentAgents(pageNumber,pageSize,name,tel, null));
296
+            return ResponseBean.success(taRecommendCustomerService.getIndependentAgents(pageNumber,pageSize,name,tel, getOrgId(request)));
231 297
         }catch (Exception e){
232 298
             e.printStackTrace();
233 299
             return ResponseBean.error(e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);
@@ -236,16 +302,35 @@ public class TaRecommendCustomerController extends BaseController {
236 302
 
237 303
 
238 304
     @GetMapping("/admin/customer/recommend/{customerId}")
239
-    public ResponseBean getCustomersIRecommended (@RequestParam int pageNumber, @RequestParam int pageSize, @PathVariable String customerId){
240
-        String buildingId="";
305
+    public ResponseBean getCustomersIRecommended (@RequestParam int pageNumber, @RequestParam int pageSize, @PathVariable String customerId,HttpServletRequest request){
306
+        Integer orgId = getOrgId(request);
241 307
         try{
242
-            return ResponseBean.success(taRecommendCustomerService.getCustomersIRecommended(pageNumber,pageSize,customerId,buildingId));
308
+            return ResponseBean.success(taRecommendCustomerService.getCustomersIRecommended(pageNumber,pageSize,customerId,orgId));
243 309
         }catch (Exception e){
244 310
             e.printStackTrace();
245 311
             return ResponseBean.error(e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);
246 312
         }
247 313
     }
248 314
 
315
+    @GetMapping("/wx/customer/recommend/{customerId}")
316
+    public ResponseBean getWxCustomersIRecommended (@RequestParam int pageNumber, @RequestParam int pageSize,HttpServletRequest request){
317
+        Integer orgId =getOrgId(request);
318
+        String openid = JWTUtils.getSubject(request);
319
+        List<TaPerson> taPersons = taPersonService.getPersonsByOpenId(openid);
320
+        if (null == taPersons || taPersons.size() != 1) {
321
+            return ResponseBean.error("验证人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
322
+        }
323
+        TaPerson person = taPersons.get(0);
324
+        try{
325
+            return ResponseBean.success(taRecommendCustomerService.getCustomersIRecommended(pageNumber,pageSize,person.getPersonId(),orgId));
326
+        }catch (Exception e){
327
+            e.printStackTrace();
328
+            return ResponseBean.error(e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);
329
+        }
330
+    }
331
+
332
+
333
+
249 334
         /**
250 335
      * 修改对象
251 336
      * @param taRecommendCustomer 实体对象
@@ -291,6 +376,29 @@ public class TaRecommendCustomerController extends BaseController {
291 376
         return responseBean;
292 377
     }
293 378
 
379
+    /**
380
+     * 修改对象
381
+     * @param taRecommendCustomer 实体对象
382
+     * @return
383
+     */
384
+    @RequestMapping(value="/wx/customer/recommend/edit/{id}",method= RequestMethod.PUT)
385
+    public ResponseBean taWxRecommendCustomerUpdate(@PathVariable String id,
386
+                                                  @RequestBody TaRecommendCustomer taRecommendCustomer){
387
+        ResponseBean responseBean = new ResponseBean();
388
+        taRecommendCustomer.setCustomerId(id);
389
+        try {
390
+            if (taRecommendCustomerService.updateById(taRecommendCustomer)){
391
+                responseBean.addSuccess(taRecommendCustomer);
392
+            }else {
393
+                responseBean.addError("fail");
394
+            }
395
+        }catch (Exception e){
396
+            e.printStackTrace();
397
+            responseBean.addError(e.getMessage());
398
+        }
399
+        return responseBean;
400
+    }
401
+
294 402
     @RequestMapping(value = "/wx/customer/recommend/get/{id}", method = RequestMethod.GET)
295 403
     public ResponseBean getSingleCustomer(@PathVariable(value = "id") String customerId) {
296 404
         ResponseBean responseBean = new ResponseBean();
@@ -330,11 +438,12 @@ public class TaRecommendCustomerController extends BaseController {
330 438
     }
331 439
 
332 440
     @GetMapping("/admin/customer/recommend/drift")
333
-    public ResponseBean getDriftCustomerList (@RequestParam(value ="buildingId",defaultValue = "false") String buildingId,
441
+    public ResponseBean getDriftCustomerList (HttpServletRequest request,
442
+                                              @RequestParam(value ="buildingId",defaultValue = "false") String buildingId,
334 443
                                          @RequestParam(value ="pageNumber",defaultValue = "1") Integer pageNumber,
335 444
                                          @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
336 445
         try{
337
-            return ResponseBean.success(taPersonService.getDriftCustomerList(pageNumber,pageSize,buildingId));
446
+            return ResponseBean.success(taPersonService.getDriftCustomerList(pageNumber,pageSize,buildingId, getOrgId(request)));
338 447
         }catch (Exception e){
339 448
             e.printStackTrace();
340 449
             return ResponseBean.error(e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);

+ 2
- 0
src/main/java/com/huiju/estateagents/entity/TaChannelPerson.java 查看文件

@@ -38,5 +38,7 @@ public class TaChannelPerson implements Serializable {
38 38
      */
39 39
     private LocalDateTime createDate;
40 40
 
41
+    private Integer status;
42
+
41 43
 
42 44
 }

+ 5
- 0
src/main/java/com/huiju/estateagents/entity/TaPersonBuilding.java 查看文件

@@ -41,5 +41,10 @@ public class TaPersonBuilding implements Serializable {
41 41
      */
42 42
     private LocalDateTime createDate;
43 43
 
44
+    /**
45
+     * 用户ID
46
+     */
47
+    private Integer userId;
48
+
44 49
 
45 50
 }

+ 4
- 4
src/main/java/com/huiju/estateagents/mapper/TaRecommendCustomerMapper.java 查看文件

@@ -26,9 +26,9 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
26 26
 
27 27
     TaRecommendCustomer getCustomerById(@Param("customerId")String customerId);
28 28
 
29
-    IPage<TaRecommendCustomer> getCustomerList(IPage<TaRecommendCustomer> page,@Param("building") String building, @Param("name") String name, @Param("tel") String tel, @Param("consultName") String consultName, @Param("consultTel") String consultTel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex);
30
-    IPage<TaRecommendCustomer> getRecCustomerList(IPage<TaRecommendCustomer> page,@Param("building") String building, @Param("name") String name, @Param("tel") String tel, @Param("consultName") String consultName, @Param("consultTel") String consultTel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex);
31
-    IPage<TaRecommendCustomer> getRepCustomerList(IPage<TaRecommendCustomer> page,@Param("building") String building, @Param("name") String name, @Param("tel") String tel, @Param("consultName") String consultName, @Param("consultTel") String consultTel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex,@Param("orgid")Integer orgid);
29
+    IPage<TaRecommendCustomer> getCustomerList(IPage<TaRecommendCustomer> page,@Param("building") String building, @Param("name") String name, @Param("tel") String tel, @Param("consultName") String consultName, @Param("consultTel") String consultTel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex, @Param("orgId") Integer orgId);
30
+    IPage<TaRecommendCustomer> getRecCustomerList(IPage<TaRecommendCustomer> page,@Param("building") String building, @Param("name") String name, @Param("tel") String tel, @Param("consultName") String consultName, @Param("consultTel") String consultTel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex, @Param("orgId") Integer orgId);
31
+    IPage<TaRecommendCustomer> getRepCustomerList(IPage<TaRecommendCustomer> page,@Param("building") String building, @Param("name") String name, @Param("tel") String tel, @Param("consultName") String consultName, @Param("consultTel") String consultTel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex, @Param("orgId") Integer orgId);
32 32
     IPage<TaPerson> getIndependentAgents(IPage<TaPerson>page, @Param("name") String name, @Param("tel") String tel, @Param("orgId") Integer orgId);
33 33
 
34 34
     /**
@@ -41,5 +41,5 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
41 41
      * @param sex
42 42
      * @return
43 43
      */
44
-    IPage<TaRecommendCustomer> getPublicCustomerList(IPage<TaPerson> page, @Param("name") String name, @Param("tel") String tel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex);
44
+    IPage<TaRecommendCustomer> getPublicCustomerList(IPage<TaPerson> page, @Param("name") String name, @Param("tel") String tel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex, @Param("orgId") Integer orgId);
45 45
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/service/ITaPersonService.java 查看文件

@@ -54,7 +54,7 @@ public interface ITaPersonService extends IService<TaPerson> {
54 54
 
55 55
     List<TaPerson> getPersonsByOpenId(String openid);
56 56
 
57
-    IPage<TaPerson> getDriftCustomerList (int pageNumber, int pageSize,String building);
57
+    IPage<TaPerson> getDriftCustomerList (int pageNumber, int pageSize,String building, Integer orgId);
58 58
 
59 59
     String getPersonIdByCustomerId(String customerId);
60 60
 

+ 4
- 4
src/main/java/com/huiju/estateagents/service/ITaRecommendCustomerService.java 查看文件

@@ -28,11 +28,11 @@ public interface ITaRecommendCustomerService extends IService<TaRecommendCustome
28 28
 
29 29
     IPage<TaRecommendCustomer> getUnSignedCustomerList(int pageNumber, int pageSize, String building,String personId);
30 30
 
31
-    IPage<TaRecommendCustomer> getCustomerList(int pageNumber, int pageSize, String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus,Integer sex, String customerType);
31
+    IPage<TaRecommendCustomer> getCustomerList(int pageNumber, int pageSize, String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus,Integer sex, String customerType, Integer orgId);
32 32
 
33
-    IPage<TaRecommendCustomer> getRecCustomerList(int pageNumber, int pageSize, String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus,Integer sex);
33
+    IPage<TaRecommendCustomer> getRecCustomerList(int pageNumber, int pageSize, String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus,Integer sex, Integer orgId);
34 34
 
35
-    IPage<TaRecommendCustomer> getRepCustomerList(int pageNumber, int pageSize, String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus,Integer sex,Integer orgid);
35
+    IPage<TaRecommendCustomer> getRepCustomerList(int pageNumber, int pageSize,String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus,Integer sex, Integer orgId);
36 36
 
37 37
     IPage<TaPerson> getIndependentAgents(int pageNumber, int pageSize,String name,String tel, Integer orgId);
38 38
 
@@ -41,7 +41,7 @@ public interface ITaRecommendCustomerService extends IService<TaRecommendCustome
41 41
 
42 42
     TaRecommendCustomer getCustomerById(String customerId);
43 43
 
44
-    IPage<TaRecommendCustomer>getCustomersIRecommended(int pageNumber, int pageSize,String customerId,String building);
44
+    IPage<TaRecommendCustomer>getCustomersIRecommended(int pageNumber, int pageSize,String customerId,Integer orgId);
45 45
 
46 46
     TaRecommendCustomer newByPerson(TaPerson person);
47 47
 }

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

@@ -649,12 +649,13 @@ public class TaPersonServiceImpl extends ServiceImpl<TaPersonMapper, TaPerson> i
649 649
     }
650 650
 
651 651
     @Override
652
-    public IPage<TaPerson> getDriftCustomerList (int pageNumber, int pageSize,String building){
652
+    public IPage<TaPerson> getDriftCustomerList (int pageNumber, int pageSize,String building, Integer orgId){
653 653
         QueryWrapper<TaPerson> queryWrapper = new QueryWrapper<>();
654 654
         queryWrapper.isNull("person_type");
655 655
         if(building.equals("") && null != building){
656 656
             queryWrapper.eq("building_id",building);
657 657
         }
658
+        queryWrapper.eq(orgId != null, "org_id", orgId);
658 659
         IPage<TaPerson> page = new Page<>(pageNumber, pageSize);
659 660
         return taPersonMapper.selectPage(page,queryWrapper);
660 661
     }

+ 9
- 10
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java 查看文件

@@ -159,7 +159,6 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
159 159
         TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
160 160
 
161 161
         taRecommendCustomer.setName(params.getString("name"));
162
-        taRecommendCustomer.setOrgId(orgId);
163 162
         taRecommendCustomer.setPicture(params.getString("picture"));
164 163
         taRecommendCustomer.setPhone(params.getString("phone"));
165 164
         taRecommendCustomer.setSex(params.getInteger("sex"));
@@ -332,17 +331,16 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
332 331
     }
333 332
 
334 333
     @Override
335
-    public IPage<TaRecommendCustomer> getCustomerList(int pageNumber, int pageSize,String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus,Integer sex, String customerType){
334
+    public IPage<TaRecommendCustomer> getCustomerList(int pageNumber, int pageSize,String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus,Integer sex, String customerType, Integer orgId){
336 335
 
337
-        IPage<TaRecommendCustomer> customerList = null;
338 336
         if (CommConstant.CUTOMER_TYPE_PUBLIC.equals(customerType)) {
339 337
             // 公客
340 338
             IPage<TaPerson>page = new Page<>(pageNumber,pageSize);
341
-            return taRecommendCustomerMapper.getPublicCustomerList(page, name, tel,  entryType, verifyStatus, sex);
339
+            return taRecommendCustomerMapper.getPublicCustomerList(page, name, tel,  entryType, verifyStatus, sex, orgId);
342 340
         } else {
343 341
             // 私客
344 342
             IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);
345
-            return taRecommendCustomerMapper.getCustomerList(page, building, name, tel, consultName, consultTel, entryType, verifyStatus, sex);
343
+            return taRecommendCustomerMapper.getCustomerList(page, building, name, tel, consultName, consultTel, entryType, verifyStatus, sex, orgId);
346 344
         }
347 345
 
348 346
     }
@@ -354,16 +352,16 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
354 352
     }
355 353
 
356 354
     @Override
357
-    public IPage<TaRecommendCustomer> getRecCustomerList(int pageNumber, int pageSize,String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus,Integer sex){
355
+    public IPage<TaRecommendCustomer> getRecCustomerList(int pageNumber, int pageSize,String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus,Integer sex, Integer orgId){
358 356
         IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);
359
-        return taRecommendCustomerMapper.getRecCustomerList(page,building,name,tel,consultName,consultTel,entryType,verifyStatus,sex);
357
+        return taRecommendCustomerMapper.getRecCustomerList(page,building,name,tel,consultName,consultTel,entryType,verifyStatus,sex, orgId);
360 358
     }
361 359
 
362 360
 
363 361
     @Override
364
-    public IPage<TaRecommendCustomer> getRepCustomerList(int pageNumber, int pageSize,String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus,Integer sex,Integer orgid){
362
+    public IPage<TaRecommendCustomer> getRepCustomerList(int pageNumber, int pageSize,String building,String name,String tel,String consultName,String consultTel,String entryType,String verifyStatus,Integer sex, Integer orgId){
365 363
         IPage<TaRecommendCustomer>page = new Page<>(pageNumber,pageSize);
366
-        return taRecommendCustomerMapper.getRepCustomerList(page,building,name,tel,consultName,consultTel,entryType,verifyStatus,sex,orgid);
364
+        return taRecommendCustomerMapper.getRepCustomerList(page,building,name,tel,consultName,consultTel,entryType,verifyStatus,sex, orgId);
367 365
     }
368 366
 
369 367
     @Override
@@ -389,7 +387,8 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
389 387
     }
390 388
 
391 389
     @Override
392
-    public IPage<TaRecommendCustomer> getCustomersIRecommended(int pageNumber, int pageSize,String customerId,String building){
390
+    public IPage<TaRecommendCustomer>getCustomersIRecommended(int pageNumber, int pageSize,String customerId,Integer orgId){
391
+
393 392
         QueryWrapper<TaRecommendCustomer>queryWrapper = new QueryWrapper<>();
394 393
         // todo
395 394
         // 此处可能不是 person_id 而是 recommend_person

+ 12
- 0
src/main/resources/mapper/TaRecommendCustomerMapper.xml 查看文件

@@ -43,6 +43,9 @@ FROM
43 43
 	<where>
44 44
         a.status > 0
45 45
         and a.report_recommend_status = 2
46
+        <if test="orgId != null">
47
+            and a.org_id = #{orgId}
48
+        </if>
46 49
         <if test="building != null and building !=''">
47 50
             and a.building_id = #{building}
48 51
         </if>
@@ -110,6 +113,9 @@ FROM
110 113
         <where>
111 114
             a.status > 0
112 115
             and a.report_recommend_status = 1
116
+            <if test="orgId != null">
117
+                and a.org_id = #{orgId}
118
+            </if>
113 119
             <if test="building != null and building !=''">
114 120
                 and a.building_id = #{building}
115 121
             </if>
@@ -153,6 +159,9 @@ FROM
153 159
         <where>
154 160
             a.status > 0
155 161
             and realty_consultant is not null
162
+            <if test="orgId != null">
163
+                and a.org_id = #{orgId}
164
+            </if>
156 165
             <if test="building != null and building !=''">
157 166
                 and a.building_id = #{building}
158 167
             </if>
@@ -210,6 +219,9 @@ FROM
210 219
             <if test="sex != null and sex !=''">
211 220
                 and b.sex = #{sex}
212 221
             </if>
222
+            <if test="orgId != null">
223
+                and b.org_id = #{orgId}
224
+            </if>
213 225
             and NOT EXISTS ( select * from ta_recommend_customer a where a.recommend_person = b.person_id)
214 226
         </where>
215 227
         order by b.create_date desc