|
|
@@ -97,8 +97,10 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
/// <param name="depName">部门名称 空查询全部</param>
|
|
|
/// <returns></returns>
|
|
|
public async Task<(bool Success, string Message, List<string> Departments, List<KpiTempDepartmentInfo> DepartmentsWithJobs)>
|
|
|
- KpiDepartmentsAndJobs(string depName = "")
|
|
|
+ KpiDepartmentsAndJobs(List<string> depNames)
|
|
|
{
|
|
|
+ if (depNames?.Any() != true) return (false, "请求部门为空", new List<string>(), new List<KpiTempDepartmentInfo>());
|
|
|
+
|
|
|
var departments = new List<string>();
|
|
|
var departmentsWithJobs = new List<KpiTempDepartmentInfo>();
|
|
|
var config = await _sqlSugar.Queryable<Sys_SetDataType>()
|
|
|
@@ -146,7 +148,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
return new { Department = dept, Job = job };
|
|
|
})
|
|
|
.Where(x => x.Department != "未分类")
|
|
|
- .WhereIF(!string.IsNullOrEmpty(depName),x=> x.Department.Equals(depName))
|
|
|
+ .WhereIF(depNames.Any(), x => depNames.Contains(x.Department))
|
|
|
.GroupBy(x => x.Department)
|
|
|
.Select(g => new KpiTempDepartmentInfo()
|
|
|
{
|
|
|
@@ -166,7 +168,8 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
/// <returns></returns>
|
|
|
public async Task<JsonView> InitAsync()
|
|
|
{
|
|
|
- var result = await KpiDepartmentsAndJobs("财务部");
|
|
|
+ var depNames = new List<string> { "财务部", "市场部" };
|
|
|
+ var result = await KpiDepartmentsAndJobs(depNames);
|
|
|
if (!result.Success)
|
|
|
{
|
|
|
_jv.Msg = result.Message;
|
|
|
@@ -211,7 +214,8 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
|
|
|
/// <returns></returns>
|
|
|
public async Task<JsonView> PlanningInitAsync()
|
|
|
{
|
|
|
- var result = await KpiDepartmentsAndJobs("策划部");
|
|
|
+ var depNames = new List<string> { "策划部" };
|
|
|
+ var result = await KpiDepartmentsAndJobs(depNames);
|
|
|
if (!result.Success)
|
|
|
{
|
|
|
_jv.Msg = result.Message;
|