检查关联培训

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
@@ -0,0 +1,22 @@
--培训类型:检查重修培训
IF NOT EXISTS (SELECT 1 FROM Base_TrainType WHERE TrainTypeId = '2F687916-5E31-4DF3-97A3-E33E108C8070')
BEGIN
--培训类型:检查重修培训
INSERT INTO Base_TrainType(TrainTypeId,TrainTypeCode,TrainTypeName,Remark,IsAboutSendCard,IsRepeat,TrainType)
VALUES('2F687916-5E31-4DF3-97A3-E33E108C8070','00','检查重修培训','',0,1,0)
END
GO
--不符合项类型:培训教材Id
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Base_SafetyProblemClassifyItem' AND COLUMN_NAME = 'CompanyTrainingItemId')
BEGIN
--培训教材Id
ALTER TABLE Base_SafetyProblemClassifyItem ADD CompanyTrainingItemId nvarchar(500);
EXEC sp_addextendedproperty 'MS_Description', N'培训教材Id','SCHEMA', N'dbo','TABLE', N'Base_SafetyProblemClassifyItem','COLUMN', N'CompanyTrainingItemId';
END
GO
@@ -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);
}
}
@@ -70,9 +70,12 @@
<f:RenderField Width="150px" ColumnID="ClassifyItemCode" DataField="ClassifyItemCode" FieldType="String"
HeaderText="编号" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="250px" ColumnID="ClassifyItemName" DataField="ClassifyItemName" FieldType="String"
<f:RenderField Width="220px" ColumnID="ClassifyItemName" DataField="ClassifyItemName" FieldType="String"
HeaderText="名称" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="380px" ColumnID="CompanyTrainingItemNames" DataField="CompanyTrainingItemNames" FieldType="String"
HeaderText="学习教材" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
@@ -196,7 +196,7 @@ namespace FineUIPro.Web.BaseInfo
if (this.trObj.SelectedNode != null && !string.IsNullOrEmpty(this.trObj.SelectedNode.NodeID))
{
StringBuilder sb = new StringBuilder();
sb.Append("SELECT item.ClassifyItemId,item.ClassifyId,item.ClassifyItemCode,item.ClassifyItemName,item.CompileMan, item.CompileDate ");
sb.Append("SELECT item.ClassifyItemId,item.ClassifyId,item.ClassifyItemCode,item.ClassifyItemName,item.CompanyTrainingItemId,item.CompileMan, item.CompileDate ");
sb.Append("FROM dbo.Base_SafetyProblemClassifyItem AS item ");
sb.Append("WHERE item.ClassifyId=@ClassifyId ");
@@ -217,6 +217,24 @@ namespace FineUIPro.Web.BaseInfo
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(sb.ToString(), parameter);
// 学习教材:把逗号分隔的教材Id转换成教材中文名称
var trainingNames = new Dictionary<string, string>();
foreach (var trainingItem in BLL.CompanyTrainingItemService.GetCompanyTrainingItemList(null))
{
trainingNames[trainingItem.CompanyTrainingItemId] = trainingItem.CompanyTrainingItemName;
}
tb.Columns.Add("CompanyTrainingItemNames", typeof(string));
foreach (DataRow dr in tb.Rows)
{
var ids = Convert.ToString(dr["CompanyTrainingItemId"]).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
var names = new List<string>();
foreach (var id in ids)
{
names.Add(trainingNames.ContainsKey(id.Trim()) ? trainingNames[id.Trim()] : id.Trim());
}
dr["CompanyTrainingItemNames"] = string.Join(",", names);
}
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
@@ -16,7 +16,7 @@
<f:FormRow>
<Items>
<f:TextBox ID="txtClassifyItemCode" runat="server" Label="编号" Required="true"
ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50" LabelWidth="120px" >
ShowRedStar="true" FocusOnPageLoad="true" MaxLength="50" LabelWidth="120px">
</f:TextBox>
</Items>
</f:FormRow>
@@ -27,6 +27,13 @@
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="dpCompanyTraining" runat="server" Label="培训教材" EnableSimulateTree="true" AutoSelectFirstItem="false" EnableMultiSelect="true" EnableCheckBoxSelect="true"
EnableEdit="true" LabelWidth="120px">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtCompileMan" runat="server" Label="整理人" Readonly="true" MaxLength="50" LabelWidth="120px">
@@ -1,9 +1,8 @@
using System;
using System.Linq;
using BLL;
using Model;
using BLL;
using System;
using System.Collections.Generic;
using Microsoft.Office.Interop.Excel;
using System.Linq;
namespace FineUIPro.Web.BaseInfo
{
@@ -46,6 +45,7 @@ namespace FineUIPro.Web.BaseInfo
{
if (!IsPostBack)
{
InitDropDownList();
this.GetButtonPower();
btnClose.OnClientClick = ActiveWindow.GetHideReference();
@@ -64,6 +64,10 @@ namespace FineUIPro.Web.BaseInfo
{
txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", model.CompileDate);
}
if (!string.IsNullOrWhiteSpace(model.CompanyTrainingItemId))
{
dpCompanyTraining.SelectedValueArray = model.CompanyTrainingItemId.Split(',');
}
}
}
else
@@ -76,6 +80,21 @@ namespace FineUIPro.Web.BaseInfo
}
}
/// <summary>
/// 初始化下拉框
/// </summary>
private void InitDropDownList()
{
List<JQueryFeature> myList = new List<JQueryFeature>();
CompanyTrainingItemService.BoundTree(myList, "0", 0);
dpCompanyTraining.DataTextField = "Name";
dpCompanyTraining.DataValueField = "Id";
dpCompanyTraining.DataSimulateTreeLevelField = "Level";
dpCompanyTraining.DataEnableSelectField = "EnableSelect";
dpCompanyTraining.DataSource = myList;
dpCompanyTraining.DataBind();
}
#endregion
@@ -94,6 +113,10 @@ namespace FineUIPro.Web.BaseInfo
CompileManName = this.CurrUser.UserName,
};
if (dpCompanyTraining.SelectedValueArray != null && dpCompanyTraining.SelectedValueArray.Count() > 0)
{
newModel.CompanyTrainingItemId = string.Join(",", dpCompanyTraining.SelectedValueArray);
}
if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim()))
{
newModel.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim());
@@ -59,6 +59,15 @@ namespace FineUIPro.Web.BaseInfo
/// </remarks>
protected global::FineUIPro.TextBox txtClassifyItemName;
/// <summary>
/// dpCompanyTraining 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList dpCompanyTraining;
/// <summary>
/// txtCompileMan 控件。
/// </summary>
@@ -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
}
@@ -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
}
@@ -58,7 +58,7 @@ namespace FineUIPro.Web.Check.QMS
{
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);
this.drpQCUser.Items.Clear();
@@ -75,7 +75,7 @@ namespace FineUIPro.Web.Check.QMS
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);
this.drpQCUser.Items.Clear();
@@ -85,6 +85,8 @@ namespace FineUIPro.Web.Check.QMS
{
this.drpProject.Text = model.ProjectName;
}
PersonService.InitPersonByProjectUnitDropDownList(this.drpRectificationUser, model.ProjectId, model.UnitId, true);
this.drpClassify.SelectedValue = model.ClassifyId;
BLL.QualityProblemClassifyItemService.InitClassifyItemDownList(this.drpClassifyItem, model.ClassifyId, true);
if (!string.IsNullOrWhiteSpace(model.ClassifyItemId))
@@ -174,7 +176,8 @@ namespace FineUIPro.Web.Check.QMS
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);
this.drpQCUser.Items.Clear();
@@ -196,7 +199,8 @@ namespace FineUIPro.Web.Check.QMS
{
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);
this.drpQCUser.Items.Clear();
@@ -109,6 +109,11 @@ namespace FineUIPro.Web.Check.QMS
/// </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 +123,8 @@ namespace FineUIPro.Web.Check.QMS
//users = BLL.ProjectUserService.GetProjectUserByProjectId(this.ProjectId,null,null);
//获取所有在岗用户
users = BLL.UserService.GetProjectUserListByProjectId(null);
//获取所有项目人员
persons = BLL.PersonService.GetPersonLitsByProjectIdUnitId(null, null);
classifys = QualityProblemClassifyService.GetClassify();
classifyItems = QualityProblemClassifyItemService.GetClassifyItemList("");
@@ -465,10 +472,12 @@ namespace FineUIPro.Web.Check.QMS
}
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
@@ -137,9 +137,10 @@ namespace FineUIPro.Web.HSSE.EduTrain
//dpWorkPost.DataTextField = "WorkPostName";
//dpWorkPost.DataSource = workPost;
//dpWorkPost.DataBind();
List<JQueryFeature> myList = new List<JQueryFeature>();
BoundTree(myList, "0", 0);
CompanyTrainingItemService.BoundTree(myList, "0", 0);
dpCompanyTraining.DataTextField = "Name";
dpCompanyTraining.DataValueField = "Id";
dpCompanyTraining.DataSimulateTreeLevelField = "Level";
@@ -150,96 +151,96 @@ namespace FineUIPro.Web.HSSE.EduTrain
}
#region JQueryFeature
//#region JQueryFeature
public class JQueryFeature
{
private string _id;
//public class JQueryFeature
//{
// private string _id;
public string Id
{
get { return _id; }
set { _id = value; }
}
private string _name;
// public string Id
// {
// get { return _id; }
// set { _id = value; }
// }
// private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
// public string Name
// {
// get { return _name; }
// set { _name = value; }
// }
private int _level;
// private int _level;
public int Level
{
get { return _level; }
set { _level = value; }
}
// public int Level
// {
// get { return _level; }
// set { _level = value; }
// }
private bool _enableSelect;
// private bool _enableSelect;
public bool EnableSelect
{
get { return _enableSelect; }
set { _enableSelect = value; }
}
// public bool EnableSelect
// {
// get { return _enableSelect; }
// set { _enableSelect = value; }
// }
public JQueryFeature(string id, string name, int level, bool enableSelect)
{
_id = id;
_name = name;
_level = level;
_enableSelect = enableSelect;
}
// public JQueryFeature(string id, string name, int level, bool enableSelect)
// {
// _id = id;
// _name = name;
// _level = level;
// _enableSelect = enableSelect;
// }
public override string ToString()
{
return String.Format("Name:{0}+Id:{1}", Name, Id);
}
}
// public override string ToString()
// {
// return String.Format("Name:{0}+Id:{1}", Name, Id);
// }
//}
#endregion
//#endregion
/// <summary>
/// 加载培训教材
/// </summary>
/// <param name="myList"></param>
/// <param name="menuId"></param>
/// <param name="depth"></param>
private 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="myList"></param>
///// <param name="menuId"></param>
///// <param name="depth"></param>
//private 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>
private 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(); ;
}
///// <summary>
///// 得到菜单方法
///// </summary>
///// <param name="parentId"></param>
///// <returns></returns>
//private 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
@@ -65,7 +65,7 @@
<f:BoundField ColumnID="ConAndEPCCount" DataField="ConAndEPCCount" HeaderText="施工及EPC项目数" HeaderTextAlign="Center" TextAlign="Center" Width="90px"></f:BoundField>
<f:BoundField ColumnID="SurveyAndDesignCount" DataField="SurveyAndDesignCount" HeaderText="勘察设计项目数" HeaderTextAlign="Center" TextAlign="Center" Width="90px"></f:BoundField>
<f:BoundField ColumnID="WorkingHours" DataField="WorkingHours" HeaderText="百万安全工时" HeaderTextAlign="Center" TextAlign="Center" Width="90px"></f:BoundField>
<f:BoundField ColumnID="SafeDrivingMileage" DataField="SafeDrivingMileage" HeaderText="万公里安全行车里程" HeaderTextAlign="Center" TextAlign="Center" Width="90px"></f:BoundField>
<f:BoundField ColumnID="SafeDrivingMileage" DataField="SafeDrivingMileage" HeaderText="百万公里安全行车里程" HeaderTextAlign="Center" TextAlign="Center" Width="90px"></f:BoundField>
</Columns>
</f:GroupField>
<f:GroupField HeaderText="分公司监督中心监督检查" HeaderTextAlign="Center" TextAlign="Center" ColumnID="GroupField2">
@@ -13,7 +13,7 @@
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow ColumnWidths="25% 30% 45%">
<f:FormRow ColumnWidths="25% 50% 25%">
<Items>
<f:DatePicker ID="txtReportDate" runat="server" Label="日期" DateFormatString="yyyy-MM" EnableEdit="false" Required="true" ShowRedStar="true" LabelWidth="155px" DisplayType="Month" ShowTodayButton="false">
</f:DatePicker>
+1 -1
View File
@@ -58,7 +58,7 @@
<f:RenderField Width="160px" ColumnID="CompileDate" DataField="CompileDate" SortField="CompileDate"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd HH:mm:ss" HeaderText="记分时间" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="160px" ColumnID="UnitName" DataField="UnitName" SortField="UnitName"
<f:RenderField Width="220px" ColumnID="UnitName" DataField="UnitName" SortField="UnitName"
FieldType="String" HeaderText="单位" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="220px" ColumnID="ProjectName" DataField="ProjectName" SortField="ProjectName"
+52
View File
@@ -0,0 +1,52 @@
using System;
namespace Model
{
public class JQueryFeature
{
private string _id;
public string Id
{
get { return _id; }
set { _id = value; }
}
private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
private int _level;
public int Level
{
get { return _level; }
set { _level = value; }
}
private bool _enableSelect;
public bool EnableSelect
{
get { return _enableSelect; }
set { _enableSelect = value; }
}
public JQueryFeature(string id, string name, int level, bool enableSelect)
{
_id = id;
_name = name;
_level = level;
_enableSelect = enableSelect;
}
public override string ToString()
{
return String.Format("Name:{0}+Id:{1}", Name, Id);
}
}
}
+24
View File
@@ -41011,6 +41011,8 @@ namespace Model
private System.Nullable<System.DateTime> _CompileDate;
private string _CompanyTrainingItemId;
private EntityRef<Base_SafetyProblemClassify> _Base_SafetyProblemClassify;
#region 可扩展性方法定义
@@ -41031,6 +41033,8 @@ namespace Model
partial void OnCompileManNameChanged();
partial void OnCompileDateChanging(System.Nullable<System.DateTime> value);
partial void OnCompileDateChanged();
partial void OnCompanyTrainingItemIdChanging(string value);
partial void OnCompanyTrainingItemIdChanged();
#endregion
public Base_SafetyProblemClassifyItem()
@@ -41183,6 +41187,26 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompanyTrainingItemId", DbType="NVarChar(50)")]
public string CompanyTrainingItemId
{
get
{
return this._CompanyTrainingItemId;
}
set
{
if ((this._CompanyTrainingItemId != value))
{
this.OnCompanyTrainingItemIdChanging(value);
this.SendPropertyChanging();
this._CompanyTrainingItemId = value;
this.SendPropertyChanged("CompanyTrainingItemId");
this.OnCompanyTrainingItemIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_SafetyProblemClassifyItem_Classify", Storage="_Base_SafetyProblemClassify", ThisKey="ClassifyId", OtherKey="ClassifyId", IsForeignKey=true)]
public Base_SafetyProblemClassify Base_SafetyProblemClassify
{
+1
View File
@@ -212,6 +212,7 @@
<Compile Include="ErrorInfo.cs" />
<Compile Include="FaceRecordForm.cs" />
<Compile Include="FastReportItem.cs" />
<Compile Include="JQueryFeature.cs" />
<Compile Include="HandleStep.cs" />
<Compile Include="HeadMonthReportProjectStationItem.cs" />
<Compile Include="HJGL\SpRpNDTWeekReport.cs" />