魏超 5 gadus atpakaļ
vecāks
revīzija
64d80340d5

+ 6
- 0
src/main/java/com/huiju/estateagents/center/taUser/entity/TaUser.java Parādīt failu

@@ -226,4 +226,10 @@ public class TaUser implements Serializable {
226 226
      */
227 227
     @TableField(exist = false)
228 228
     private String consultantPersonId;
229
+
230
+    /**
231
+     * personId集合
232
+     */
233
+    @TableField(exist = false)
234
+    private List<TaPerson> personIds;
229 235
 }

+ 19
- 0
src/main/java/com/huiju/estateagents/controller/TaRecommendCustomerController.java Parādīt failu

@@ -28,6 +28,7 @@ import io.swagger.annotations.Api;
28 28
 import io.swagger.annotations.ApiImplicitParam;
29 29
 import io.swagger.annotations.ApiImplicitParams;
30 30
 import io.swagger.annotations.ApiOperation;
31
+import org.apache.commons.collections.CollectionUtils;
31 32
 import org.springframework.beans.factory.annotation.Autowired;
32 33
 import org.springframework.context.ApplicationContext;
33 34
 import org.springframework.format.annotation.DateTimeFormat;
@@ -413,6 +414,24 @@ public class TaRecommendCustomerController extends BaseController {
413 414
         }
414 415
     }
415 416
 
417
+    /**
418
+     * 批量分配置业顾问
419
+     */
420
+    @RequestMapping(value="/admin/customer/consultant/batchAssist",method= RequestMethod.POST)
421
+    public ResponseBean batchAssistConsultant (@RequestBody TaUser taUser, HttpServletRequest request){
422
+        if (CollectionUtils.isEmpty(taUser.getPersonIds())){
423
+            return ResponseBean.error("请至少选择一条数据", ResponseBean.ERROR_UNAVAILABLE);
424
+        }
425
+        try{
426
+            Integer orgId = getOrgId(request);
427
+            taRecommendCustomerService.batchConsultantAssist(taUser, orgId);
428
+            return ResponseBean.success("");
429
+        }catch (Exception e){
430
+            e.printStackTrace();
431
+            return ResponseBean.error(e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);
432
+        }
433
+    }
434
+
416 435
     @GetMapping("/admin/customer/recommend/{customerId}")
417 436
     public ResponseBean getCustomersIRecommended (@RequestParam int pageNumber, @RequestParam int pageSize, @PathVariable String customerId,HttpServletRequest request){
418 437
         Integer orgId = getOrgId(request);

+ 5
- 0
src/main/java/com/huiju/estateagents/entity/TaPerson.java Parādīt failu

@@ -189,6 +189,11 @@ public class TaPerson implements Serializable {
189 189
      */
190 190
     private String idcard;
191 191
 
192
+    /**
193
+     * 授权手机号时间
194
+     */
195
+    private LocalDateTime authPhoneTime;
196
+
192 197
     /**
193 198
      * 访问记录
194 199
      */

+ 34
- 0
src/main/java/com/huiju/estateagents/excel/PrivateCustomerExport.java Parādīt failu

@@ -52,4 +52,38 @@ public class PrivateCustomerExport {
52 52
     @ExcelProperty(value = "项目名称", index = 5)
53 53
     private String buildingName;
54 54
 
55
+    /**
56
+     * 用户注册时间
57
+     */
58
+    @ColumnWidth(15)
59
+    @ExcelProperty(value = "关注时间", index = 6)
60
+    private String createDate;
61
+
62
+    /**
63
+     * 国家
64
+     */
65
+    @ColumnWidth(15)
66
+    @ExcelProperty(value = "国家", index = 7)
67
+    private String country;
68
+
69
+    /**
70
+     * 省份
71
+     */
72
+    @ColumnWidth(15)
73
+    @ExcelProperty(value = "省份", index = 8)
74
+    private String province;
75
+
76
+    /**
77
+     * 来访方式
78
+     */
79
+    @ColumnWidth(15)
80
+    @ExcelProperty(value = "来访方式", index = 9)
81
+    private String sceneType;
82
+
83
+    /**
84
+     * 意向度
85
+     */
86
+    @ColumnWidth(15)
87
+    @ExcelProperty(value = "意向度", index = 10)
88
+    private String intention ;
55 89
 }

+ 34
- 0
src/main/java/com/huiju/estateagents/excel/PublicCustomerExport.java Parādīt failu

@@ -31,4 +31,38 @@ public class PublicCustomerExport {
31 31
     @ExcelProperty(value = "性别", index = 2)
32 32
     private String sex;
33 33
 
34
+    /**
35
+     * 关注时间
36
+     */
37
+    @ColumnWidth(15)
38
+    @ExcelProperty(value = "关注时间", index = 3)
39
+    private String createDate;
40
+
41
+    /**
42
+     * 国家
43
+     */
44
+    @ColumnWidth(15)
45
+    @ExcelProperty(value = "国家", index = 4)
46
+    private String country;
47
+
48
+    /**
49
+     * 省份
50
+     */
51
+    @ColumnWidth(15)
52
+    @ExcelProperty(value = "省份", index = 5)
53
+    private String province;
54
+
55
+    /**
56
+     * 来访方式
57
+     */
58
+    @ColumnWidth(15)
59
+    @ExcelProperty(value = "性别", index = 6)
60
+    private String sceneType;
61
+
62
+    /**
63
+     * 意向度
64
+     */
65
+    @ColumnWidth(15)
66
+    @ExcelProperty(value = "意向度", index = 7)
67
+    private String intention;
34 68
 }

+ 1
- 0
src/main/java/com/huiju/estateagents/service/ITaRecommendCustomerService.java Parādīt failu

@@ -58,6 +58,7 @@ public interface ITaRecommendCustomerService extends IService<TaRecommendCustome
58 58
 
59 59
     ResponseBean consultantAssist(TaUser taUser, String personId, Integer orgId);
60 60
 
61
+    ResponseBean batchConsultantAssist(TaUser taUser, Integer orgId);
61 62
     /**
62 63
      * 导出数据(推荐客户)
63 64
      * @param orgId

+ 1
- 0
src/main/java/com/huiju/estateagents/service/impl/TaPersonServiceImpl.java Parādīt failu

@@ -179,6 +179,7 @@ public class TaPersonServiceImpl extends ServiceImpl<TaPersonMapper, TaPerson> i
179 179
 
180 180
         UpdateWrapper<TaPerson> wrapper = new UpdateWrapper<>();
181 181
         wrapper.set("phone", phone);
182
+        wrapper.set("auth_phone_time", LocalDateTime.now());
182 183
 
183 184
         if (CommConstant.PERSON_ESTATE_DRIFT.equals(person.getPersonType())) {
184 185
             wrapper.set("person_type",CommConstant.PERSON_ESTATE_CUSTOMER);

+ 11
- 0
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java Parādīt failu

@@ -24,6 +24,7 @@ import com.huiju.estateagents.service.ITaRecommendCustomerService;
24 24
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
25 25
 import com.huiju.estateagents.statistic.entity.TaCustomerFollowUpRecord;
26 26
 import com.huiju.estateagents.statistic.mapper.TaCustomerFollowUpRecordMapper;
27
+import org.apache.commons.collections.CollectionUtils;
27 28
 import org.springframework.beans.factory.annotation.Autowired;
28 29
 import org.springframework.stereotype.Service;
29 30
 
@@ -751,6 +752,16 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
751 752
         }
752 753
     }
753 754
 
755
+    @Override
756
+    public ResponseBean batchConsultantAssist(TaUser taUser, Integer orgId) {
757
+        if (CollectionUtils.isNotEmpty(taUser.getPersonIds())){
758
+            for (TaPerson taPerson : taUser.getPersonIds()){
759
+                consultantAssist(taUser, taPerson.getPersonId(), orgId);
760
+            }
761
+        }
762
+        return ResponseBean.success("操作成功");
763
+    }
764
+
754 765
     @Override
755 766
     public ResponseBean consultantAssist(TaUser taUser, String personId, Integer orgId) {
756 767
         TaPerson taPerson = taPersonMapper.getById(personId);

+ 14
- 2
src/main/resources/mapper/TaRecommendCustomerMapper.xml Parādīt failu

@@ -546,10 +546,16 @@ FROM
546 546
         SELECT
547 547
           b.nickname as nickname,
548 548
           b.phone as phone,
549
-          if(b.gender = 1, '男', if(b.gender = 2, '女', '未知')) as sex
549
+          if(b.gender = 1, '男', if(b.gender = 2, '女', '未知')) as sex,
550
+          b.create_date,
551
+          b.country,
552
+          b.province,
553
+          z.intention,
554
+          d.scene_alias as sceneType
550 555
         FROM
551 556
         ta_person b
552 557
         LEFT JOIN ta_person_from_record r ON b.person_id = r.person_id AND r.is_first_time = 1 and r.org_id = #{orgId}
558
+        left join (select sum(t.intention) as intention,t.person_id From ta_person_intention_record t where t.org_id = #{orgId} group by t.person_id) z on z.person_id = b.person_id
553 559
         left join td_wx_dict d on r.scene_id = d.scene_id
554 560
         <where>
555 561
             b.status > 0
@@ -650,7 +656,12 @@ FROM
650 656
         WHEN b.tel IS NULL THEN
651 657
         d.phone ELSE b.tel
652 658
         END AS consultTel,
653
-        t.building_name
659
+        t.building_name,
660
+        z.intention,
661
+        a.create_date,
662
+        a.country,
663
+        a.province,
664
+        w.scene_alias as scene_type
654 665
         FROM
655 666
         ta_recommend_customer a
656 667
         LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
@@ -659,6 +670,7 @@ FROM
659 670
         LEFT JOIN ta_person_from_record p ON a.person_id = p.person_id AND p.is_first_time = 1 and p.org_id = #{orgId}
660 671
         left join ta_building t on a.building_id = t.building_id
661 672
         LEFT JOIN td_wx_dict w ON p.scene_id = w.scene_id
673
+        left join (select sum(t.intention) as intention,t.person_id From ta_person_intention_record t where t.org_id = #{orgId} group by t.person_id) z on z.person_id = a.person_id
662 674
         <where>
663 675
             a.status > 0
664 676
             and a.verify_status = 1