Просмотр исходного кода

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents into dev

yansen 5 лет назад
Родитель
Сommit
289e6b619c
23 измененных файлов: 916 добавлений и 73 удалений
  1. 29
    0
      src/main/java/com/huiju/estateagents/bo/request/QrCodeStatisticResponseBO.java
  2. 90
    0
      src/main/java/com/huiju/estateagents/common/MiniAppPageEnum.java
  3. 33
    0
      src/main/java/com/huiju/estateagents/common/WxQrCodeUtils.java
  4. 20
    18
      src/main/java/com/huiju/estateagents/controller/TaChannelController.java
  5. 200
    0
      src/main/java/com/huiju/estateagents/controller/TaQrcodeController.java
  6. 3
    6
      src/main/java/com/huiju/estateagents/controller/TaRaiseController.java
  7. 19
    11
      src/main/java/com/huiju/estateagents/controller/TaRecommendCustomerController.java
  8. 8
    4
      src/main/java/com/huiju/estateagents/entity/TaChannel.java
  9. 2
    0
      src/main/java/com/huiju/estateagents/entity/TaMiniappQrcode.java
  10. 99
    0
      src/main/java/com/huiju/estateagents/entity/TaQrcode.java
  11. 14
    0
      src/main/java/com/huiju/estateagents/mapper/TaChannelMapper.java
  12. 2
    0
      src/main/java/com/huiju/estateagents/mapper/TaMiniappMapper.java
  13. 32
    0
      src/main/java/com/huiju/estateagents/mapper/TaQrcodeMapper.java
  14. 64
    27
      src/main/java/com/huiju/estateagents/mapper/TaRecommendCustomerMapper.java
  15. 26
    0
      src/main/java/com/huiju/estateagents/service/ITaQrcodeService.java
  16. 15
    0
      src/main/java/com/huiju/estateagents/service/TaChannelService.java
  17. 13
    3
      src/main/java/com/huiju/estateagents/service/impl/MiniAppServiceImpl.java
  18. 29
    0
      src/main/java/com/huiju/estateagents/service/impl/TaChannelServiceImpl.java
  19. 140
    0
      src/main/java/com/huiju/estateagents/service/impl/TaQrcodeServiceImpl.java
  20. 1
    1
      src/main/java/com/huiju/estateagents/third/controller/TaThirdPartyMiniappConfigController.java
  21. 22
    0
      src/main/resources/mapper/TaChannelMapper.xml
  22. 37
    0
      src/main/resources/mapper/TaQrcodeMapper.xml
  23. 18
    3
      src/main/resources/mapper/TaRecommendCustomerMapper.xml

+ 29
- 0
src/main/java/com/huiju/estateagents/bo/request/QrCodeStatisticResponseBO.java Просмотреть файл

@@ -0,0 +1,29 @@
1
+package com.huiju.estateagents.bo.request;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * 二维码统计返回实体
7
+ *
8
+ * @author gusy
9
+ * @date 2020/5/21 13:53
10
+ */
11
+@Data
12
+public class QrCodeStatisticResponseBO {
13
+
14
+    /**
15
+     * 访问人数
16
+     */
17
+    private Integer visitPersons;
18
+
19
+    /**
20
+     * 访问次数
21
+     */
22
+    private Integer visitNum;
23
+
24
+    /**
25
+     * 新增用户
26
+     */
27
+    private Integer newPersons;
28
+
29
+}

+ 90
- 0
src/main/java/com/huiju/estateagents/common/MiniAppPageEnum.java Просмотреть файл

@@ -0,0 +1,90 @@
1
+package com.huiju.estateagents.common;
2
+
3
+/**
4
+ * 小程序页面枚举
5
+ *
6
+ * @author gusy
7
+ * @date 2020/5/21 15:58
8
+ */
9
+public enum MiniAppPageEnum {
10
+
11
+    /**
12
+     * 项目
13
+     */
14
+    PROJECT("project", "targetId=%s&targetType=%S&channelId=%s&qrCodeId=%s&buildingId=%s", "pages/project/detail/index"),
15
+
16
+    /**
17
+     * 报名活动
18
+     */
19
+    ACTIVITY("activity", "targetId=%s&targetType=%S&channelId=%s&qrCodeId=%s&buildingId=%s", "pages/activity/detail/index"),
20
+
21
+    /**
22
+     * 助力活动
23
+     */
24
+    HELP("help", "targetId=%s&targetType=%S&channelId=%s&qrCodeId=%s&buildingId=%s", "pages/activity/detail/assistance"),
25
+
26
+    /**
27
+     * 拼团活动
28
+     */
29
+    GROUP("group", "targetId=%s&targetType=%S&channelId=%s&qrCodeId=%s&buildingId=%s", "pages/activity/detail/assemble"),
30
+
31
+    /**
32
+     * h5活动
33
+     */
34
+    H5("h5", "targetId=%s&targetType=%S&channelId=%s&qrCodeId=%s&buildingId=%s", "pages/project/h5Page"),
35
+
36
+    /**
37
+     * 直播活动
38
+     */
39
+    LIVE("live", "targetId=%s&targetType=%S&channelId=%s&qrCodeId=%s&buildingId=%s", "onlineSelling/pages/live/index"),
40
+
41
+    /**
42
+     * 资讯
43
+     */
44
+    NEWS("news", "targetId=%s&targetType=%S&channelId=%s&qrCodeId=%s&buildingId=%s", "pages/news/detail/index"),
45
+
46
+    /**
47
+     * 在线选房
48
+     */
49
+    SALESBATCH("salesBatch", "targetId=%s&targetType=%S&channelId=%s&qrCodeId=%s&buildingId=%s", "onlineSelling/pages/houseList/index");
50
+
51
+    private String type;
52
+    private String scene;
53
+    private String page;
54
+
55
+    MiniAppPageEnum(String type, String scene, String page) {
56
+        this.type = type;
57
+        this.scene = scene;
58
+        this.page = page;
59
+    }
60
+
61
+    public String getType() {
62
+        return type;
63
+    }
64
+
65
+    public String getScene() {
66
+        return scene;
67
+    }
68
+
69
+    public String getPage() {
70
+        return page;
71
+    }
72
+
73
+    public static String getSceneByType(String type) {
74
+        for (MiniAppPageEnum pageEnum : MiniAppPageEnum.values()) {
75
+            if (type.equals(pageEnum.getType())) {
76
+                return pageEnum.getScene();
77
+            }
78
+        }
79
+        return null;
80
+    }
81
+
82
+    public static String getPageByType(String type) {
83
+        for (MiniAppPageEnum pageEnum : MiniAppPageEnum.values()) {
84
+            if (type.equals(pageEnum.getType())) {
85
+                return pageEnum.getPage();
86
+            }
87
+        }
88
+        return null;
89
+    }
90
+}

+ 33
- 0
src/main/java/com/huiju/estateagents/common/WxQrCodeUtils.java Просмотреть файл

@@ -0,0 +1,33 @@
1
+package com.huiju.estateagents.common;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import org.apache.commons.lang3.StringUtils;
5
+
6
+/**
7
+ * 微信二维码生成工具类
8
+ *
9
+ * @author gusy
10
+ * @date 2020/5/21 15:40
11
+ */
12
+public class WxQrCodeUtils {
13
+
14
+    /**
15
+     * 生成scene和页面
16
+     *
17
+     * @param type
18
+     * @param scene  为空则使用配置的通用模板
19
+     * @param params scene为空是必须按照模板内容填写
20
+     * @return
21
+     */
22
+    public static String generateSceneAndPage(String type, String scene, String... params) {
23
+        if (StringUtils.isBlank(scene)) {
24
+            String sceneTemplate = MiniAppPageEnum.getSceneByType(type);
25
+            scene = String.format(sceneTemplate, params);
26
+        }
27
+
28
+        JSONObject obj = new JSONObject();
29
+        obj.put("scene", scene);
30
+        obj.put("page", MiniAppPageEnum.getPageByType(type));
31
+        return obj.toJSONString();
32
+    }
33
+}

+ 20
- 18
src/main/java/com/huiju/estateagents/controller/TaChannelController.java Просмотреть файл

@@ -1,41 +1,27 @@
1 1
 package com.huiju.estateagents.controller;
2 2
 
