自主管理加分项
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using BLL;
|
||||
using FineUIPro.Web.DataShow;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using static BLL.TrainingPlanService;
|
||||
|
||||
namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
{
|
||||
@@ -78,10 +80,7 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
|
||||
UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpUnit, this.CurrUser.LoginProjectId, Const.ProjectUnitType_2, true);
|
||||
UnitWorkService.InitUnitWorkDownList(this.drpWorkArea, this.CurrUser.LoginProjectId, true);
|
||||
UserService.InitUserProjectIdUnitTypeDropDownList(this.drpResponsibleMan, this.CurrUser.LoginProjectId, Const.ProjectUnitType_2, true);
|
||||
this.InitDropDownList();
|
||||
|
||||
this.drpRegisterTypes.DataTextField = "RegisterTypesName";
|
||||
this.drpRegisterTypes.DataValueField = "RegisterTypesId";
|
||||
@@ -102,11 +101,13 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
this.drpUnit.SelectedValue = registration.ResponsibleUnit;
|
||||
this.drpWorkArea.DataSource = UnitWorkService.GetUnitWorkList(this.CurrUser.LoginProjectId);
|
||||
this.drpWorkArea.DataBind();
|
||||
this.drpResponsibleMan.DataSource = from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser
|
||||
on x.UserId equals y.UserId
|
||||
where y.ProjectId == this.CurrUser.LoginProjectId && x.UnitId == this.drpUnit.SelectedValue
|
||||
select x;
|
||||
//this.drpResponsibleMan.DataSource = from x in db.Sys_User
|
||||
// join y in db.Project_ProjectUser
|
||||
// on x.UserId equals y.UserId
|
||||
// where y.ProjectId == this.CurrUser.LoginProjectId && x.UnitId == this.drpUnit.SelectedValue
|
||||
// select x;
|
||||
|
||||
PersonService.InitPersonByProjectUnitDropDownList(this.drpResponsibleMan, this.CurrUser.LoginProjectId, registration.ResponsibleUnit, false);
|
||||
this.drpResponsibleMan.DataBind();
|
||||
this.drpWorkArea.SelectedValue = BLL.Const._Null;
|
||||
this.drpResponsibleMan.SelectedValue = BLL.Const._Null;
|
||||
@@ -126,6 +127,13 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
if (!string.IsNullOrEmpty(registration.ResponsibleMan))
|
||||
{
|
||||
this.drpResponsibleMan.SelectedValue = registration.ResponsibleMan;
|
||||
//根据人员Id获取职务Id
|
||||
var user = PersonService.GetPersonById(registration.ResponsibleMan);
|
||||
CompanyTrainingItemService.InitCompanyTrainingItemDownList(this.drpTrainingItem, user.WorkPostId, false);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(registration.CompanyTrainingItemId))
|
||||
{
|
||||
this.drpTrainingItem.SelectedValue = registration.CompanyTrainingItemId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(registration.Risk_Level))
|
||||
{
|
||||
@@ -169,6 +177,39 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下拉框加载
|
||||
/// </summary>
|
||||
private void InitDropDownList()
|
||||
{
|
||||
UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpUnit, this.CurrUser.LoginProjectId, Const.ProjectUnitType_2, true);
|
||||
UnitWorkService.InitUnitWorkDownList(this.drpWorkArea, this.CurrUser.LoginProjectId, true);
|
||||
//UserService.InitUserProjectIdUnitTypeDropDownList(this.drpResponsibleMan, this.CurrUser.LoginProjectId, Const.ProjectUnitType_2, true);
|
||||
PersonService.InitPersonByProjectUnitDropDownList(this.drpResponsibleMan, this.CurrUser.LoginProjectId, string.Empty, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 责任人下拉加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drpResponsibleMan_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
//责任人Id
|
||||
var responsibleManId = this.drpResponsibleMan.SelectedValue;
|
||||
if (!string.IsNullOrWhiteSpace(responsibleManId))
|
||||
{
|
||||
//根据人员Id获取职务Id
|
||||
var user = PersonService.GetPersonById(responsibleManId);
|
||||
if (user != null && !string.IsNullOrWhiteSpace(user.WorkPostId))
|
||||
{
|
||||
CompanyTrainingItemService.InitCompanyTrainingItemDownList(this.drpTrainingItem, user.WorkPostId, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
@@ -186,12 +227,14 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
{
|
||||
this.drpWorkArea.DataSource = UnitWorkService.GetUnitWorkList(this.CurrUser.LoginProjectId);
|
||||
this.drpWorkArea.DataBind();
|
||||
this.drpResponsibleMan.DataSource = from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser
|
||||
on x.UserId equals y.UserId
|
||||
where y.ProjectId == this.CurrUser.LoginProjectId && x.UnitId == this.drpUnit.SelectedValue
|
||||
select x;
|
||||
this.drpResponsibleMan.DataBind();
|
||||
|
||||
PersonService.InitPersonByProjectUnitDropDownList(this.drpResponsibleMan, this.CurrUser.LoginProjectId, this.drpUnit.SelectedValue, false);
|
||||
//this.drpResponsibleMan.DataSource = from x in db.Sys_User
|
||||
// join y in db.Project_ProjectUser
|
||||
// on x.UserId equals y.UserId
|
||||
// where y.ProjectId == this.CurrUser.LoginProjectId && x.UnitId == this.drpUnit.SelectedValue
|
||||
// select x;
|
||||
//this.drpResponsibleMan.DataBind();
|
||||
}
|
||||
Funs.FineUIPleaseSelect(this.drpWorkArea);
|
||||
Funs.FineUIPleaseSelect(this.drpResponsibleMan);
|
||||
@@ -215,16 +258,21 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
ShowNotify("请选择责任单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.drpWorkArea.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择单位工程!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.drpWorkArea.SelectedValue == BLL.Const._Null)
|
||||
//if (this.drpWorkArea.SelectedValue == BLL.Const._Null)
|
||||
//{
|
||||
// ShowNotify("请选择单位工程!", MessageBoxIcon.Warning);
|
||||
// return;
|
||||
//}
|
||||
if (this.drpResponsibleMan.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择责任人!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.drpTrainingItem.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择重修教材!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
SaveData(true);
|
||||
}
|
||||
else
|
||||
@@ -240,45 +288,67 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
/// <param name="p"></param>
|
||||
private void SaveData(bool isClosed)
|
||||
{
|
||||
Model.HSSE_Hazard_HazardRegister register = new Model.HSSE_Hazard_HazardRegister();
|
||||
register.ProjectId = this.CurrUser.LoginProjectId;
|
||||
register.ProblemTypes = "1"; //安全隐患问题
|
||||
register.RegisterTypesId = this.drpRegisterTypes.SelectedValue;
|
||||
register.CheckCycle = this.ckType.SelectedValue;
|
||||
register.IsEffective = "1";
|
||||
register.Risk_Level = this.dpRiskLevel.SelectedText;
|
||||
Model.HSSE_Hazard_HazardRegister model = new Model.HSSE_Hazard_HazardRegister();
|
||||
model.ProjectId = this.CurrUser.LoginProjectId;
|
||||
model.ProblemTypes = "1"; //安全隐患问题
|
||||
model.RegisterTypesId = this.drpRegisterTypes.SelectedValue;
|
||||
model.CheckCycle = this.ckType.SelectedValue;
|
||||
model.IsEffective = "1";
|
||||
model.Risk_Level = this.dpRiskLevel.SelectedText;
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
register.ResponsibleUnit = this.drpUnit.SelectedValue;
|
||||
model.ResponsibleUnit = this.drpUnit.SelectedValue;
|
||||
}
|
||||
if (this.drpWorkArea.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
register.Place = this.drpWorkArea.SelectedValue;
|
||||
model.Place = this.drpWorkArea.SelectedValue;
|
||||
}
|
||||
register.RegisterDef = this.txtRegisterDef.Text.Trim();
|
||||
model.RegisterDef = this.txtRegisterDef.Text.Trim();
|
||||
if (this.drpResponsibleMan.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
register.ResponsibleMan = this.drpResponsibleMan.SelectedValue;
|
||||
model.ResponsibleMan = this.drpResponsibleMan.SelectedValue;
|
||||
}
|
||||
register.RectificationPeriod = Funs.GetNewDateTime(this.txtRectificationPeriod.Text.Trim() + " 18:00:00");
|
||||
register.CheckManId = this.hdCheckManId.Text;
|
||||
register.CutPayment = Funs.GetNewIntOrZero(this.txtCutPayment.Text.Trim());
|
||||
register.States = "1"; //待整改
|
||||
model.RectificationPeriod = Funs.GetNewDateTime(this.txtRectificationPeriod.Text.Trim() + " 18:00:00");
|
||||
model.CheckManId = this.hdCheckManId.Text;
|
||||
model.CutPayment = Funs.GetNewIntOrZero(this.txtCutPayment.Text.Trim());
|
||||
model.States = "1";//待整改
|
||||
model.CompanyTrainingItemId = drpTrainingItem.SelectedValue;
|
||||
if (!string.IsNullOrEmpty(HazardRegisterId))
|
||||
{
|
||||
register.HazardRegisterId = HazardRegisterId;
|
||||
BLL.HSSE_Hazard_HazardRegisterService.UpdateHazardRegister(register);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, register.HazardCode, register.HazardRegisterId, BLL.Const.HiddenRectificationMenuId, BLL.Const.BtnModify);
|
||||
model.HazardRegisterId = HazardRegisterId;
|
||||
BLL.HSSE_Hazard_HazardRegisterService.UpdateHazardRegister(model);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, model.HazardCode, model.HazardRegisterId, BLL.Const.HiddenRectificationMenuId, BLL.Const.BtnModify);
|
||||
}
|
||||
else
|
||||
{
|
||||
register.HazardRegisterId = SQLHelper.GetNewID(typeof(Model.HSSE_Hazard_HazardRegister));
|
||||
HazardRegisterId = register.HazardRegisterId;
|
||||
register.CheckTime = DateTime.Now;
|
||||
register.ControlId = Request.Params["ControlId"];
|
||||
BLL.HSSE_Hazard_HazardRegisterService.AddHazardRegister(register);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, register.HazardCode, register.HazardRegisterId, BLL.Const.HiddenRectificationMenuId, BLL.Const.BtnAdd);
|
||||
model.HazardRegisterId = SQLHelper.GetNewID(typeof(Model.HSSE_Hazard_HazardRegister));
|
||||
HazardRegisterId = model.HazardRegisterId;
|
||||
model.CheckTime = DateTime.Now;
|
||||
model.ControlId = Request.Params["ControlId"];
|
||||
BLL.HSSE_Hazard_HazardRegisterService.AddHazardRegister(model);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, model.HazardCode, model.HazardRegisterId, BLL.Const.HiddenRectificationMenuId, BLL.Const.BtnAdd);
|
||||
}
|
||||
|
||||
#region 责任人和重修教材非空,生成培训计划
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(model.ResponsibleMan) && !string.IsNullOrWhiteSpace(model.CompanyTrainingItemId))
|
||||
{//责任人和重修教材非空,生成培训计划
|
||||
Model.RetakeCourseProducePlanInfo info = new Model.RetakeCourseProducePlanInfo
|
||||
{
|
||||
CurrProjectId = this.CurrUser.LoginProjectId,
|
||||
CurrUserId = this.CurrUser.UserId,
|
||||
CheckId = model.HazardRegisterId,
|
||||
CheckType = (int)Enums.RetakeCourseType.日常巡检,
|
||||
CheckTypeName = "日常巡检重修",
|
||||
PersonId = model.ResponsibleMan,
|
||||
CompanyTrainingItemId = model.CompanyTrainingItemId,
|
||||
TrainEndDate = model.RectificationPeriod
|
||||
};
|
||||
TrainingPlanService.RetakeCourseProducePlan(info);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
if (isClosed)
|
||||
{
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
@@ -302,8 +372,8 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
|
||||
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HSSE_HiddenRectificationListMenuId, BLL.Const.BtnAdd))
|
||||
{
|
||||
edit = "1";
|
||||
Model.HSSE_Hazard_HazardRegister register = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(this.HazardRegisterId);
|
||||
DateTime date = Convert.ToDateTime(register.CheckTime);
|
||||
Model.HSSE_Hazard_HazardRegister model = BLL.HSSE_Hazard_HazardRegisterService.GetHazardRegisterByHazardRegisterId(this.HazardRegisterId);
|
||||
DateTime date = Convert.ToDateTime(model.CheckTime);
|
||||
string dateStr = date.Year.ToString() + date.Month.ToString();
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/Registration/" + dateStr + "&menuId={1}&edit={2}", this.HazardRegisterId, Const.HSSE_HiddenRectificationListMenuId, edit)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user