|
|
|
@ -45,8 +45,8 @@ public class SearchAppealDomainServiceImpl implements SearchAppealDomainService |
|
|
|
QueryWrapper<AppealEntity> appealEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
IPage<AppealDTO> appealDTOIPage = new Page<>(); |
|
|
|
Map<Long, String> taskIdToSubLineNameMap = new HashMap<>(); |
|
|
|
appealEntityQueryWrapper.orderByDesc("update_time"); |
|
|
|
if (StringUtils.isBlank(appealParam.getSubLineName())){ |
|
|
|
appealEntityQueryWrapper.orderByDesc("create_time"); |
|
|
|
if (appealParam.getBusinessId() == null && appealParam.getLineId() == null && appealParam.getSubLineId() == null) { |
|
|
|
Page<AppealEntity> appealEntityPage = appealMapper.selectPage(PageConverter.toMpPage(appealParam), appealEntityQueryWrapper); |
|
|
|
appealDTOIPage = appealEntityPage.convert(entity -> entity.toDTO(AppealDTO::new)); |
|
|
|
|
|
|
|
@ -58,13 +58,15 @@ public class SearchAppealDomainServiceImpl implements SearchAppealDomainService |
|
|
|
} |
|
|
|
}else{ |
|
|
|
//查询产品线相关的考试任务
|
|
|
|
List<TaskDTO> taskBySubLineName = taskMapper.getTaskBySubLineName(appealParam.getSubLineName()); |
|
|
|
taskIdToSubLineNameMap = taskBySubLineName.stream().collect(Collectors.toMap(TaskDTO::getId, TaskDTO::getSubLineName)); |
|
|
|
|
|
|
|
//查询申诉列表
|
|
|
|
appealEntityQueryWrapper.in("task_id",taskBySubLineName.stream().map(TaskDTO::getId).collect(Collectors.toList())); |
|
|
|
Page<AppealEntity> appealEntityPage = appealMapper.selectPage(PageConverter.toMpPage(appealParam), appealEntityQueryWrapper); |
|
|
|
appealDTOIPage = appealEntityPage.convert(entity -> entity.toDTO(AppealDTO::new)); |
|
|
|
List<TaskDTO> taskByAppealParam = taskMapper.getTaskByAppealParam(appealParam.getSubLineId(),appealParam.getLineId(),appealParam.getBusinessId()); |
|
|
|
taskIdToSubLineNameMap = taskByAppealParam.stream().collect(Collectors.toMap(TaskDTO::getId, TaskDTO::getSubLineName)); |
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(taskByAppealParam)){ |
|
|
|
//查询申诉列表
|
|
|
|
appealEntityQueryWrapper.in("task_id",taskByAppealParam.stream().map(TaskDTO::getId).collect(Collectors.toList())); |
|
|
|
Page<AppealEntity> appealEntityPage = appealMapper.selectPage(PageConverter.toMpPage(appealParam), appealEntityQueryWrapper); |
|
|
|
appealDTOIPage = appealEntityPage.convert(entity -> entity.toDTO(AppealDTO::new)); |
|
|
|
} |
|
|
|
} |
|
|
|
appealDTOIPage.setRecords(buildDTO(appealDTOIPage.getRecords(),taskIdToSubLineNameMap)); |
|
|
|
return Result.page(appealDTOIPage); |
|
|
|
|