数据穿透

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
@@ -52,6 +52,17 @@
<f:DatePicker ID="txtEndDate" runat="server" AutoPostBack="true" OnTextChanged="TextBox_TextChanged"
Width="150px" EmptyText="结束时间" LabelWidth="80px">
</f:DatePicker>
<f:DropDownList ID="drpStates" runat="server" Label="状态" LabelAlign="Right" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
<f:ListItem Text="待开工" Value="1"/>
<f:ListItem Text="作业中" Value="2"/>
<f:ListItem Text="已关闭" Value="3"/>
<f:ListItem Text="已取消" Value="-1"/>
</f:DropDownList>
<f:RadioButtonList runat="server" ID="rbSource" Width="220px" Label="来源" LabelWidth="50px"
AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged" AutoColumnWidth="true">
<f:RadioItem Text="全部" Value="0" Selected="true"/>
<f:RadioItem Text="系统内单位" Value="1"/>
</f:RadioButtonList>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" Hidden="true" Text="新增"
@@ -105,6 +116,10 @@
<f:RenderField Width="100px" ColumnID="WorkStatesStr" DataField="WorkStatesStr" SortField="WorkStatesStr"
FieldType="String" HeaderText="状态" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="SourceDes" DataField="SourceDes"
FieldType="String" HeaderText="来源说明" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<%-- <f:WindowField TextAlign="Left" Width="60px" WindowID="WindowAtt" HeaderText="附件"
Text="详细" ToolTip="附件上传查看" DataIFrameUrlFields="LicenseManagerId" DataIFrameUrlFormatString="~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/LicenseManagerAttachUrl&menuId=0E9B7084-D021-4CA3-B9D2-9CBAA27A571B"
HeaderTextAlign="Center" />--%>
@@ -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>
@@ -149,6 +149,24 @@ namespace FineUIPro.Web.HSSE.License
/// </remarks>
protected global::FineUIPro.DatePicker txtEndDate;
/// <summary>
/// drpStates 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpStates;
/// <summary>
/// rbSource 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rbSource;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@@ -61,7 +61,8 @@ namespace FineUIPro.Web.HSSE.License
{
this.InitDropDownList();
}
this.txtLicenseManagerCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.LicenseManagerId);
this.txtLicenseManagerCode.Text = licenseManager.LicenseManagerCode;
//this.txtLicenseManagerCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.LicenseManagerId);
//this.txtLicenseManageName.Text = licenseManager.LicenseManageName;
if (!string.IsNullOrEmpty(licenseManager.UnitId))
{
@@ -126,6 +127,12 @@ namespace FineUIPro.Web.HSSE.License
protected void btnSave_Click(object sender, EventArgs e)
{
this.SaveData(BLL.Const.BtnSave);
var porject = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
if (!string.IsNullOrWhiteSpace(porject.SubjectUnit) && !string.IsNullOrWhiteSpace(porject.SubjectProject))
{//项目关联了总包单位项目,保存成功后自动推送至总包单位
BLL.APILicenseSyncService.PushLicenseManagerLists(this.ProjectId, this.LicenseManagerId);
}
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
@@ -39,7 +39,8 @@ namespace FineUIPro.Web.HSSE.License
Model.License_LicenseManager licenseManager = BLL.LicenseManagerService.GetLicenseManagerById(this.LicenseManagerId);
if (licenseManager != null)
{
this.txtLicenseManagerCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.LicenseManagerId);
this.txtLicenseManagerCode.Text = licenseManager.LicenseManagerCode;
//this.txtLicenseManagerCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.LicenseManagerId);
if (!string.IsNullOrEmpty(licenseManager.UnitId))
{
var unit = BLL.UnitService.GetUnitByUnitId(licenseManager.UnitId);