岗位技能_宝连通 (服务)

master
xiaochanghai 2 months ago
parent 6722801e83
commit e281e248ac
  1. 86
      Tiobon.Core.Services/Ghre/Ghre_TitleSkill_BoltoneServices.cs

@ -1,4 +1,5 @@
using MySqlX.XDevAPI.Common;
using NPOI.OpenXmlFormats;
using NPOI.SS.Formula.Functions;
using OfficeOpenXml.FormulaParsing;
using Org.BouncyCastle.Utilities;
@ -120,7 +121,40 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices<Ghre_TitleSkill_Bolt
dynamic obj = new ExpandoObject();
dynamic result = new ExpandoObject();
var result2 = await _staffServices.QueryFilterPage(filter);
var titleSkills = await base.QueryFilterPage(new QueryBody()
{
menuName = "F_TitleSkill_Boltone",
pageNum = 1,
pageSize = 10000,
orderBy = ""
});
var group1 = titleSkills.result.DT_TableDataT1
.Select(x => new
{
x.DeptId,
x.TitleId
}).Distinct().ToList();
string condition = "1=1";
if (group1.Any())
{
condition += "AND (";
var i = 0;
group1.ForEach(x =>
{
if (i == 0)
condition += $"(DeptId={x.DeptId} AND TitleId={x.TitleId})";
else
condition += $"OR (DeptId={x.DeptId} AND TitleId={x.TitleId})";
i++;
});
condition += ")";
}
var result2 = await _staffServices.QueryFilterPage(filter, condition);
var DT_TableDataT1 = result2.result.DT_TableDataT1;
@ -131,16 +165,9 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices<Ghre_TitleSkill_Bolt
};
var module = await _commonServices.GetModuleInfoAsync(param);
var titleSkills = await base.QueryFilterPage(new QueryBody()
{
menuName = "F_TitleSkill_Boltone",
pageNum = 1,
pageSize = 10000,
orderBy = ""
});
var columns = new JArray();
var src = Db.Queryable<Ghre_StudyRecord>();
for (int i = 0; i < result2.result.DT_TableDataT1.Count; i++)
{
var column = result2.result.DT_TableDataT1[i];
@ -155,25 +182,36 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices<Ghre_TitleSkill_Bolt
new JProperty("StaffType1Label", column.StaffType1Label),
new JProperty("TitleName", column.TitleName),
};
//× 生手 技能有效期内所对应课程还未分配或课程学习时长为0
//× 生手 技能有效期内所对应课程还未分配或课程学习时长为0
//◑ 受训中 技能有效期内所对应课程学习时长大于0小时
//☆ 熟练工 技能有效期内所对应的课程学习状态为已完成(含必修、选修课程状态)
//★ 可带教 员工技能所对应的课程学习状态已完成,且通过讲师课程培训学习和考核
//☆ 熟练工 技能有效期内所对应的课程学习状态为已完成(含必修、选修课程状态)
//★ 可带教 员工技能所对应的课程学习状态已完成,且通过讲师课程培训学习和考核
titleSkills.result.DT_TableDataT1.ForEach(item =>
for (int j = 0; j < titleSkills.result.DT_TableDataT1.Count; j++)
{
var item = titleSkills.result.DT_TableDataT1[j];
if (column.DeptID != item.DeptId || column.TitleID != item.TitleId)
continue;
var key = item.CourseId + "_" + item.DeptId + "_" + item.TitleId + "_" + item.RequiredElective;
//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
item1.Add(new JProperty(key, "★"));
});
var value = "×";
if (await src.Where(x =>
x.CourseId == item.CourseId &&
x.StaffId == column.StaffID &&
x.StudyStatus == "NoFinish" &&
((x.CourseBeginTime >= item.EffectiveDate && x.CourseBeginTime <= item.ExpiryDate) || (x.CourseEndTime >= item.EffectiveDate && x.CourseEndTime <= item.ExpiryDate))
).AnyAsync())
value = "◑";
if (await src.Where(x =>
x.CourseId == item.CourseId &&
x.StaffId == column.StaffID &&
x.StudyStatus == "HasFinish" &&
((x.CourseBeginTime >= item.EffectiveDate && x.CourseBeginTime <= item.ExpiryDate) || (x.CourseEndTime >= item.EffectiveDate && x.CourseEndTime <= item.ExpiryDate))
).AnyAsync())
value = "☆";
item1.Add(new JProperty(key, value));
}
columns.Add(item1);
}

Loading…
Cancel
Save