安全管理,公司级树补充

This commit is contained in:
2025-04-10 17:46:57 +08:00
parent d9a4bb09ac
commit f550c9c63c
5 changed files with 371 additions and 286 deletions
@@ -131,11 +131,11 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
ddlFileType.DataSource = myList;
ddlFileType.DataBind();
}
else
{
GridColumn column = Grid1.FindColumn("UnitName");
column.HeaderText = "收文类型";
GridColumn column2 = Grid1.FindColumn("CompileDate");
@@ -269,7 +269,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
//只有集团公司能看到
if (BLL.CommonService.IsMainUnitOrAdmin(this.CurrUser.UserId))
{
string strSql = @"SELECT FileId,F.UnitId,F.ProjectId,FileCode,FileName,KeyWords,CompileMan,CompileDate,ReplyDatePlan,ReplyDateReal,
string strSql = @"SELECT FileId,F.UnitId,F.ProjectId,FileCode,FileName,KeyWords,CompileMan,CompileDate,ReplyDatePlan,ReplyDateReal,
ReplyContent,CompileManUser.UserName AS CompileManName,U.UnitName,P.ProjectName,F.FileType,
CASE WHEN States='0' then '待发送' when States='1' then '待回复' when States='2' then '已回复' END as StatesNr,F.States
@@ -284,7 +284,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
#region
bool UnitBol = false;
//不是本公司
if (CurrUser.UnitId!= "A26E718E-C3B3-458E-A5A3-D2568A0F7D49")
if (CurrUser.UnitId != "A26E718E-C3B3-458E-A5A3-D2568A0F7D49")
{
UnitBol = true;
}
@@ -306,7 +306,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
strSql += " and (F.FileType='0' or F.FileType='1' or F.FileType='2' or F.FileType='3' or F.FileType='10' or F.FileType='11') ";
//不是管理员只能看到自己编制的 或者是自己的
//公司级
if (TypesOf == "0"&& UnitBol)
if (TypesOf == "0" && UnitBol)
{
//能看到接收人是自己的
strSql += " and (F.UnitId like '%" + CurrUser.UnitId + "%' or CompileMan = @CompileMan ) ";
@@ -337,7 +337,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
{
strSql += " and (F.FileType='4' or F.FileType='5' or F.FileType='6' or F.FileType='7' or F.FileType='8' or F.FileType='9') ";
//不是管理员或者本公司只能看到自己编制的 或者是自己的
//公司级
if (TypesOf == "0" && UnitBol)
@@ -346,7 +346,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
strSql += " and (F.UnitId like '%" + CurrUser.UnitId + "%' or CompileMan = @CompileMan ) ";
listStr.Add(new SqlParameter("@CompileMan", CurrUser.UserId));
}
else if(TypesOf=="1" && UnitBol)
else if (TypesOf == "1" && UnitBol)
{
//项目级
//只能看到单位id或者项目id同时是自己的数据
@@ -384,8 +384,8 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
}
if (!string.IsNullOrEmpty(txtMonth.Text))
{
strSql += " AND Year(F.CompileDate) = '"+ txtMonth.Text + "'";
strSql += " AND Year(F.CompileDate) = '" + txtMonth.Text + "'";
}
#endregion
@@ -393,13 +393,13 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
dataTable=tb;
Grid1.RecordCount = tb.Rows.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
dataTable = tb;
Grid1.RecordCount = tb.Rows.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
}
@@ -538,16 +538,16 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
}
else if (FinalFileManage.States == "1" && (
//接收文件页面,待接收,并且接收人是自己,接收项目是空的:回复页面。
(FinalFileManage.UnitId.IndexOf(CurrUser.UnitId)!=-1 && string.IsNullOrEmpty(FinalFileManage.ProjectId)) || (userId == Const.sysglyId || userId == Const.hfnbdId)))
(FinalFileManage.UnitId.IndexOf(CurrUser.UnitId) != -1 && string.IsNullOrEmpty(FinalFileManage.ProjectId)) || (userId == Const.sysglyId || userId == Const.hfnbdId)))
{
this.Window1.Title = "回复";
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SendAndAccepView.aspx?FileId={0}&Type=1&Fwtype=0", id, "回复 - "),"回复"));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SendAndAccepView.aspx?FileId={0}&Type=1&Fwtype=0", id, "回复 - "), "回复"));
}
else
{
//否则是查看页面
this.Window1.Title = "详情";
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SendAndAccepView.aspx?FileId={0}&Fwtype=0", id, "查看 - "),"查看"));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SendAndAccepView.aspx?FileId={0}&Fwtype=0", id, "查看 - "), "查看"));
}
}
else
@@ -580,7 +580,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
//如果是发文件页面,状态是待发送的:编辑,
if (FinalFileManage.States == "0")
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SendAndAccepEdit.aspx?FileId={0}&Fwtype=1", id, "编辑 - "),"编辑"));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SendAndAccepEdit.aspx?FileId={0}&Fwtype=1", id, "编辑 - "), "编辑"));
}
else
{
@@ -660,7 +660,8 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
}
#endregion
protected void btnMenuUpdate(object sender, EventArgs e) {
protected void btnMenuUpdate(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
@@ -668,7 +669,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
}
string id = Grid1.SelectedRowID;
var model = Funs.DB.FinalFileManage_SendAndAccep.FirstOrDefault(x => x.FileId == id);
if (model!=null)
if (model != null)
{
if (model.States == "2")
{
@@ -678,7 +679,8 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
{
model.States = "2";
}
else {
else
{
Alert.ShowInTop("当前数据不允许修改状态!", MessageBoxIcon.Warning);
return;
}
@@ -697,13 +699,13 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
{
Print();
}
}
#endregion
void Print()
{
string path = Funs.RootPath + @"File\Excel\Temp\SendAndAccep"+ string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx";
string path = Funs.RootPath + @"File\Excel\Temp\SendAndAccep" + string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx";
var filetypelist = dataTable.AsEnumerable().Select(x => new
{
@@ -714,22 +716,22 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
string fileName = string.Empty;
if (Type == "0")
{
fileName= "发文台账.xlsx";
fileName = "发文台账.xlsx";
}
else
{
fileName = "收文台账.xlsx";
}
var sheets = new DataSet();
string[] Send=new string [] {"0", "1" , "2" , "3" , "10" , "11" };
string[] Accep=new string [] {"4", "5" , "6" , "7" , "8" , "9" };
string[] Send = new string[] { "0", "1", "2", "3", "10", "11" };
string[] Accep = new string[] { "4", "5", "6", "7", "8", "9" };
foreach (var item in filetypelist)
{
if (Send.Contains(item.FileType))
{
var result = dataTable.AsEnumerable().Where(x => x.Field<string>("FileType") == item.FileType).Select(x => new
{
= x.Field<string>("FileCode"),
= x.Field<string>("FileName"),
= x.Field<DateTime?>("CompileDate"),
@@ -753,7 +755,7 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
= x.Field<string>("UnitName"),
= x.Field<DateTime?>("CompileDate"),
= x.Field<string>("KeyWords"),
= x.Field<string>("States")== "已回复"?"是":"否",
= x.Field<string>("States") == "已回复" ? "是" : "否",
= x.Field<DateTime?>("ReplyDatePlan"),
= "",
= ""
@@ -763,8 +765,8 @@ namespace FineUIPro.Web.ZHGL.FinalFileManage
sheets.Tables.Add(tb);
}
}
MiniExcel.SaveAs(path,sheets);
MiniExcel.SaveAs(path, sheets);
FileInfo info = new FileInfo(path);
long fileSize = info.Length;