Commit f75e7df6 authored by zhangyingbin's avatar zhangyingbin

修改根据type查询项目资源接口

parent 2cab712f
......@@ -60,6 +60,12 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
@Autowired
SuperviseRuleServiceImpl superviseRuleService;
@Autowired
MaterialServiceImpl materialService;
@Autowired
EquipmentServiceImpl equipmentService;
/**
* 分页查询
*/
......@@ -206,7 +212,8 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
public IPage getResourceInfo(String type,IPage page){
List<Project> projectList = this.getProjectList();
List<Long> projectIdList = new ArrayList<>();
List<Long> welderIdList = new ArrayList<>();
List<Long> idList = new ArrayList<>();
List list = new ArrayList<>();
for(Project project:projectList){
projectIdList.add(project.getSequenceNbr());
}
......@@ -216,16 +223,26 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
.eq(ProjectResource::getProjectId,projectId);
IPage<ProjectResource> projectResourceList = this.page(page,projectResourceWrapper);
for(ProjectResource projectResource : projectResourceList.getRecords()){
welderIdList.add(projectResource.getResourceId());
idList.add(projectResource.getResourceId());
}
}
List<Map> mapList = new ArrayList<>();
for(Long welderId:welderIdList){
mapList.add(orgService.getdetialInfo(String.valueOf(welderId)));
if(焊工资源.getCode().equals(type)){
List<Map> mapList = new ArrayList<>();
for(Long welderId:idList){
mapList.add(orgService.getdetialInfo(String.valueOf(welderId)));
}
page.setRecords(mapList);
}else if(管材资源.getCode().equals(type)){
for(Long id:idList){
list.add(materialService.getById(id));
}
page.setRecords(list);
}else {
for(Long id:idList){
list.add(equipmentService.getById(id));
}
page.setRecords(list);
}
page.setRecords(mapList);
return page;
}
}
\ No newline at end of file
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