安全管理,作业票等,补充公司级树

This commit is contained in:
2025-04-10 10:20:23 +08:00
parent 3db3510a9d
commit 6e6f78e900
44 changed files with 2305 additions and 1281 deletions
@@ -40,19 +40,20 @@ namespace FineUIPro.Web.HSSE.License
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
////权限按钮方法
this.GetButtonPower();
this.ProjectId = this.CurrUser.LoginProjectId;
//if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
//{
// this.ProjectId = Request.Params["projectId"];
//}
UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true);
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
{
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
this.drpUnit.Enabled = false;
this.ProjectId = Request.Params["projectId"];
}
this.InitDropDownList();
this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.ProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
this.GetButtonPower();
}
this.drpStates.DataValueField = "Value";
@@ -69,11 +70,41 @@ namespace FineUIPro.Web.HSSE.License
this.BindGrid();
}
}
private void InitDropDownList()
{
UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true);
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
{
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
this.drpUnit.Enabled = false;
}
}
/// <summary>
/// 公司级树加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
this.InitDropDownList();
//if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
//{
// btnNew.Hidden = true;
//}
this.GetButtonPower();
this.BindGrid();
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string strSql = "SELECT license.FireWorkId,license.ProjectId,license.LicenseCode,license.ApplyUnitId,ApplyUnit.UnitName AS ApplyUnitName,license.ApplyManId,license.ApplyDate,license.WorkPalce,license.ValidityStartTime,license.ValidityEndTime,license.WorkMeasures,license.States"
+ @" ,(CASE WHEN license.States=-2 THEN '作废' WHEN license.States=0 THEN '待提交' WHEN license.States=1 THEN '审核中' WHEN license.States=2 THEN '作业中' WHEN license.States=3 THEN '已完成' WHEN license.States=-1 THEN '已取消' ELSE '未知' END) AS StatesName "
+ @" FROM dbo.License_FireWork AS license "
@@ -86,7 +117,7 @@ namespace FineUIPro.Web.HSSE.License
strSql += " AND license.ApplyUnitId = @UnitId"; ///状态为已完成
listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId));
}
if (this.drpUnit.SelectedValue != Const._Null)
if (this.drpUnit.SelectedValue != null && this.drpUnit.SelectedValue != Const._Null)
{
strSql += " AND license.ApplyUnitId = @UnitId2";
listStr.Add(new SqlParameter("@UnitId2", this.drpUnit.SelectedValue));
@@ -238,7 +269,7 @@ namespace FineUIPro.Web.HSSE.License
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectFireWorkMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectFireWorkMenuId);
if (buttonList.Count() > 0)
{
//if (buttonList.Contains(BLL.Const.BtnAdd))
@@ -293,7 +324,7 @@ namespace FineUIPro.Web.HSSE.License
string filePath = string.Empty;
initTemplatePath = "File\\Word\\HSSE\\动火作业票.doc";
uploadfilepath = rootPath + initTemplatePath;
string docfilename = Funs.GetNewFileName() ;
string docfilename = Funs.GetNewFileName();
newUrl = uploadfilepath.Replace(".doc", docfilename + ".doc");
filePath = initTemplatePath.Replace(".doc", docfilename + ".pdf");
File.Copy(uploadfilepath, newUrl);
@@ -829,7 +860,7 @@ namespace FineUIPro.Web.HSSE.License
var file = rootPath + getUser.SignatureUrl;
DocumentBuilder builders = new DocumentBuilder(doc);
builders.MoveToBookmark("Cancel");
// builders.InsertImage(file, 80, 20);
// builders.InsertImage(file, 80, 20);
builders.Write("取消原因:" + getFireWork.CancelReasons + " 取消时间:" + string.Format("{0:yyyy-MM-dd HH:mm}", getFireWork.CancelTime));
}
else
@@ -861,7 +892,7 @@ namespace FineUIPro.Web.HSSE.License
var file = rootPath + getUser.SignatureUrl;
DocumentBuilder builders = new DocumentBuilder(doc);
builders.MoveToBookmark("Close");
// builders.InsertImage(file, 80, 20);
// builders.InsertImage(file, 80, 20);
builders.Write("关闭时间:" + string.Format("{0:yyyy-MM-dd HH:mm}", getFireWork.CloseTime));
}
else