Explorar el Código

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

傅行帆 hace 5 años
padre
commit
390529b9d0

+ 10
- 5
src/main/java/com/huiju/estateagents/channel/sysChannel/controller/SysUserChannelController.java Ver fichero

@@ -19,6 +19,7 @@ import com.huiju.estateagents.common.JWTUtils;
19 19
 import com.huiju.estateagents.common.MD5Utils;
20 20
 import com.huiju.estateagents.entity.TaChannelAppRelation;
21 21
 import com.huiju.estateagents.service.ITaChannelAppRelationService;
22
+import org.apache.commons.collections.CollectionUtils;
22 23
 import org.slf4j.Logger;
23 24
 import org.slf4j.LoggerFactory;
24 25
 import org.springframework.beans.factory.annotation.Autowired;
@@ -233,6 +234,7 @@ public class SysUserChannelController extends BaseController {
233 234
             return responseBean;
234 235
         }
235 236
 
237
+        taChannelProxy.setExpireDate(taChannelProxy.getExpireDate().plusDays(1L));
236 238
         //更新业务层的登录账号为禁用
237 239
         if (taChannelProxy.getStatus() != null){
238 240
             QueryWrapper<TaChannelAppRelation> taChannelAppRelationQueryWrapper = new QueryWrapper<>();
@@ -242,11 +244,14 @@ public class SysUserChannelController extends BaseController {
242 244
             taChannelAppRelation.forEach(e->{
243 245
                 orgIdList.add(e.getOrgId());
244 246
             });
245
-            QueryWrapper<TaUser> taUserQueryWrapper = new QueryWrapper<>();
246
-            taUserQueryWrapper.in("org_id", orgIdList);
247
-            TaUser taUser = new TaUser();
248
-            taUser.setStatus(taChannelProxy.getStatus());
249
-            iTaUserService.update(taUser, taUserQueryWrapper);
247
+            if (CollectionUtils.isNotEmpty(orgIdList)){
248
+                QueryWrapper<TaUser> taUserQueryWrapper = new QueryWrapper<>();
249
+                taUserQueryWrapper.in("org_id", orgIdList);
250
+                TaUser taUser = new TaUser();
251
+                taUser.setStatus(taChannelProxy.getStatus());
252
+                iTaUserService.update(taUser, taUserQueryWrapper);
253
+            }
254
+
250 255
         }
251 256
 
252 257
         QueryWrapper<TaChannelProxy> taChannelProxyQueryWrapper = new QueryWrapper<>();

+ 2
- 2
src/main/java/com/huiju/estateagents/excel/TaActivityDynamicEnlistExport.java Ver fichero

@@ -41,10 +41,10 @@ public class TaActivityDynamicEnlistExport implements Serializable {
41 41
      * 推广人
42 42
      */
43 43
     @ColumnWidth(15)
44
-    @ExcelProperty(value = "推广人", index = 4)
44
+    @ExcelProperty(value = "引流人", index = 4)
45 45
     private String sharePersonName;
46 46
 
47
-    /**
47
+    /*
48 48
      * 公司
49 49
      */
50 50
     @ColumnWidth(15)

+ 1
- 1
src/main/java/com/huiju/estateagents/interceptor/AccessInterceptor.java Ver fichero

@@ -145,7 +145,7 @@ public class AccessInterceptor implements HandlerInterceptor {
145 145
             // 只尝试去解析
146 146
             Jwts.parser().setSigningKey(JWTUtils.key).parseClaimsJws(jwtAuths[1]);
147 147
         } catch (ExpiredJwtException e) {
148
-            ResponseBean resp = ResponseBean.error("权限验证非法, Token 已过期", ResponseBean.ERROR_AUTH_EXPIRED);
148
+            ResponseBean resp = ResponseBean.error("权限验证非法, 身份信息已过期", ResponseBean.ERROR_AUTH_EXPIRED);
149 149
             response.addHeader("Content-type", "application/json");
150 150
             response.getOutputStream().write(JSONObject.toJSONBytes(resp));
151 151
             return false;

+ 11
- 5
src/main/java/com/huiju/estateagents/service/impl/TaBuildingServiceImpl.java Ver fichero

@@ -304,7 +304,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
304 304
 
305 305
         boolean isMainMoreThanTenFlag = publishCountIsMainBuilding(building, orgId, null, "update");
306 306
         if (!isMainMoreThanTenFlag){
307
-            responseBean.addError("每个城市只能推荐10个楼盘到首页,请先将已推荐楼盘取消推荐后再推荐当前楼盘。");
307
+            responseBean.addError("当前城市最多只能推荐10个项目至首页哦。");
308 308
             return responseBean;
309 309
         }
310 310
 
@@ -458,6 +458,12 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
458 458
 
459 459
         TaBuilding building = object.toJavaObject(TaBuilding.class);
460 460
 
461
+        boolean isMainMoreThanTenFlag = publishCountIsMainBuilding(building, orgId, null, "add");
462
+        if (!isMainMoreThanTenFlag){
463
+            responseBean.addError("当前城市最多只能推荐10个项目至首页哦。");
464
+            return responseBean;
465
+        }
466
+
461 467
         building.setCreateDate(LocalDateTime.now());
462 468
         building.setStatus(2);
463 469
         building.setOrgId(orgId);
@@ -553,7 +559,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
553 559
 
554 560
         boolean isMainMoreThanTenFlag = publishCountIsMainBuilding(taBuildingMapper.selectOne(buildingIdQueryWrapper), orgId, status, "updateStatus");
555 561
         if (!isMainMoreThanTenFlag){
556
-            responseBean.addError("每个城市只能推荐10个楼盘到首页,请先将已推荐楼盘取消推荐后再推荐当前楼盘。");
562
+            responseBean.addError("当前城市最多只能推荐10个项目至首页哦");
557 563
             return responseBean;
558 564
         }
559 565
 
@@ -944,9 +950,9 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
944 950
         if (taBuilding.getIsMain() != 1){
945 951
             return true;
946 952
         }
947
-        if (operte.equals("update") && (info.getStatus() == 2)){
948
-            return true;
949
-        }
953
+//        if (operte.equals("update") && (info.getStatus() == 2)){
954
+//            return true;
955
+//        }
950 956
         if (operte.equals("updateStatus") && status == 2){
951 957
             return true;
952 958
         }

+ 1
- 1
src/main/java/com/huiju/estateagents/service/impl/TaPersonVisitRecordServiceImpl.java Ver fichero

@@ -132,7 +132,7 @@ public class TaPersonVisitRecordServiceImpl extends ServiceImpl<TaPersonVisitRec
132 132
 				e.setUserTel(personInfo.getPhone());
133 133
 			}
134 134
 
135
-			TaPerson userShareInfo = taPersonMapper.selectById(e.getSharePersonId());
135
+			TaPerson userShareInfo = taPersonMapper.selectById(e.getPersonId());
136 136
 			if (userShareInfo != null) {
137 137
 				e.setShareName(userShareInfo.getNickname());
138 138
 				e.setShareTel(userShareInfo.getPhone());

+ 4
- 0
src/main/java/com/huiju/estateagents/service/impl/TaShareServiceImpl.java Ver fichero

@@ -71,6 +71,10 @@ public class TaShareServiceImpl extends ServiceImpl<TaShareMapper, TaShare> impl
71 71
         queryWrapper.eq("tagert_type", typeOf);
72 72
         List<TaShare> uvs = taShareMapper.selectList(queryWrapper);
73 73
         if (null != uvs && uvs.size() > 0) {
74
+            //更新分享为最新时间
75
+            TaShare taShare = new TaShare();
76
+            taShare.setCreateDate(LocalDateTime.now());
77
+            taShareMapper.update(taShare, queryWrapper);
74 78
             return ResponseBean.success("");
75 79
         }
76 80
 

+ 33
- 29
src/main/resources/mapper/TaPersonVisitRecordMapper.xml Ver fichero

@@ -123,7 +123,7 @@
123 123
 
124 124
     <select id="getWxActivityVisitRecordList" resultType="com.huiju.estateagents.entity.TaPersonVisitRecord">
125 125
         SELECT
126
-            t.* ,
126
+            t.share_from_id, t.share_person as consultant_id, t.share_person_type, t.person_id, t.target_type, t.target_id, t.create_date as visit_time, t.org_id ,building_id, t.status, t.is_first_time,
127 127
 	        p.`name` as user_name,
128 128
 	        p.`nickname` as nickname,
129 129
 	        p.avatarurl
@@ -154,7 +154,12 @@
154 154
     <select id="getDrainageVisitRecord" resultType="com.huiju.estateagents.entity.TaPersonVisitRecord">
155 155
         select * from (
156 156
             select
157
-            <include refid="columnSql"></include>,
157
+<!--            <include refid="columnSql"></include>,-->
158
+            t.person_id,
159
+            c.person_type,
160
+            t.create_date as visit_time,
161
+            t.tagert_type as event_type,
162
+            t.be_share as target_id,
158 163
             b.name as drainageName,
159 164
             d.building_name as buildingName,
160 165
             tn.news_name as newsName,
@@ -162,26 +167,25 @@
162 167
             tsa.activity_name as groupActivityName,
163 168
             tbd.title as activityName,
164 169
             b.drainage_id
165
-            from ta_person_visit_record t
166
-            left join ta_drainage b on t.target_id = b.drainage_id
167
-            left join ta_building d on t.target_id = d.building_id
168
-            left join ta_news tn on t.target_id = tn.news_id
169
-            left join ta_help_activity tha on t.target_id = tha.help_activity_id
170
-            left join ta_share_activity tsa on t.target_id = tsa.group_activity_id
171
-            left join ta_building_dynamic tbd on t.target_id = tbd.dynamic_id
172
-            left join ta_person c on t.share_person_id = c.person_id
173
-            where
174
-            t.share_person_id != t.person_id and t.share_person_id is not null and t.share_person_id != ''
170
+            from ta_share t
171
+            left join ta_drainage b on t.be_share = b.drainage_id
172
+            left join ta_building d on t.be_share = d.building_id
173
+            left join ta_news tn on t.be_share = tn.news_id
174
+            left join ta_help_activity tha on t.be_share = tha.help_activity_id
175
+            left join ta_share_activity tsa on t.be_share = tsa.group_activity_id
176
+            left join ta_building_dynamic tbd on t.be_share = tbd.dynamic_id
177
+            left join ta_person c on t.person_id = c.person_id
178
+            where 1=1
175 179
             <if test="orgId != null and orgId != ''">
176
-                and t.org_id = #{orgId}
180
+                and c.org_id = #{orgId}
177 181
             </if>
178 182
             <if test="eventType !=null and eventType != ''">
179
-                and t.event_type = #{eventType}
183
+                and t.tagert_type = #{eventType}
180 184
             </if>
181 185
             <if test="activityName !=null and activityName != ''">
182 186
                 and (
183
-                (b.name like concat('%',#{activityName},'%') and t.event_type = 'h5')or (d.name like concat('%',#{activityName},'%') and t.event_type = 'building') or (tn.news_name like concat('%',#{activityName},'%') and t.event_type = 'news')
184
-                or (tha.title like concat( '%', #{activityName}, '%' ) and t.event_type = 'help')  or (tsa.activity_name like concat('%',#{activityName},'%') and t.event_type = 'group') or (tbd.title like concat('%',#{activityName},'%') and t.event_type = 'activity')
187
+                (b.name like concat('%',#{activityName},'%') and t.tagert_type = 'h5')or (d.name like concat('%',#{activityName},'%') and t.tagert_type = 'building') or (tn.news_name like concat('%',#{activityName},'%') and t.tagert_type = 'news')
188
+                or (tha.title like concat( '%', #{activityName}, '%' ) and t.tagert_type = 'help')  or (tsa.activity_name like concat('%',#{activityName},'%') and t.tagert_type = 'group') or (tbd.title like concat('%',#{activityName},'%') and t.tagert_type = 'activity')
185 189
                 )
186 190
             </if>
187 191
             <if test="shareName !=null and shareName != ''">
@@ -191,23 +195,23 @@
191 195
                 and c.phone = #{shareTel}
192 196
             </if>
193 197
             <if test="personType == 'Realty Consultant'">
194
-                and t.consultant_id is not null  and t.consultant_id != ''
198
+                and c.person_type = 'Realty Consultant'
195 199
             </if>
196 200
             <if test="personType == 'customer'">
197
-                and t.consultant_id is null
201
+                and c.person_type != 'Realty Consultant'
198 202
             </if>
199 203
             <if test="buildingId !=null and buildingId != ''">
200
-                and t.building_id = #{buildingId}
204
+                and d.building_id = #{buildingId}
201 205
             </if>
202 206
             <if test="personBuildingList != null and personBuildingList.size > 0">
203
-                AND t.building_id in
207
+                AND d.building_id in
204 208
                 <foreach collection="personBuildingList" item="personBuilding" open="(" close=")" separator=",">
205 209
                     #{personBuilding.buildingId}
206 210
                 </foreach>
207 211
             </if>
208
-            order by t.visit_time desc
212
+            order by t.create_date desc
209 213
         ) t
210
-        group by t.person_id, t.share_person_id,t.target_id,t.event_type
214
+        group by t.person_id, t.target_id,t.event_type
211 215
         order by t.visit_time desc
212 216
     </select>
213 217
 
@@ -222,7 +226,7 @@
222 226
                 a.address,
223 227
                 a.price,
224 228
                 t.tagert_type as eventType,
225
-				t.create_date
229
+				t.create_date as visit_time
226 230
                 from ta_share t
227 231
                 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.be_share = a.building_id
228 232
                 where t.tagert_type = 'project'
@@ -241,7 +245,7 @@
241 245
         '2' as building_name,
242 246
         '3' as address,
243 247
         t.tagert_type as eventType,
244
-		t.create_date
248
+		t.create_date as visit_time
245 249
         from ta_share t
246 250
         left join ta_building_dynamic b on t.be_share = b.dynamic_id
247 251
         where t.tagert_type = 'activity'
@@ -260,7 +264,7 @@
260 264
         '2' as building_name,
261 265
         '3' as address,
262 266
         t.tagert_type as eventType,
263
-		t.create_date
267
+		t.create_date as visit_time
264 268
         from ta_share t
265 269
         left join ta_help_activity c on t.be_share = c.help_activity_id
266 270
         where t.tagert_type = 'help'
@@ -279,7 +283,7 @@
279 283
         '2' as building_name,
280 284
         '3' as address,
281 285
         t.tagert_type as eventType,
282
-		t.create_date
286
+		t.create_date as visit_time
283 287
         from ta_share t
284 288
         left join ta_share_activity d on t.be_share = d.group_activity_id
285 289
         where t.tagert_type = 'group'
@@ -298,7 +302,7 @@
298 302
         '2' as building_name,
299 303
         '3' as address,
300 304
         t.tagert_type as eventType,
301
-		t.create_date
305
+		t.create_date as visit_time
302 306
         from ta_share t
303 307
         left join ta_news e on t.be_share = e.news_id
304 308
         where t.tagert_type = 'news'
@@ -317,7 +321,7 @@
317 321
             '2' as building_name,
318 322
             '3' as address,
319 323
 			t.tagert_type as eventType,
320
-			t.create_date
324
+			t.create_date as visit_time
321 325
             from ta_share t
322 326
             left join ta_drainage f on t.be_share = f.drainage_id
323 327
             where t.tagert_type = 'h5'
@@ -325,7 +329,7 @@
325 329
             ) t
326 330
             group by t.target_id
327 331
         ) t
328
-        order by t.create_date desc
332
+        order by t.visit_time desc
329 333
     </select>
330 334
 
331 335
     <select id="countShareNumByEventType" resultType="java.lang.Integer">

+ 6
- 2
src/main/resources/mapper/TaRecommendCustomerMapper.xml Ver fichero

@@ -559,6 +559,7 @@ FROM
559 559
                 and b.tel like CONCAT('%',#{consultTel}, '%')
560 560
             </if>
561 561
             and NOT EXISTS ( select * from ta_recommend_customer a where a.recommend_person = b.person_id)
562
+            AND b.person_id not IN ( SELECT c.person_id FROM ta_recommend_customer c WHERE c.org_id = #{orgId} AND person_id is not null AND person_id != ''  )
562 563
         </where>
563 564
         order by b.create_date desc
564 565
         limit #{pageCode}, #{pageSize}
@@ -632,11 +633,14 @@ FROM
632 633
         FROM
633 634
         ta_recommend_customer a
634 635
         LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
635
-        left join ta_person c on a.realty_consultant = c.user_id
636
+        LEFT JOIN ta_person c ON a.realty_consultant = c.user_id
637
+        LEFT JOIN ta_user d on d.user_id = a.realty_consultant
638
+        LEFT JOIN ta_person_from_record p ON a.person_id = p.person_id AND p.is_first_time = 1
636 639
         <where>
637 640
             a.status > 0
638 641
             and a.verify_status = 1
639
-            and realty_consultant is not null
642
+            and a.realty_consultant is not null
643
+            and a.realty_consultant != ''
640 644
             <if test="orgId != null">
641 645
                 and a.org_id = #{orgId}
642 646
             </if>