瀏覽代碼

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

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

+ 1
- 6
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
-            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());
326
+            Integer shareNum = iTaPersonVisitRecordService.countShareNumByEventType(e.getTargetId(), getOrgId(request), userId, e.getEventType());
332
             switch (e.getEventType()){
327
             switch (e.getEventType()){
333
                 case CommConstant.POSTER_CONTENT_TYPE_ACTIVITY:
328
                 case CommConstant.POSTER_CONTENT_TYPE_ACTIVITY:
334
                     e.setActivityShareNum(shareNum);
329
                     e.setActivityShareNum(shareNum);

+ 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, @Param("personId")String personId);
83
+    Integer countShareNumByEventType(@Param("targetId") String targetId, @Param("orgId")Integer orgId, @Param("userId")Integer userId, @Param("eventType")String eventType);
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, String personId);
56
+	Integer countShareNumByEventType(String targetId, Integer orgId, Integer userId, String eventType);
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, String personId) {
167
-		return personVisitRecordMapper.countShareNumByEventType(targetId, orgId, userId, eventType, personId);
166
+	public Integer countShareNumByEventType(String targetId, Integer orgId, Integer userId, String eventType) {
167
+		return personVisitRecordMapper.countShareNumByEventType(targetId, orgId, userId, eventType);
168
 	}
168
 	}
169
 
169
 
170
 	/**
170
 	/**

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

242
 
242
 
243
 		// 发放积分
243
 		// 发放积分
244
 		TaPerson taPerson = taPersonMapper.getById(taRecommendCustomer.getRecommendPerson());
244
 		TaPerson taPerson = taPersonMapper.getById(taRecommendCustomer.getRecommendPerson());
245
-		if (savePoints(taPerson, changeType, changeParams, pointsAmount, orgId)) {
245
+		if (null != taPerson && savePoints(taPerson, changeType, changeParams, pointsAmount, orgId)) {
246
 			taPersonMapper.setFieldIncrement(taPerson.getPersonId(), "points", pointsAmount);
246
 			taPersonMapper.setFieldIncrement(taPerson.getPersonId(), "points", pointsAmount);
247
 		}
247
 		}
248
 	}
248
 	}

+ 7
- 6
src/main/resources/mapper/HelpActivityMapper.xml 查看文件

72
                 a.end_date as endDate,
72
                 a.end_date as endDate,
73
                 a.`status` as status,
73
                 a.`status` as status,
74
                 a.activity_status as activityStatus,
74
                 a.activity_status as activityStatus,
75
-				"help" AS type
75
+				"help" AS type,
76
+                a.heavy
76
 			FROM
77
 			FROM
77
 				ta_help_activity a
78
 				ta_help_activity a
78
 				WHERE
79
 				WHERE
86
                 <if test="buildingId != null and buildingId != ''">
87
                 <if test="buildingId != null and buildingId != ''">
87
                   and a.building_id = #{buildingId}
88
                   and a.building_id = #{buildingId}
88
                 </if>
89
                 </if>
89
-                 order  by a.heavy desc
90
 		)
90
 		)
91
 		UNION ALL
91
 		UNION ALL
92
 			(
92
 			(
99
                     s.end_time as endDate,
99
                     s.end_time as endDate,
100
                     s.status as status,
100
                     s.status as status,
101
                     s.activity_status as activityStatus,
101
                     s.activity_status as activityStatus,
102
-					"group" AS type
102
+					"group" AS type,
103
+                    s.heavy
103
 				FROM
104
 				FROM
104
 					ta_share_activity s
105
 					ta_share_activity s
105
 					WHERE
106
 					WHERE
113
                 <if test="buildingId != null and buildingId != ''">
114
                 <if test="buildingId != null and buildingId != ''">
114
                     and s.building_id = #{buildingId}
115
                     and s.building_id = #{buildingId}
115
                 </if>
116
                 </if>
116
-                order  by s.heavy desc
117
 			)
117
 			)
118
 		UNION ALL
118
 		UNION ALL
119
 		    (
119
 		    (
126
                 t.end_date as endDate,
126
                 t.end_date as endDate,
127
                 t.status as status,
127
                 t.status as status,
128
                 t.activity_status as activityStatus,
128
                 t.activity_status as activityStatus,
129
-                "activity" AS type
129
+                "activity" AS type,
130
+                t.heavy
130
                 FROM
131
                 FROM
131
                 ta_building_dynamic t
132
                 ta_building_dynamic t
132
                 WHERE
133
                 WHERE
140
                 <if test="buildingId != null and buildingId != ''">
141
                 <if test="buildingId != null and buildingId != ''">
141
                     and t.building_id = #{buildingId}
142
                     and t.building_id = #{buildingId}
142
                 </if>
143
                 </if>
143
-                order  by t.heavy desc
144
             )
144
             )
145
+            order by heavy
145
     </select>
146
     </select>
146
 
147
 
147
     <select id="helpActivityListEffectivePage" resultType="com.huiju.estateagents.entity.HelpActivity">
148
     <select id="helpActivityListEffectivePage" resultType="com.huiju.estateagents.entity.HelpActivity">

+ 3
- 13
src/main/resources/mapper/TaPersonVisitRecordMapper.xml 查看文件

141
             left join ta_building_dynamic tbd on t.target_id = tbd.dynamic_id
141
             left join ta_building_dynamic tbd on t.target_id = tbd.dynamic_id
142
             left join ta_person c on t.share_person_id = c.person_id
142
             left join ta_person c on t.share_person_id = c.person_id
143
             where
143
             where
144
-            1=1
144
+            t.share_person_id is not null and t.share_person_id != ''
145
             <if test="orgId != null and orgId != ''">
145
             <if test="orgId != null and orgId != ''">
146
                 and t.org_id = #{orgId}
146
                 and t.org_id = #{orgId}
147
             </if>
147
             </if>
274
         where t.event_type = 'news'
273
         where t.event_type = 'news'
275
         and t.consultant_id = #{userId}
274
         and t.consultant_id = #{userId}
276
         and t.org_id = #{orgId}
275
         and t.org_id = #{orgId}
277
-        group by t.target_id
278
         and t.`event` = 'share'
276
         and t.`event` = 'share'
277
+        group by t.target_id
279
 
278
 
280
         union all
279
         union all
281
 
280
 
298
     </select>
297
     </select>
299
 
298
 
300
     <select id="countShareNumByEventType" resultType="java.lang.Integer">
299
     <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
311
-        select count(DISTINCT t.person_id) from ta_person_visit_record t
300
+        select count(DISTINCT t.person_id)  from ta_person_visit_record t
312
         where
301
         where
313
         t.consultant_id = #{userId}
302
         t.consultant_id = #{userId}
314
         and t.org_id = #{orgId}
303
         and t.org_id = #{orgId}