优化岗位技能矩阵_宝连通

master
xiaochanghai 4 weeks ago
parent ac7d737947
commit ff9f6cdbf3
  1. 7
      Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs
  2. 141
      Tiobon.Core.Services/Ghre/Ghre_TitleSkill_BoltoneServices.cs

@ -1317,6 +1317,13 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
#endregion
#region 处理学习完成状态
studyRecord.CompleteStatus = DIC_STUDY_RECORD_STUDY_COMPLETE_STATUS.NO_FINISH;
await Db.Updateable(studyRecord)
.UpdateColumns(it => new
{
it.CompleteStatus
}, true)
.ExecuteCommandAsync();
if (record.IsPass == true)
await ExamHelper.MarkCompleteStatusAsync(Db, studyRecord);

@ -1,4 +1,7 @@
namespace Tiobon.Core.Services;
using SqlSugar.Extensions;
using System.Collections.Generic;
namespace Tiobon.Core.Services;
/// <summary>
/// 岗位技能_宝连通 (服务)
@ -55,7 +58,7 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices<Ghre_TitleSkill_Bolt
DT_TableDataT1[i].DeptName = dept?.DeptName;
if (dept != null && dept.ParentDeptID.IsNotEmptyOrNull())
DT_TableDataT1[i].ParentDeptName = depts.Where(x => x.DeptID == dept.ParentDeptID).Select(X => X.DeptName).FirstOrDefault();
DT_TableDataT1[i].ParentDeptName = await Db.Queryable<Ghro_Dept>().Where(x => x.DeptID == dept.ParentDeptID).Select(X => X.DeptName).FirstAsync();
}
if (DT_TableDataT1[i].TitleId.IsNotEmptyOrNull())
@ -114,13 +117,121 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices<Ghre_TitleSkill_Bolt
dynamic obj = new ExpandoObject();
dynamic result = new ExpandoObject();
var titleSkills = await base.QueryFilterPage(new QueryBody()
string titleSkillsCondition = "1=1";
int? TitleId = null;
DateTime? Date = null;
int? StaffId = null;
int? DeptId = null;
int? ParentDeptId = null;
long? CourseId = null;
if (filter.jsonParam != null)
foreach (JProperty jProperty in filter.jsonParam.Properties())
{
var name = jProperty.Name;
var value = jProperty.Value.ToString();
if (name == "page" || name == "pageSize")
continue;
if (name == "TitleId")
{
var jsonParam = JsonConvert.DeserializeObject<JsonParam>(value);
if (jsonParam.columnValue.IsNotEmptyOrNull())
TitleId = jsonParam.columnValue.ObjToInt();
continue;
}
else if (name == "Date")
{
var jsonParam = JsonConvert.DeserializeObject<JsonParam>(value);
if (jsonParam.columnValue.IsNotEmptyOrNull())
Date = jsonParam.columnValue.ObjToDate();
continue;
}
else if (name == "StaffId")
{
var jsonParam = JsonConvert.DeserializeObject<JsonParam>(value);
if (jsonParam.columnValue.IsNotEmptyOrNull())
StaffId = jsonParam.columnValue.ObjToInt();
continue;
}
else if (name == "ParentDeptName")
{
var jsonParam = JsonConvert.DeserializeObject<JsonParam>(value);
if (jsonParam.columnValue.IsNotEmptyOrNull())
ParentDeptId = jsonParam.columnValue.ObjToInt();
continue;
}
else if (name == "DeptName")
{
var jsonParam = JsonConvert.DeserializeObject<JsonParam>(value);
if (jsonParam.columnValue.IsNotEmptyOrNull())
DeptId = jsonParam.columnValue.ObjToInt();
continue;
}
else if (name == "CourseId")
{
var jsonParam = JsonConvert.DeserializeObject<JsonParam>(value);
if (jsonParam.columnValue.IsNotEmptyOrNull())
CourseId = jsonParam.columnValue.ObjToLong();
continue;
}
}
if (TitleId != null)
titleSkillsCondition += $" AND TitleId='{TitleId}'";
if (CourseId != null)
titleSkillsCondition += $" AND CourseId='{CourseId}'";
if (Date != null)
titleSkillsCondition += $" AND EffectiveDate <='{Date}' AND ExpiryDate >='{Date}'";
var deptIds1 = new List<int?>();
if (DeptId != null)
deptIds1.Add(DeptId);
if (ParentDeptId != null)
{
var deptIds = await Db.Queryable<Ghro_Dept>()
.Where(x => x.ParentDeptID != null && x.ParentDeptID == ParentDeptId)
.Select(x => x.DeptID).ToListAsync();
if (deptIds.Any())
deptIds1.AddRange(deptIds);
else deptIds1 = new List<int?>() { 0 };
}
if (deptIds1.Any())
{
titleSkillsCondition += " AND (";
var i = 0;
deptIds1.ForEach(x =>
{
if (i == 0)
titleSkillsCondition += $"DeptId={x}";
else
titleSkillsCondition += $" OR DeptId={x}";
i++;
});
titleSkillsCondition += ")";
}
var titleSkillsfilter = new QueryBody()
{
menuName = "F_TitleSkill_Boltone",
pageNum = 1,
pageSize = 10000,
orderBy = ""
});
};
var src = Db.Queryable<Ghre_TitleSkill_Boltone>();
var titleSkills = await QueryFilterPage(titleSkillsfilter, titleSkillsCondition);
var group1 = titleSkills.result.DT_TableDataT1
.Select(x => new
@ -149,6 +260,24 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices<Ghre_TitleSkill_Bolt
else
condition += $" AND 1!=1";
if (deptIds1.Any())
{
condition += " AND (";
var i = 0;
deptIds1.ForEach(x =>
{
if (i == 0)
condition += $"DeptId={x}";
else
condition += $" OR DeptId={x}";
i++;
});
condition += ")";
}
if (StaffId != null)
condition += $" AND StaffID={StaffId}";
var result2 = await _staffServices.QueryFilterPage(filter, condition);
var DT_TableDataT1 = result2.result.DT_TableDataT1;
@ -162,7 +291,7 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices<Ghre_TitleSkill_Bolt
var columns = new JArray();
var src = Db.Queryable<Ghre_StudyRecord>();
//var src = Db.Queryable<Ghre_StudyRecord>();
for (int i = 0; i < result2.result.DT_TableDataT1.Count; i++)
{
var column = result2.result.DT_TableDataT1[i];
@ -178,6 +307,8 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices<Ghre_TitleSkill_Bolt
new JProperty("StaffName", column.StaffName),
new JProperty("StaffType1Label", column.Reverse16),
new JProperty("TitleName", column.TitleName),
new JProperty("ParentDeptName", column.ParentDeptName),
};
//× 生手 技能有效期内所对应课程还未分配或课程学习时长为0
//◑ 受训中 技能有效期内所对应课程学习时长大于0小时

Loading…
Cancel
Save