|
|
@ -1,4 +1,7 @@ |
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
using Elasticsearch.Net; |
|
|
|
|
|
|
|
using NPOI.Util.Collections; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// 年度人力配置 (服务) |
|
|
|
/// 年度人力配置 (服务) |
|
|
@ -6,17 +9,33 @@ |
|
|
|
public class Ghrh_YearHumanSettingsServices : BaseServices<Ghrh_YearHumanSettings, Ghrh_YearHumanSettingsDto, InsertGhrh_YearHumanSettingsInput, EditGhrh_YearHumanSettingsInput>, IGhrh_YearHumanSettingsServices |
|
|
|
public class Ghrh_YearHumanSettingsServices : BaseServices<Ghrh_YearHumanSettings, Ghrh_YearHumanSettingsDto, InsertGhrh_YearHumanSettingsInput, EditGhrh_YearHumanSettingsInput>, IGhrh_YearHumanSettingsServices |
|
|
|
{ |
|
|
|
{ |
|
|
|
private readonly IBaseRepository<Ghrh_YearHumanSettings> _dal; |
|
|
|
private readonly IBaseRepository<Ghrh_YearHumanSettings> _dal; |
|
|
|
public Ghrh_YearHumanSettingsServices(ICaching caching, IBaseRepository<Ghrh_YearHumanSettings> dal) |
|
|
|
private readonly ICommonServices _commonServices; |
|
|
|
|
|
|
|
public Ghrh_YearHumanSettingsServices(ICaching caching, IBaseRepository<Ghrh_YearHumanSettings> dal, ICommonServices commonServices) |
|
|
|
{ |
|
|
|
{ |
|
|
|
this._dal = dal; |
|
|
|
this._dal = dal; |
|
|
|
base.BaseDal = dal; |
|
|
|
base.BaseDal = dal; |
|
|
|
base._caching = caching; |
|
|
|
base._caching = caching; |
|
|
|
|
|
|
|
_commonServices = commonServices; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public override async Task<ServicePageResult<Ghrh_YearHumanSettingsDto>> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) |
|
|
|
public override async Task<ServicePageResult<Ghrh_YearHumanSettingsDto>> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var result = await base.QueryFilterPage(filter, condition, IsEnable); |
|
|
|
var result = await base.QueryFilterPage(filter, condition, IsEnable); |
|
|
|
var entitys = result.result.DT_TableDataT1; |
|
|
|
var entitys = result.result.DT_TableDataT1; |
|
|
|
|
|
|
|
int? year = null; |
|
|
|
|
|
|
|
if (filter.jsonParam != null) |
|
|
|
|
|
|
|
foreach (JProperty jProperty in filter.jsonParam.Properties()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var name = jProperty.Name; |
|
|
|
|
|
|
|
var value = jProperty.Value.ToString(); |
|
|
|
|
|
|
|
if (name == "Year") |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var jsonParam = JsonHelper.JsonToObj<JsonParam>(value); |
|
|
|
|
|
|
|
year = jsonParam.columnValue.ObjToInt(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var deptIds = entitys.Where(x => x.DeptId != null).Select(x => x.DeptId).ToList(); |
|
|
|
var deptIds = entitys.Where(x => x.DeptId != null).Select(x => x.DeptId).ToList(); |
|
|
|
var titleIds = entitys.Where(x => x.TitleId != null).Select(x => x.TitleId).ToList(); |
|
|
|
var titleIds = entitys.Where(x => x.TitleId != null).Select(x => x.TitleId).ToList(); |
|
|
@ -64,6 +83,27 @@ public class Ghrh_YearHumanSettingsServices : BaseServices<Ghrh_YearHumanSetting |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
result.result.DT_TableDataT1 = entitys; |
|
|
|
result.result.DT_TableDataT1 = entitys; |
|
|
|
|
|
|
|
ModuleParam param = new ModuleParam() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
langId = filter.langId, |
|
|
|
|
|
|
|
menuName = filter.menuName |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
var module = await _commonServices.GetModuleInfoAsync(param); |
|
|
|
|
|
|
|
result.result.JM_TableColumnT1 = module.Data.JM_TableColumnT1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var yearField = module.Data.JM_TableColumnT1.TableColumn.Where(x => x.field == "Year").SingleOrDefault(); |
|
|
|
|
|
|
|
if (year != yearField?.searchColumnDefaultValue.ObjToInt()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.result.JM_TableColumnT1.TableColumn?.ForEach(x => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int month = x.field.Replace("M", null).ObjToInt(); |
|
|
|
|
|
|
|
if (x.GroupName == "预算编制数") |
|
|
|
|
|
|
|
x.label = year + "-" + x.field.Replace("M", null); |
|
|
|
|
|
|
|
if (month == 12) |
|
|
|
|
|
|
|
year++; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |