Ver Fonte

会话聊天时间筛选

zoujiajian há 2 anos atrás
pai
commit
de0268fe10

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/manage/views/CorpMsgAuditUserView.java

@@ -17,7 +17,7 @@ import java.util.Date;
         where = " c.id = cu.corp_user_id " +
                 "and cu.external_userid = cr.corp_user_id " +
                 "and f.userid = cr.follow_id " +
-                ":tag: :intention:",
+                ":tag: :intention: :talkTime:",
         groupBy = "c.name,cu.external_userid,c.avatar,c.type,c.gender,f.name,f.userid,cr.agree_status,cr.add_created_time"
 )
 public class CorpMsgAuditUserView {

+ 4 - 1
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CorpMsgAuditController.java

@@ -57,7 +57,7 @@ public class CorpMsgAuditController {
      * @return
      */
     @GetMapping
-    public Result<SearchResult<CorpMsgAuditUserView>> get(String textKey, @RequestParam(value = "tagIds", required = false) List<String> tagIds, Integer intention) throws Exception {
+    public Result<SearchResult<CorpMsgAuditUserView>> get(String textKey, @RequestParam(value = "tagIds", required = false) List<String> tagIds, Integer intention, Long talkStartTime, Long talkEndTime) throws Exception {
         Set<String> userIds = new HashSet<>();
         if(StringUtils.isNotBlank(textKey)){
             List<QyMsgContent> text = corpQyMsgContentService.list(Wrappers.lambdaQuery(QyMsgContent.class).select(QyMsgContent::getFrom, QyMsgContent::getExternalUserid,QyMsgContent::getTolist).like(QyMsgContent::getText, textKey).eq(QyMsgContent::getRoomid,"").eq(QyMsgContent::getMsgtype, "text"));
@@ -80,6 +80,9 @@ public class CorpMsgAuditController {
         if (intention != null) {
             builder.put("intention", String.format("and exists (select 1 from corp_user_pay_intention cup where cup.union_id = c.unionid and intention = %s limit 1)", intention));
         }
+        if (talkEndTime != null && talkStartTime != null) {
+            builder.put("talkTime", String.format(" and exists (select 1 from qy_msg_content qmc where qmc.external_userid = cu.external_userid and qmc.msgtime between %s and %s)", talkStartTime, talkEndTime));
+        }
         SearchResult<CorpMsgAuditUserView> search = beanSearcher.search(CorpMsgAuditUserView.class, builder.build());
         search.getDataList().forEach(e -> {
             Optional.ofNullable(corpUserPayIntentionMapper.selectOne(Wrappers.lambdaQuery(CorpUserPayIntention.class)