岗位技能矩阵

master
xiaochanghai 3 months ago
parent cddb765704
commit 4a5c8f6e59
  1. 8
      Tiobon.Core.Api/Controllers/Ghra/Ghra_TitleController.cs
  2. 4
      Tiobon.Core.IServices/Ghra/IGhra_TitleServices.cs
  3. 17
      Tiobon.Core.Model/ViewModels/Extend/TitleSkillMatrix.cs
  4. 19
      Tiobon.Core.Services/CommonServices.cs
  5. 133
      Tiobon.Core.Services/Ghra/Ghra_TitleServices.cs
  6. 6
      Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs

@ -11,4 +11,12 @@ public class Ghra_TitleController : BaseController<IGhra_TitleServices, Ghra_Tit
public Ghra_TitleController(IGhra_TitleServices service) : base(service) public Ghra_TitleController(IGhra_TitleServices service) : base(service)
{ {
} }
#region 新增
[HttpPost("QuerySkillMatrix")]
public async Task<dynamic> QuerySkillMatrix([FromBody] QueryBody filter)
{
return await _service.QuerySkillMatrix(filter);
}
#endregion
} }

@ -1,5 +1,4 @@
using Tiobon.Core.IServices.BASE; using Tiobon.Core.Common;
using Tiobon.Core.Model.Models;
namespace Tiobon.Core.IServices; namespace Tiobon.Core.IServices;
@ -8,4 +7,5 @@ namespace Tiobon.Core.IServices;
/// </summary> /// </summary>
public interface IGhra_TitleServices : IBaseServices<Ghra_Title, Ghra_TitleDto, InsertGhra_TitleInput, EditGhra_TitleInput> public interface IGhra_TitleServices : IBaseServices<Ghra_Title, Ghra_TitleDto, InsertGhra_TitleInput, EditGhra_TitleInput>
{ {
Task<dynamic> QuerySkillMatrix(QueryBody filter);
} }

@ -0,0 +1,17 @@
namespace Tiobon.Core.Model.ViewModels.Extend;
public class TitleSkillMatrix
{
public long Id { get; set; }
public string CourseNo { get; set; }
public string CourseName { get; set; }
public string RemarkSz { get; set; }
public int SortNo { get; set; }
public int IsEnable { get; set; }
public string Type { get; set; }
public string CourseSceneName { get; set; }
}

@ -2317,7 +2317,7 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
{ {
result.JM_TableColumnT1.TableColumn?.ForEach(x => result.JM_TableColumnT1.TableColumn?.ForEach(x =>
{ {
if (x.label == "实际合计人天" && x.GroupName== num + "月") if (x.label == "实际合计人天" && x.GroupName == num + "月")
x.SortNo = sort; x.SortNo = sort;
if (x.label == "进展率" && x.GroupName == num + "月") if (x.label == "进展率" && x.GroupName == num + "月")
x.SortNo = sort + 1; x.SortNo = sort + 1;
@ -2376,6 +2376,23 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
} }
} }
break; break;
case "F_TitleSkillMatrix":
var column = result.JM_TableColumnT1.TableColumn.Where(x => x.field == "Title_A01").SingleOrDefault();
sort = column.SortNo;
result.JM_TableColumnT1.TableColumn = result.JM_TableColumnT1.TableColumn.Where(x => x.field != "Title_A01").ToList();
var titles = await Db.Queryable<Ghra_Title>().OrderBy(x => x.SortNo).ToListAsync();
index = 0;
titles.ForEach(x =>
{
var copyColumn = Mapper.Map(column).ToANew<TableColumn>();
copyColumn.field = "Title_" + x.TitleNo;
copyColumn.label = x.TitleName;
result.JM_TableColumnT1.TableColumn.Insert(index + sort, copyColumn);
index++;
});
break;
} }
#endregion #endregion

