数据穿透

This commit is contained in:
geh
2026-03-06 14:24:20 +08:00
parent 474e208256
commit a05f640047
115 changed files with 14173 additions and 203 deletions
@@ -99,30 +99,48 @@ namespace FineUIPro.Web.HSSE.License
{
return;
}
if (!string.IsNullOrEmpty(this.ProjectId))
{
string strSql = "SELECT LicenseManager.LicenseManagerId,LicenseManager.ProjectId,LicenseManager.WorkStatesStr,LicenseManager.LicenseTypeId,CodeRecords.Code AS LicenseManagerCode,LicenseManager.IsHighRisk,LicenseManager.LicenseManageName,LicenseManager.UnitId,LicenseManager.LicenseManageContents,LicenseManager.CompileMan,LicenseManager.CompileDate,LicenseManager.States,LicenseManager.ProjectCode,LicenseManager.ProjectName,LicenseManager.LicenseTypeName,LicenseManager.UnitName,LicenseManager.UnitTypeName,LicenseManager.UserName,LicenseManager.WorkAreaName,LicenseManager.StartDate,LicenseManager.EndDate"
+ @" ,(CASE WHEN LicenseManager.States = " + BLL.Const.State_0 + " OR LicenseManager.States IS NULL THEN '待['+OperateUser.UserName+']提交' WHEN LicenseManager.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperateUser.UserName+']办理' END) AS FlowOperateName"
+ @" FROM View_License_LicenseManager AS LicenseManager "
+ @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON LicenseManager.LicenseManagerId=CodeRecords.DataId "
+ @" LEFT JOIN Sys_FlowOperate AS FlowOperate ON LicenseManager.LicenseManagerId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1"
+ @" LEFT JOIN Sys_User AS OperateUser ON FlowOperate.OperaterId=OperateUser.UserId"
+ @" WHERE 1=1 ";
string strSql =
"SELECT LicenseManager.LicenseManagerId,LicenseManager.ProjectId,LicenseManager.WorkStatesStr,LicenseManager.LicenseTypeId,LicenseManager.LicenseManagerCode,LicenseManager.IsHighRisk,LicenseManager.LicenseManageName,LicenseManager.UnitId,LicenseManager.LicenseManageContents,LicenseManager.CompileMan,LicenseManager.CompileDate,LicenseManager.States,LicenseManager.ProjectCode,LicenseManager.ProjectName,LicenseManager.LicenseTypeName,LicenseManager.UnitName,LicenseManager.UnitTypeName,LicenseManager.UserName,LicenseManager.WorkAreaName,LicenseManager.StartDate,LicenseManager.EndDate,LicenseManager.SourceDes"
+ @" ,(CASE WHEN LicenseManager.States = " + BLL.Const.State_0 +
" OR LicenseManager.States IS NULL THEN '待['+OperateUser.UserName+']提交' WHEN LicenseManager.States = " +
BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperateUser.UserName+']办理' END) AS FlowOperateName"
+ @" FROM View_License_LicenseManager AS LicenseManager "
//+ @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON LicenseManager.LicenseManagerId=CodeRecords.DataId "
+ @" LEFT JOIN Sys_FlowOperate AS FlowOperate ON LicenseManager.LicenseManagerId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1"
+ @" LEFT JOIN Sys_User AS OperateUser ON FlowOperate.OperaterId=OperateUser.UserId"
+ @" WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND LicenseManager.ProjectId = @ProjectId";
if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值
if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值
{
listStr.Add(new SqlParameter("@ProjectId", Request.Params["projectId"]));
strSql += " AND LicenseManager.States = @States"; ///状态为已完成
strSql += " AND LicenseManager.States = @States"; ///状态为已完成
listStr.Add(new SqlParameter("@States", BLL.Const.State_2));
}
else
{
listStr.Add(new SqlParameter("@ProjectId", ProjectId));
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
}
if (this.rbSource.SelectedValue == "1")
{
strSql += " AND LicenseManager.SourceDes LIKE @SourceDes ";
listStr.Add(new SqlParameter("@SourceDes", "%#%"));
}
if (!string.IsNullOrEmpty(this.drpStates.SelectedValue) &&
this.drpStates.SelectedValue != BLL.Const._Null)
{
strSql += " AND LicenseManager.WorkStates = @States";
listStr.Add(new SqlParameter("@States", this.drpStates.SelectedValue));
}
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
{
strSql += " AND LicenseManager.UnitId = @UnitId"; ///状态为已完成
strSql += " AND LicenseManager.UnitId = @UnitId"; ///状态为已完成
listStr.Add(new SqlParameter("@UnitId", this.CurrUser.UnitId));
}
@@ -140,21 +158,25 @@ namespace FineUIPro.Web.HSSE.License
listStr.Add(new SqlParameter("@EndDate", endDate));
}
if (!string.IsNullOrEmpty(this.drpLicenseType.SelectedValue) && this.drpLicenseType.SelectedValue != BLL.Const._Null)
if (!string.IsNullOrEmpty(this.drpLicenseType.SelectedValue) &&
this.drpLicenseType.SelectedValue != BLL.Const._Null)
{
strSql += " AND LicenseManager.LicenseTypeId = @LicenseTypeId";
listStr.Add(new SqlParameter("@LicenseTypeId", this.drpLicenseType.SelectedValue));
}
if (!string.IsNullOrEmpty(this.drpUnit.SelectedValue) && this.drpUnit.SelectedValue != BLL.Const._Null)
if (this.drpUnit.SelectedValue != BLL.Const._Null)
{
strSql += " AND LicenseManager.UnitId = @UnitId2";
listStr.Add(new SqlParameter("@UnitId2", this.drpUnit.SelectedValue));
}
if (!string.IsNullOrEmpty(this.drpUnitType.SelectedValue) && this.drpUnitType.SelectedValue != BLL.Const._Null)
if (this.drpUnitType.SelectedValue != BLL.Const._Null)
{
strSql += " AND LicenseManager.UnitTypeId = @UnitTypeId";
listStr.Add(new SqlParameter("@UnitTypeId", this.drpUnitType.SelectedValue));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
@@ -164,7 +186,6 @@ namespace FineUIPro.Web.HSSE.License
Grid1.DataSource = table;
Grid1.DataBind();
}
}
/// <summary>