ソースを参照

管理员查看会话存档特殊处理

zoujiajian 2 年 前
コミット
8b0d20521e

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/mapper/corp/CorpTagMapper.java

@@ -16,7 +16,7 @@ import java.util.List;
  *创建时间:2022/10/13 18:07
  */
 public interface CorpTagMapper extends BaseMapper<CorpTag> {
-	Page<CorpTagBackView> getCorpTagBackView(@Param("page") Page<CorpTagBackView> page, @Param("tagName") String tagName, @Param("groupIds") String[] groupIds, @Param("sort") String sort, @Param("order") String order, @Param("wxCorpId") Long wxCorpId);
+	Page<CorpTagBackView> getCorpTagBackView(@Param("page") Page<CorpTagBackView> page, @Param("tagName") String tagName, @Param("groupIds") String[] groupIds, @Param("sort") String sort, @Param("order") String order, @Param("wxCorpId") Long wxCorpId, @Param("tagIdStr") String tagIdStr);
 
 	List<String> selectTagsIdByGroupId(String groupId);
 

+ 3 - 0
netflix-dao/src/main/resources/mapper/CorpTagMapper.xml

@@ -30,6 +30,9 @@
                     #{item}
                 </foreach>
             </if>
+            <if test="tagIdStr != null">
+                and ct.tag_id = #{tagIdStr}
+            </if>
         </where>
         ) s
         order by tagId desc

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/corp/CorpTagService.java

@@ -26,7 +26,7 @@ public interface CorpTagService {
 
 	void saveOrUpdateRule(CorpTagRule rule);
 
-	Page<CorpTagBackView> getCorpTagBackView(Integer start, Integer limit, Integer type, String name,  String[] groupIds, String sort, String order) throws Exception;
+	Page<CorpTagBackView> getCorpTagBackView(Integer start, Integer limit, Integer type, String name, String[] groupIds, String sort, String order, String tagIdStr) throws Exception;
 
 	List<CorpTag> getGroupTagDetail(String groupId);
 

+ 2 - 2
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpTagServiceImpl.java

@@ -293,10 +293,10 @@ public class CorpTagServiceImpl implements CorpTagService {
 	}
 
 	@Override
-	public Page<CorpTagBackView> getCorpTagBackView(Integer start, Integer limit, Integer type, String name, String[] groupIds, String sort, String order) throws Exception {
+	public Page<CorpTagBackView> getCorpTagBackView(Integer start, Integer limit, Integer type, String name, String[] groupIds, String sort, String order, String tagIdStr) throws Exception {
 		Long wxCorpId = 2l;
 		if (type == 1) {
-			Page<CorpTagBackView> corpTagBackViewPage = corpTagMapper.getCorpTagBackView(new Page<>(start, limit), name,groupIds, sort, order, wxCorpId);
+			Page<CorpTagBackView> corpTagBackViewPage = corpTagMapper.getCorpTagBackView(new Page<>(start, limit), name, groupIds, sort, order, wxCorpId, tagIdStr);
 			corpTagBackViewPage.getRecords().forEach(view -> {
 				if (StrUtil.isNotEmpty(view.getRuleNameListStr())) {
 					try {

+ 7 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CorpMsgAuditController.java

@@ -1,5 +1,6 @@
 package com.cyksj.web.controller.manage.corp;
 
+import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -58,6 +59,7 @@ public class CorpMsgAuditController {
      */
     @GetMapping
     public Result<SearchResult<CorpMsgAuditUserView>> get(String textKey, @RequestParam(value = "tagIds", required = false) List<String> tagIds, Integer intention, Long talkStartTime, Long talkEndTime) throws Exception {
+        long adminId = StpUtil.getLoginIdAsLong();
         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"));
@@ -77,6 +79,11 @@ public class CorpMsgAuditController {
             builder.put("tag", String.format( "and cr.id = t.relation_id and t.tag_id %s", tagStr));
             builder.put("tagTable", ",corp_user_tag t");
         }
+        //管理员
+        if (adminId == 78l) {
+            builder.put("tagTable", ",corp_user_tag t");
+            builder.put("tag", String.format("and cr.id = t.relation_id and t.tag_id =  'etvj2DPQAAxqh9QlGJG4N1EbdQBNYGAA'"));
+        }
         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));
         }

+ 8 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CorpTagController.java

@@ -1,5 +1,6 @@
 package com.cyksj.web.controller.manage.corp;
 
+import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.lang.Assert;
 import com.alibaba.excel.support.ExcelTypeEnum;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -120,8 +121,13 @@ public class CorpTagController {
 	 * 标签管理详情
 	 */
 	@GetMapping("/get/corpTag")
-	public Result<Page<CorpTagBackView>> getCorpTagBackView(@RequestParam(defaultValue = "0") Integer start, @RequestParam(defaultValue = "10") Integer limit, @RequestParam(required = false, defaultValue = "1") Integer type, String name, String[] groupIds, String sort, String order) throws Exception {
-		Page<CorpTagBackView> corpTagBackViews = corpTagService.getCorpTagBackView(start, limit, type, name, groupIds, sort, order);
+	public Result<Page<CorpTagBackView>> getCorpTagBackView(@RequestParam(defaultValue = "0") Integer start, @RequestParam(defaultValue = "10") Integer limit, @RequestParam(required = false, defaultValue = "1") Integer type, String name, String[] groupIds, String sort, String order, String tagIdStr) throws Exception {
+		Long adminId = StpUtil.getLoginIdAsLong();
+		//指定管理员可查看标签
+		if (adminId == 78l) {
+			tagIdStr = "etvj2DPQAAxqh9QlGJG4N1EbdQBNYGAA";
+		}
+		Page<CorpTagBackView> corpTagBackViews = corpTagService.getCorpTagBackView(start, limit, type, name, groupIds, sort, order, tagIdStr);
 		return GatewayResponse.SUCCESS.newBuilder().toResult(corpTagBackViews);
 	}