diff --git a/CreateModel.bat b/CreateModel.bat index 2f27853..27ceb4a 100644 --- a/CreateModel.bat +++ b/CreateModel.bat @@ -25,9 +25,9 @@ REM -------------- @echo 设置.net控制台环境 @echo. -@call "%VS100COMNTOOLS%"vsvars32.bat +@call "%VS150%" -SqlMetal /views /server:.\SQL2016 /database:HJGLDB_ZJBSF /code:%Model_ROOT%\Model.cs /namespace:Model +SqlMetal /views /server:. /database:HJGLDB_ZJBSF /code:%Model_ROOT%\Model.cs /namespace:Model @ECHO 完成 pause diff --git a/HJGL/.vs/HJGL/config/applicationhost.config b/HJGL/.vs/HJGL/config/applicationhost.config index 1963de0..e47cfd0 100644 --- a/HJGL/.vs/HJGL/config/applicationhost.config +++ b/HJGL/.vs/HJGL/config/applicationhost.config @@ -162,7 +162,7 @@ - + @@ -250,7 +250,7 @@ - + diff --git a/HJGL/.vs/HJGL/v17/.suo b/HJGL/.vs/HJGL/v17/.suo index 0d35fb2..454cc7e 100644 Binary files a/HJGL/.vs/HJGL/v17/.suo and b/HJGL/.vs/HJGL/v17/.suo differ diff --git a/HJGL/FineUIPro.Web/FineUIPro.Web.csproj b/HJGL/FineUIPro.Web/FineUIPro.Web.csproj index bc5a722..f843a5d 100644 --- a/HJGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/HJGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1235,6 +1235,7 @@ + @@ -5422,6 +5423,13 @@ PMIDelegationEdit.aspx + + PMIDelegationReport.aspx + ASPXCodeBehind + + + PMIDelegationReport.aspx + PMIDetectionEntry.aspx ASPXCodeBehind diff --git a/HJGL/FineUIPro.Web/Web.config b/HJGL/FineUIPro.Web/Web.config index baa8804..9ecdad1 100644 --- a/HJGL/FineUIPro.Web/Web.config +++ b/HJGL/FineUIPro.Web/Web.config @@ -9,7 +9,7 @@
- + diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx index 138bc7c..3881793 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx @@ -133,7 +133,9 @@ - + diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx.cs index c614310..3739f7b 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationEdit.aspx.cs @@ -139,7 +139,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI } //url鏌ヨ - string window = String.Format($"PMISelectList.aspx?unitId={this.drpUnitId.SelectedValue}&projectId={this.CurrUser.LoginProjectId}&weldJointIds={weldJointIds}", "缂栬緫 - "); + string window = String.Format($"PMISelectList.aspx?unitId={this.drpUnitId.SelectedValue}&projectId={this.CurrUser.LoginProjectId}&weldJointIds={weldJointIds}&installId={drpInstallationId.SelectedValue}", "缂栬緫 - "); PageContext.RegisterStartupScript(Window1.GetSaveStateReference(hdItemsString.ClientID) + Window1.GetShowReference(window)); } else @@ -285,19 +285,24 @@ namespace FineUIPro.Web.WeldingProcess.PMI { string[] arr = weldJointIds.Split('|'); JArray mergedData = Grid1.GetMergedData(); - var result = Funs.DB.View_Pipeline_WeldJoint.Select(t => new View_PMI_DelegationDetails { - WeldJointId= t.WeldJointId, - PipelineCode= t.PipelineCode, - ProjectId= t.ProjectId, - Acceptance="", - QualityNo="", - WeldJointCode=t.WeldJointCode, - Specification=t.Specification, - MaterialCode=t.MaterialCode, - WorkAreaId=t.WorkAreaId, - Status=0, - PMIId=this.PMIDelegationId - }).Where(t => arr.Contains(t.WeldJointId)).ToList(); + var result = Funs.DB.View_Pipeline_WeldJoint.Where(t =>t.UnitId==this.drpUnitId.SelectedValue + && t.InstallationId==this.drpInstallationId.SelectedValue + &&arr.Contains(t.WeldJointId)) + .Select(t => new View_PMI_DelegationDetails + { + WeldJointId = t.WeldJointId, + PipelineCode = t.PipelineCode, + ProjectId = t.ProjectId, + Acceptance = "", + QualityNo = "", + WeldJointCode = t.WeldJointCode, + Specification = t.Specification, + MaterialCode = t.MaterialCode, + WorkAreaId = t.WorkAreaId, + Status = 0, + PMIId = this.PMIDelegationId + }) + .ToList(); result.ForEach(item => { item.Id = SQLHelper.GetNewID(typeof(PMI_DelegationDetails)); @@ -317,6 +322,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI newTrustItem.WeldJointId = values.Value("WeldJointId").ToString(); newTrustItem.Acceptance = values.Value("Acceptance").ToString(); newTrustItem.QualityNo = values.Value("QualityNo").ToString(); + newTrustItem.WorkAreaId = values.Value("WorkAreaId").ToString(); newTrustItem.WeldJointCode = values.Value("WeldJointCode").ToString(); newTrustItem.Specification =HttpUtility.HtmlDecode(values.Value("Specification").ToString()); newTrustItem.MaterialCode = values.Value("MaterialCode").ToString(); @@ -349,6 +355,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI newTrustItem.JointId = values.Value("WeldJointId").ToString(); newTrustItem.Acceptance = values.Value("Acceptance").ToString(); newTrustItem.QualityNo = values.Value("QualityNo").ToString(); + newTrustItem.WorkAreaId = values.Value("WorkAreaId").ToString(); newTrustItem.Status = 0; newTrustItem.CheckTime = DateTime.Now; newTrustItem.ReportTime = DateTime.Now; diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx new file mode 100644 index 0000000..ec96cd2 --- /dev/null +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx @@ -0,0 +1,96 @@ +锘<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PMIDelegationReport.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.PMI.PMIDelegationReport" %> + + + + + + + PMI妫娴嬫姤鍛 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx.cs new file mode 100644 index 0000000..261daee --- /dev/null +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx.cs @@ -0,0 +1,180 @@ +锘縰sing BLL; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.WeldingProcess.PMI +{ + public partial class PMIDelegationReport : PageBase + { + #region 鍔犺浇 + /// + /// 鍔犺浇椤甸潰 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + BLL.Base_UnitService.InitProjectUnitDropDownList(this.drpUnitId, true, this.CurrUser.LoginProjectId, BLL.Const.UnitType_5, Resources.Lan.PleaseSelect);//鍗曚綅 + BLL.Project_WorkAreaService.InitWorkAreaDropDownList(this.drpWorkAreaId, true, this.CurrUser.LoginProjectId, string.Empty, this.drpUnitId.SelectedValue, string.Empty, Resources.Lan.PleaseSelect);//鍖哄煙 + + } + } + + /// + /// 缁戝畾鏁版嵁 + /// + private void BindGrid() + { + string sql = @"select *from ( + select + projectId, + InstallationId, + WorkAreaId, + UnitId, + PipelineId, + InstallationCode, + WorkAreaCode, + PipelineCode, + PMINum, + (convert(float,PMIBySNum)/NULLIF(convert(float,PMINum),0)*100) as RateBys, + PMIBySNum, + (convert(float,PMIByFNum)/NULLIF(convert(float,PMINum),0)*100) as RateByf, + PMIByFNum + from ( + select + a.projectId, + a.InstallationId, + a.WorkAreaId, + a.UnitId, + a.PipelineId, + b.InstallationCode, + c.WorkAreaCode, + a.PipelineCode, + (select count(1) from Pipeline_WeldJoint as d where isPMI=1 and d.PipelineId=a.PipelineId) as PMINum, + ( + select count(1) from PMI_Delegation as pd inner join PMI_DelegationDetails as pdd on pd.Id=pdd.PMIId + inner join Pipeline_WeldJoint as pwj on pdd.JointId=pwj.WeldJointId + where pd.InstallationId=a.InstallationId and pd.UnitId=a.UnitId and pdd.WorkAreaId=a.WorkAreaId + and pwj.PipelineId=a.PipelineId and pwj.JointAttribute='娲诲姩S' and pwj.isPMI=1 + ) as PMIBySNum, + ( + select count(1) from PMI_Delegation as pd inner join PMI_DelegationDetails as pdd on pd.Id=pdd.PMIId + inner join Pipeline_WeldJoint as pwj on pdd.JointId=pwj.WeldJointId + where pd.InstallationId=a.InstallationId and pd.UnitId=a.UnitId and pdd.WorkAreaId=a.WorkAreaId + and pwj.PipelineId=a.PipelineId and pwj.JointAttribute='鍥哄畾F' and pwj.isPMI=1 + ) as PMIByFNum + from Pipeline_Pipeline as a + left join Project_Installation as b on a.InstallationId=b.InstallationId + left join Project_WorkArea as c on a.WorkAreaId=c.WorkAreaId + ) as t + ) as H where projectId=@projectId and RateBys>0 "; + List listStr = new List(); + listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId)); + if (this.drpUnitId.SelectedValue != BLL.Const._Null) + { + sql += " and UnitId=@unitId"; + listStr.Add(new SqlParameter("@unitId", this.drpUnitId.SelectedValue)); + } + if (this.drpWorkAreaId.SelectedValue != BLL.Const._Null) + { + sql += " and WorkAreaId=@unitId"; + listStr.Add(new SqlParameter("@workAreaId", this.drpWorkAreaId.SelectedValue)); + } + if (this.drpIsALl.SelectedValue!="鍏ㄩ儴") + { + sql += " and RateBys<=2"; + } + if (!string.IsNullOrEmpty(this.txtPipelineCode.Text)) + { + sql += " and PipelineCode like '%@PipelineCode%'"; + listStr.Add(new SqlParameter("@PipelineCode", this.txtPipelineCode.Text.Trim())); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(sql, parameter); + this.Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + + /// + /// 鏀瑰彉绱㈠紩浜嬩欢 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 鍒嗛〉涓嬫媺閫夋嫨浜嬩欢 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + + /// + /// 鎺掑簭 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 缁熻鎸夐挳浜嬩欢 + /// + /// 缁熻 + /// + /// + /// + protected void BtnAnalyse_Click(object sender, EventArgs e) + { + BindGrid(); + } + #endregion + + #region 涓嬫媺閫夋嫨浜嬩欢 + /// + /// 鍗曚綅涓嬫媺閫夋嫨浜嬩欢 + /// + /// + /// + protected void drpUnitId_SelectedIndexChanged(object sender, EventArgs e) + { + this.drpWorkAreaId.Items.Clear(); + if (this.drpUnitId.SelectedValue != BLL.Const._Null) + { + BLL.Project_WorkAreaService.InitWorkAreaDropDownList(this.drpWorkAreaId, true, this.CurrUser.LoginProjectId, string.Empty, this.drpUnitId.SelectedValue, string.Empty, Resources.Lan.PleaseSelect); + } + else + { + Funs.FineUIPleaseSelect(this.drpWorkAreaId, Resources.Lan.PleaseSelect); + } + this.drpWorkAreaId.SelectedValue = BLL.Const._Null; + } + + protected void drpIsALl_SelectedIndexChanged(object obj, EventArgs e) + { + this.BindGrid(); + } + #endregion + } +} \ No newline at end of file diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx.designer.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx.designer.cs new file mode 100644 index 0000000..37f5fa9 --- /dev/null +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDelegationReport.aspx.designer.cs @@ -0,0 +1,188 @@ +锘//------------------------------------------------------------------------------ +// <鑷姩鐢熸垚> +// 姝や唬鐮佺敱宸ュ叿鐢熸垚銆 +// +// 瀵规鏂囦欢鐨勬洿鏀瑰彲鑳藉鑷翠笉姝g‘鐨勮涓猴紝濡傛灉 +// 閲嶆柊鐢熸垚浠g爜锛屽垯鎵鍋氭洿鏀瑰皢涓㈠け銆 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.WeldingProcess.PMI +{ + + + public partial class PMIDelegationReport + { + + /// + /// form1 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar1 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// drpUnitId 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.DropDownList drpUnitId; + + /// + /// drpWorkAreaId 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.DropDownList drpWorkAreaId; + + /// + /// drpIsALl 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.DropDownList drpIsALl; + + /// + /// ToolbarFill1 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// BtnAnalyse 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.Button BtnAnalyse; + + /// + /// Toolbar2 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// txtPipelineCode 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.TextBox txtPipelineCode; + + /// + /// ToolbarFill2 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// labNumber 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::System.Web.UI.WebControls.Label labNumber; + + /// + /// labRateBys 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::System.Web.UI.WebControls.Label labRateBys; + + /// + /// Label1 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// ToolbarSeparator1 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + } +} diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMISelectList.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMISelectList.aspx.cs index 5734da7..06427de 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMISelectList.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMISelectList.aspx.cs @@ -1,4 +1,6 @@ 锘縰sing BLL; +using Model; +using NPOI.SS.Formula.Functions; using System; using System.Collections.Generic; using System.Data.SqlClient; @@ -15,6 +17,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI string ProjectId = string.Empty; string PMIId = string.Empty; string weldJointIds=string.Empty; + string installId=string.Empty; #region 鍔犺浇椤甸潰 /// /// 鍔犺浇椤甸潰 @@ -27,6 +30,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI this.ProjectId = this.CurrUser.LoginProjectId; this.PMIId = Request.Params["PMIId"] ?? ""; this.weldJointIds = Request.Params["weldJointIds"] ?? ""; + this.installId = Request.Params["installId"]; if (!IsPostBack) { this.InitTreeMenu();//鍔犺浇鏍 @@ -54,13 +58,23 @@ namespace FineUIPro.Web.WeldingProcess.PMI b in Funs.DB.PMI_DelegationDetails.AsQueryable() on a.Id equals b.PMIId select b.JointId - ).Distinct().ToList(); + ).Distinct().ToList(); //鏌ヨ甯︽湁PMI澶勭悊鐨勭绾挎暟鎹 - var iso = from x in Funs.DB.View_Pipeline_WeldJoint - where x.ProjectId == this.ProjectId && x.IsPMI == true && x.UnitId == this.UnitId - select new { x.PipelineCode, x.PipelineId,x.WeldJointId }; //from x in Funs.DB.Pipeline_Pipeline where x.ProjectId == this.ProjectId && x.UnitId == this.UnitId select x; - + var iso = (from a in Funs.DB.Pipeline_Pipeline join b + in Funs.DB.Project_WorkArea on a.WorkAreaId equals b.WorkAreaId + join c in Funs.DB.Pipeline_WeldJoint on a.PipelineId equals c.PipelineId + where a.ProjectId==this.ProjectId && a.UnitId==this.UnitId && + a.InstallationId==this.installId && c.IsPMI==true + select new { + a.PipelineCode, + a.PipelineId, + b.WorkAreaId, + b.WorkAreaCode, + c.WeldJointId, + c.WeldJointCode + }); + if (listData.Count > 0) { iso = iso.Where(e => !listData.Contains(e.WeldJointId)); @@ -69,14 +83,14 @@ namespace FineUIPro.Web.WeldingProcess.PMI { iso = iso.Where(e => e.PipelineCode.Contains(this.txtIsono.Text.Trim())); } - var isoList = iso.Select(x => new {x.PipelineId,x.PipelineCode }).OrderBy(x => x.PipelineCode).Distinct().ToList(); + var isoList = iso.Select(x => new { x.PipelineId,x.PipelineCode,x.WorkAreaCode}).OrderBy(x => x.PipelineCode).Distinct().ToList(); if (isoList.Count > 0) { foreach (var q in isoList) { TreeNode newNode = new TreeNode(); newNode.NodeID = q.PipelineId; - newNode.Text = q.PipelineCode; + newNode.Text = q.PipelineCode + "(" + q.WorkAreaCode + ")"; newNode.EnableClickEvent = true; rootNode.Nodes.Add(newNode); } @@ -128,7 +142,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI ).Distinct().ToList(); string[] arr = this.weldJointIds.Split('|'); - var query = Funs.DB.View_Pipeline_WeldJoint.Where(t => t.IsPMI == true); + var query = Funs.DB.View_Pipeline_WeldJoint.Where(t => t.IsPMI == true && t.PipelineId == this.tvControlItem.SelectedNodeID); if (arr.Length > 0) { listData.Add(arr[0]); @@ -141,10 +155,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI { query = query.Where(t => t.WeldJointCode == this.txtJointNo.Text); } - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) - { - query = query.Where(t => t.PipelineId == this.tvControlItem.SelectedNodeID); - } + var data= query.ToList() ; if (!string.IsNullOrEmpty(weldJointIds)) { diff --git a/HJGL/Model/Model.cs b/HJGL/Model/Model.cs index 8f2cc39..8841de2 100644 --- a/HJGL/Model/Model.cs +++ b/HJGL/Model/Model.cs @@ -22792,6 +22792,8 @@ namespace Model private System.Nullable _ReportTime; + private string _WorkAreaId; + #region 鍙墿灞曟ф柟娉曞畾涔 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -22814,6 +22816,8 @@ namespace Model partial void OnCheckTimeChanged(); partial void OnReportTimeChanging(System.Nullable value); partial void OnReportTimeChanged(); + partial void OnWorkAreaIdChanging(string value); + partial void OnWorkAreaIdChanged(); #endregion public PMI_DelegationDetails() @@ -23001,6 +23005,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaId", DbType="NVarChar(50)")] + public string WorkAreaId + { + get + { + return this._WorkAreaId; + } + set + { + if ((this._WorkAreaId != value)) + { + this.OnWorkAreaIdChanging(value); + this.SendPropertyChanging(); + this._WorkAreaId = value; + this.SendPropertyChanged("WorkAreaId"); + this.OnWorkAreaIdChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged;