|
@@ -1,8 +1,10 @@
|
|
|
package com.cyksj.web.controller.manage.corp;
|
|
package com.cyksj.web.controller.manage.corp;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
|
|
+import com.cyksj.common.util.Jsons;
|
|
|
import com.cyksj.dto.Result;
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
import com.cyksj.model.entity.QyMsgContent;
|
|
import com.cyksj.model.entity.QyMsgContent;
|
|
@@ -19,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -49,11 +52,11 @@ public class CorpMsgAuditController {
|
|
|
/**
|
|
/**
|
|
|
* 会话存档用户列表
|
|
* 会话存档用户列表
|
|
|
* @param textKey 关键词搜索
|
|
* @param textKey 关键词搜索
|
|
|
- * @param tagId 标签筛选
|
|
|
|
|
|
|
+ * @param tagIds 标签筛选
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@GetMapping
|
|
@GetMapping
|
|
|
- public Result<SearchResult<CorpMsgAuditUserView>> get(String textKey, String tagId, Integer intention) {
|
|
|
|
|
|
|
+ public Result<SearchResult<CorpMsgAuditUserView>> get(String textKey, @RequestParam(value = "tagIds", required = false) List<String> tagIds, Integer intention) throws Exception {
|
|
|
Set<String> userIds = new HashSet<>();
|
|
Set<String> userIds = new HashSet<>();
|
|
|
if(StringUtils.isNotBlank(textKey)){
|
|
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"));
|
|
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"));
|
|
@@ -63,8 +66,14 @@ public class CorpMsgAuditController {
|
|
|
if (userIds.size() > 0) {
|
|
if (userIds.size() > 0) {
|
|
|
builder.field(CorpMsgAuditUserView::getExternalUserid,userIds).op(InList.class);
|
|
builder.field(CorpMsgAuditUserView::getExternalUserid,userIds).op(InList.class);
|
|
|
}
|
|
}
|
|
|
- if(StringUtils.isNotBlank(tagId)){
|
|
|
|
|
- builder.put("tag", String.format( "and cr.id = t.relation_id and t.tag_id = '%s'", tagId));
|
|
|
|
|
|
|
+ if(CollUtil.isNotEmpty(tagIds)){
|
|
|
|
|
+ StringBuilder tagStr = new StringBuilder();
|
|
|
|
|
+ if (tagIds.size() == 1) {
|
|
|
|
|
+ tagStr.append("=").append("'").append(tagIds.get(0)).append("'");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ tagStr.append("in").append(Jsons.toJson(tagIds).replaceAll("\\[", "(").replaceAll("]", ")"));
|
|
|
|
|
+ }
|
|
|
|
|
+ builder.put("tag", String.format( "and cr.id = t.relation_id and t.tag_id %s", tagStr));
|
|
|
builder.put("tagTable", ",corp_user_tag t");
|
|
builder.put("tagTable", ",corp_user_tag t");
|
|
|
}
|
|
}
|
|
|
if (intention != null) {
|
|
if (intention != null) {
|