瀏覽代碼

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

张延森 5 年之前
父節點
當前提交
5a950a2857

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

164
 
164
 
165
     /**
165
     /**
166
      * 微信接口获取首页分享或推荐客户图
166
      * 微信接口获取首页分享或推荐客户图
167
-     * @param imgType
168
      */
167
      */
169
     @RequestMapping(value="/wx/taCustomImg",method= RequestMethod.GET)
168
     @RequestMapping(value="/wx/taCustomImg",method= RequestMethod.GET)
170
-    public ResponseBean taCustomImgGet(@RequestParam(value ="imgType") String imgType,HttpServletRequest request){
169
+    public ResponseBean taCustomImgGet(HttpServletRequest request){
171
         ResponseBean responseBean = new ResponseBean();
170
         ResponseBean responseBean = new ResponseBean();
172
         try {
171
         try {
173
             QueryWrapper<TaCustomImg> queryWrapper = new QueryWrapper<>();
172
             QueryWrapper<TaCustomImg> queryWrapper = new QueryWrapper<>();
174
-            queryWrapper.eq("img_type", imgType);
175
             queryWrapper.eq("org_id", getOrgId(request));
173
             queryWrapper.eq("org_id", getOrgId(request));
176
             TaCustomImg taCustomImg = iTaCustomImgService.getOne(queryWrapper);
174
             TaCustomImg taCustomImg = iTaCustomImgService.getOne(queryWrapper);
177
             responseBean.addSuccess(taCustomImg);
175
             responseBean.addSuccess(taCustomImg);

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

323
 
323
 
324
         List<TaConsultantInfo> taConsultantInfos = result.getRecords();
324
         List<TaConsultantInfo> taConsultantInfos = result.getRecords();
325
         taConsultantInfos.forEach(e ->{
325
         taConsultantInfos.forEach(e ->{
326
-            Integer shareNum = iTaPersonVisitRecordService.countShareNumByEventType(e.getTargetId(), getOrgId(request), userId, e.getEventType());
326
+            QueryWrapper<TaPerson> taPersonQueryWrapper = new QueryWrapper<>();
327
+            taPersonQueryWrapper.eq("user_id",userId);
328
+            taPersonQueryWrapper.eq("org_id",getOrgId(request));
329
+            TaPerson taPerson = taPersonService.getOne(taPersonQueryWrapper);
330
+
331
+            Integer shareNum = iTaPersonVisitRecordService.countShareNumByEventType(e.getTargetId(), getOrgId(request), userId, e.getEventType(), taPerson.getPersonId());
327
             switch (e.getEventType()){
332
             switch (e.getEventType()){
328
                 case CommConstant.POSTER_CONTENT_TYPE_ACTIVITY:
333
                 case CommConstant.POSTER_CONTENT_TYPE_ACTIVITY:
329
                     e.setActivityShareNum(shareNum);
334
                     e.setActivityShareNum(shareNum);
340
                 case CommConstant.POSTER_CONTENT_TYPE_BUILDING:
345
                 case CommConstant.POSTER_CONTENT_TYPE_BUILDING:
341
                     e.setBuildingNum(shareNum);
346
                     e.setBuildingNum(shareNum);
342
                     break;
347
                     break;
343
-                case CommConstant.TARGET_TYPE_H5:
348
+                case CommConstant.EVENT_H5:
344
                     e.setDrainageShareNum(shareNum);
349
                     e.setDrainageShareNum(shareNum);
345
                     break;
350
                     break;
346
             }
351
             }

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaPersonVisitRecordMapper.java 查看文件

80
 
80
 
81
     IPage<TaConsultantInfo> getConsultantShareInfoList(IPage<TaConsultantInfo> pg, @Param("userId") Integer userId, @Param("orgId") Integer orgId);
81
     IPage<TaConsultantInfo> getConsultantShareInfoList(IPage<TaConsultantInfo> pg, @Param("userId") Integer userId, @Param("orgId") Integer orgId);
82
 
82
 
83
-    Integer countShareNumByEventType(@Param("targetId") String targetId, @Param("orgId")Integer orgId, @Param("userId")Integer userId, @Param("eventType")String eventType);
83
+    Integer countShareNumByEventType(@Param("targetId") String targetId, @Param("orgId")Integer orgId, @Param("userId")Integer userId, @Param("eventType")String eventType, @Param("personId")String personId);
84
 }
84
 }

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

53
 
53
 
54
 	IPage<TaConsultantInfo> getConsultantShareInfoList(IPage<TaConsultantInfo> pg, Integer userId, Integer orgId);
54
 	IPage<TaConsultantInfo> getConsultantShareInfoList(IPage<TaConsultantInfo> pg, Integer userId, Integer orgId);
55
 
55
 
56
-	Integer countShareNumByEventType(String targetId, Integer orgId, Integer userId, String eventType);
56
+	Integer countShareNumByEventType(String targetId, Integer orgId, Integer userId, String eventType, String personId);
57
 }
57
 }

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

163
 	}
163
 	}
164
 
164
 
165
 	@Override
165
 	@Override
166
-	public Integer countShareNumByEventType(String targetId, Integer orgId, Integer userId, String eventType) {
167
-		return personVisitRecordMapper.countShareNumByEventType(targetId, orgId, userId, eventType);
166
+	public Integer countShareNumByEventType(String targetId, Integer orgId, Integer userId, String eventType, String personId) {
167
+		return personVisitRecordMapper.countShareNumByEventType(targetId, orgId, userId, eventType, personId);
168
 	}
168
 	}
169
 
169
 
170
 	/**
170
 	/**

+ 16
- 0
src/main/resources/mapper/TaPersonVisitRecordMapper.xml 查看文件

185
     <select id="getConsultantShareInfoList" resultType="com.huiju.estateagents.entity.TaConsultantInfo">
185
     <select id="getConsultantShareInfoList" resultType="com.huiju.estateagents.entity.TaConsultantInfo">
186
         select * From (
186
         select * From (
187
         select
187
         select
188
+        t.target_id,
188
         a.url as activity_img,
189
         a.url as activity_img,
189
         a.building_name as activity_name,
190
         a.building_name as activity_name,
190
         a.building_name,
191
         a.building_name,
203
         union all
204
         union all
204
 
205
 
205
         select
206
         select
207
+        t.target_id,
206
         b.list_img_url as activity_img,
208
         b.list_img_url as activity_img,
207
         b.title as activity_name,
209
         b.title as activity_name,
208
         '1' as price,
210
         '1' as price,
221
         union all
223
         union all
222
 
224
 
223
         select
225
         select
226
+        t.target_id,
224
         c.list_img as activity_img,
227
         c.list_img as activity_img,
225
         c.title as activity_name,
228
         c.title as activity_name,
226
         '1' as price,
229
         '1' as price,
239
         union all
242
         union all
240
 
243
 
241
         select
244
         select
245
+        t.target_id,
242
         d.list_img as activity_img,
246
         d.list_img as activity_img,
243
         d.activity_name as activity_name,
247
         d.activity_name as activity_name,
244
         '1' as price,
248
         '1' as price,
257
         union all
261
         union all
258
 
262
 
259
         select
263
         select
264
+        t.target_id,
260
         e.news_img as activity_img,
265
         e.news_img as activity_img,
261
         e.news_name as activity_name,
266
         e.news_name as activity_name,
262
         '1' as price,
267
         '1' as price,
275
         union all
280
         union all
276
 
281
 
277
         select
282
         select
283
+        t.target_id,
278
         f.share_img as activity_img,
284
         f.share_img as activity_img,
279
         f.`name` as activity_name,
285
         f.`name` as activity_name,
280
         '1' as price,
286
         '1' as price,
292
     </select>
298
     </select>
293
 
299
 
294
     <select id="countShareNumByEventType" resultType="java.lang.Integer">
300
     <select id="countShareNumByEventType" resultType="java.lang.Integer">
301
+		select count(1) from (
302
+				 SELECT
303
+            t.*
304
+        FROM
305
+            ( SELECT t.* FROM ta_person_visit_record t WHERE org_id = #{orgId} and target_id = #{targetId}  AND consultant_id = #{userId} and person_id != #{personId} and t.event_type = #{eventType} ORDER BY visit_time DESC LIMIT 999) t
306
+            left JOIN ta_person p on t.person_id = p.person_id
307
+        GROUP BY
308
+            t.person_id
309
+	        t.visit_time DESC ) t;
310
+        ORDER BY
295
         select count(DISTINCT t.person_id) from ta_person_visit_record t
311
         select count(DISTINCT t.person_id) from ta_person_visit_record t
296
         where
312
         where
297
         t.consultant_id = #{userId}
313
         t.consultant_id = #{userId}