新增岗位部门没关联进去
This commit is contained in:
@ -81,6 +81,7 @@ public class JobController {
|
||||
if (resources.getId() != null) {
|
||||
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
||||
}
|
||||
resources.setDeptId(resources.getDept().getId());
|
||||
return new ResponseEntity<>(jobService.save(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
@ -67,11 +67,9 @@ public class JobServiceImpl extends BaseServiceImpl<JobMapper, Job> implements J
|
||||
//@Cacheable
|
||||
public List<Job> queryAll(JobQueryCriteria criteria){
|
||||
List<Job> jobList = baseMapper.selectList(QueryHelpPlus.getPredicate(Job.class, criteria));
|
||||
List<Job> jobScopeList = new ArrayList<>();
|
||||
if(criteria.getDeptIds().size()==0){
|
||||
for (Job job : jobList) {
|
||||
job.setDept(deptService.getById(job.getDeptId()));
|
||||
jobScopeList.add(job);
|
||||
}
|
||||
}else {
|
||||
//断权限范围
|
||||
@ -79,12 +77,11 @@ public class JobServiceImpl extends BaseServiceImpl<JobMapper, Job> implements J
|
||||
for (Job job : jobList) {
|
||||
if(deptId ==job.getDeptId()){
|
||||
job.setDept(deptService.getById(job.getDeptId()));
|
||||
jobScopeList.add(job);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return jobScopeList;
|
||||
return jobList;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user