|
|
|
@ -1,4 +1,9 @@ |
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
using MySqlX.XDevAPI.Common; |
|
|
|
|
using NPOI.SS.Formula.Functions; |
|
|
|
|
using OfficeOpenXml.FormulaParsing; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// 岗位技能_宝连通 (服务) |
|
|
|
@ -6,11 +11,18 @@ |
|
|
|
|
public class Ghre_TitleSkill_BoltoneServices : BaseServices<Ghre_TitleSkill_Boltone, Ghre_TitleSkill_BoltoneDto, InsertGhre_TitleSkill_BoltoneInput, EditGhre_TitleSkill_BoltoneInput>, IGhre_TitleSkill_BoltoneServices |
|
|
|
|
{ |
|
|
|
|
private readonly IBaseRepository<Ghre_TitleSkill_Boltone> _dal; |
|
|
|
|
public Ghre_TitleSkill_BoltoneServices(ICaching caching, IBaseRepository<Ghre_TitleSkill_Boltone> dal) |
|
|
|
|
private readonly ICommonServices _commonServices; |
|
|
|
|
private readonly IGhra_StaffServices _staffServices; |
|
|
|
|
public Ghre_TitleSkill_BoltoneServices(ICaching caching, |
|
|
|
|
IBaseRepository<Ghre_TitleSkill_Boltone> dal, |
|
|
|
|
IGhra_StaffServices staffServices, |
|
|
|
|
ICommonServices commonServices) |
|
|
|
|
{ |
|
|
|
|
this._dal = dal; |
|
|
|
|
base.BaseDal = dal; |
|
|
|
|
base._caching = caching; |
|
|
|
|
_staffServices = staffServices; |
|
|
|
|
_commonServices = commonServices; |
|
|
|
|
} |
|
|
|
|
public override async Task<ServicePageResult<Ghre_TitleSkill_BoltoneDto>> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) |
|
|
|
|
{ |
|
|
|
@ -101,4 +113,100 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices<Ghre_TitleSkill_Bolt |
|
|
|
|
// result.result.DT_TableDataT1[0].TotalDays = result.result.DT_TableDataT1[0].TrainNum * result.result.DT_TableDataT1[0].TrainDays; |
|
|
|
|
// return result; |
|
|
|
|
//} |
|
|
|
|
|
|
|
|
|
public async Task<dynamic> QueryMatrix(QueryBody filter) |
|
|
|
|
{ |
|
|
|
|
dynamic obj = new ExpandoObject(); |
|
|
|
|
dynamic result = new ExpandoObject(); |
|
|
|
|
|
|
|
|
|
var result2 = await _staffServices.QueryFilterPage(filter); |
|
|
|
|
|
|
|
|
|
var DT_TableDataT1 = result2.result.DT_TableDataT1; |
|
|
|
|
|
|
|
|
|
ModuleParam param = new ModuleParam() |
|
|
|
|
{ |
|
|
|
|
langId = filter.langId, |
|
|
|
|
menuName = filter.menuName |
|
|
|
|
}; |
|
|
|
|
var module = await _commonServices.GetModuleInfoAsync(param); |
|
|
|
|
|
|
|
|
|
//var result1 = new ServicePageResult<Ghre_TitleSkillMatrix_Boltone>(filter.pageNum, result2.result.DT_TablePageInfoT1.TotalCount, filter.pageSize, entitys); |
|
|
|
|
//result1.result.JM_TableColumnT1 = module.Data.JM_TableColumnT1; |
|
|
|
|
|
|
|
|
|
var titleSkills = await base.QueryFilterPage(new QueryBody() |
|
|
|
|
{ |
|
|
|
|
menuName = "F_TitleSkill_Boltone", |
|
|
|
|
pageNum = 1, |
|
|
|
|
pageSize = 10000, |
|
|
|
|
orderBy = "" |
|
|
|
|
}); |
|
|
|
|
var columns = new JArray(); |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < result2.result.DT_TableDataT1.Count; i++) |
|
|
|
|
{ |
|
|
|
|
var column = result2.result.DT_TableDataT1[i]; |
|
|
|
|
|
|
|
|
|
var item = new JObject |
|
|
|
|
{ |
|
|
|
|
new JProperty("StaffID", column.StaffID), |
|
|
|
|
new JProperty("DeptName", column.DeptName), |
|
|
|
|
new JProperty("IndateLabel", column.IndateLabel), |
|
|
|
|
new JProperty("StaffNo", column.StaffNo), |
|
|
|
|
new JProperty("StaffName", column.StaffName), |
|
|
|
|
new JProperty("StaffType1Label", column.StaffType1Label), |
|
|
|
|
new JProperty("TitleName", column.TitleName), |
|
|
|
|
}; |
|
|
|
|
columns.Add(item); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var list = titleSkills.result.DT_TableDataT1.Select(x => new |
|
|
|
|
{ |
|
|
|
|
Code = x.DeptId + "_" + x.TitleId + "_" + x.RequiredElective, |
|
|
|
|
Name = x.DeptName + "(" + x.RequiredElective + ")", |
|
|
|
|
x.CourseId, |
|
|
|
|
x.CourseName, |
|
|
|
|
x.DeptId, |
|
|
|
|
x.DeptName, |
|
|
|
|
x.TitleId, |
|
|
|
|
x.TitleName, |
|
|
|
|
x.RequiredElective, |
|
|
|
|
}).ToList(); |
|
|
|
|
|
|
|
|
|
var group = list.GroupBy(x => new { x.Name }) |
|
|
|
|
.Select(x => |
|
|
|
|
new |
|
|
|
|
{ |
|
|
|
|
x.Key.Name, |
|
|
|
|
items = x.ToList() |
|
|
|
|
|
|
|
|
|
}).ToList(); |
|
|
|
|
group = group.OrderBy(x => x.Name).ToList(); |
|
|
|
|
|
|
|
|
|
var demoColumn = module.Data.JM_TableColumnT1.TableColumn.Where(x => x.field == "Demo").FirstOrDefault(); |
|
|
|
|
group.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
x.items.ForEach(item => |
|
|
|
|
{ |
|
|
|
|
var column1 = Mapper.Map(demoColumn).ToANew<TableColumn>(); |
|
|
|
|
column1.field = item.CourseId + "" + item.DeptId + item.TitleId + item.RequiredElective; |
|
|
|
|
column1.label = item.CourseName; |
|
|
|
|
column1.GroupName = x.Name; |
|
|
|
|
module.Data.JM_TableColumnT1.TableColumn.Add(column1); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
module.Data.JM_TableColumnT1.TableColumn = module.Data.JM_TableColumnT1.TableColumn.Where(x => x.field != "Demo").ToList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.JM_TableColumnT1 = module.Data.JM_TableColumnT1; |
|
|
|
|
result.DT_TablePageInfoT1 = result2.result.DT_TablePageInfoT1; |
|
|
|
|
result.DT_TableDataT1 = columns; |
|
|
|
|
obj.result = result; |
|
|
|
|
obj.Success = true; |
|
|
|
|
obj.code = "0"; |
|
|
|
|
obj.type = "success"; |
|
|
|
|
obj.message = "查询成功!"; |
|
|
|
|
return obj; |
|
|
|
|
} |
|
|
|
|
} |