소스 검색

Merge branch 'dev'

# Conflicts:
#	src/main/java/com/huiju/estateagents/controller/TaCustomImgController.java
傅行帆 5 년 전
부모
커밋
421da1abea
2개의 변경된 파일19개의 추가작업 그리고 6개의 파일을 삭제
  1. 13
    0
      src/main/java/com/huiju/estateagents/controller/MiniAppController.java
  2. 6
    6
      src/main/resources/mapper/TaPersonVisitRecordMapper.xml

+ 13
- 0
src/main/java/com/huiju/estateagents/controller/MiniAppController.java 파일 보기

@@ -22,6 +22,7 @@ import com.huiju.estateagents.common.JWTUtils;
22 22
 import com.huiju.estateagents.third.entity.TaThirdPartyMiniappConfig;
23 23
 import com.huiju.estateagents.third.service.ITaThirdPartyMiniappConfigService;
24 24
 import me.chanjar.weixin.common.error.WxErrorException;
25
+import org.apache.commons.collections.CollectionUtils;
25 26
 import org.apache.commons.lang3.StringUtils;
26 27
 import org.apache.http.HttpStatus;
27 28
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,6 +32,7 @@ import org.springframework.web.bind.annotation.*;
31 32
 import javax.annotation.Resource;
32 33
 import javax.servlet.http.HttpServletRequest;
33 34
 import java.time.LocalDateTime;
35
+import java.util.Collections;
34 36
 import java.util.HashMap;
35 37
 import java.util.List;
36 38
 import java.util.Map;
@@ -77,6 +79,9 @@ public class MiniAppController extends BaseController {
77 79
     @Autowired
78 80
     public ITaThirdPartyMiniappConfigService iTaThirdPartyMiniappConfigService;
79 81
 
82
+    @Autowired
83
+    private ITaCustomImgService iTaCustomImgService;
84
+
80 85
 
81 86
     /**
82 87
      * 验证接入
@@ -220,6 +225,14 @@ public class MiniAppController extends BaseController {
220 225
             result.put("extraInfo", extraInfo);
221 226
             result.put("miniAuthorized", null != taPerson.getAvatarurl() && taPerson.getAvatarurl().indexOf("wx.qlogo.cn") > 0);
222 227
 
228
+            //返回是否授权标识
229
+            QueryWrapper<TaCustomImg> queryWrapper = new QueryWrapper<>();
230
+            queryWrapper.eq("org_id", getOrgId(request));
231
+            queryWrapper.eq("img_type", "auth");
232
+            List<TaCustomImg>  taCustomImgs = iTaCustomImgService.list(queryWrapper);
233
+            result.put("avatarAuth", CollectionUtils.isEmpty(taCustomImgs) ? false : "1".equals(taCustomImgs.get(0).getImgUrl()) ? true: false);
234
+
235
+
223 236
             String token = (String) miniResp.get("token");
224 237
             sysTokenService.saveToken(token);
225 238
 

+ 6
- 6
src/main/resources/mapper/TaPersonVisitRecordMapper.xml 파일 보기

@@ -215,7 +215,7 @@
215 215
                 where t.event_type = 'building'
216 216
                 and t.consultant_id = #{userId}
217 217
                 and t.org_id = #{orgId}
218
-                and t.`event` = 'share' order by t.visit_time desc
218
+                and t.`event` = 'share' order by t.visit_time desc limit 9999
219 219
             ) t
220 220
             group by t.target_id
221 221
 
@@ -236,7 +236,7 @@
236 236
         where t.event_type = 'activity'
237 237
         and t.consultant_id = #{userId}
238 238
         and t.org_id = #{orgId}
239
-        and t.`event` = 'share' order by t.visit_time desc
239
+        and t.`event` = 'share' order by t.visit_time desc limit 9999
240 240
         ) t
241 241
         group by t.target_id
242 242
 
@@ -257,7 +257,7 @@
257 257
         where t.event_type = 'help'
258 258
         and t.consultant_id = #{userId}
259 259
         and t.org_id = #{orgId}
260
-        and t.`event` = 'share' order by t.visit_time desc
260
+        and t.`event` = 'share' order by t.visit_time desc limit 9999
261 261
         ) t
262 262
         group by t.target_id
263 263
 
@@ -279,7 +279,7 @@
279 279
         and t.consultant_id = #{userId}
280 280
         and t.org_id = #{orgId}
281 281
         and t.`event` = 'share'
282
-        group by t.target_id order by t.visit_time desc
282
+        group by t.target_id order by t.visit_time desc limit 9999
283 283
         ) t
284 284
 
285 285
         union all
@@ -299,7 +299,7 @@
299 299
         where t.event_type = 'news'
300 300
         and t.consultant_id = #{userId}
301 301
         and t.org_id = #{orgId}
302
-        and t.`event` = 'share' order by t.visit_time desc
302
+        and t.`event` = 'share' order by t.visit_time desc limit 9999
303 303
         ) t
304 304
         group by t.target_id
305 305
 
@@ -320,7 +320,7 @@
320 320
             where t.event_type = 'h5'
321 321
             and t.consultant_id = #{userId}
322 322
             and t.org_id = #{orgId}
323
-            and t.`event` = 'share' order by t.visit_time desc
323
+            and t.`event` = 'share' order by t.visit_time desc limit 9999
324 324
             ) t
325 325
             group by t.target_id
326 326
         ) t