@ -6,11 +6,13 @@
public class Ghra_TitleServices : BaseServices<Ghra_Title, Ghra_TitleDto, InsertGhra_TitleInput, EditGhra_TitleInput>, IGhra_TitleServices public class Ghra_TitleServices : BaseServices<Ghra_Title, Ghra_TitleDto, InsertGhra_TitleInput, EditGhra_TitleInput>, IGhra_TitleServices
{ {
private readonly IBaseRepository<Ghra_Title> _dal; private readonly IBaseRepository<Ghra_Title> _dal;
public Ghra_TitleServices(ICaching caching, IBaseRepository<Ghra_Title> dal) private readonly ICommonServices _commonServices;
public Ghra_TitleServices(ICaching caching, IBaseRepository<Ghra_Title> 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<Ghra_TitleDto> QueryById(object objId) public override async Task<Ghra_TitleDto> QueryById(object objId)
@ -19,4 +21,133 @@ public class Ghra_TitleServices : BaseServices<Ghra_Title, Ghra_TitleDto, Insert
return entity; return entity;
} }
public async Task<dynamic> QuerySkillMatrix(QueryBody filter)
{
dynamic obj = new ExpandoObject();
dynamic result = new ExpandoObject();
if (string.IsNullOrWhiteSpace(filter.orderBy))
filter.orderBy = "Type ASC";
string sql = $"SELECT * FROM Ghre_CourseScene_V WHERE IsEnable=1";
#region 处理查询条件
//Expression<Func<Ghrh_Resume, bool>> whereExpression = new Expression<Func<Ghrh_Resume, bool>>();
var whereExpression = Expressionable.Create<Ghrh_Resume>();
foreach (JProperty jProperty in filter.jsonParam.Properties())
{
var name = jProperty.Name;
var value = jProperty.Value.ToString();
if (name == "page" || name == "pageSize")
continue;
if (value.IsNotEmptyOrNull())
{
//var jsonParam = JsonHelper.JsonToObj<JsonParam>(value);
//switch (name)
//{
// case "WaitRecommend":
// if (jsonParam.columnValue.ObjToInt() == 1)
// sql += $" AND C.Status = '{DIC_INTERVIEW_ORDER_STATUS.WaitRecommended}'";
// break;
// case "HasRecommended":
// if (jsonParam.columnValue.ObjToInt() == 1)
// sql += $" AND C.Status = '{DIC_INTERVIEW_ORDER_STATUS.HasRecommended}'";
// break;
// case "WaitAppointment":
// default:
// break;
//}
}
}
#endregion
if (filter.pageSize == 0)
filter.pageSize = 10000;
var sql1 = GetQueryString(sql, filter.pageNum, filter.pageSize, filter.orderBy);
var totalCount = await Db.Ado.GetIntAsync("select count(0) from ( " + sql + ") A");
var list = DbAccess.QueryList<TitleSkillMatrix>(sql);
ModuleParam param = new ModuleParam()
{
langId = filter.langId,
menuName = filter.menuName
};
var module = await _commonServices.GetModuleInfoAsync(param);
var result1 = new ServicePageResult<TitleSkillMatrix>(filter.pageNum, totalCount, filter.pageSize, list);
result1.result.JM_TableColumnT1 = module.Data.JM_TableColumnT1;
var columns = new JArray();
var titles = await Db.Queryable<Ghra_Title>().OrderBy(x => x.SortNo).ToListAsync();
var rules = await Db.Queryable<Ghre_StudyRule>().Where(x => x.RuleType == "Required" && x.TrainType == "Title").ToListAsync();
var dict = new Dictionary<string, List<int>>();
rules.ForEach(x =>
{
if (x.TitleId.IsNotEmptyOrNull())
{
var key = (x.CourseId ?? x.CourseSceneId).ObjToString();
if (dict.ContainsKey(key))
{
var ids = dict[key];
ids.AddRange(JsonHelper.JsonToObj<List<int>>(x.TitleId));
ids = ids.Distinct().ToList();
dict[key] = ids;
}
else
{
dict.Add(key, JsonHelper.JsonToObj<List<int>>(x.TitleId));
}
}
});
for (int i = 0; i < list.Count; i++)
{
var column = list[i];
var item = new JObject
{
new JProperty("Id", column.Id),
new JProperty("CourseNo", column.CourseNo),
new JProperty("CourseName", column.CourseName),
new JProperty("Type", column.Type),
};
titles.ForEach(x =>
{
if (dict.ContainsKey(column.Id.ObjToString()))
{
var ids = dict[column.Id.ObjToString()];
if (ids.Where(id => id == x.TitleID).Any())
item.Add(new JProperty("Title_" + x.TitleNo, "✔"));
else
item.Add(new JProperty("Title_" + x.TitleNo, ""));
}
else
item.Add(new JProperty("Title_" + x.TitleNo, ""));
});
columns.Add(item);
}
result.JM_TableColumnT1 = module.Data.JM_TableColumnT1;
result.DT_TablePageInfoT1 = result1.result.DT_TablePageInfoT1;
result.DT_TableDataT1 = columns;
obj.result = result;
obj.Success = true;
obj.code = "0";
obj.type = "success";
obj.message = "查询成功!";
return obj;
}
} }

@ -1,8 +1,4 @@
using NPOI.SS.Formula.Functions; using static Tiobon.Core.Model.Consts;
using NPOI.SS.Util;
using System.Linq;
using Tiobon.Core.Common.HttpContextUser;
using static Tiobon.Core.Model.Consts;
namespace Tiobon.Core.Services; namespace Tiobon.Core.Services;

Loading…
Cancel
Save