检查关联培训
This commit is contained in:
@@ -109,6 +109,10 @@ namespace FineUIPro.Web.Check.HSE
|
||||
/// </summary>
|
||||
public static List<Sys_User> users = new List<Sys_User>();
|
||||
|
||||
/// <summary>
|
||||
/// 项目人员
|
||||
/// </summary>
|
||||
public static List<SitePerson_Person> persons = new List<SitePerson_Person>();
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
@@ -118,6 +122,8 @@ namespace FineUIPro.Web.Check.HSE
|
||||
//users = BLL.ProjectUserService.GetProjectUserByProjectId(this.ProjectId,null,null);
|
||||
//获取所有在岗用户
|
||||
users = BLL.UserService.GetProjectUserListByProjectId(null);
|
||||
//获取所有项目人员
|
||||
persons = BLL.PersonService.GetPersonLitsByProjectIdUnitId(null, null);
|
||||
|
||||
classifys = SafetyProblemClassifyService.GetClassify();
|
||||
classifyItems = SafetyProblemClassifyItemService.GetClassifyItemList("");
|
||||
@@ -462,10 +468,12 @@ namespace FineUIPro.Web.Check.HSE
|
||||
}
|
||||
if (!string.IsNullOrEmpty(rData9))
|
||||
{
|
||||
var user = users.Where(x => x.UserName == rData9).FirstOrDefault();
|
||||
var user = persons.Where(x => (x.ProjectId == ProjectId || ProjectId == null) && x.PersonName == rData9).FirstOrDefault();
|
||||
//var user = users.Where(x => x.UserName == rData9).FirstOrDefault();
|
||||
if (user != null)
|
||||
{
|
||||
RectificationUserId = user.UserId;
|
||||
RectificationUserId = user.PersonName;
|
||||
//RectificationUserId = user.UserId;
|
||||
RectificationUserName = rData9;
|
||||
}
|
||||
else
|
||||
@@ -699,16 +707,19 @@ namespace FineUIPro.Web.Check.HSE
|
||||
Funs.DB.CheckProblem_Safety.InsertAllOnSubmit(toInsert);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
#region 扣分记录
|
||||
#region 扣分记录&重修培训
|
||||
toInsert = toInsert.OrderBy(x => x.CheckDate).ToList();
|
||||
foreach (var item in toInsert)
|
||||
{
|
||||
#region 扣分记录
|
||||
|
||||
ScoreFlowLog log = new ScoreFlowLog();
|
||||
log.Id = SQLHelper.GetNewID();
|
||||
log.Year = item.CheckDate.Year;
|
||||
log.UserId = item.RectificationUserId;
|
||||
log.UserName = item.RectificationUserName;
|
||||
var user = BLL.UserService.GetUserByUserId(item.RectificationUserId);
|
||||
var user = BLL.PersonService.GetPersonById(item.RectificationUserId);
|
||||
//var user = BLL.UserService.GetUserByUserId(item.RectificationUserId);
|
||||
if (user != null)
|
||||
{
|
||||
log.IdentityCard = user.IdentityCard;
|
||||
@@ -773,6 +784,37 @@ namespace FineUIPro.Web.Check.HSE
|
||||
su.DataSourceId = log.DataSourceId;
|
||||
su.CheckDate = log.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(su);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 责任人和问题类型关联重修教材非空,生成培训计划
|
||||
|
||||
var classModel = SafetyProblemClassifyItemService.GetClassifyItemById(item.ClassifyItemId);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(item.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(item.ProjectId) ? item.ProjectId : this.CurrUser.LoginProjectId,
|
||||
CurrUserId = this.CurrUser.UserId,
|
||||
CheckId = $"{item.CheckId}_{index}",
|
||||
CheckType = (int)Enums.RetakeCourseType.HSE不符合项,
|
||||
CheckTypeName = "HSE不符合项",
|
||||
PersonId = item.RectificationUserId,
|
||||
CompanyTrainingItemId = ItemId,
|
||||
//TrainEndDate = model.RectificationPeriod
|
||||
};
|
||||
TrainingPlanService.RetakeCourseProducePlan(info);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user