|
@@ -23,6 +23,7 @@ namespace OASystem.API.Controllers
|
|
private readonly SystemMenuAndFunctionRepository _SystemMenuAndFunctionRepository;
|
|
private readonly SystemMenuAndFunctionRepository _SystemMenuAndFunctionRepository;
|
|
private readonly JobPostAuthorityRepository _JobPostAuthorityRepository;
|
|
private readonly JobPostAuthorityRepository _JobPostAuthorityRepository;
|
|
private readonly JobPostRepository _jobRep;
|
|
private readonly JobPostRepository _jobRep;
|
|
|
|
+
|
|
private readonly UserAuthorityRepository _UserAuthorityRepository;
|
|
private readonly UserAuthorityRepository _UserAuthorityRepository;
|
|
|
|
|
|
public SystemController( CompanyRepository syscom, DepartmentRepository sysDepRep, UsersRepository userRep,
|
|
public SystemController( CompanyRepository syscom, DepartmentRepository sysDepRep, UsersRepository userRep,
|
|
@@ -43,6 +44,7 @@ namespace OASystem.API.Controllers
|
|
_SystemMenuAndFunctionRepository = systemMenuAndFunctionRepository;
|
|
_SystemMenuAndFunctionRepository = systemMenuAndFunctionRepository;
|
|
_JobPostAuthorityRepository = jobPostAuthorityRepository;
|
|
_JobPostAuthorityRepository = jobPostAuthorityRepository;
|
|
_UserAuthorityRepository = userAuthorityRepository;
|
|
_UserAuthorityRepository = userAuthorityRepository;
|
|
|
|
+ _jobRep = jobRep;
|
|
}
|
|
}
|
|
|
|
|
|
#region 企业操作
|
|
#region 企业操作
|
|
@@ -434,12 +436,28 @@ namespace OASystem.API.Controllers
|
|
{
|
|
{
|
|
if (dto.PortType == 1)
|
|
if (dto.PortType == 1)
|
|
{
|
|
{
|
|
- var result = _sysDepRep.QueryDto<Sys_JobPost, JobPostView>(s => s.CompanyId == dto.CompanyId && s.DepId == dto.DepId).ToList();
|
|
|
|
- if (result.Count == 0)
|
|
|
|
|
|
+ string sqlWhere = string.Empty;
|
|
|
|
+ if (dto.CompanyId != 0)
|
|
|
|
+ {
|
|
|
|
+ sqlWhere += string.Format(@" And jp.CompanyId={0}", dto.CompanyId);
|
|
|
|
+ }
|
|
|
|
+ if (dto.DepId != 0)
|
|
|
|
+ {
|
|
|
|
+ sqlWhere += string.Format(@" And jp.DepId={0}", dto.DepId);
|
|
|
|
+ }
|
|
|
|
+ if (!string.IsNullOrEmpty(sqlWhere.Trim()))
|
|
|
|
+ {
|
|
|
|
+ Regex r = new Regex("And");
|
|
|
|
+ sqlWhere = r.Replace(sqlWhere, "Where", 1);
|
|
|
|
+ }
|
|
|
|
+ List<Sys_JobPostI> jobList = await _jobRep.QueryJobPost(sqlWhere);
|
|
|
|
+
|
|
|
|
+ List<JobPostView> List = _mapper.Map<List<JobPostView>>(jobList);
|
|
|
|
+ if (jobList.Count == 0)
|
|
{
|
|
{
|
|
return Ok(JsonView(false, "暂无数据!"));
|
|
return Ok(JsonView(false, "暂无数据!"));
|
|
}
|
|
}
|
|
- return Ok(JsonView(true, "查询成功!", result));
|
|
|
|
|
|
+ return Ok(JsonView(true, "查询成功!", jobList));
|
|
}
|
|
}
|
|
else if (dto.PortType == 2)
|
|
else if (dto.PortType == 2)
|
|
{
|
|
{
|