فهرست منبع

周日报接入钉钉消息

zhangjq 1 سال پیش
والد
کامیت
7e61ee0e0a

+ 2 - 0
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/AdmServerApplication.java

@@ -3,6 +3,7 @@ package com.zjugis.module.adm;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.scheduling.annotation.EnableAsync;
 
 import java.nio.charset.StandardCharsets;
 import java.util.Base64;
@@ -17,6 +18,7 @@ import java.util.Base64;
  */
 @EnableFeignClients
 @SpringBootApplication
+@EnableAsync
 public class AdmServerApplication {
 
     public static void main(String[] args) {

+ 2 - 2
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/controller/admin/reportComment/ReportCommentController.java

@@ -38,8 +38,8 @@ public class ReportCommentController {
     @GetMapping("/getList")
     @Operation(summary = "报告回复_获取报告列表")
 //    @PreAuthorize("@ss.hasPermission('adm:report:query-comment')")
-    public CommonResult<List<ReportCommentRespVO>> getList(@Valid @NotNull(message = "报告ID不能为空") Long reportId, @NotNull(message = "被回复用户ID不能为空") String uId){
-        return success(reportCommentService.getReportCommentList(reportId, uId));
+    public CommonResult<List<ReportCommentRespVO>> getList(@Valid @NotNull(message = "报告ID不能为空") Long reportId){
+        return success(reportCommentService.getReportCommentList(reportId));
     }
 
     @DeleteMapping("/delete")

+ 229 - 0
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/service/report/ReportDingServiceImpl.java

@@ -0,0 +1,229 @@
+package com.zjugis.module.adm.service.report;
+
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request;
+import com.zjugis.framework.common.pojo.CommonResult;
+import com.zjugis.framework.common.util.date.LocalDateTimeUtils;
+
+import com.zjugis.module.adm.controller.admin.report.vo.base.ReportCreateReqVO;
+import com.zjugis.module.adm.controller.admin.report.vo.comment.ReportCommentCreateReqVO;
+import com.zjugis.module.adm.controller.admin.report.vo.workload.ReportWorkloadCreateReqVO;
+import com.zjugis.module.adm.dal.dataobject.report.ReportDO;
+import com.zjugis.module.adm.dal.mysql.report.ReportMapper;
+import com.zjugis.module.adm.remote.ProjectClient;
+import com.zjugis.module.adm.remote.dto.ProjectDto;
+import com.zjugis.module.adm.remote.vo.ProjectVO;
+import com.zjugis.module.infra.api.ding.DingApi;
+import com.zjugis.module.infra.api.ding.dto.DingMessageDto;
+import com.zjugis.module.infra.api.ding.enums.DingMsg;
+import com.zjugis.module.system.api.user.AdminUserApi;
+import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+
+/**
+ * 行政管理_工作报告 Service 实现类
+ *
+ * @author 管理员
+ */
+@Service
+@Validated
+public class ReportDingServiceImpl {
+
+    @Resource
+    private AdminUserApi adminUserApi;
+
+    @Resource
+    private ProjectClient projectClient;
+
+    @Autowired
+    DingApi dingApi;
+
+    @Resource
+    private ReportMapper reportMapper;
+
+    private static final String URL = "http://10.10.10.7:18080/html_h5";
+
+    /**
+     * 发送报告钉钉消息
+     * @param reportRequestVO
+     */
+    @Async
+    public void sendReportDingMessage(ReportCreateReqVO reportRequestVO) {
+        //用户map
+        Map<String, AdminUserRespDTO> userMap = adminUserApi.getUserMap();
+        //项目map
+        Map<String, String> projectMap = getProjectMap();
+        //发送钉钉消息
+        List<String> receiveUserIds = reportRequestVO.getReceiveUserIds();
+
+        String url = "/logsDetail?id= " + reportRequestVO.getReportId();
+        for (String receiveUserId : receiveUserIds) {
+            OapiMessageCorpconversationAsyncsendV2Request.OA oa = new OapiMessageCorpconversationAsyncsendV2Request.OA();
+            oa.setMessageUrl(URL +  url);
+            oa.setPcMessageUrl(URL +  url);
+            OapiMessageCorpconversationAsyncsendV2Request.Head head = new OapiMessageCorpconversationAsyncsendV2Request.Head();
+            head.setBgcolor("FFBBBBBB");
+            head.setText("浙江万维OA");
+            oa.setHead(head);
+
+            //消息实体
+            OapiMessageCorpconversationAsyncsendV2Request.Body body = new OapiMessageCorpconversationAsyncsendV2Request.Body();
+
+            //消息标题
+            String userNickName = userMap.get(reportRequestVO.getUserId()) != null ? userMap.get(reportRequestVO.getUserId()).getNickname() : "(异常人员)";
+            String reportType = "daily".equals(reportRequestVO.getReportType()) ? "日报" : "周报";
+            body.setTitle(userNickName + "的" + reportType);
+
+            //消息内容
+            List<OapiMessageCorpconversationAsyncsendV2Request.Form> formList = new ArrayList<>();
+            OapiMessageCorpconversationAsyncsendV2Request.Form formStartDate = new OapiMessageCorpconversationAsyncsendV2Request.Form();
+            formStartDate.setKey("开始日期:");
+            formStartDate.setValue(LocalDateTimeUtils.format(reportRequestVO.getReportStartDate(), "yyyy-MM-dd"));
+            formList.add(formStartDate);
+
+            OapiMessageCorpconversationAsyncsendV2Request.Form formEndDate = new OapiMessageCorpconversationAsyncsendV2Request.Form();
+            formEndDate.setKey("结束日期:");
+            formEndDate.setValue(LocalDateTimeUtils.format(reportRequestVO.getReportEndDate(), "yyyy-MM-dd"));
+            formList.add(formEndDate);
+
+            OapiMessageCorpconversationAsyncsendV2Request.Form formContent = new OapiMessageCorpconversationAsyncsendV2Request.Form();
+            formContent.setKey("本周完成工作:\n");
+            formContent.setValue(reportRequestVO.getReportContent());
+            formList.add(formContent);
+
+            StringBuffer formWorkTimeValue = new StringBuffer();
+            List<ReportWorkloadCreateReqVO> weeklyWorkloadList = reportRequestVO.getWeeklyWorkloadList();
+            for (ReportWorkloadCreateReqVO workLoad : weeklyWorkloadList) {
+                String projectName = projectMap.get(workLoad.getProjectId());
+                if (StrUtil.isNotBlank(projectName)) {
+                    formWorkTimeValue.append("(").append(workLoad.getWorkTime()).append("小时)").append(projectName).append("\n");
+                } else {
+                    formWorkTimeValue.append("(").append(workLoad.getWorkTime()).append("小时)").append("(异常项目)").append("\n");
+                }
+            }
+            OapiMessageCorpconversationAsyncsendV2Request.Form formWorkTime = new OapiMessageCorpconversationAsyncsendV2Request.Form();
+            formWorkTime.setKey("工作量分配:\n");
+            formWorkTime.setValue(formWorkTimeValue.toString());
+            formList.add(formWorkTime);
+
+            body.setForm(formList);
+            oa.setBody(body);
+
+            DingMessageDto message = new DingMessageDto(receiveUserId);
+            message.setMsgType(DingMsg.OA);
+            message.setOa(oa);
+            dingApi.sendMessage(message);
+        }
+
+
+    }
+
+
+    /**
+     * 发送评论及回复评论钉钉消息
+     * @param reportCommentCreateReqVO
+     */
+    @Async
+    public void sendCommentDingMessage(ReportCommentCreateReqVO reportCommentCreateReqVO) {
+        //用户map
+        Map<String, AdminUserRespDTO> userMap = adminUserApi.getUserMap();
+        //报告map
+        ReportDO reportDO = reportMapper.selectById(reportCommentCreateReqVO.getReportId());
+        String url = "/logsDetail?id= " + reportDO.getId();
+        //发送钉钉消息
+        OapiMessageCorpconversationAsyncsendV2Request.OA oa = new OapiMessageCorpconversationAsyncsendV2Request.OA();
+        oa.setMessageUrl(URL +  url);
+        oa.setPcMessageUrl(URL +  url);
+
+        OapiMessageCorpconversationAsyncsendV2Request.Head head = new OapiMessageCorpconversationAsyncsendV2Request.Head();
+        head.setBgcolor("FFBBBBBB");
+        head.setText("浙江万维OA");
+        oa.setHead(head);
+
+        OapiMessageCorpconversationAsyncsendV2Request.Body body = new OapiMessageCorpconversationAsyncsendV2Request.Body();
+
+        String commentUserNickName = userMap.get(reportCommentCreateReqVO.getCommentUserId()) != null ? userMap.get(reportCommentCreateReqVO.getCommentUserId()).getNickname() : "(异常人员)";
+        String reportAuthor = userMap.get(reportDO.getUserId()) != null ? userMap.get(reportDO.getUserId()).getNickname() : "(异常人员)";
+        String reportType = "daily".equals(reportDO.getReportType()) ? "日报" : "周报";
+        String messageUserId = reportDO.getUserId();//默认为报告作者
+
+        //发送评论
+        if(!reportCommentCreateReqVO.getCommentUserId().equals(reportDO.getUserId())){
+            //消息标题
+            body.setTitle(commentUserNickName + "评论了你「" + LocalDateTimeUtils.format(reportDO.getReportStartDate(), "yyyy-MM-dd")
+                    + "~" + LocalDateTimeUtils.format(reportDO.getReportStartDate(), "yyyy-MM-dd") + "」的" + reportType);
+
+            //消息内容
+            List<OapiMessageCorpconversationAsyncsendV2Request.Form> formList = new ArrayList<>();
+            OapiMessageCorpconversationAsyncsendV2Request.Form formContent = new OapiMessageCorpconversationAsyncsendV2Request.Form();
+            formContent.setKey("评论内容:\n");
+            formContent.setValue(reportCommentCreateReqVO.getCommentContent());
+            formList.add(formContent);
+            body.setForm(formList);
+
+            oa.setBody(body);
+
+            DingMessageDto message = new DingMessageDto(messageUserId);
+            message.setMsgType(DingMsg.OA);
+            message.setOa(oa);
+            dingApi.sendMessage(message);
+        }
+
+        //回复评论
+        if (StrUtil.isNotBlank(reportCommentCreateReqVO.getReplyToUserid()) && !reportCommentCreateReqVO.getCommentUserId().equals(reportCommentCreateReqVO.getReplyToUserid())) {
+            messageUserId = reportCommentCreateReqVO.getReplyToUserid();
+            //消息标题
+            body.setTitle(commentUserNickName + "回复了你在" + reportAuthor + "「" + LocalDateTimeUtils.format(reportDO.getReportStartDate(), "yyyy-MM-dd")
+                    + "~" + LocalDateTimeUtils.format(reportDO.getReportStartDate(), "yyyy-MM-dd") + "」" + reportType + "下的评论");
+
+            //消息内容
+            List<OapiMessageCorpconversationAsyncsendV2Request.Form> formList = new ArrayList<>();
+            OapiMessageCorpconversationAsyncsendV2Request.Form formContent = new OapiMessageCorpconversationAsyncsendV2Request.Form();
+            formContent.setKey("回复内容:\n");
+
+            int index = reportCommentCreateReqVO.getCommentContent().indexOf(":");
+            String replyCommentContent = reportCommentCreateReqVO.getCommentContent().substring(index + 1);
+            formContent.setValue(replyCommentContent);
+            formList.add(formContent);
+            body.setForm(formList);
+            oa.setBody(body);
+
+            DingMessageDto message = new DingMessageDto(messageUserId);
+            message.setMsgType(DingMsg.OA);
+            message.setOa(oa);
+            dingApi.sendMessage(message);
+        }
+
+
+    }
+
+
+    /**
+     * 获取项目map
+     *
+     * @return
+     */
+    private Map<String, String> getProjectMap() {
+        Map<String, String> projectMap = new HashMap<>();
+        ProjectDto projectDto = new ProjectDto();
+        projectDto.setPageNo(1);
+        projectDto.setPageSize(-1);
+        CommonResult<Page<ProjectVO>> projectPage = projectClient.getProjectPage(projectDto);
+        if (projectPage.isSuccess()) {
+            List<ProjectVO> projectList = projectPage.getData().getRecords();
+            projectMap = projectList.stream().collect(Collectors.toMap(ProjectVO::getId, ProjectVO::getXmmc));
+        }
+        return projectMap;
+    }
+
+}

+ 33 - 15
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/service/report/ReportServiceImpl.java

@@ -44,6 +44,7 @@ import com.zjugis.module.system.api.dict.dto.DictDataRespDTO;
 import com.zjugis.module.system.api.user.AdminUserApi;
 import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -107,9 +108,13 @@ public class ReportServiceImpl implements ReportService {
     @Resource
     private ProjectClient projectClient;
 
+    @Autowired
+    ReportDingServiceImpl reportDingService;
+
 
     /**
      * 新增工作报告
+     *
      * @param reportRequestVO
      * @return
      */
@@ -123,8 +128,11 @@ public class ReportServiceImpl implements ReportService {
         reportWorkloadService.batchCreateReportWorkload(reportRequestVO);
         //批量新增报告接收人
         reportReceiveService.batchCreateReportReceive(reportRequestVO);
+
         //非暂存时发送钉钉消息
         if (!reportRequestVO.getIsTemp()) {
+            reportDingService.sendReportDingMessage(reportRequestVO);
+
         }
         return reportId;
     }
@@ -143,6 +151,7 @@ public class ReportServiceImpl implements ReportService {
 
     /**
      * 获取报告分页列表
+     *
      * @param reqVO
      * @return
      */
@@ -162,6 +171,7 @@ public class ReportServiceImpl implements ReportService {
 
     /**
      * 获取工作报告列表
+     *
      * @param reqVO
      * @return
      */
@@ -191,7 +201,7 @@ public class ReportServiceImpl implements ReportService {
             report.setComments(reportCommentList.stream().filter(comment -> comment.getReportId().equals(report.getId())).collect(Collectors.toList()));
 
             //接收人信息
-            List<String> receiveIds =  reportReceiveList.stream().filter(receive -> receive.getReportId().equals(report.getId())).map(ReportReceiveRespVO::getReceiveUserId).collect(Collectors.toList());
+            List<String> receiveIds = reportReceiveList.stream().filter(receive -> receive.getReportId().equals(report.getId())).map(ReportReceiveRespVO::getReceiveUserId).collect(Collectors.toList());
             report.setReceiveIds(receiveIds);
             report.setReceiveNames(userInfoList.stream().filter(user -> receiveIds.contains(user.getId())).map(AdminUserRespDTO::getNickname).collect(Collectors.toList()));
 
@@ -200,10 +210,9 @@ public class ReportServiceImpl implements ReportService {
     }
 
 
-
-
     /**
      * 获取报告详情(包含工作量、回复列表等)
+     *
      * @param reportId
      * @return
      */
@@ -221,27 +230,28 @@ public class ReportServiceImpl implements ReportService {
         List<AdminUserRespDTO> userInfoList = adminUserApi.getUsers(receiveIds).getData();
         reportRespVO.setReceiveNames(userInfoList.stream().map(AdminUserRespDTO::getNickname).collect(Collectors.toList()));
         //报告回复列表
-        reportRespVO.setComments(reportCommentService.getReportCommentList(reportId, reportRespVO.getUserId()));
+        reportRespVO.setComments(reportCommentService.getReportCommentList(reportId));
         return reportRespVO;
     }
 
     /**
      * 根据条件查询工作报告
+     *
      * @param reportQueryDTO
      * @return
      */
     @Override
     public ReportDO getReportByCondition(ReportQueryDTO reportQueryDTO) {
         LambdaQueryWrapper<ReportDO> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(ReportDO::getReportType,reportQueryDTO.getReportType());
-        queryWrapper.eq(ReportDO::getUserId,reportQueryDTO.getUserId());
-        if("daily".equals(reportQueryDTO.getReportType())){
-            queryWrapper.eq(ReportDO::getReportStartDate,reportQueryDTO.getReportStartDate());
-            queryWrapper.eq(ReportDO::getReportEndDate,reportQueryDTO.getReportEndDate());
+        queryWrapper.eq(ReportDO::getReportType, reportQueryDTO.getReportType());
+        queryWrapper.eq(ReportDO::getUserId, reportQueryDTO.getUserId());
+        if ("daily".equals(reportQueryDTO.getReportType())) {
+            queryWrapper.eq(ReportDO::getReportStartDate, reportQueryDTO.getReportStartDate());
+            queryWrapper.eq(ReportDO::getReportEndDate, reportQueryDTO.getReportEndDate());
         } else {
-            queryWrapper.eq(ReportDO::getReportYear,reportQueryDTO.getReportYear());
-            queryWrapper.eq(ReportDO::getReportMonth,reportQueryDTO.getReportMonth());
-            queryWrapper.eq(ReportDO::getReportWeek,reportQueryDTO.getReportWeek());
+            queryWrapper.eq(ReportDO::getReportYear, reportQueryDTO.getReportYear());
+            queryWrapper.eq(ReportDO::getReportMonth, reportQueryDTO.getReportMonth());
+            queryWrapper.eq(ReportDO::getReportWeek, reportQueryDTO.getReportWeek());
         }
         ReportDO reportDO = reportMapper.selectOne(queryWrapper);
         return reportDO;
@@ -254,6 +264,7 @@ public class ReportServiceImpl implements ReportService {
 
     /**
      * 新增或更新报告内容
+     *
      * @param createReqVO 创建信息
      * @return
      */
@@ -279,6 +290,7 @@ public class ReportServiceImpl implements ReportService {
 
     /**
      * 获取员工工作报告Map
+     *
      * @param reportType 报告类型
      * @param year       年份
      * @param month      月份
@@ -327,11 +339,11 @@ public class ReportServiceImpl implements ReportService {
             //添加自身部门
             deptIds.add(reportStatisticReqDTO.getDeptId());
             records = adminUserApi.getUserListByDeptIds(deptIds).getData();
-        }else{
+        } else {
             records = adminUserApi.getUserList().getData();
         }
 
-        if(StrUtil.isNotBlank(reportStatisticReqDTO.getUserId())){
+        if (StrUtil.isNotBlank(reportStatisticReqDTO.getUserId())) {
             records = records.stream().filter(user -> reportStatisticReqDTO.getUserId().equals(user.getId())).collect(Collectors.toList());
         }
         //获取工作报告
@@ -453,6 +465,7 @@ public class ReportServiceImpl implements ReportService {
 
     /**
      * 工作报告聚合统计
+     *
      * @param dailyReportStatistics
      * @param deptList
      * @param year
@@ -512,6 +525,7 @@ public class ReportServiceImpl implements ReportService {
 
     /**
      * 获取部门及子部门id
+     *
      * @param deptTree
      * @return key是部门id,value是所有子集节点id列表
      */
@@ -535,6 +549,7 @@ public class ReportServiceImpl implements ReportService {
 
     /**
      * 递归地收集子集节点
+     *
      * @param dept
      * @param idToDeptMap
      * @param result
@@ -562,6 +577,7 @@ public class ReportServiceImpl implements ReportService {
 
     /**
      * 获取报告工作量统计信息
+     *
      * @param reportWorkloadStatisticReqDTO
      * @return
      */
@@ -654,7 +670,7 @@ public class ReportServiceImpl implements ReportService {
                 .sorted(Comparator.comparing(c -> PinyinUtil.toFirstLetter(c.getNickName())))
                 .collect(Collectors.toList());
 
-        if(reportWorkloadStatisticReqDTO.getIsPage()){
+        if (reportWorkloadStatisticReqDTO.getIsPage()) {
             PageResult<ReportWorkloadStatisticVO> pageResult = PageUtil.getPages(reportWorkloadStatisticReqDTO.getPageNo(), reportWorkloadStatisticReqDTO.getPageSize(), resultList);
             return pageResult;
         } else {
@@ -666,6 +682,7 @@ public class ReportServiceImpl implements ReportService {
 
     /**
      * 获取用户最新报告的接收人
+     *
      * @param userId
      * @return
      */
@@ -686,6 +703,7 @@ public class ReportServiceImpl implements ReportService {
 
     /**
      * 检验报告是否存在
+     *
      * @param id
      */
     private void validateReportExists(Long id) {

+ 2 - 3
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/service/reportcomment/ReportCommentService.java

@@ -26,13 +26,12 @@ public interface ReportCommentService {
      * 获得行政管理_报告回复列表
      *
      * @param reportId 报告ID
-     * @param uId 被回复用户ID
      * @return 行政管理_报告回复列表
      */
-    List<ReportCommentRespVO> getReportCommentList(Long reportId, String uId);
+    List<ReportCommentRespVO> getReportCommentList(Long reportId);
 
     /**
-     * 根据报告Id批量获取评论信息
+     * 根据报告Id批量获取评论信息
      * @param reportId 报告ID
      * @return 工作量信息
      * **/

+ 13 - 16
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/service/reportcomment/ReportCommentServiceImpl.java

@@ -6,8 +6,10 @@ import com.zjugis.module.adm.controller.admin.report.vo.base.ReportRespVO;
 import com.zjugis.module.adm.controller.admin.report.vo.comment.*;
 import com.zjugis.module.adm.dal.dataobject.report.ReportDO;
 import com.zjugis.module.adm.dal.mysql.report.ReportMapper;
+import com.zjugis.module.adm.service.report.ReportDingServiceImpl;
 import com.zjugis.module.system.api.user.AdminUserApi;
 import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import org.springframework.validation.annotation.Validated;
@@ -40,6 +42,9 @@ public class ReportCommentServiceImpl implements ReportCommentService {
     private ReportMapper reportMapper;
     @Resource
     private AdminUserApi adminUserApi;
+    @Autowired
+    ReportDingServiceImpl reportDingService;
+
 
     @Override
     public Long createReportComment(ReportCommentCreateReqVO createReqVO) {
@@ -47,28 +52,21 @@ public class ReportCommentServiceImpl implements ReportCommentService {
         ReportCommentDO reportComment = ReportCommentConvert.INSTANCE.convert(createReqVO);
         reportComment.setCommentUserId(SecurityFrameworkUtils.getLoginUserId());
         reportComment.setCommentDate(LocalDateTime.now());
-        ReportDO report = reportMapper.selectById(createReqVO.getReportId());
-        reportComment.setReplyToUserid(report.getUserId());
         reportCommentMapper.insert(reportComment);
+
+        //发送钉钉消息
+        reportDingService.sendCommentDingMessage(createReqVO);
         return reportComment.getId();
     }
 
 
-    private void validateReportCommentExists(Long id) {
-        if (reportCommentMapper.selectById(id) == null) {
-            throw exception(REPORT_COMMENT_NOT_EXISTS);
-        }
-    }
-
     @Override
-    public List<ReportCommentRespVO> getReportCommentList(Long reportId, String uId) {
+    public List<ReportCommentRespVO> getReportCommentList(Long reportId) {
         List<ReportCommentRespVO> reportCommentList = ReportCommentConvert.INSTANCE.convertList(reportCommentMapper.selectList(new LambdaQueryWrapperX<ReportCommentDO>()
-                .eqIfPresent(ReportCommentDO::getReplyToUserid, uId)
                 .eqIfPresent(ReportCommentDO::getReportId, reportId)));
-        List<AdminUserRespDTO> userList = adminUserApi.getUserList().getData();
+        Map<String, AdminUserRespDTO> userMap = adminUserApi.getUserMap();
         reportCommentList.forEach(comment->{
-            Optional<AdminUserRespDTO> userOptional = userList.stream().filter(c -> c.getId().equals(comment.getCommentUserId())).findFirst();
-            comment.setCommentUserName(userOptional.get().getNickname());
+            comment.setCommentUserName(userMap.get(comment.getCommentUserId()).getNickname());
         });
         return reportCommentList;
     }
@@ -77,10 +75,9 @@ public class ReportCommentServiceImpl implements ReportCommentService {
     public List<ReportCommentRespVO> getReportCommentListByRIds(List<Long> reportId) {
         List<ReportCommentRespVO> reportCommentList = ReportCommentConvert.INSTANCE.convertList(reportCommentMapper.selectList(new LambdaQueryWrapperX<ReportCommentDO>()
                 .inIfPresent(ReportCommentDO::getReportId, reportId)));
-        List<AdminUserRespDTO> userList = adminUserApi.getUserList().getData();
+        Map<String, AdminUserRespDTO> userMap = adminUserApi.getUserMap();
         reportCommentList.forEach(comment->{
-            Optional<AdminUserRespDTO> userOptional = userList.stream().filter(c -> c.getId().equals(comment.getCommentUserId())).findFirst();
-            comment.setCommentUserName(userOptional.get().getNickname());
+            comment.setCommentUserName(userMap.get(comment.getCommentUserId()).getNickname());
         });
         return reportCommentList;
     }