检查关联培训

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
@@ -58,7 +58,7 @@ namespace FineUIPro.Web.Check.HSE
{
this.drpUnit.SelectedValue = model.UnitId;
this.drpRectificationUser.Items.Clear();
BLL.UserService.InitUserUnitIdDropDownList(this.drpRectificationUser, model.UnitId, true);
//BLL.UserService.InitUserUnitIdDropDownList(this.drpRectificationUser, model.UnitId, true);
this.drpPMUser.Items.Clear();
BLL.UserService.InitUserUnitIdDropDownList(this.drpPMUser, model.UnitId, true);
@@ -71,7 +71,7 @@ namespace FineUIPro.Web.Check.HSE
var pro = BLL.ProjectService.GetProjectByProjectId(model.ProjectId);
this.txtAddress.Text = pro.ProjectAddress;
this.drpRectificationUser.Items.Clear();
BLL.UserService.InitUserDropDownList(this.drpRectificationUser, model.ProjectId, true);
//BLL.UserService.InitUserDropDownList(this.drpRectificationUser, model.ProjectId, true);
this.drpPMUser.Items.Clear();
BLL.UserService.InitUserDropDownList(this.drpPMUser, model.ProjectId, true);
}
@@ -79,6 +79,7 @@ namespace FineUIPro.Web.Check.HSE
{
this.drpProject.Text = model.ProjectName;
}
PersonService.InitPersonByProjectUnitDropDownList(this.drpRectificationUser, model.ProjectId, model.UnitId, true);
//var pro = BLL.ProjectService.GetProjectByProjectId(model.ProjectId);
//if (pro != null)
//{
@@ -172,7 +173,8 @@ namespace FineUIPro.Web.Check.HSE
BLL.ProjectService.InitProjectDropDownList(this.drpProject, this.drpUnit.SelectedValue, true);
this.drpRectificationUser.Items.Clear();
BLL.UserService.InitUserUnitIdDropDownList(this.drpRectificationUser, this.drpUnit.SelectedValue, true);
//BLL.UserService.InitUserUnitIdDropDownList(this.drpRectificationUser, this.drpUnit.SelectedValue, true);
PersonService.InitPersonByProjectUnitDropDownList(this.drpRectificationUser, null, this.drpUnit.SelectedValue, true);
this.drpPMUser.Items.Clear();
BLL.UserService.InitUserUnitIdDropDownList(this.drpPMUser, this.drpUnit.SelectedValue, true);
}
@@ -192,7 +194,8 @@ namespace FineUIPro.Web.Check.HSE
{
this.txtAddress.Text = pro.ProjectAddress;
this.drpRectificationUser.Items.Clear();
BLL.UserService.InitUserDropDownList(this.drpRectificationUser, proId, true);
//BLL.UserService.InitUserDropDownList(this.drpRectificationUser, proId, true);
PersonService.InitPersonByProjectUnitDropDownList(this.drpRectificationUser, proId, this.drpUnit.SelectedValue, true);
this.drpPMUser.Items.Clear();
BLL.UserService.InitUserDropDownList(this.drpPMUser, proId, true);
}
@@ -407,7 +410,8 @@ namespace FineUIPro.Web.Check.HSE
}
#region 扣分记录
var user = BLL.UserService.GetUserByUserId(model.RectificationUserId);
var user = BLL.PersonService.GetPersonById(model.RectificationUserId);
//var user = BLL.UserService.GetUserByUserId(model.RectificationUserId);
if (user != null)
{
int oldS = 0;
@@ -428,20 +432,17 @@ namespace FineUIPro.Web.Check.HSE
//增加人员记分流水
ScoreFlowLog log = new ScoreFlowLog();
log.Id = SQLHelper.GetNewID();
if (!string.IsNullOrEmpty(txtCheckDate.Text.Trim()))
{
log.Year = Convert.ToDateTime(txtCheckDate.Text.Trim()).Year;
}
log.UserId = this.drpRectificationUser.SelectedValue;
log.UserName = this.drpRectificationUser.SelectedText;
log.Year = model.CheckDate.Year;
log.UserId = model.RectificationUserId;
log.UserName = model.RectificationUserName;
log.IdentityCard = user.IdentityCard;
log.UnitId = this.drpUnit.SelectedValue;
log.ProjectId = this.drpProject.SelectedValue;
log.UnitName = this.drpUnit.SelectedText;
log.ProjectName = this.drpProject.SelectedText;
log.UnitId = model.UnitId;
log.ProjectId = model.ProjectId;
log.UnitName = model.UnitName;
log.ProjectName = model.ProjectName;
log.Item = "安全不符合项";
log.LogContent = "隐患问责扣分";
log.CheckDate = Convert.ToDateTime(this.txtCheckDate.Text.Trim());
log.CheckDate = model.CheckDate;
if (saveType == "1")
{
log.CompileDate = DateTime.Now;
@@ -452,7 +453,7 @@ namespace FineUIPro.Web.Check.HSE
}
log.CompileMan = this.CurrUser.UserName;
log.CompileManId = this.CurrUser.UserId;
log.DataSourceId = this.CheckId;
log.DataSourceId = model.CheckId;
log.Type = 0;//扣分
//特别严重(管控红线)扣成0分,严重(危险作业许可)扣除100分,较大扣除50分,一般扣除20分,轻微扣除2分
if (drpNature.SelectedValue == BLL.Const.SafetyNatureIdN1)
@@ -499,7 +500,7 @@ namespace FineUIPro.Web.Check.HSE
su.Score = log.CurrentScore;
su.UserName = log.UserName;
su.CompileDate = log.CompileDate;
su.DataSourceId = this.CheckId;
su.DataSourceId = model.CheckId;
su.CheckDate = log.CheckDate;
BLL.ScoreUserService.AddScoreUser(su);
#endregion
@@ -524,6 +525,35 @@ namespace FineUIPro.Web.Check.HSE
}
}
#endregion
var classModel = SafetyProblemClassifyItemService.GetClassifyItemById(model.ClassifyItemId);
#region 责任人和问题类型关联重修教材非空,生成培训计划
if (!string.IsNullOrWhiteSpace(model.RectificationUserId) && !string.IsNullOrWhiteSpace(classModel.CompanyTrainingItemId))
{//责任人和重修教材非空,生成培训计划
var ItemIds = classModel.CompanyTrainingItemId.Split(',');
int index = 0;
foreach (var ItemId in ItemIds)
{
index++;
var CheckTypeName = Enums.RetakeCourseType.HSE不符合项.ToString();
Model.ProducePlanInfo info = new Model.ProducePlanInfo
{
CurrProjectId = !string.IsNullOrWhiteSpace(model.ProjectId) ? model.ProjectId : this.CurrUser.LoginProjectId,
CurrUserId = this.CurrUser.UserId,
CheckId = $"{this.CheckId}_{index}",
CheckType = (int)Enums.RetakeCourseType.HSE不符合项,
CheckTypeName = "HSE不符合项",
PersonId = model.RectificationUserId,
CompanyTrainingItemId = ItemId,
//TrainEndDate = model.RectificationPeriod
};
TrainingPlanService.RetakeCourseProducePlan(info);
}
}
#endregion
}