Browse Source

Merge branch 'dev'

# Conflicts:
#	src/main/java/com/huiju/estateagents/controller/TaCustomImgController.java
傅行帆 5 years ago
parent
commit
421da1abea

+ 13
- 0
src/main/java/com/huiju/estateagents/controller/MiniAppController.java View File

22
 import com.huiju.estateagents.third.entity.TaThirdPartyMiniappConfig;
22
 import com.huiju.estateagents.third.entity.TaThirdPartyMiniappConfig;
23
 import com.huiju.estateagents.third.service.ITaThirdPartyMiniappConfigService;
23
 import com.huiju.estateagents.third.service.ITaThirdPartyMiniappConfigService;
24
 import me.chanjar.weixin.common.error.WxErrorException;
24
 import me.chanjar.weixin.common.error.WxErrorException;
25
+import org.apache.commons.collections.CollectionUtils;
25
 import org.apache.commons.lang3.StringUtils;
26
 import org.apache.commons.lang3.StringUtils;
26
 import org.apache.http.HttpStatus;
27
 import org.apache.http.HttpStatus;
27
 import org.springframework.beans.factory.annotation.Autowired;
28
 import org.springframework.beans.factory.annotation.Autowired;
31
 import javax.annotation.Resource;
32
 import javax.annotation.Resource;
32
 import javax.servlet.http.HttpServletRequest;
33
 import javax.servlet.http.HttpServletRequest;
33
 import java.time.LocalDateTime;
34
 import java.time.LocalDateTime;
35
+import java.util.Collections;
34
 import java.util.HashMap;
36
 import java.util.HashMap;
35
 import java.util.List;
37
 import java.util.List;
36
 import java.util.Map;
38
 import java.util.Map;
77
     @Autowired
79
     @Autowired
78
     public ITaThirdPartyMiniappConfigService iTaThirdPartyMiniappConfigService;
80
     public ITaThirdPartyMiniappConfigService iTaThirdPartyMiniappConfigService;
79
 
81
 
82
+    @Autowired
83
+    private ITaCustomImgService iTaCustomImgService;
84
+
80
 
85
 
81
     /**
86
     /**
82
      * 验证接入
87
      * 验证接入
220
             result.put("extraInfo", extraInfo);
225
             result.put("extraInfo", extraInfo);
221
             result.put("miniAuthorized", null != taPerson.getAvatarurl() && taPerson.getAvatarurl().indexOf("wx.qlogo.cn") > 0);
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
             String token = (String) miniResp.get("token");
236
             String token = (String) miniResp.get("token");
224
             sysTokenService.saveToken(token);
237
             sysTokenService.saveToken(token);
225
 
238
 

+ 6
- 6
src/main/resources/mapper/TaPersonVisitRecordMapper.xml View File

215
                 where t.event_type = 'building'
215
                 where t.event_type = 'building'
216
                 and t.consultant_id = #{userId}
216
                 and t.consultant_id = #{userId}
217
                 and t.org_id = #{orgId}
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
             ) t
219
             ) t
220
             group by t.target_id
220
             group by t.target_id
221
 
221
 
236
         where t.event_type = 'activity'
236
         where t.event_type = 'activity'
237
         and t.consultant_id = #{userId}
237
         and t.consultant_id = #{userId}
238
         and t.org_id = #{orgId}
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
         ) t
240
         ) t
241
         group by t.target_id
241
         group by t.target_id
242
 
242
 
257
         where t.event_type = 'help'
257
         where t.event_type = 'help'
258
         and t.consultant_id = #{userId}
258
         and t.consultant_id = #{userId}
259
         and t.org_id = #{orgId}
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
         ) t
261
         ) t
262
         group by t.target_id
262
         group by t.target_id
263
 
263
 
279
         and t.consultant_id = #{userId}
279
         and t.consultant_id = #{userId}
280
         and t.org_id = #{orgId}
280
         and t.org_id = #{orgId}
281
         and t.`event` = 'share'
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
         ) t
283
         ) t
284
 
284
 
285
         union all
285
         union all
299
         where t.event_type = 'news'
299
         where t.event_type = 'news'
300
         and t.consultant_id = #{userId}
300
         and t.consultant_id = #{userId}
301
         and t.org_id = #{orgId}
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
         ) t
303
         ) t
304
         group by t.target_id
304
         group by t.target_id
305
 
305
 
320
             where t.event_type = 'h5'
320
             where t.event_type = 'h5'
321
             and t.consultant_id = #{userId}
321
             and t.consultant_id = #{userId}
322
             and t.org_id = #{orgId}
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
             ) t
324
             ) t
325
             group by t.target_id
325
             group by t.target_id
326
         ) t
326
         ) t