Commit 9aa9e0d7 authored by 陈立彬's avatar 陈立彬

无对练的场景分类过滤

parent 10c477ab
...@@ -155,7 +155,8 @@ public class AppExamineService { ...@@ -155,7 +155,8 @@ public class AppExamineService {
PageResult<ExamineSceneCategoryMobileDto> pageResult = PageResult.of(request.getPageNo(), request.getPageSize(), (int) page.getTotalRow(), null); PageResult<ExamineSceneCategoryMobileDto> pageResult = PageResult.of(request.getPageNo(), request.getPageSize(), (int) page.getTotalRow(), null);
if(CollectionUtil.isNotEmpty(page.getRecords())) { if(CollectionUtil.isNotEmpty(page.getRecords())) {
List<ExamineSceneCategoryMobileDto> dtoList = page.getRecords().stream().map(v -> { List<ExamineSceneCategoryMobileDto> dtoList = page.getRecords().stream().filter(v -> examineService.countExamine(v.getId()) > 0)
.map(v -> {
ExamineSceneCategoryMobileDto dto = BeanUtil.copyProperties(v, ExamineSceneCategoryMobileDto.class); ExamineSceneCategoryMobileDto dto = BeanUtil.copyProperties(v, ExamineSceneCategoryMobileDto.class);
return dto; return dto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
......
...@@ -76,6 +76,8 @@ public interface ExamineService { ...@@ -76,6 +76,8 @@ public interface ExamineService {
void saveExamine(ExamineSaveModel dto); void saveExamine(ExamineSaveModel dto);
long countExamine(Integer sceneCategoryId);
/***************************************** 对练题目关联 *****************************************/ /***************************************** 对练题目关联 *****************************************/
List<ExamineQaXrefResponseModel> examineQaXrefList(Integer examineId); List<ExamineQaXrefResponseModel> examineQaXrefList(Integer examineId);
......
...@@ -370,6 +370,15 @@ public class ExamineServiceImpl implements ExamineService { ...@@ -370,6 +370,15 @@ public class ExamineServiceImpl implements ExamineService {
dto.setId(entity.getId()); dto.setId(entity.getId());
} }
@Override
public long countExamine(Integer sceneCategoryId) {
QueryWrapper queryWrapper = QueryWrapper.create()
.where(EXAMINE_ENTITY.CATEGORY_ID.eq(sceneCategoryId))
.and(EXAMINE_ENTITY.STATUS.eq(1))
.and(EXAMINE_ENTITY.DELETED.eq(0));
return examineMapper.selectCountByQuery(queryWrapper);
}
@Override @Override
public List<ExamineQaXrefResponseModel> examineQaXrefList(Integer examineId) { public List<ExamineQaXrefResponseModel> examineQaXrefList(Integer examineId) {
QueryWrapper queryWrapper = QueryWrapper.create() QueryWrapper queryWrapper = QueryWrapper.create()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment