导出加搜索条件

This commit is contained in:
CD
2022-09-28 17:05:25 +08:00
parent eb739f813e
commit f0d8fd0e59
3 changed files with 8 additions and 4 deletions
@@ -179,8 +179,9 @@ public class SarFileCompareItemCommentController extends JeroController<SarFileC
@RequestParam(name = "selectIds", required = true) String selectIds,
@RequestParam(name = "includeComments", required = true) boolean includeComments,
@RequestParam(name = "cut", required = true) String cut,
HttpServletResponse response,HttpServletRequest request) {
sarFileCompareItemCommentService.exportResXls(request,response, infoId, selectIds, includeComments, cut);
HttpServletResponse response,HttpServletRequest request,
@RequestParam(name = "comment", required = false) String comment) {
sarFileCompareItemCommentService.exportResXls(request,response, infoId, selectIds, includeComments, cut,comment);
}
}
@@ -67,7 +67,7 @@ public interface ISarFileCompareItemCommentService extends IService<SarFileCompa
SarFileCompareResultVO queryCompareResult(String infoId,String comment);
void exportResXls(HttpServletRequest request,HttpServletResponse response, String infoId, String selectIds, boolean includeComments, String cut);
void exportResXls(HttpServletRequest request,HttpServletResponse response, String infoId, String selectIds, boolean includeComments, String cut,String comment);
void consensusAssessment(SarFileCompareItemComment sarFileCompareItemComment);
}
@@ -187,7 +187,7 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
}
@Override
public void exportResXls(HttpServletRequest request,HttpServletResponse response, String infoId, String selectIds, boolean includeComments, String cut) {
public void exportResXls(HttpServletRequest request,HttpServletResponse response, String infoId, String selectIds, boolean includeComments, String cut,String comment) {
List<SarFileCompareItemComment> list = null;
if (includeComments && StringUtils.isEmpty(selectIds)) {
//只导出全文评论的情况
@@ -198,6 +198,9 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
if (!StringUtils.isEmpty(selectIds)) {
queryWrapper.in(SarFileCompareItemComment::getId, Arrays.asList(selectIds.split(",")));
}
if (ObjectUtils.isNotEmpty(comment)) {
queryWrapper.eq(SarFileCompareItemComment::getComment, comment);
}
queryWrapper.orderBy(true, true, SarFileCompareItemComment::getCreateTime);
list = this.list(queryWrapper);
}