安全检查补充公司级树

This commit is contained in:
2025-04-09 20:34:57 +08:00
parent 023e3d33cf
commit 3db3510a9d
21 changed files with 1330 additions and 714 deletions
@@ -48,14 +48,21 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
{
if (!IsPostBack)
{
////权限按钮方法
GetButtonPower();
Funs.DropDownPageSize(this.ddlPageSize);
this.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
{
this.ProjectId = Request.Params["projectId"];
}
}
this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.ProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
this.GetButtonPower();
}
this.btnNew.OnClientClick = Window1.GetShowReference("ProblemNoticeManagerEdit.aspx?Type=0") + "return false;";
this.btnNew_Finalize.OnClientClick = Window1.GetShowReference("ProblemNoticeManagerEdit.aspx?Type=-1") + "return false;";
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
@@ -65,19 +72,25 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
this.BindGrid();
for (int i = 0; i < Grid1.Rows.Count; i++)
{
Model.Problem_Notice model = Funs.DB.Problem_Notice.FirstOrDefault(x => x.ProNoticeId == Grid1.Rows[i].DataKeys[0].ToString());
if (model.State == "-1" && string.IsNullOrEmpty(BLL.AttachFileService.getFileUrl(model.ProNoticeId + "-FinalizeRelpy")))
{
Grid1.Rows[i].RowCssClass = "red";
}
}
}
}
/// <summary>
/// 公司级树加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
btnNew.Hidden = true;
}
this.GetButtonPower();
this.BindGrid();
}
#region
/// <summary>
@@ -91,7 +104,7 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProblemNoticeManagerMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProblemNoticeManagerMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
@@ -151,6 +164,10 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
#region
protected void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
int unitType = CommonService.GetUnitTypeByUserId(this.CurrUser.UserId);
string strSql = @"select F.ProjectId,ProNoticeId,
@@ -168,15 +185,15 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
LEFT JOIN Base_unit e on b.UnitId=e.Unitid
Where 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (unitType!=0 && string.IsNullOrEmpty(ProjectId)) //公司/分公司
if (unitType != 0 && string.IsNullOrEmpty(this.ProjectId)) //公司/分公司
{
strSql += " AND ( F.ProjectId='" + CurrUser.UnitId + "' and proType='2') or ( proType='1' and F.Unitid='" + CurrUser.UnitId + "' ) or a.UnitId='"+ CurrUser.UnitId + "'";
strSql += " AND ( F.ProjectId='" + CurrUser.UnitId + "' and proType='2') or ( proType='1' and F.Unitid='" + CurrUser.UnitId + "' ) or a.UnitId='" + CurrUser.UnitId + "'";
}
else
{
if (!string.IsNullOrEmpty(ProjectId))
if (!string.IsNullOrEmpty(this.ProjectId))
{
strSql+= " and proType='1' And F.ProjectId='" + ProjectId + "' ";
strSql += " and proType='1' And F.ProjectId='" + this.ProjectId + "' ";
}
}
if (!string.IsNullOrEmpty(txtProCode.Text.Trim()))
@@ -198,7 +215,7 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
//}
//除了超级管理员,其他只显示单位的数据
if (CurrUser.Account!="hfnbd")
if (CurrUser.Account != "hfnbd")
{
strSql += " AND e.UnitId=@CreateUnitId ";
listStr.Add(new SqlParameter("@CreateUnitId", CurrUser.UnitId));
@@ -212,13 +229,22 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
Grid1.DataSource = table;
Grid1.DataBind();
for (int i = 0; i < Grid1.Rows.Count; i++)
{
Model.Problem_Notice model = Funs.DB.Problem_Notice.FirstOrDefault(x => x.ProNoticeId == Grid1.Rows[i].DataKeys[0].ToString());
if (model.State == "-1" && string.IsNullOrEmpty(BLL.AttachFileService.getFileUrl(model.ProNoticeId + "-FinalizeRelpy")))
{
Grid1.Rows[i].RowCssClass = "red";
}
}
}
#endregion
#region
protected string ConvertState(object proType,object state)
protected string ConvertState(object proType, object state)
{
if (state != null&& proType!=null)
if (state != null && proType != null)
{
//项目级
string proTypes = proType.ToString();
@@ -252,13 +278,13 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
string result = "";
if (proNoticeId != null)
{
var list= ProblemNoticeApprove.GetProblem_NoticeApproveByParentId(proNoticeId.ToString());
if (list != null)
var list = ProblemNoticeApprove.GetProblem_NoticeApproveByParentId(proNoticeId.ToString());
if (list != null)
{
string userids = string.Join(",", list.Select(x => x.ApproveMan).ToList());
result = UserService.getUserNamesUserIds(userids);
}
}
return result;
}
@@ -283,7 +309,7 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
var ProblemNoticeItem = Funs.DB.Problem_Notice.FirstOrDefault(x => x.ProNoticeId == id);
if (ProblemNoticeItem != null)
{
if (Convert.ToInt32(ProblemNoticeItem.State)<=2)
if (Convert.ToInt32(ProblemNoticeItem.State) <= 2)
{
ShowNotify("当前通知单尚未回复。", MessageBoxIcon.Warning);
}
@@ -340,8 +366,8 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
var ProblemNoticeItem = Funs.DB.Problem_Notice.FirstOrDefault(x => x.ProNoticeId == id);
if (ProblemNoticeItem != null)
{
if ((this.btnMenuEdit.Hidden || Convert.ToInt32(ProblemNoticeItem.State)>1)&& ProblemNoticeItem.CreateUser==CurrUser.UserId) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面
if ((this.btnMenuEdit.Hidden || Convert.ToInt32(ProblemNoticeItem.State) > 1) && ProblemNoticeItem.CreateUser == CurrUser.UserId) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProblemNoticeManagerEdit.aspx?ProNoticeId={0}&Type=1", id, "查看 - ")));
}
@@ -400,13 +426,13 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
{
ShowNotify("只能导出已提交的数据。!", MessageBoxIcon.Warning);
return;
}
}
BuildSignaturesAndProjectInfo(id, model, out CheckUnitSignature, out CheckMansSignature, out ProjectName);
var cdate = Convert.ToDateTime(model.CreateDate);
var nowFileName = cdate.Month.ToString() + "." + cdate.Day.ToString() + ProjectName + "问题督导整改通知单";
string rootPath = Server.MapPath("~/");
var initTemplatePath = "File\\Word\\问题督导整改通知单.docx";
var uploadfilepath = rootPath + initTemplatePath;
var uploadfilepath = rootPath + initTemplatePath;
var newUrl = uploadfilepath.Replace("问题督导整改通知单.docx", nowFileName + ".docx");
if (File.Exists(newUrl))
{
@@ -418,7 +444,7 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
#region
Bookmark Bmark = doc.Range.Bookmarks["ProjectName"]; //项目名称
if (Bmark != null)
{
@@ -439,12 +465,12 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
Bmark = doc.Range.Bookmarks["CheckTime"]; //检查时间
if (Bmark != null)
{
{
var CheckTime = Convert.ToDateTime(model.CheckStartTime);
var EndTime = Convert.ToDateTime(model.CheckEndTime);
Bmark.Text = CheckTime.Year.ToString() + "." + CheckTime.Month.ToString() + "." +
CheckTime.Day.ToString()
+ "-" + EndTime.Month.ToString() + "." +
+ "-" + EndTime.Month.ToString() + "." +
EndTime.Day.ToString();
}
@@ -476,7 +502,7 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
builder.StartTable();
builder.RowFormat.Alignment = Aspose.Words.Tables.RowAlignment.Center;
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
builder.CellFormat.Borders.Color = System.Drawing.Color.Black;
builder.CellFormat.Borders.Color = System.Drawing.Color.Black;
//builder.RowFormat.LeftIndent = 5;
//builder.RowFormat.RightPadding = 50;
builder.Bold = false;
@@ -496,7 +522,7 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
foreach (var item in detailList)
{
var CheckManName = UserService.GetUserNameByUserId(item.CheckMan);
dt.Rows.Add(new string[] { item.SortIndex+ item.QueDescribe, item.Requirements , CheckManName });
dt.Rows.Add(new string[] { item.SortIndex + item.QueDescribe, item.Requirements, CheckManName });
}
}
@@ -512,13 +538,13 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
builder.CellFormat.Width = width1;
builder.Write("存在问题");
builder.InsertCell();
builder.CellFormat.Width = width2/2;
builder.CellFormat.Width = width2 / 2;
builder.Write("整改要求");
builder.InsertCell();
builder.Write("整改责任人");
builder.CellFormat.Width = width2 / 2;
builder.EndRow();
//循环插入表格内容
foreach (DataRow row in dt.Rows)
{
@@ -751,7 +777,7 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
builder.EndRow();
}
}
builder.EndTable();
}
@@ -819,7 +845,7 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
tables.Add(tempDt);
}
var table2= builder.StartTable();
var table2 = builder.StartTable();
builder.RowFormat.Height = 20;
builder.Bold = false;
builder.InsertCell();
@@ -830,12 +856,12 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center; //水平居中对齐
builder.CellFormat.Width = width1 + width2;
builder.Write("检查问题照片");
builder.EndRow();
builder.EndRow();
builder.RowFormat.Height = 50;
builder.Bold = false;
foreach (var dataTable in tables) //循环表格
{
@@ -896,7 +922,7 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
builder.InsertCell();
builder.CellFormat.Width = width1;
builder.Write(dataTable.Rows[0]["存在问题"].ToString()??" ");
builder.Write(dataTable.Rows[0]["存在问题"].ToString() ?? " ");
builder.InsertCell();
builder.CellFormat.Width = width2;
builder.Write(dataTable.Rows[1]["存在问题"].ToString() ?? " ");
@@ -983,7 +1009,7 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
FileInfo info = new FileInfo(newUrl);
long fileSize = info.Length;
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
System.Web.HttpContext.Current.Response.TransmitFile(newUrl, 0, fileSize);
@@ -1014,7 +1040,7 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
}
if (model.ProType == "1")
{
ProjectName = BLL.ProjectService.GetProjectByProjectId(model.ProjectId).ShortName;
ProjectName = BLL.ProjectService.GetProjectByProjectId(model.ProjectId).ShortName;
var ProjectApprove = BLL.UserService.getUserListUserIds(model.ProjectUnitApproveUserIds);
if (ProjectApprove != null)
{
@@ -1033,7 +1059,7 @@ namespace FineUIPro.Web.Customization.CNCCG.ZHGL.Problem
}
}
}
#endregion
}
}