|
@@ -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;
|
|
|
}
|
|
|
|
|
|
}
|