自主管理加分项

This commit is contained in:
2025-03-04 18:12:07 +08:00
parent 6b48da4eff
commit 5d3273f119
92 changed files with 3646 additions and 4595 deletions
@@ -9,100 +9,104 @@
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:DropDownList runat="server" EnableSimulateTree="True" Label="检查项" ID="drpRegisterTypes" >
</f:DropDownList>
<f:RadioButtonList ID="ckType" runat="server" Label="巡检周期"
Width="330px" Hidden="true">
<f:RadioItem Value="D" Selected="True" Text="日检" />
<f:RadioItem Value="W" Text="周检" />
<f:RadioItem Value="M" Text="月检" />
</f:RadioButtonList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList runat="server" EnableSimulateTree="True" Label="责任单位" ID="drpUnit"
AutoPostBack="true" OnSelectedIndexChanged="drpUnit_OnSelectedIndexChanged">
</f:DropDownList>
<f:DropDownList runat="server" EnableSimulateTree="True" Label="单位工程" ID="drpWorkArea">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList runat="server" EnableSimulateTree="True" Label="级别" ID="dpRiskLevel" >
<f:ListItem Text="轻微" Value="轻微"/>
<f:ListItem Text="一般" Value="一般"/>
<f:ListItem Text="较大" Value="较大"/>
<f:ListItem Text="严重" Value="严重"/>
</f:DropDownList>
<f:DropDownList runat="server" EnableSimulateTree="True" Label="检查项" ID="DropDownList1" Hidden="true">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRegisterDef" runat="server" Label="问题描述" ShowRedStar="true" Required="true">
</f:TextArea>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox runat="server" ID="txtHandleIdea" Label="复检问题描述" Hidden="true"></f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList runat="server" EnableSimulateTree="True" Label="责任人" ID="drpResponsibleMan"
>
</f:DropDownList>
<f:DatePicker ID="txtRectificationPeriod" runat="server" Label="整改期限" LabelAlign="Right" Required="True" ShowRedStar="true"
>
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtCheckManName" runat="server" Label="检查" Readonly="true">
</f:TextBox>
<f:TextBox ID="txtCheckTime" runat="server" Label="检查时间" Readonly="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:LinkButton ID="UploadAttach" runat="server" Label="整改前照片" Text="上传和查看" OnClick="btnAttachUrl_Click" LabelAlign="Right">
</f:LinkButton>
<f:NumberBox ID="txtCutPayment" runat="server" Label="罚款金额" LabelAlign="Right" Text="0" NoNegative="true" NoDecimal="true"></f:NumberBox>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:HiddenField ID="hdCheckManId" runat="server"></f:HiddenField>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Window ID="Window1" Title="文件上传" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="680px"
Height="480px">
</f:Window>
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:DropDownList runat="server" EnableSimulateTree="True" Label="检查项" ID="drpRegisterTypes">
</f:DropDownList>
<f:RadioButtonList ID="ckType" runat="server" Label="巡检周期"
Width="330px" Hidden="true">
<f:RadioItem Value="D" Selected="True" Text="日检" />
<f:RadioItem Value="W" Text="周检" />
<f:RadioItem Value="M" Text="月检" />
</f:RadioButtonList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList runat="server" EnableSimulateTree="True" Label="责任单位" ID="drpUnit"
AutoPostBack="true" OnSelectedIndexChanged="drpUnit_OnSelectedIndexChanged">
</f:DropDownList>
<f:DropDownList runat="server" EnableSimulateTree="True" Label="单位工程" ID="drpWorkArea">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList runat="server" EnableSimulateTree="True" Label="级别" ID="dpRiskLevel">
<f:ListItem Text="轻微" Value="轻微" />
<f:ListItem Text="一般" Value="一般" />
<f:ListItem Text="较大" Value="较大" />
<f:ListItem Text="严重" Value="严重" />
</f:DropDownList>
<f:DropDownList runat="server" EnableSimulateTree="True" Label="检查项" ID="DropDownList1" Hidden="true">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRegisterDef" runat="server" Label="问题描述" ShowRedStar="true" Required="true">
</f:TextArea>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox runat="server" ID="txtHandleIdea" Label="复检问题描述" Hidden="true"></f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList runat="server" EnableSimulateTree="True" Label="责任人" ID="drpResponsibleMan" Required="True" ShowRedStar="true" AutoSelectFirstItem="false" AutoPostBack="true" OnSelectedIndexChanged="drpResponsibleMan_SelectedIndexChanged">
</f:DropDownList>
<f:DatePicker ID="txtRectificationPeriod" runat="server" Label="整改期限" LabelAlign="Right" Required="True" ShowRedStar="true">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList runat="server" EnableSimulateTree="True" Label="重修教材" ID="drpTrainingItem" EnableEdit="true" ForceSelection="false" Required="True" ShowRedStar="true">
</f:DropDownList>
<f:TextBox ID="txtCheckTime" runat="server" Label="检查时间" Readonly="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtCheckManName" runat="server" Label="检查人" Readonly="true">
</f:TextBox>
<f:NumberBox ID="txtCutPayment" runat="server" Label="罚款金额" LabelAlign="Right" Text="0" NoNegative="true" NoDecimal="true"></f:NumberBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:LinkButton ID="UploadAttach" runat="server" Label="整改前照片" Text="上传和查看" OnClick="btnAttachUrl_Click" LabelAlign="Right">
</f:LinkButton>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:HiddenField ID="hdCheckManId" runat="server"></f:HiddenField>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Window ID="Window1" Title="文件上传" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="680px"
Height="480px">
</f:Window>
</form>
</body>
</html>
@@ -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)));
}
@@ -132,13 +132,13 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
protected global::FineUIPro.DatePicker txtRectificationPeriod;
/// <summary>
/// txtCheckManName 控件。
/// drpTrainingItem 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtCheckManName;
protected global::FineUIPro.DropDownList drpTrainingItem;
/// <summary>
/// txtCheckTime 控件。
@@ -150,13 +150,13 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
protected global::FineUIPro.TextBox txtCheckTime;
/// <summary>
/// UploadAttach 控件。
/// txtCheckManName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.LinkButton UploadAttach;
protected global::FineUIPro.TextBox txtCheckManName;
/// <summary>
/// txtCutPayment 控件。
@@ -167,6 +167,15 @@ namespace FineUIPro.Web.HSSE.HiddenInspection
/// </remarks>
protected global::FineUIPro.NumberBox txtCutPayment;
/// <summary>
/// UploadAttach 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.LinkButton UploadAttach;
/// <summary>
/// Toolbar1 控件。
/// </summary>