根据projectId查询相关人员名单法规工程师接口。

This commit is contained in:
wangzhijiang
2023-04-06 21:55:42 +08:00
parent d430680843
commit 39402540dd
3 changed files with 42 additions and 0 deletions
@@ -247,4 +247,17 @@ public class ProjectRelatedPersonnelController extends JeroController<ProjectRel
}
}
/**
* 通过projectId查询法规工程师
*
* @return
*/
@AutoLog(value = "项目库-相关人员维护表-根据projectId查询法规工程师")
@ApiOperation(value="项目库-相关人员维护表-根据projectId查询法规工程师", notes="项目库-相关人员维护表-根据projectId查询法规工程师")
@GetMapping(value = "/queryLawEngineerByProjectId")
public Result<?> queryLawEngineerByProjectId(@RequestParam Map<String,Object> params){
List<Map<String,Object>> regulatoryEngineerMapList = projectRelatedPersonnelService.queryLawEngineerByProjectId(params);
return Result.OK(regulatoryEngineerMapList);
}
}
@@ -94,4 +94,11 @@ public interface IProjectRelatedPersonnelService extends IService<ProjectRelated
List<ProjectRelatedPersonnel> queryCertificationEngineer(String projectId);
void setBatch(ProjectRelatedPersonnel projectRelatedPersonnel);
/**
* 根据项目库id,查询相关人员名单中的法规工程师
* @param params
* @return
*/
List<Map<String, Object>> queryLawEngineerByProjectId(Map<String, Object> params);
}
@@ -1803,4 +1803,26 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
}
}
@Override
public List<Map<String, Object>> queryLawEngineerByProjectId(Map<String, Object> params) {
List<Map<String, Object>> resultList = new ArrayList<>();
String projectLibraryId = (String) params.get("projectLibraryId");
QueryWrapper<ProjectRelatedPersonnel> queryWrapper = new QueryWrapper<>();
List<ProjectRelatedPersonnel> prpEoList = this.list(queryWrapper.eq("project_id", projectLibraryId));
if(CollectionUtils.isNotEmpty(prpEoList)){
String lawEngineerIds = prpEoList.stream().filter(e->StringUtils.isNotEmpty(e.getLawEngineer()))
.map(ProjectRelatedPersonnel::getLawEngineer).collect(Collectors.joining(","));
List<SysUser> lawEngineerList = this.sysUserService.querySysUserListByIdList(Arrays.asList(lawEngineerIds.split(",")));
if(CollectionUtils.isNotEmpty(lawEngineerList)){
for (SysUser lawEngineer : lawEngineerList) {
Map<String,Object> certificationEngineerMap = new HashMap<>();
certificationEngineerMap.put("id",lawEngineer.getId());
certificationEngineerMap.put("userName",lawEngineer.getUsername());
resultList.add(certificationEngineerMap);
}
}
}
return resultList;
}
}