3
-import com.alibaba.fastjson.JSONObject;
4
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 3
 import com.baomidou.mybatisplus.core.metadata.IPage;
6 4
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 5
 import com.huiju.estateagents.base.BaseController;
8 6
 import com.huiju.estateagents.base.ResponseBean;
9
-import io.swagger.annotations.ApiOperation;
10
-import com.huiju.estateagents.common.JWTUtils;
11
-import com.huiju.estateagents.common.StringUtils;
12
-import com.huiju.estateagents.entity.TaBuildingReport;
13 7
 import com.huiju.estateagents.entity.TaChannel;
14
-import com.huiju.estateagents.entity.TaPerson;
15 8
 import com.huiju.estateagents.mapper.TaChannelMapper;
16 9
 import com.huiju.estateagents.service.ITaPersonService;
17 10
 import com.huiju.estateagents.service.TaChannelService;
18 11
 import io.swagger.annotations.Api;
19 12
 import io.swagger.annotations.ApiImplicitParam;
20 13
 import io.swagger.annotations.ApiImplicitParams;
21
-import org.apache.http.HttpRequest;
14
+import io.swagger.annotations.ApiOperation;
22 15
 import org.slf4j.Logger;
23 16
 import org.slf4j.LoggerFactory;
24 17
 import org.springframework.beans.factory.annotation.Autowired;
25
-import org.springframework.web.bind.annotation.PathVariable;
26
-import org.springframework.web.bind.annotation.RequestBody;
27
-import org.springframework.web.bind.annotation.RequestMapping;
28
-import org.springframework.web.bind.annotation.RequestMethod;
29
-import org.springframework.web.bind.annotation.RequestParam;
30
-import org.springframework.web.bind.annotation.ResponseBody;
31
-import org.springframework.web.bind.annotation.RestController;
18
+import org.springframework.format.annotation.DateTimeFormat;
19
+import org.springframework.web.bind.annotation.*;
32 20
 
33 21
 import javax.servlet.http.HttpServletRequest;
34
-
35
-import java.time.LocalDateTime;
22
+import java.time.LocalDate;
36 23
 import java.util.HashMap;
37 24
 import java.util.List;
38
-import java.util.stream.Collectors;
39 25
 
40 26
 
41 27
 /**
@@ -260,4 +246,20 @@ public class TaChannelController extends BaseController {
260 246
         ResponseBean taPerson =  taPersonService.InviteClientsList(id,phone,pageNum,pageSize);
261 247
         return taPerson;
262 248
     }
249
+
250
+    /**
251
+     * 渠道引进客户统计
252
+     * @return
253
+     */
254
+    @GetMapping(value = "/admin/channel/introductionList")
255
+    public ResponseBean getChannelIntroductionList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
256
+                                                     @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize,
257
+                                                     @RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDate startDate,
258
+                                                     @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDate endDate,
259
+                                                     @RequestParam(value = "channelType", required = false)String channelType,
260
+                                                     @RequestParam(value = "buildingId", required = false)String buildingId,
261
+                                                     @RequestParam(value = "channelId") Integer channelId,
262
+                                                     HttpServletRequest request) {
263
+        return taChannelService.getChannelIntroductionList(pageNum, pageSize, getOrgId(request), startDate, endDate, channelType, buildingId, channelId);
264
+    }
263 265
 }

+ 200
- 0
src/main/java/com/huiju/estateagents/controller/TaQrcodeController.java Просмотреть файл

@@ -0,0 +1,200 @@
1
+package com.huiju.estateagents.controller;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
+import com.baomidou.mybatisplus.core.metadata.IPage;
6
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
+import com.google.gson.JsonObject;
8
+import com.huiju.estateagents.base.BaseController;
9
+import com.huiju.estateagents.base.ResponseBean;
10
+import com.huiju.estateagents.common.CommConstant;
11
+import com.huiju.estateagents.common.WxQrCodeUtils;
12
+import com.huiju.estateagents.entity.TaMiniapp;
13
+import com.huiju.estateagents.entity.TaQrcode;
14
+import com.huiju.estateagents.service.IMiniAppService;
15
+import com.huiju.estateagents.service.ITaQrcodeService;
16
+import org.apache.commons.lang3.StringUtils;
17
+import org.slf4j.Logger;
18
+import org.slf4j.LoggerFactory;
19
+import org.springframework.beans.factory.annotation.Autowired;
20
+import org.springframework.web.bind.annotation.*;
21
+
22
+import javax.servlet.http.HttpServletRequest;
23
+import java.time.LocalDateTime;
24
+import java.util.List;
25
+
26
+/**
27
+ * <p>
28
+ * 二维码管理表 前端控制器
29
+ * </p>
30
+ *
31
+ * @author fxf
32
+ * @since 2020-05-20
33
+ */
34
+@RestController
35
+@RequestMapping("/api")
36
+public class TaQrcodeController extends BaseController {
37
+
38
+    private final Logger logger = LoggerFactory.getLogger(TaQrcodeController.class);
39
+
40
+    @Autowired
41
+    public ITaQrcodeService iTaQrcodeService;
42
+
43
+    @Autowired
44
+    private IMiniAppService iMiniAppService;
45
+
46
+
47
+    /**
48
+     * 分页查询列表
49
+     *
50
+     * @param pageNum
51
+     * @param pageSize
52
+     * @return
53
+     */
54
+    @RequestMapping(value = "/admin/listQrCode", method = RequestMethod.GET)
55
+    public ResponseBean listQrCodeByCondition(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
56
+                                     @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
57
+                                     String targetType, String targetName, Integer channelId, String buildingId,
58
+                                     HttpServletRequest request) {
59
+        logger.info("接收参数:targetType:{},targetName:{},channelId:{},buildingId:{}",
60
+                targetType, targetName, channelId, buildingId);
61
+        ResponseBean responseBean = new ResponseBean();
62
+        try {
63
+            responseBean = iTaQrcodeService.listQrCodeByCondition(pageNum,pageSize,targetType,targetName,channelId,buildingId,getOrgId(request));
64
+        } catch (Exception e) {
65
+            e.printStackTrace();
66
+            logger.error("taQrcodeList -=- {}", e.toString());
67
+            responseBean.addError(e.getMessage());
68
+        }
69
+        return responseBean;
70
+    }
71
+
72
+    /**
73
+     * 保存对象
74
+     *
75
+     * @param taQrcode 实体对象
76
+     * @return
77
+     */
78
+    @RequestMapping(value = "/admin/taQrcode", method = RequestMethod.POST)
79
+    public ResponseBean saveQrcode(@RequestBody TaQrcode taQrcode, HttpServletRequest request) {
80
+        ResponseBean responseBean = new ResponseBean();
81
+        try {
82
+            responseBean = iTaQrcodeService.saveQrcode(taQrcode, getUserId(request), getOrgId(request));
83
+        } catch (Exception e) {
84
+            e.printStackTrace();
85
+            logger.error("saveQrcode -=- {}", e.toString());
86
+            responseBean.addError(e.getMessage());
87
+        }
88
+        return responseBean;
89
+    }
90
+
91
+    /**
92
+     * 根据id删除对象
93
+     *
94
+     * @param id 实体ID
95
+     */
96
+    @ResponseBody
97
+    @RequestMapping(value = "/taQrcode/{id}", method = RequestMethod.DELETE)
98
+    public ResponseBean taQrcodeDelete(@PathVariable Integer id) {
99
+        ResponseBean responseBean = new ResponseBean();
100
+        try {
101
+            if (iTaQrcodeService.removeById(id)) {
102
+                responseBean.addSuccess("success");
103
+            } else {
104
+                responseBean.addError("fail");
105
+            }
106
+        } catch (Exception e) {
107
+            e.printStackTrace();
108
+            logger.error("taQrcodeDelete -=- {}", e.toString());
109
+            responseBean.addError(e.getMessage());
110
+        }
111
+        return responseBean;
112
+    }
113
+
114
+    /**
115
+     * 批量删除
116
+     */
117
+    @ResponseBody
118
+    @RequestMapping(value = "/admin/qrCode/batchDelete", method = RequestMethod.DELETE)
119
+    public ResponseBean batchDelete(List<TaQrcode> taQrcodeList) {
120
+        ResponseBean responseBean = new ResponseBean();
121
+        try {
122
+
123
+            taQrcodeList.stream().forEach((record) -> {
124
+                record.setStatus(CommConstant.STATUS_DELETE);
125
+            });
126
+
127
+            responseBean.addSuccess(iTaQrcodeService.updateBatchById(taQrcodeList));
128
+
129
+        } catch (Exception e) {
130
+            e.printStackTrace();
131
+            logger.error("taQrcodeDelete -=- {}", e.toString());
132
+            responseBean.addError(e.getMessage());
133
+        }
134
+        return responseBean;
135
+    }
136
+
137
+
138
+    /**
139
+     * 修改对象
140
+     *
141
+     * @param id       实体ID
142
+     * @param taQrcode 实体对象
143
+     * @return
144
+     */
145
+    @RequestMapping(value = "/taQrcode/{id}", method = RequestMethod.PUT)
146
+    public ResponseBean taQrcodeUpdate(@PathVariable Integer id,
147
+                                       @RequestBody TaQrcode taQrcode) {
148
+        ResponseBean responseBean = new ResponseBean();
149
+        try {
150
+            if (iTaQrcodeService.updateById(taQrcode)) {
151
+                responseBean.addSuccess(taQrcode);
152
+            } else {
153
+                responseBean.addError("fail");
154
+            }
155
+        } catch (Exception e) {
156
+            e.printStackTrace();
157
+            logger.error("taQrcodeUpdate -=- {}", e.toString());
158
+            responseBean.addError(e.getMessage());
159
+        }
160
+        return responseBean;
161
+    }
162
+
163
+    /**
164
+     * 根据id查询对象
165
+     *
166
+     * @param id 实体ID
167
+     */
168
+    @RequestMapping(value = "/taQrcode/{id}", method = RequestMethod.GET)
169
+    public ResponseBean taQrcodeGet(@PathVariable Integer id) {
170
+        ResponseBean responseBean = new ResponseBean();
171
+        try {
172
+            responseBean.addSuccess(iTaQrcodeService.getById(id));
173
+        } catch (Exception e) {
174
+            e.printStackTrace();
175
+            logger.error("taQrcodeDelete -=- {}", e.toString());
176
+            responseBean.addError(e.getMessage());
177
+        }
178
+        return responseBean;
179
+    }
180
+
181
+    /**
182
+     * 获取二维码统计信息
183
+     *
184
+     * @param request
185
+     * @return
186
+     */
187
+    @RequestMapping("/admin/qrCode/getStatisticData")
188
+    public ResponseBean getStatisticData(Integer qrCodeId, HttpServletRequest request) {
189
+        logger.info("getStatisticData 接收参数:qrCodeId:{}", qrCodeId);
190
+        ResponseBean responseBean = new ResponseBean();
191
+        try {
192
+            responseBean = iTaQrcodeService.getStatisticData(qrCodeId, getOrgId(request));
193
+            logger.info("getStatisticData 返回结果:{}", JSONObject.toJSONString(responseBean));
194
+        } catch (Exception e) {
195
+            logger.error("getStatisticData 异常:", e);
196
+            responseBean.addError(e.getMessage());
197
+        }
198
+        return responseBean;
199
+    }
200
+}

