Procházet zdrojové kódy

adm服务:评论详情修改

zhangjq před 1 rokem
rodič
revize
b41728f159

+ 1 - 1
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/controller/admin/report/vo/comment/ReportCommentBaseVO.java

@@ -20,7 +20,7 @@ import static com.zjugis.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_
 public class ReportCommentBaseVO {
 
     @Schema(description = "评论人用户ID", example = "29690")
-    private Long commentUserId;
+    private String commentUserId;
 
     @Schema(description = "评论时间")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)

+ 3 - 0
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/controller/admin/report/vo/comment/ReportCommentRespVO.java

@@ -16,4 +16,7 @@ public class ReportCommentRespVO extends ReportCommentBaseVO {
     @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9958")
     private Long id;
 
+    @Schema(description = "评论人用户名称")
+    private String commentUserName;
+
 }

+ 11 - 2
zjugis-module-adm/zjugis-module-adm-biz/src/main/java/com/zjugis/module/adm/service/reportcomment/ReportCommentServiceImpl.java

@@ -6,6 +6,8 @@ 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.system.api.user.AdminUserApi;
+import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
 import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import org.springframework.validation.annotation.Validated;
@@ -36,7 +38,8 @@ public class ReportCommentServiceImpl implements ReportCommentService {
     private ReportCommentMapper reportCommentMapper;
     @Resource
     private ReportMapper reportMapper;
-
+    @Resource
+    private AdminUserApi adminUserApi;
 
     @Override
     public Long createReportComment(ReportCommentCreateReqVO createReqVO) {
@@ -59,9 +62,15 @@ public class ReportCommentServiceImpl implements ReportCommentService {
 
     @Override
     public List<ReportCommentRespVO> getReportCommentList(Long reportId, String uId) {
-        return ReportCommentConvert.INSTANCE.convertList(reportCommentMapper.selectList(new LambdaQueryWrapperX<ReportCommentDO>()
+        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();
+        reportCommentList.forEach(comment->{
+            Optional<AdminUserRespDTO> userOptional = userList.stream().filter(c -> c.getId().equals(comment.getCommentUserId())).findFirst();
+            comment.setCommentUserName(userOptional.get().getNickname());
+        });
+        return reportCommentList;
     }
 
 }