魏超 5 anos atrás
pai
commit
0f2cf99410

+ 2
- 26
src/main/java/com/huiju/estateagents/controller/TaPersonVisitRecordController.java Ver arquivo

@@ -323,8 +323,8 @@ public class TaPersonVisitRecordController extends BaseController {
323 323
 
324 324
         List<TaConsultantInfo> taConsultantInfos = result.getRecords();
325 325
         taConsultantInfos.forEach(e ->{
326
-            Integer shareNum = iTaPersonVisitRecordService.countShareNumByEventType(e.getTargetId(), getOrgId(request), userId, e.getShareType());
327
-            switch (e.getShareType()){
326
+            Integer shareNum = iTaPersonVisitRecordService.countShareNumByEventType(e.getTargetId(), getOrgId(request), userId, e.getEventType());
327
+            switch (e.getEventType()){
328 328
                 case CommConstant.POSTER_CONTENT_TYPE_ACTIVITY:
329 329
                     e.setActivityShareNum(shareNum);
330 330
                     break;
@@ -348,28 +348,4 @@ public class TaPersonVisitRecordController extends BaseController {
348 348
         result.setRecords(taConsultantInfos);
349 349
         return ResponseBean.success(result);
350 350
     }
351
-
352
-    @RequestMapping(value = "/wx/sharePersonInfoList",method= RequestMethod.GET)
353
-    public ResponseBean getSharePersonList(@RequestParam(value ="pageNumber",defaultValue = "1") Integer pageNumber,
354
-                                           @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
355
-                                           @RequestParam(value = "userId") Integer userId,
356
-                                           @RequestParam(value = "targetId")String targetId,
357
-                                           HttpServletRequest request){
358
-        try {
359
-            //使用分页插件
360
-            IPage<TaPerson> pg = new Page<>(pageNumber, pageSize);
361
-            IPage<TaPerson> result = iTaPersonVisitRecordService.getSharePersonList(pg, getOrgId(request), userId, targetId);
362
-            return ResponseBean.success(result);
363
-        }catch (Exception e){
364
-            e.printStackTrace();
365
-            logger.error("taPersonVisitRecordList -=- {}",e.toString());
366
-            return ResponseBean.error(e.getMessage(),ResponseBean.ERROR_UNAVAILABLE);
367
-        }
368
-    }
369
-
370
-    @RequestMapping(value = "/wx/judgeBindCustomer", method = RequestMethod.GET)
371
-    public ResponseBean judgeBindCustomer(@RequestParam("customerId")String customerId, @RequestParam("recommendPersonId") String recommendPersonId){
372
-        boolean judgeBindCustomerFlag = taRecommendCustomerService.judgeBindCustomer(customerId, recommendPersonId);
373
-        return ResponseBean.success(judgeBindCustomerFlag);
374
-    }
375 351
 }

+ 7
- 23
src/main/java/com/huiju/estateagents/entity/TaConsultantInfo.java Ver arquivo

@@ -4,47 +4,31 @@ import lombok.Data;
4 4
 
5 5
 @Data
6 6
 public class TaConsultantInfo {
7
-    private String targetId;
8
-
9
-    private String shareType;
7
+    private String activityImg;
10 8
 
11
-    private String buildingUrl;
9
+    private String activityName;
12 10
 
13 11
     private String buildingName;
14 12
 
15
-    private Integer buildingNum;
16
-
17 13
     private String address;
18 14
 
19 15
     private String price;
20 16
 
21
-    private String activityImg;
17
+    private String eventType;
22 18
 
23
-    private String activityName;
19
+    private String targetId;
24 20
 
25
-    private Integer activityShareNum;
21
+    private String buildingUrl;
26 22
 
27
-    private String helpActivityName;
23
+    private Integer buildingNum;
28 24
 
29
-    private String helpActivityImg;
25
+    private Integer activityShareNum;
30 26
 
31 27
     private Integer helpActivityShareNum;
32 28
 
33
-    private String groupActivityImg;
34
-
35
-    private String groupActivityName;
36
-
37 29
     private Integer groupActivityShareNum;
38 30
 
39
-    private String newsImg;
40
-
41
-    private String newsName;
42
-
43 31
     private Integer newsNum;
44 32
 
45
-    private String drainageImg;
46
-
47
-    private String drainageName;
48
-
49 33
     private Integer drainageShareNum;
50 34
 }

+ 0
- 2
src/main/java/com/huiju/estateagents/mapper/TaPersonVisitRecordMapper.java Ver arquivo

@@ -81,6 +81,4 @@ public interface TaPersonVisitRecordMapper extends BaseMapper<TaPersonVisitRecor
81 81
     IPage<TaConsultantInfo> getConsultantShareInfoList(IPage<TaConsultantInfo> pg, @Param("userId") Integer userId, @Param("orgId") Integer orgId);
82 82
 
83 83
     Integer countShareNumByEventType(@Param("targetId") String targetId, @Param("orgId")Integer orgId, @Param("userId")Integer userId, @Param("eventType")String eventType);
84
-
85
-    IPage<TaPerson> getSharePersonList(IPage<TaPerson> pg, @Param("orgId") Integer orgId, @Param("userId")Integer userId, @Param("targetId")String targetId);
86 84
 }

+ 0
- 2
src/main/java/com/huiju/estateagents/service/ITaPersonVisitRecordService.java Ver arquivo

@@ -54,6 +54,4 @@ public interface ITaPersonVisitRecordService extends IService<TaPersonVisitRecor
54 54
 	IPage<TaConsultantInfo> getConsultantShareInfoList(IPage<TaConsultantInfo> pg, Integer userId, Integer orgId);
55 55
 
56 56
 	Integer countShareNumByEventType(String targetId, Integer orgId, Integer userId, String eventType);
57
-
58
-	IPage<TaPerson> getSharePersonList(IPage<TaPerson> pg, Integer orgId, Integer userId, String targetId);
59 57
 }

+ 0
- 1
src/main/java/com/huiju/estateagents/service/ITaRecommendCustomerService.java Ver arquivo

@@ -149,5 +149,4 @@ public interface ITaRecommendCustomerService extends IService<TaRecommendCustome
149 149
      */
150 150
     ResponseBean getAdminMyCustList(String openid, String keywords, int pageNumber, int pageSize);
151 151
 
152
-    boolean judgeBindCustomer(String customerId, String recommendPersonId);
153 152
 }

+ 0
- 7
src/main/java/com/huiju/estateagents/service/impl/TaPersonVisitRecordServiceImpl.java Ver arquivo

@@ -150,13 +150,6 @@ public class TaPersonVisitRecordServiceImpl extends ServiceImpl<TaPersonVisitRec
150 150
 		return personVisitRecordMapper.countShareNumByEventType(targetId, orgId, userId, eventType);
151 151
 	}
