检查关联培训

This commit is contained in:
2026-11-19 16:31:11 +08:00
parent 461bca785b
commit 8490311e94
22 changed files with 442 additions and 132 deletions
@@ -32,6 +32,7 @@ namespace BLL
newModel.ClassifyId = model.ClassifyId;
newModel.ClassifyItemCode = model.ClassifyItemCode;
newModel.ClassifyItemName = model.ClassifyItemName;
newModel.CompanyTrainingItemId = model.CompanyTrainingItemId;
newModel.CompileMan = model.CompileMan;
newModel.CompileManName = model.CompileManName;
newModel.CompileDate = model.CompileDate;
@@ -52,6 +53,7 @@ namespace BLL
newModel.ClassifyId = model.ClassifyId;
newModel.ClassifyItemCode = model.ClassifyItemCode;
newModel.ClassifyItemName = model.ClassifyItemName;
newModel.CompanyTrainingItemId = model.CompanyTrainingItemId;
newModel.CompileMan = model.CompileMan;
newModel.CompileManName = model.CompileManName;
newModel.CompileDate = model.CompileDate;
+1
View File
@@ -56,6 +56,7 @@ namespace BLL
日常巡检 = 1,
专项检查 = 2,
领导带班检查 = 3,
HSE不符合项 = 4,
}
#endregion
@@ -1,4 +1,6 @@
using System.Collections.Generic;
using System;
using Model;
using System.Collections.Generic;
using System.Linq;
namespace BLL
@@ -117,5 +119,49 @@ namespace BLL
return lst;
}
#region BoundTree
/// <summary>
/// 加载培训教材
/// </summary>
/// <param name="myList"></param>
/// <param name="menuId"></param>
/// <param name="depth"></param>
public static void BoundTree(List<JQueryFeature> myList, string menuId, int depth)
{
var dt = GetNewTraining(menuId);
if (dt.Count() > 0)
{
foreach (var dr in dt)
{
myList.Add(new JQueryFeature(dr.CompanyTrainingId, dr.CompanyTrainingName, depth, false));
BoundTree(myList, dr.CompanyTrainingId, depth + 1);
}
}
else
{
var item = Funs.DB.Training_CompanyTrainingItem.Where(x => x.CompanyTrainingId == menuId).OrderBy(x => x.CompanyTrainingItemCode);
if (item.Count() > 0)
{
foreach (var dr in item)
{
myList.Add(new JQueryFeature(dr.CompanyTrainingItemId, dr.CompanyTrainingItemName, depth, true));
}
}
}
}
/// <summary>
/// 得到菜单方法
/// </summary>
/// <param name="parentId"></param>
/// <returns></returns>
public static List<Model.Training_CompanyTraining> GetNewTraining(string parentId)
{
return (from x in Funs.DB.Training_CompanyTraining where x.SupCompanyTrainingId == parentId orderby x.CompanyTrainingCode select x).ToList(); ;
}
#endregion
}
}
@@ -11,7 +11,7 @@ namespace BLL
/// </summary>
public static class TrainingPlanService
{
/// <summary>
/// 根据主键获取培训计划
@@ -172,6 +172,7 @@ namespace BLL
var plan = GetPlanByCheckId(info.CheckId);
var person = PersonService.GetPersonById(info.PersonId);
var companyTrainingItem = CompanyTrainingItemService.GetCompanyTrainingItemById(info.CompanyTrainingItemId);
//var teachHour = companyTrainingItem.LearningTime != null ? companyTrainingItem.LearningTime / 3600 : 0;
var teachHour = companyTrainingItem.LearningTime / 3600;
string planId = string.Empty;
@@ -189,7 +190,7 @@ namespace BLL
TrainStartDate = plan.TrainStartDate,
TrainEndDate = info.TrainEndDate,
TeachMan = plan.TeachMan,
TeachAddress = plan.TeachAddress,
TeachAddress = !string.IsNullOrWhiteSpace(plan.TeachAddress) ? plan.TeachAddress : "小程序线上培训",
TrainTypeId = Const.RetakeCourseTrainTypeId,
TrainLevelId = Const.OtherTrainLevelId,
States = "1",
@@ -204,8 +205,8 @@ namespace BLL
else
{//生成培训计划
planId = SQLHelper.GetNewID();
string code = ProjectService.GetProjectByProjectId(info.CurrProjectId).ProjectCode + "-";
string planCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.Training_Plan", "PlanCode", info.CurrProjectId, code);
string code = $"{(!string.IsNullOrWhiteSpace(info.CurrProjectId) ? ProjectService.GetProjectByProjectId(info.CurrProjectId).ProjectCode : "HSE")}-";
string planCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.Training_Plan", "PlanCode", (!string.IsNullOrWhiteSpace(info.CurrProjectId) ? info.CurrProjectId : "HSE"), code);
Model.Training_Plan planModel = new Model.Training_Plan
{
@@ -221,6 +222,7 @@ namespace BLL
TeachHour = teachHour,
//TeachMan = model.TeachMan,
//TeachAddress = model.TeachAddress,
TeachAddress = "小程序线上培训",
TrainTypeId = Const.RetakeCourseTrainTypeId,
TrainLevelId = Const.OtherTrainLevelId,
UnitIds = person.UnitId,
+24 -10
View File
@@ -12,7 +12,7 @@ namespace BLL
/// </summary>
public static class PersonService
{
#region 劳务人员列表
/// <summary>
@@ -186,25 +186,39 @@ namespace BLL
/// <summary>
/// 根据项目单位获取人员信息
/// </summary>
/// <param name="personId"></param>
/// <param name="projectId"></param>
/// <param name="unitId"></param>
/// <returns></returns>
public static List<Model.SitePerson_Person> GetPersonLitsByprojectIdUnitId(string projectId, string unitId)
public static List<Model.SitePerson_Person> GetPersonLitsByProjectIdUnitId(string projectId, string unitId)
{
if (!string.IsNullOrEmpty(unitId))
if (!string.IsNullOrEmpty(projectId) && !string.IsNullOrEmpty(unitId))
{
return (from x in Funs.DB.SitePerson_Person
where x.ProjectId == projectId && x.UnitId == unitId
//where x.ProjectId == projectId && x.UnitId == unitId
where x.ProjectId == projectId
orderby x.PersonName
select x).ToList();
}
else
else if (!string.IsNullOrEmpty(projectId))
{
return (from x in Funs.DB.SitePerson_Person
where x.ProjectId == projectId
orderby x.PersonName
select x).ToList();
}
else if (!string.IsNullOrEmpty(unitId))
{
return (from x in Funs.DB.SitePerson_Person
where x.UnitId == unitId
orderby x.PersonName
select x).ToList();
}
else
{
return (from x in Funs.DB.SitePerson_Person
orderby x.PersonName
select x).ToList();
}
}
/// <summary>
@@ -214,7 +228,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.SitePerson_Person> GetPersonLitsByprojectIdUnitIdTeamGroupId(string projectId, string unitId, string teamGroupId)
{
var getPersons = GetPersonLitsByprojectIdUnitId(projectId, unitId);
var getPersons = GetPersonLitsByProjectIdUnitId(projectId, unitId);
if (!string.IsNullOrEmpty(teamGroupId))
{
getPersons = getPersons.Where(x => x.TeamGroupId == teamGroupId).OrderBy(x => x.PersonName).ToList();
@@ -695,7 +709,7 @@ namespace BLL
{
dropName.DataValueField = "PersonId";
dropName.DataTextField = "PersonName";
dropName.DataSource = GetPersonLitsByprojectIdUnitId(projectId, unitId);
dropName.DataSource = GetPersonLitsByProjectIdUnitId(projectId, unitId);
dropName.DataBind();
if (isShowPlease)
{
@@ -720,7 +734,7 @@ namespace BLL
{
if (!string.IsNullOrWhiteSpace(item))
{
var lst = GetPersonLitsByprojectIdUnitId(projectId, item);
var lst = GetPersonLitsByProjectIdUnitId(projectId, item);
list.AddRange(lst);
}
}