Преглед на файлове

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,12 +323,7 @@ public class TaPersonVisitRecordController extends BaseController {
323 323
 
324 324
         List<TaConsultantInfo> taConsultantInfos = result.getRecords();
325 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 327
             switch (e.getEventType()){
333 328
                 case CommConstant.POSTER_CONTENT_TYPE_ACTIVITY:
334 329
                     e.setActivityShareNum(shareNum);

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaPersonVisitRecordMapper.java Целия файл

@@ -80,5 +80,5 @@ public interface TaPersonVisitRecordMapper extends BaseMapper<TaPersonVisitRecor
80 80
 
81 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,5 +53,5 @@ public interface ITaPersonVisitRecordService extends IService<TaPersonVisitRecor
53 53
 
54 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,8 +163,8 @@ public class TaPersonVisitRecordServiceImpl extends ServiceImpl<TaPersonVisitRec
163 163
 	}
164 164
 
165 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,7 +242,7 @@ public class TaPointsRecordsServiceImpl extends ServiceImpl<TaPointsRecordsMappe
242 242
 
243 243
 		// 发放积分
244 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 246
 			taPersonMapper.setFieldIncrement(taPerson.getPersonId(), "points", pointsAmount);
247 247
 		}
248 248
 	}

+ 7
- 6
src/main/resources/mapper/HelpActivityMapper.xml Целия файл

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

+ 3
- 13
src/main/resources/mapper/TaPersonVisitRecordMapper.xml Целия файл

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