152 152
 
153
-	@Override
154
-	public IPage<TaPerson> getSharePersonList(IPage<TaPerson> pg, Integer orgId, Integer userId, String targetId) {
155
-		IPage<TaPerson> result = personVisitRecordMapper.getSharePersonList(pg, orgId, userId, targetId);
156
-		return result;
157
-	}
158
-
159
-
160 153
 	/**
161 154
 	 * 分页获取个人中心访客记录
162 155
 	 *

+ 0
- 11
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java Ver arquivo

@@ -893,15 +893,4 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
893 893
         taCustomerFollowUpRecord.setCustomerSex(taRecommendCustomer.getSex());
894 894
         customerFollowUpRecordMapper.insert(taCustomerFollowUpRecord);
895 895
     }
896
-
897
-    public boolean judgeBindCustomer(String customerId, String recommendPersonId){
898
-        QueryWrapper<TaRecommendCustomer> taRecommendCustomerQueryWrapper = new QueryWrapper<>();
899
-        taRecommendCustomerQueryWrapper.eq("customer_id", customerId);
900
-        taRecommendCustomerQueryWrapper.eq("",recommendPersonId);
901
-        TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.selectOne(taRecommendCustomerQueryWrapper);
902
-        if (taRecommendCustomer != null){
903
-            return true;
904
-        }
905
-        return false;
906
-    }
907 896
 }

+ 3
- 0
src/main/resources/mapper/HelpActivityMapper.xml Ver arquivo

@@ -86,6 +86,7 @@
86 86
                 <if test="buildingId != null and buildingId != ''">
87 87
                   and a.building_id = #{buildingId}
88 88
                 </if>
89
+                 order  by a.heavy desc
89 90
 		)
90 91
 		UNION ALL
91 92
 			(
@@ -112,6 +113,7 @@
112 113
                 <if test="buildingId != null and buildingId != ''">
113 114
                     and s.building_id = #{buildingId}
114 115
                 </if>
116
+                order  by s.heavy desc
115 117
 			)
116 118
 		UNION ALL
117 119
 		    (
@@ -138,6 +140,7 @@
138 140
                 <if test="buildingId != null and buildingId != ''">
139 141
                     and t.building_id = #{buildingId}
140 142
                 </if>
143
+                order  by t.heavy desc
141 144
             )
142 145
     </select>
143 146
 

+ 90
- 35
src/main/resources/mapper/TaPersonVisitRecordMapper.xml Ver arquivo

@@ -180,35 +180,106 @@
180 180
 
181 181
     <select id="getConsultantShareInfoList" resultType="com.huiju.estateagents.entity.TaConsultantInfo">
182 182
         select
183
-            t.target_id,
184
-            t.event_type as share_type,
185
-            a.url as building_img,
186
-            a.building_name,
187
-            a.address,
188
-            a.price,
189
-            b.list_img_url as activity_img,
190
-            b.title as activity_name,
191
-            c.list_img as help_activity_img,
192
-            c.title as help_activity_name,
193
-            d.list_img as group_activity_img,
194
-            d.activity_name as group_activity_name,
195
-            e.news_img,
196
-            e.news_name,
197
-            f.share_img as drainage_img,
198
-            f.`name` as drainage_name
199
-        From ta_person_visit_record t
183
+        a.url as activity_img,
184
+        a.building_name as activity_name,
185
+        a.building_name,
186
+        a.address,
187
+        a.price,
188
+        t.event_type
189
+        from ta_person_visit_record t
200 190
         left join (select b.url, a.building_name,a.address,a.price,a.building_id from ta_building a left join ta_building_img b on a.building_id = b.building_id where b.img_type = 'list') a on t.target_id = a.building_id
191
+        where t.event_type = 'building'
192
+        and t.consultant_id = #{userId}
193
+        and t.org_id = #{orgId}
194
+        and t.`event` = 'share'
195
+        order by t.visit_time desc
196
+
197
+        union all
198
+
199
+        select
200
+        b.list_img_url as activity_img,
201
+        b.title as activity_name,
202
+        '1' as price,
203
+        '2' as building_name,
204
+        '3' as address,
205
+        t.event_type
206
+        from ta_person_visit_record t
201 207
         left join ta_building_dynamic b on t.target_id = b.dynamic_id
208
+        where t.event_type = 'activity'
209
+        and t.consultant_id = #{userId}
210
+        and t.org_id = #{orgId}
211
+        and t.`event` = 'share'
212
+        order by t.visit_time desc
213
+
214
+        union all
215
+
216
+        select
217
+        c.list_img as activity_img,
218
+        c.title as activity_name,
219
+        '1' as price,
220
+        '2' as building_name,
221
+        '3' as address,
222
+        t.event_type
223
+        from ta_person_visit_record t
202 224
         left join ta_help_activity c on t.target_id = c.help_activity_id
225
+        where t.event_type = 'help'
226
+        and t.consultant_id = #{userId}
227
+        and t.org_id = #{orgId}
228
+        and t.`event` = 'share'
229
+        order by t.visit_time desc
230
+
231
+        union all
232
+
233
+        select
234
+        d.list_img as activity_img,
235
+        d.activity_name as activity_name,
236
+        '1' as price,
237
+        '2' as building_name,
238
+        '3' as address,
239
+        t.event_type
240
+        from ta_person_visit_record t
203 241
         left join ta_share_activity d on t.target_id = d.group_activity_id
242
+        where t.event_type = 'group'
243
+        and t.consultant_id = #{userId}
244
+        and t.org_id = #{orgId}
245
+        and t.`event` = 'share'
246
+        order by t.visit_time desc
247
+
248
+        union all
249
+
250
+        select
251
+        e.news_img as activity_img,
252
+        e.news_name,
253
+        '1' as price,
254
+        '2' as building_name,
255
+        '3' as address,
256
+        t.event_type
257
+        from ta_person_visit_record t
204 258
         left join ta_news e on t.target_id = e.news_id
259
+        where t.event_type = 'news'
260
+        and t.consultant_id = #{userId}
261
+        and t.org_id = #{orgId}
262
+        and t.`event` = 'share'
263
+        order by t.visit_time desc
264
+
265
+        union all
266
+
267
+        select
268
+        f.share_img as drainage_img,
269
+        f.`name` as drainage_name,
270
+        '1' as price,
271
+        '2' as building_name,
272
+        '3' as address,
273
+        t.event_type
274
+        from ta_person_visit_record t
205 275
         left join ta_drainage f on t.target_id = f.drainage_id
206
-        where
207
-        t.consultant_id = #{userId}
276
+        where t.event_type = 'h5'
277
+        and t.consultant_id = #{userId}
208 278
         and t.org_id = #{orgId}
209 279
         and t.`event` = 'share'
210 280
         order by t.visit_time desc
211 281
     </select>
282
+
212 283
     <select id="countShareNumByEventType" resultType="java.lang.Integer">
213 284
         select count(*) from ta_person_visit_record t
214 285
         where
@@ -220,20 +291,4 @@
220 291
         group by t.event_type, person_id
221 292
     </select>
222 293
 
223
-    <select id="getSharePersonList" resultType="com.huiju.estateagents.entity.TaPerson">
224
-        select
225
-        t.person_type,
226
-        t.avatarurl,
227
-        t.nickname,
228
-        a.visit_time
229
-        from ta_person t
230
-        left join ta_person_visit_record a on t.person_id = a.person_id
231
-        where
232
-        a.org_id = #{orgId}
233
-        and a.target_id = #{targetId}
234
-        and a.consultant_id = #{userId}
235
-        and a.person_id != a.share_person_id
236
-        group by a.person_id order by a.visit_time desc
237
-    </select>
238
-
239 294
 </mapper>