Commit ae758df0 by zhiwj

转移门店

parent 076fa730
......@@ -99,6 +99,9 @@ public class ProjectApiServiceImpl implements ProjectApiService{
public ServiceResponse<List<ProjectDTO>> listAllProject() {
List<TabProject> tabProjectList = projectService.listAllProject();
List<ProjectDTO> projectList = EntityUtil.changeEntityListByJSON(ProjectDTO.class, tabProjectList);
if (CollectionUtils.isEmpty(projectList)) {
return ServiceResponse.success(Collections.emptyList());
}
List<TabProjectItem> tabItemList = projectItemService.listAllProjectItem();
List<ProjectItemDTO> itemList = EntityUtil.changeEntityListByJSON(ProjectItemDTO.class, tabItemList);
Map<Integer, List<ProjectItemDTO>> group = Optional.ofNullable(itemList).orElse(Collections.emptyList()).stream()
......@@ -107,7 +110,8 @@ public class ProjectApiServiceImpl implements ProjectApiService{
for (ProjectDTO projectDTO : projectList) {
projectDTO.setItemList(group.get(projectDTO.getProjectId()));
}
return ServiceResponse.success(projectList);
List<ProjectDTO> result = projectList.stream().filter(e -> CollectionUtils.isNotEmpty(e.getItemList())).collect(Collectors.toList());
return ServiceResponse.success(result);
}
......
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