+ 3
- 6
src/main/java/com/huiju/estateagents/controller/TaRaiseController.java Просмотреть файл

@@ -7,23 +7,20 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 7
 import com.huiju.estateagents.base.BaseController;
8 8
 import com.huiju.estateagents.base.ResponseBean;
9 9
 import com.huiju.estateagents.common.CommConstant;
10
-import com.huiju.estateagents.common.StringUtils;
11 10
 import com.huiju.estateagents.entity.TaPersonBuilding;
12 11
 import com.huiju.estateagents.entity.TaRaise;
13
-import com.huiju.estateagents.entity.TaRaiseInvite;
14 12
 import com.huiju.estateagents.entity.TaSalesBatch;
15
-import com.huiju.estateagents.service.*;
13
+import com.huiju.estateagents.service.ITaRaiseService;
14
+import com.huiju.estateagents.service.ITaSalesBatchService;
15
+import com.huiju.estateagents.service.ITdCityService;
16 16
 import com.huiju.estateagents.service.impl.TaRaiseInviteServiceImpl;
17
-import io.swagger.models.auth.In;
18 17
 import org.slf4j.Logger;
19 18
 import org.slf4j.LoggerFactory;
20 19
 import org.springframework.beans.factory.annotation.Autowired;
21 20
 import org.springframework.web.bind.annotation.*;
22 21
 
23 22
 import javax.servlet.http.HttpServletRequest;
24
-import java.lang.reflect.Array;
25 23
 import java.time.LocalDateTime;
26
-import java.util.ArrayList;
27 24
 import java.util.List;
28 25
 
29 26
 /**

+ 19
- 11
src/main/java/com/huiju/estateagents/controller/TaRecommendCustomerController.java Просмотреть файл

@@ -846,6 +846,8 @@ public class TaRecommendCustomerController extends BaseController {
846 846
                                       @RequestParam(value = "customerType") String customerType,
847 847
                                       @RequestParam(value = "status", required = false) Integer status,
848 848
                                       @RequestParam(value = "sceneType", required = false) String sceneType,
849
+                                      @RequestParam(value = "startCreateDate", required = false) String startCreateDate,
850
+                                      @RequestParam(value = "endCreateDate", required = false) String endCreateDate,
849 851
                                       @RequestParam(value = "belongStatus", required = false) Integer belongStatus) throws IOException { // public 公  private 私
850 852
 
851 853
         //        response.setContentType("application/vnd.ms-excel");
@@ -874,7 +876,9 @@ public class TaRecommendCustomerController extends BaseController {
874 876
 //            pageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
875 877
 //            List<PublicCustomerExport> publicList = null;
876 878
 //            do {
877
-            List<PublicCustomerExport> publicList = taRecommendCustomerMapper.getPublicCustomerExportList(pageCode * pageSize, pageSize, buildingId, name, tel, entryType, verifyStatus, sex, orgId, consultTel, sceneType, getTaPersonBuildingListByUserId(request), belongStatus);
879
+            List<PublicCustomerExport> publicList = taRecommendCustomerMapper.getPublicCustomerExportList(pageCode * pageSize, pageSize,
880
+                    buildingId, name, tel, entryType, verifyStatus, sex, orgId, consultTel, sceneType, getTaPersonBuildingListByUserId(request),
881
+                    belongStatus, startCreateDate, endCreateDate);
878 882
             excelWriter.write(publicList, writeSheet);
879 883
 
880 884
 //                pageCode ++;
@@ -896,7 +900,9 @@ public class TaRecommendCustomerController extends BaseController {
896 900
 //            pageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
897 901
 //            List<PrivateCustomerExport> privateList = null;
898 902
 //            do {
899
-            List<PrivateCustomerExport> privateList = taRecommendCustomerMapper.getCustomerExportList(pageCode * pageSize, pageSize, buildingId, name, tel, consultName, consultTel, entryType, verifyStatus, sex, orgId, status, sceneType, getTaPersonBuildingListByUserId(request));
903
+            List<PrivateCustomerExport> privateList = taRecommendCustomerMapper.getCustomerExportList(pageCode * pageSize, pageSize,
904
+                    buildingId, name, tel, consultName, consultTel, entryType, verifyStatus, sex, orgId, status, sceneType, startCreateDate,
905
+                    endCreateDate, getTaPersonBuildingListByUserId(request));
900 906
             excelWriter.write(privateList, writeSheet);
901 907
 
902 908
 //                pageCode ++;
@@ -976,35 +982,37 @@ public class TaRecommendCustomerController extends BaseController {
976 982
 
977 983
     /**
978 984
      * 校验此职业顾问下有没有私客存在
985
+     *
979 986
      * @return
980 987
      */
981 988
     @GetMapping("/admin/consultant/customer/list")
982 989
     public ResponseBean consultantCustomerList(@RequestParam(value = "userId") Integer userId,
983 990
                                                @RequestParam(value = "personId") String personId,
984 991
                                                @RequestParam(value = "buildingId") String buildingId,
985
-                                               HttpServletRequest request){
992
+                                               HttpServletRequest request) {
986 993
         Integer orgId = getOrgId(request);
987
-        try{
988
-            List<TaRecommendCustomer> list = taRecommendCustomerService.getConsultantCustomerList(userId,personId,buildingId,orgId,getTaPersonBuildingListByUserId(request));
994
+        try {
995
+            List<TaRecommendCustomer> list = taRecommendCustomerService.getConsultantCustomerList(userId, personId, buildingId, orgId, getTaPersonBuildingListByUserId(request));
989 996
             return ResponseBean.success(list);
990
-        }catch (Exception e){
997
+        } catch (Exception e) {
991 998
             e.printStackTrace();
992
-            return ResponseBean.error(e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);
999
+            return ResponseBean.error(e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
993 1000
         }
994 1001
     }
995 1002
 
996 1003
     /**
997 1004
      * 迁移私客到新的置业顾问
1005
+     *
998 1006
      * @return
999 1007
      */
1000 1008
     @PutMapping("/admin/consultant/customer/move")
1001
-    public ResponseBean moveConsultantCustomer(@RequestBody List<TaRecommendCustomer> list,HttpServletRequest request){
1002
-        try{
1009
+    public ResponseBean moveConsultantCustomer(@RequestBody List<TaRecommendCustomer> list, HttpServletRequest request) {
1010
+        try {
1003 1011
             taRecommendCustomerService.updateBatchById(list);
1004 1012
             return ResponseBean.success(list);
1005
-        }catch (Exception e){
1013
+        } catch (Exception e) {
1006 1014
             e.printStackTrace();
1007
-            return ResponseBean.error(e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);
1015
+            return ResponseBean.error(e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
1008 1016
         }
1009 1017
     }
1010 1018
 }

+ 8
- 4
src/main/java/com/huiju/estateagents/entity/TaChannel.java Просмотреть файл

@@ -1,15 +1,16 @@
1 1
 package com.huiju.estateagents.entity;
2 2
 
3
-import com.baomidou.mybatisplus.annotation.TableField;
4
-import com.baomidou.mybatisplus.annotation.TableName;
5 3
 import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
6 5
 import com.baomidou.mybatisplus.annotation.TableId;
7
-import java.time.LocalDateTime;
8
-import java.io.Serializable;
6
+import com.baomidou.mybatisplus.annotation.TableName;
9 7
 import lombok.Data;
10 8
 import lombok.EqualsAndHashCode;
11 9
 import lombok.experimental.Accessors;
12 10
 
11
+import java.io.Serializable;
12
+import java.time.LocalDateTime;
13
+
13 14
 /**
14 15
  * <p>
15 16
  *  
@@ -70,6 +71,9 @@ public class TaChannel implements Serializable {
70 71
     @TableField(exist = false)
71 72
     private Integer inviteCount;
72 73
 
74
+    @TableField(exist = false)
75
+    private Integer customerNum;
76
+
73 77
     /**
74 78
      * 创建时间
75 79
      */

+ 2
- 0
src/main/java/com/huiju/estateagents/entity/TaMiniappQrcode.java Просмотреть файл

@@ -55,4 +55,6 @@ public class TaMiniappQrcode implements Serializable {
55 55
      */
56 56
     private String qrCode;
57 57
 
58
+    private Integer targetId;
59
+
58 60
 }

+ 99
- 0
src/main/java/com/huiju/estateagents/entity/TaQrcode.java Просмотреть файл

@@ -0,0 +1,99 @@
1
+package com.huiju.estateagents.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+import java.time.LocalDateTime;
12
+import java.util.List;
13
+
14
+/**
15
+ * <p>
16
+ * 二维码管理表
17
+ * </p>
18
+ *
19
+ * @author fxf
20
+ * @since 2020-05-20
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+public class TaQrcode implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    /**
30
+     * qr_code_id id
31
+     */
32
+    @TableId(value = "qr_code_id", type = IdType.AUTO)
33
+    private Integer qrCodeId;
34
+
35
+    /**
36
+     * org_id
37
+     */
38
+    private Integer orgId;
39
+
40
+    /**
41
+     * building_id 关联项目ID
42
+     */
43
+    private String buildingId;
44
+
45
+    /**
46
+     * channel_id 渠道ID
47
+     */
48
+    private Integer channelId;
49
+
50
+    /**
51
+     * target_type 二维码类型
52
+     */
53
+    private String targetType;
54
+
55
+    /**
56
+     * target_name 二维码内容
57
+     */
58
+    private String targetName;
59
+
60
+    /**
61
+     * target_id
62
+     */
63
+    private String targetId;
64
+
65
+    /**
66
+     * qr_code_url 二维码地址
67
+     */
68
+    private String qrCodeUrl;
69
+
70
+    /**
71
+     * status 状态
72
+     */
73
+    private Integer status;
74
+
75
+    /**
76
+     * create_date 创建时间
77
+     */
78
+    private LocalDateTime createDate;
79
+
80
+    /**
81
+     * create_user 创建人
82
+     */
83
+    private Integer createUser;
84
+
85
+    @TableField(exist = false)
86
+    private List<TaQrcode> qrcodeList;
87
+
88
+    /**
89
+     * 楼盘名称
90
+     */
91
+    @TableField(exist = false)
92
+    private String buildingName;
93
+
94
+    /**
95
+     * 渠道名称
96
+     */
97
+    @TableField(exist = false)
98
+    private String channelName;
99
+}

+ 14
- 0
src/main/java/com/huiju/estateagents/mapper/TaChannelMapper.java Просмотреть файл

@@ -3,9 +3,11 @@ package com.huiju.estateagents.mapper;
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5 5
 import com.huiju.estateagents.entity.TaChannel;
6
+import com.huiju.estateagents.entity.TsActivityDaily;
6 7
 import org.apache.ibatis.annotations.Mapper;
7 8
 import org.apache.ibatis.annotations.Param;
8 9
 
10
+import java.time.LocalDate;
9 11
 import java.util.List;
10 12
 
11 13
 /**
@@ -39,4 +41,16 @@ public interface TaChannelMapper extends BaseMapper<TaChannel> {
39 41
     IPage<TaChannel> pageTaChannel(IPage<TaChannel> pg,@Param("orgId")Integer orgId,@Param("channelId")Integer channelId);
40 42
 
41 43
     List<TaChannel> recommendCount(@Param("orgId")Integer orgId,@Param("channelId")Integer channelId);
44
+
45
+    /**
46
+     * 渠道引进客户统计
47
+     * @param pg
48
+     * @param orgId
49
+     * @param startDate
50
+     * @param endDate
51
+     * @param channelType
52
+     * @param buildingId
53
+     * @return
54
+     */
55
+    IPage<TsActivityDaily> getChannelIntroductionList(IPage<TsActivityDaily> pg,@Param("orgId") Integer orgId,@Param("startDate") LocalDate startDate,@Param("endDate") LocalDate endDate,@Param("channelType") String channelType,@Param("buildingId") String buildingId,@Param("channelId") Integer channelId);
42 56
 }

+ 2
- 0
src/main/java/com/huiju/estateagents/mapper/TaMiniappMapper.java Просмотреть файл

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.huiju.estateagents.entity.TaMiniapp;
5 5
 import com.huiju.estateagents.entity.TaMiniappTemplate;
6 6
 import org.apache.ibatis.annotations.Mapper;
7
+import org.springframework.stereotype.Component;
7 8
 
8 9
 import java.util.List;
9 10
 
@@ -16,6 +17,7 @@ import java.util.List;
16 17
  * @since 2019-09-11
17 18
  */
18 19
 @Mapper
20
+@Component
19 21
 public interface TaMiniappMapper extends BaseMapper<TaMiniapp> {
20 22
 
21 23
     List<TaMiniapp> getAllAvaliableMiniapps();

+ 32
- 0
src/main/java/com/huiju/estateagents/mapper/TaQrcodeMapper.java Просмотреть файл

@@ -0,0 +1,32 @@
1
+package com.huiju.estateagents.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.huiju.estateagents.bo.request.QrCodeStatisticResponseBO;
7
+import com.huiju.estateagents.entity.TaQrcode;
8
+import org.apache.ibatis.annotations.Mapper;
9
+import org.apache.ibatis.annotations.Param;
10
+import org.springframework.stereotype.Component;
11
+
12
+/**
13
+ * <p>
14
+ * 二维码管理表 Mapper 接口
15
+ * </p>
16
+ *
17
+ * @author fxf
18
+ * @since 2020-05-20
19
+ */
20
+@Mapper
21
+@Component
22
+public interface TaQrcodeMapper extends BaseMapper<TaQrcode> {
23
+
24
+    QrCodeStatisticResponseBO getStatisticData(@Param("orgId") Integer orgId);
25
+
26
+    IPage<TaQrcode> listQrCodeByCondition(IPage<TaQrcode> page,
27
+                                          @Param("targetType") String targetType,
28
+                                          @Param("targetName") String targetName,
29
+                                          @Param("channelId") Integer channelId,
30
+                                          @Param("buildingId") String buildingId,
31
+                                          @Param("orgId") Integer orgId);
32
+}

+ 64
- 27
src/main/java/com/huiju/estateagents/mapper/TaRecommendCustomerMapper.java Просмотреть файл

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
9 9
 import com.huiju.estateagents.excel.*;
10 10
 import org.apache.ibatis.annotations.Mapper;
11 11
 import org.apache.ibatis.annotations.Param;
12
+import org.springframework.web.bind.annotation.RequestParam;
12 13
 
13 14
 import java.time.LocalDateTime;
14 15
 import java.util.List;
@@ -27,19 +28,23 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
27 28
 
28 29
     Integer getMyCutsomerNum(@Param("personId") String personId);
29 30
 
30
-    String getCustomerPersonId(@Param("customerId")String customerId);
31
+    String getCustomerPersonId(@Param("customerId") String customerId);
31 32
 
32
-    TaRecommendCustomer getCustomerDetail(@Param("customerId")String customerId,@Param("personId")String personId);
33
+    TaRecommendCustomer getCustomerDetail(@Param("customerId") String customerId, @Param("personId") String personId);
33 34
 
34
-    TaRecommendCustomer getCustomerById(@Param("customerId")String customerId);
35
+    TaRecommendCustomer getCustomerById(@Param("customerId") String customerId);
35 36
 
36
-    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,@Param("status")Integer status, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList,@Param("sceneType") String sceneType, @Param("startCreateDate") String startCreateDate, @Param("endCreateDate") String endCreateDate, @Param("sharePersonName") String sharePersonName);
37
-    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, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
38
-    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, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
39
-    IPage<TaPerson> getIndependentAgents(IPage<TaPerson>page, @Param("name") String name, @Param("tel") String tel, @Param("channelId") String channelId, @Param("orgId") Integer orgId);
37
+    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, @Param("status") Integer status, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList, @Param("sceneType") String sceneType, @Param("startCreateDate") String startCreateDate, @Param("endCreateDate") String endCreateDate, @Param("sharePersonName") String sharePersonName);
38
+
39
+    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, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
40
+
41
+    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, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
42
+
43
+    IPage<TaPerson> getIndependentAgents(IPage<TaPerson> page, @Param("name") String name, @Param("tel") String tel, @Param("channelId") String channelId, @Param("orgId") Integer orgId);
40 44
 
41 45
     /**
42 46
      * 公客
47
+     *
43 48
      * @param page
44 49
      * @param name
45 50
      * @param tel
@@ -67,34 +72,39 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
67 72
 
68 73
     /**
69 74
      * 导出数据 获取推荐用户数据
75
+     *
70 76
      * @param orgId
71 77
      * @return
72 78
      */
73
-    List<ExcelRecommendCustomer> getRecCustomerExport(@Param("orgId") Integer orgId, @Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize,@Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
79
+    List<ExcelRecommendCustomer> getRecCustomerExport(@Param("orgId") Integer orgId, @Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
74 80
 
75 81
     /**
76 82
      * 导出数据 获取推荐用户数据 总数
83
+     *
77 84
      * @param orgId
78 85
      * @return
79 86
      */
80
-    Integer getRecCustomerExportCount(@Param("orgId") Integer orgId,@Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
87
+    Integer getRecCustomerExportCount(@Param("orgId") Integer orgId, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
81 88
 
82 89
     /**
83 90
      * 导出数据 获取报备客户数据 总数
91
+     *
84 92
      * @param orgId
85 93
      * @return
86 94
      */
87
-    Integer getRepCustomerReportCount(@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,@Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
95
+    Integer getRepCustomerReportCount(@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, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
88 96
 
89 97
     /**
90 98
      * 导出数据 获取报备客户数据
99
+     *
91 100
      * @param orgId
92 101
      * @return
93 102
      */
94
-    List<ReporRecommendCustomer> getRepCustomerReportExport(@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, @Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize,@Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
103
+    List<ReporRecommendCustomer> getRepCustomerReportExport(@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, @Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
95 104
 
96 105
     /**
97 106
      * 导出数据 获取经纪人数据 总数
107
+     *
98 108
      * @param orgId
99 109
      * @return
100 110
      */
@@ -102,15 +112,17 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
102 112
 
103 113
     /**
104 114
      * 导出数据 获取经纪人数据
115
+     *
105 116
      * @param orgId
106 117
      * @param pageCode
107 118
      * @param pageSize
108 119
      * @return
109 120
      */
110
-    List<AgentsRecommendCustomer> getIndependentAgentsExport(@Param("name")String name, @Param("tel")String tel, @Param("channelId")String channelId, @Param("orgId") Integer orgId, @Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize);
121
+    List<AgentsRecommendCustomer> getIndependentAgentsExport(@Param("name") String name, @Param("tel") String tel, @Param("channelId") String channelId, @Param("orgId") Integer orgId, @Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize);
111 122
 
112 123
     /**
113 124
      * 导出数据 公客总数
125
+     *
114 126
      * @param name
115 127
      * @param tel
116 128
      * @param entryType
@@ -120,10 +132,11 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
120 132
      * @param consultTel
121 133
      * @return
122 134
      */
123
-    Integer getPublicCustomerExportListCount(@Param("name") String name, @Param("tel") String tel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex, @Param("orgId") Integer orgId,@Param("consultTel")String consultTel);
135
+    Integer getPublicCustomerExportListCount(@Param("name") String name, @Param("tel") String tel, @Param("entryType") String entryType, @Param("verifyStatus") String verifyStatus, @Param("sex") Integer sex, @Param("orgId") Integer orgId, @Param("consultTel") String consultTel);
124 136
 
125 137
     /**
126 138
      * 导出数据 公客
139
+     *
127 140
      * @param name
128 141
      * @param tel
129 142
      * @param entryType
@@ -135,20 +148,23 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
135 148
      */
136 149
     List<PublicCustomerExport> getPublicCustomerExportList(@Param("pageCode") Integer pageCode,
137 150
                                                            @Param("pageSize") Integer pageSize,
138
-                                                           @Param("buildingId")String buildingId,
151
+                                                           @Param("buildingId") String buildingId,
139 152
                                                            @Param("name") String name,
140 153
                                                            @Param("tel") String tel,
141 154
                                                            @Param("entryType") String entryType,
142 155
                                                            @Param("verifyStatus") String verifyStatus,
143 156
                                                            @Param("sex") Integer sex,
144 157
                                                            @Param("orgId") Integer orgId,
145
-                                                           @Param("consultTel")String consultTel,
146
-                                                           @Param("sceneType")String sceneType,
158
+                                                           @Param("consultTel") String consultTel,
159
+                                                           @Param("sceneType") String sceneType,
147 160
                                                            @Param("personBuildingList") List<TaPersonBuilding> personBuildingList,
148
-                                                           @Param("belongStatus") Integer belongStatus);
161
+                                                           @Param("belongStatus") Integer belongStatus,
162
+                                                           @Param("startCreateDate") String startCreateDate,
163
+                                                           @Param("endCreateDate") String endCreateDate);
149 164
 
150 165
     /**
151 166
      * 导出数据 私客总数
167
+     *
152 168
      * @param buildingId
153 169
      * @param name
154 170
      * @param tel
@@ -161,10 +177,11 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
161 177
      * @param status
162 178
      * @return
163 179
      */
164
-    Integer getCustomerExportListCount(@Param("building") String buildingId, @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,@Param("status")Integer status,@Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
180
+    Integer getCustomerExportListCount(@Param("building") String buildingId, @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, @Param("status") Integer status, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
165 181
 
166 182
     /**
167 183
      * 导出数据 私客
184
+     *
168 185
      * @param pageCode
169 186
      * @param pageSize
170 187
      * @param buildingId
@@ -179,18 +196,35 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
179 196
      * @param status
180 197
      * @return
181 198
      */
182
-    List<PrivateCustomerExport> getCustomerExportList(@Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize, @Param("building") String buildingId, @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, @Param("status")Integer status,@Param("sceneType") String sceneType,@Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
183
-    
199
+    List<PrivateCustomerExport> getCustomerExportList(@Param("pageCode") Integer pageCode,
200
+                                                      @Param("pageSize") Integer pageSize,
201
+                                                      @Param("building") String buildingId,
202
+                                                      @Param("name") String name,
203
+                                                      @Param("tel") String tel,
204
+                                                      @Param("consultName") String consultName,
205
+                                                      @Param("consultTel") String consultTel,
206
+                                                      @Param("entryType") String entryType,
207
+                                                      @Param("verifyStatus") String verifyStatus,
208
+                                                      @Param("sex") Integer sex,
209
+                                                      @Param("orgId") Integer orgId,
210
+                                                      @Param("status") Integer status,
211
+                                                      @Param("sceneType") String sceneType,
212
+                                                      @Param("startCreateDate") String startCreateDate,
213
+                                                      @Param("endCreateDate") String endCreateDate,
214
+                                                      @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
215
+
184 216
     /**
185 217
      * 获取我的客户的人数统计
218
+     *
186 219
      * @param personId
187 220
      * @param userId
188 221
      * @return
189 222
      */
190
-	Map<String, Object> getMyCustStatistics(@Param("personId") String personId,@Param("userId") Integer userId,@Param("orgId") Integer orgId);
191
-    
223
+    Map<String, Object> getMyCustStatistics(@Param("personId") String personId, @Param("userId") Integer userId, @Param("orgId") Integer orgId);
224
+
192 225
     /**
193 226
      * 获取我的跟进客户数据
227
+     *
194 228
      * @param page
195 229
      * @param personId
196 230
      * @param userId
@@ -205,18 +239,19 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
205 239
      * @param endArrivalDate
206 240
      * @return
207 241
      */
208
-    IPage<TaRecommendCustomer> getMyCustFollowOrClinch(IPage<TaRecommendCustomer> page, @Param("personId") String personId, @Param("userId") Integer userId, @Param("orgId") Integer orgId, @Param("type") String type, @Param("name") String name, @Param("phone") String phone, @Param("status") Integer status,@Param("startReportDate") String startReportDate,@Param("endReportDate") String endReportDate,@Param("startArrivalDate") String startArrivalDate,@Param("endArrivalDate") String endArrivalDate);
209
-    
242
+    IPage<TaRecommendCustomer> getMyCustFollowOrClinch(IPage<TaRecommendCustomer> page, @Param("personId") String personId, @Param("userId") Integer userId, @Param("orgId") Integer orgId, @Param("type") String type, @Param("name") String name, @Param("phone") String phone, @Param("status") Integer status, @Param("startReportDate") String startReportDate, @Param("endReportDate") String endReportDate, @Param("startArrivalDate") String startArrivalDate, @Param("endArrivalDate") String endArrivalDate);
243
+
210 244
     /**
211 245
      * 获取我的客户详情数据
246
+     *
212 247
      * @param customerId
213 248
      * @return
214 249
      */
215 250
     TaRecommendCustomer getMyCustDetailById(String customerId);
216 251
 
217
-    List<PersonIntention> getCustomerIntentions(@Param("personId")String personId,@Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
252
+    List<PersonIntention> getCustomerIntentions(@Param("personId") String personId, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
218 253
 
219
-    IPage<TaRecommendCustomer>getCustomersIRecommended(IPage<TaRecommendCustomer> page,@Param("customerId")String customerId,@Param("status")Integer status,@Param("orgId") Integer orgId,@Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
254
+    IPage<TaRecommendCustomer> getCustomersIRecommended(IPage<TaRecommendCustomer> page, @Param("customerId") String customerId, @Param("status") Integer status, @Param("orgId") Integer orgId, @Param("personBuildingList") List<TaPersonBuilding> personBuildingList);
220 255
 
221 256
     /**
222 257
      * @param page
@@ -240,6 +275,7 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
240 275
      * 查询 person 对应 楼盘 的客户
241 276
      * 如果对应的楼盘没有客户, 则返回无楼盘的, 小程序级别的客户信息
242 277
      * 如果没有无小程序级别客户, 则返回最早的一条
278
+     *
243 279
      * @param orgId
244 280
      * @param personId
245 281
      * @param buildingId
@@ -249,13 +285,14 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
249 285
 
250 286
     /**
251 287
      * 获取置业福问下的客户
288
+     *
252 289
      * @param userId
253 290
      * @param personId
254 291
      * @param buildingId
255 292
      * @param orgId
256 293
      * @return
257 294
      */
258
-    List<TaRecommendCustomer> getConsultantCustomerList(@Param("userId") Integer userId,@Param("personId") String personId,@Param("buildingId") String buildingId,@Param("orgId") Integer orgId);
295
+    List<TaRecommendCustomer> getConsultantCustomerList(@Param("userId") Integer userId, @Param("personId") String personId, @Param("buildingId") String buildingId, @Param("orgId") Integer orgId);
259 296
 
260 297
     /**
261 298
      * 校验客户存在记录

+ 26
- 0
src/main/java/com/huiju/estateagents/service/ITaQrcodeService.java Просмотреть файл

@@ -0,0 +1,26 @@
1
+package com.huiju.estateagents.service;
2
+
3
+import com.huiju.estateagents.base.ResponseBean;
4
+import com.huiju.estateagents.entity.TaQrcode;
5
+import com.baomidou.mybatisplus.extension.service.IService;
6
+import org.springframework.web.bind.annotation.RequestParam;
7
+
8
+import javax.servlet.http.HttpServletRequest;
9
+
10
+/**
11
+ * <p>
12
+ * 二维码管理表 服务类
13
+ * </p>
14
+ *
15
+ * @author fxf
16
+ * @since 2020-05-20
17
+ */
18
+public interface ITaQrcodeService extends IService<TaQrcode> {
19
+
20
+    ResponseBean listQrCodeByCondition(Integer pageNum, Integer pageSize, String targetType, String targetName, Integer channelId, String buildingId, Integer orgId);
21
+
22
+    ResponseBean saveQrcode(TaQrcode taQrcode, Integer userId, Integer orgId);
23
+
24
+    ResponseBean getStatisticData(Integer qrCodeId, Integer orgId);
25
+
26
+}

+ 15
- 0
src/main/java/com/huiju/estateagents/service/TaChannelService.java Просмотреть файл

@@ -1,7 +1,10 @@
1 1
 package com.huiju.estateagents.service;
2 2
 import com.baomidou.mybatisplus.extension.service.IService;
3
+import com.huiju.estateagents.base.ResponseBean;
3 4
 import com.huiju.estateagents.entity.TaChannel;
4 5
 
6
+import java.time.LocalDate;
7
+
5 8
 /**
6 9
  * <p>
7 10
  *   服务类
@@ -12,4 +15,16 @@ import com.huiju.estateagents.entity.TaChannel;
12 15
  */
13 16
 public interface TaChannelService extends IService<TaChannel> {
14 17
 
18
+    /**
19
+     * 渠道引进客户统计
20
+     * @param pageNum
21
+     * @param pageSize
22
+     * @param orgId
23
+     * @param startDate
24
+     * @param endDate
25
+     * @param channelType
26
+     * @param buildingId
27
+     * @return
28
+     */
29
+    ResponseBean getChannelIntroductionList(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String channelType, String buildingId, Integer channelId);
15 30
 }

+ 13
- 3
src/main/java/com/huiju/estateagents/service/impl/MiniAppServiceImpl.java Просмотреть файл

@@ -335,15 +335,21 @@ public class MiniAppServiceImpl implements IMiniAppService {
335 335
         String scene = params.getString("scene");
336 336
         String page = StringUtils.ifNull(params.getString("page"), "");
337 337
         Integer width = params.getInteger("width");
338
-        if (null == width) width = 430;
338
+        if (null == width) {
339
+            width = 430;
340
+        }
339 341
 
340 342
         Boolean autoColor = params.getBoolean("auto_color");
341
-        if (null == autoColor) autoColor = false;
343
+        if (null == autoColor) {
344
+            autoColor = false;
345
+        }
342 346
 
343 347
         String lineColorStr = StringUtils.ifNull(params.getString("line_color"), "{\"r\":0,\"g\":0,\"b\":0}");
344 348
         WxMaCodeLineColor lineColor = JSONObject.parseObject(lineColorStr, WxMaCodeLineColor.class);
345 349
         Boolean isHyaline = params.getBoolean("is_hyaline");
346
-        if (null == isHyaline) isHyaline = true;
350
+        if (null == isHyaline) {
351
+            isHyaline = true;
352
+        }
347 353
 
348 354
         try {
349 355
 
@@ -352,6 +358,10 @@ public class MiniAppServiceImpl implements IMiniAppService {
352 358
             taQrcode.setCreateDate(LocalDateTime.now());
353 359
             taQrcode.setExpireDate(LocalDateTime.now().plusDays(7));
354 360
             taQrcode.setQrParams(paramsStr);
361
+            JSONObject sceneObj = JSONObject.parseObject(scene);
362
+            if (!StringUtils.isEmpty(sceneObj.getString("qrCodeId"))) {
363
+                taQrcode.setTargetId(Integer.parseInt(sceneObj.getString("qrCodeId")));
364
+            }
355 365
 
356 366
             boolean success = taMiniappQrcodeMapper.insert(taQrcode) > 0;
357 367
             if (!success) {

+ 29
- 0
src/main/java/com/huiju/estateagents/service/impl/TaChannelServiceImpl.java Просмотреть файл

@@ -1,10 +1,18 @@
1 1
 package com.huiju.estateagents.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
2 5
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
6
+import com.huiju.estateagents.base.ResponseBean;
3 7
 import com.huiju.estateagents.entity.TaChannel;
8
+import com.huiju.estateagents.entity.TsActivityDaily;
4 9
 import com.huiju.estateagents.mapper.TaChannelMapper;
5 10
 import com.huiju.estateagents.service.TaChannelService;
11
+import org.springframework.beans.factory.annotation.Autowired;
6 12
 import org.springframework.stereotype.Service;
7 13
 
14
+import java.time.LocalDate;
15
+
8 16
 /**
9 17
  * <p>
10 18
  *   服务实现类
@@ -16,4 +24,25 @@ import org.springframework.stereotype.Service;
16 24
 @Service
17 25
 public class TaChannelServiceImpl extends ServiceImpl<TaChannelMapper, TaChannel> implements TaChannelService {
18 26
 
27
+    @Autowired
28
+    private TaChannelMapper taChannelMapper;
29
+
30
+    /**
31
+     * 渠道引进客户统计
32
+     *
33
+     * @param pageNum
34
+     * @param pageSize
35
+     * @param orgId
36
+     * @param startDate
37
+     * @param endDate
38
+     * @param channelType
39
+     * @param buildingId
40
+     * @return
41
+     */
42
+    @Override
43
+    public ResponseBean getChannelIntroductionList(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String channelType, String buildingId, Integer channelId) {
44
+        IPage<TsActivityDaily> pg = new Page<>(pageNum, pageSize);
45
+        IPage<TsActivityDaily> data = taChannelMapper.getChannelIntroductionList(pg, orgId,startDate,endDate,channelType,buildingId, channelId);
46
+        return ResponseBean.success(data);
47
+    }
19 48
 }

+ 140
- 0
src/main/java/com/huiju/estateagents/service/impl/TaQrcodeServiceImpl.java Просмотреть файл

@@ -0,0 +1,140 @@
1
+package com.huiju.estateagents.service.impl;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
+import com.baomidou.mybatisplus.core.metadata.IPage;
6
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
8
+import com.huiju.estateagents.base.ResponseBean;
9
+import com.huiju.estateagents.bo.request.QrCodeStatisticResponseBO;
10
+import com.huiju.estateagents.common.CommConstant;
11
+import com.huiju.estateagents.common.WxQrCodeUtils;
12
+import com.huiju.estateagents.entity.TaMiniapp;
13
+import com.huiju.estateagents.entity.TaQrcode;
14
+import com.huiju.estateagents.mapper.TaMiniappMapper;
15
+import com.huiju.estateagents.mapper.TaQrcodeMapper;
16
+import com.huiju.estateagents.service.IMiniAppService;
17
+import com.huiju.estateagents.service.ITaQrcodeService;
18
+import org.checkerframework.checker.units.qual.A;
19
+import org.slf4j.Logger;
20
+import org.slf4j.LoggerFactory;
21
+import org.springframework.beans.factory.annotation.Autowired;
22
+import org.springframework.stereotype.Service;
23
+
24
+import java.time.LocalDateTime;
25
+
26
+/**
27
+ * <p>
28
+ * 二维码管理表 服务实现类
29
+ * </p>
30
+ *
31
+ * @author fxf
32
+ * @since 2020-05-20
33
+ */
34
+@Service
35
+public class TaQrcodeServiceImpl extends ServiceImpl<TaQrcodeMapper, TaQrcode> implements ITaQrcodeService {
36
+
37
+    private Logger logger = LoggerFactory.getLogger(TaQrcodeServiceImpl.class);
38
+
39
+    @Autowired
40
+    private TaQrcodeMapper taQrcodeMapper;
41
+
42
+    @Autowired
43
+    private TaMiniappMapper taMiniappMapper;
44
+
45
+    @Autowired
46
+    private IMiniAppService iMiniAppService;
47
+
48
+    /**
49
+     * 条件查询二维码列表
50
+     *
51
+     * @param pageNum
52
+     * @param pageSize
53
+     * @param targetType
54
+     * @param targetName
55
+     * @param channelId
56
+     * @param buildingId
57
+     * @param orgId
58
+     * @return
59
+     */
60
+    @Override
61
+    public ResponseBean listQrCodeByCondition(Integer pageNum, Integer pageSize, String targetType, String targetName, Integer channelId, String buildingId, Integer orgId) {
62
+        ResponseBean responseBean = new ResponseBean();
63
+        IPage<TaQrcode> pg = new Page<>(pageNum, pageSize);
64
+        responseBean.addSuccess(taQrcodeMapper.listQrCodeByCondition(pg, targetType, targetName, channelId, buildingId, orgId));
65
+        return responseBean;
66
+    }
67
+
68
+    /**
69
+     * 保存二维码信息
70
+     *
71
+     * @param taQrcode
72
+     * @param userId
73
+     * @param orgId
74
+     * @return
75
+     */
76
+    @Override
77
+    public ResponseBean saveQrcode(TaQrcode taQrcode, Integer userId, Integer orgId) {
78
+        ResponseBean responseBean = new ResponseBean();
79
+
80
+        // 保存数据
81
+        taQrcode.setOrgId(orgId);
82
+        taQrcode.setCreateUser(userId);
83
+        taQrcode.setCreateDate(LocalDateTime.now());
84
+        taQrcode.setStatus(CommConstant.STATUS_NORMAL);
85
+        if (!save(taQrcode)) {
86
+            responseBean.addError("fail");
87
+            return responseBean;
88
+        }
89
+
90
+        // 获取appId
91
+        QueryWrapper<TaMiniapp> taMiniappQuery = new QueryWrapper<>();
92
+        taMiniappQuery.eq("org_id", orgId);
93
+        TaMiniapp taMiniapp = taMiniappMapper.selectOne(taMiniappQuery);
94
+
95
+        // 生成二维码
96
+        String paramsStr = WxQrCodeUtils.generateSceneAndPage(taQrcode.getTargetType(), "",
97
+                taQrcode.getTargetId(), taQrcode.getTargetType(), taQrcode.getChannelId() + "", taQrcode.getQrCodeId() + "", taQrcode.getBuildingId());
98
+        ResponseBean qrCodeResult = iMiniAppService.getQrCode(paramsStr, taMiniapp.getMiniappId());
99
+        if (qrCodeResult != null && ResponseBean.CODE_SUCCESS == qrCodeResult.getCode()) {
100
+            // 更新数据
101
+            taQrcode.setQrCodeUrl(qrCodeResult.getCode() + "");
102
+            if (updateById(taQrcode)) {
103
+                responseBean.addSuccess(taQrcode);
104
+                return responseBean;
105
+            }
106
+        }
107
+        removeById(taQrcode.getQrCodeId());
108
+        responseBean.addError("fail");
109
+        return responseBean;
110
+    }
111
+
112
+    /**
113
+     * 获取二维码统计
114
+     *
115
+     * @param qrCodeId
116
+     * @param orgId
117
+     * @return
118
+     */
119
+    @Override
120
+    public ResponseBean getStatisticData(Integer qrCodeId, Integer orgId) {
121
+        ResponseBean responseBean = new ResponseBean();
122
+
123
+        // 获取二维码信息
124
+        TaQrcode taQrcode = taQrcodeMapper.selectById(qrCodeId);
125
+        if (taQrcode == null) {
126
+            responseBean.addError("fail");
127
+            return responseBean;
128
+        }
129
+
130
+        // 获取统计数据
131
+        QrCodeStatisticResponseBO statisticData = taQrcodeMapper.getStatisticData(orgId);
132
+
133
+        // 组装反参
134
+        JSONObject resultObj = new JSONObject();
135
+        resultObj.put("statistic", statisticData);
136
+        resultObj.put("qrCodeInfo", taQrcode);
137
+        responseBean.addSuccess(resultObj);
138
+        return responseBean;
139
+    }
140
+}

+ 1
- 1
src/main/java/com/huiju/estateagents/third/controller/TaThirdPartyMiniappConfigController.java Просмотреть файл

@@ -165,7 +165,7 @@ public class TaThirdPartyMiniappConfigController extends BaseController {
165 165
     }
166 166
 
167 167
     /**
168
-     * 第三方生成二维码
168
+     * 第三方生成
169 169
      * @return
170 170
      */
171 171
     @PostMapping("/third/qrcode")

+ 22
- 0
src/main/resources/mapper/TaChannelMapper.xml Просмотреть файл

@@ -33,11 +33,15 @@
33 33
         c.*,
34 34
         count(tp.person_id) AS brokerCount,
35 35
         (SELECT COUNT(p.recommend_agent ) from ta_person p WHERE cp.person_id = p.recommend_agent) AS inviteCount,
36
+        IFNULL(ts.customerNum,0) as customerNum,
36 37
         cp.person_id
37 38
         FROM
38 39
         ta_channel c
39 40
         LEFT JOIN ta_channel_person cp ON c.channel_id = cp.channel_id
40 41
         LEFT JOIN ta_person tp ON cp.person_id = tp.person_id 	AND tp.person_type = 'estate agent' 	AND cp.STATUS = 1
42
+        LEFT JOIN (SELECT sum(z.customerNum) as customerNum,z.qr_code_id,z.org_id,z.channel_id from (SELECT sum(new_customers) as customerNum,qr_code_id,channel_id,org_id from ts_activity_daily where channel_id is not null and org_id = #{orgId} GROUP BY channel_id
43
+        union all
44
+        SELECT sum(new_customers) as customerNum,qr_code_id,channel_id,org_id from ts_channel_daily where channel_id is not null and org_id = #{orgId} GROUP BY channel_id) z GROUP BY z.channel_id) ts on c.channel_id = ts.channel_id
41 45
         <where>
42 46
             <if test="channelId != null and channelId != ''">
43 47
                 c.channel_id = #{channelId}
@@ -65,4 +69,22 @@
65 69
         GROUP BY c.channel_id
66 70
     </select>
67 71
 
72
+    <select id="getChannelIntroductionList" resultType="com.huiju.estateagents.entity.TsActivityDaily">
73
+        SELECT
74
+            *
75
+        FROM
76
+            ts_activity_daily
77
+        WHERE
78
+            channel_id = #{channelId}
79
+        AND org_id = #{orgId}
80
+        UNION ALL
81
+        SELECT
82
+            *
83
+        FROM
84
+            ts_channel_daily
85
+        WHERE
86
+            channel_id = #{channelId}
87
+            AND org_id = #{orgId}
88
+    </select>
89
+
68 90
 </mapper>

+ 37
- 0
src/main/resources/mapper/TaQrcodeMapper.xml Просмотреть файл

@@ -0,0 +1,37 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.huiju.estateagents.mapper.TaQrcodeMapper">
4
+
5
+    <select id="listQrCodeByCondition" resultType="com.huiju.estateagents.entity.TaQrcode">
6
+    SELECT
7
+        t.*,
8
+        t2.building_name,
9
+        t3.channel_name
10
+    FROM
11
+        ta_qrcode t
12
+        LEFT JOIN ta_building t2 ON t.building_id = t2.building_id
13
+        LEFT JOIN ta_channel t3 ON t.channel_id = t3.channel_id
14
+    WHERE
15
+        t.`status` > - 1
16
+        AND t.org_id = #{orgId}
17
+        <if test = "buildingId == '' or buildingId == null">
18
+            AND t.building_id = #{buildingId}
19
+        </if>
20
+        <if test = "targetType == '' or targetType == null">
21
+            AND t.target_type = #{targetType}
22
+        </if>
23
+        <if test = "targetName == '' or targetName == null">
24
+            AND t.target_name = #{targetName}
25
+        </if>
26
+        <if test = "channelId == null">
27
+            AND t.channel_id = #{channelId}
28
+        </if>
29
+      ORDER BY
30
+        t.create_date DESC
31
+    </select>
32
+
33
+    <select id="getStatisticData" resultType="com.huiju.estateagents.bo.request.QrCodeStatisticResponseBO">
34
+
35
+    </select>
36
+
37
+</mapper>

+ 18
- 3
src/main/resources/mapper/TaRecommendCustomerMapper.xml Просмотреть файл

@@ -622,6 +622,12 @@
622 622
         <if test="sex != null and sex !=''">
623 623
             and t.sex = #{sex}
624 624
         </if>
625
+        <if test="startCreateDate != null and startCreateDate !=''">
626
+            and t.create_Date >= #{startCreateDate}
627
+        </if>
628
+        <if test="endCreateDate != null and endCreateDate !=''">
629
+            and t.create_Date &lt;= #{endCreateDate}
630
+        </if>
625 631
         <if test="personBuildingList != null and personBuildingList.size > 0">
626 632
             AND t.building_id in
627 633
             <foreach collection="personBuildingList" item="personBuilding" open="(" close=")" separator=",">
@@ -682,6 +688,12 @@
682 688
             <if test="sex != null and sex !=''">
683 689
                 and a.sex = #{sex}
684 690
             </if>
691
+            <if test="startCreateDate != null and startCreateDate !=''">
692
+                and a.create_Date >= #{startCreateDate}
693
+            </if>
694
+            <if test="endCreateDate != null and endCreateDate !=''">
695
+                and a.create_Date &lt;= #{endCreateDate}
696
+            </if>
685 697
             <if test="personBuildingList != null and personBuildingList.size > 0">
686 698
                 AND a.building_id in
687 699
                 <foreach collection="personBuildingList" item="personBuilding" open="(" close=")" separator=",">
@@ -723,9 +735,6 @@
723 735
         LEFT JOIN ta_person p2 ON a.person_id = p2.person_id
724 736
         LEFT JOIN ta_person c ON p2.recommend_person = c.person_id
725 737
         left join ta_building t on a.building_id = t.building_id
726
-        --         LEFT JOIN ta_person c ON p.share_person_id = c.person_id
727
-        --         left join ta_building t on a.building_id = t.building_id
728
-        --         LEFT JOIN td_wx_dict w ON p.scene_id = w.scene_id
729 738
         left JOIN (select sum(points_amount) as points,person_id from ta_points_records where org_id = #{orgId} GROUP BY
730 739
         person_id) s on a.person_id = s.person_id
731 740
         left join (select sum(t.intention) as intention,t.person_id From ta_person_intention_record t where t.org_id =
@@ -765,6 +774,12 @@
765 774
             <if test="sex != null and sex !=''">
766 775
                 and a.sex = #{sex}
767 776
             </if>
777
+            <if test="startCreateDate != null and startCreateDate !=''">
778
+                and a.create_Date >= #{startCreateDate}
779
+            </if>
780
+            <if test="endCreateDate != null and endCreateDate !=''">
781
+                and a.create_Date &lt;= #{endCreateDate}
782
+            </if>
768 783
             <if test="personBuildingList != null and personBuildingList.size > 0">
769 784
                 AND a.building_id in
770 785
                 <foreach collection="personBuildingList" item="personBuilding" open="(" close=")" separator=",">