From 3bdc41a3c5a0857b04c1ee4d6f7cc515d1983820 Mon Sep 17 00:00:00 2001 From: 王 垚 <1402714037@qq.com> Date: 星期四, 04 二月 2021 10:26:05 +0800 Subject: [PATCH] 齐套分析增加物料属性字段 --- src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs | 78 +++++++++++++++++++++++++++++---------- 1 files changed, 58 insertions(+), 20 deletions(-) diff --git a/src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs b/src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs index 2286bd4..99839da 100644 --- a/src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs +++ b/src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs @@ -1,18 +1,14 @@ -锘縰sing Kingdee.BOS.App.Data; -using Kingdee.BOS.Core.DynamicForm; +锘縰sing Kingdee.BOS.Core.DynamicForm; using Kingdee.BOS.Core.DynamicForm.PlugIn; -using Kingdee.BOS.Core.DynamicForm.PlugIn.Args; -using Kingdee.BOS.Core.Metadata.EntityElement; using Kingdee.BOS.Orm.DataEntity; using Kingdee.BOS.Util; using System; -using System.Collections.Generic; using System.ComponentModel; using System.Data; -using System.Linq; -using System.Text; using Kingdee.BOS.ServiceHelper; -using System.Threading.Tasks; +using Kingdee.BOS.Core.DynamicForm.PlugIn.Args; +using Kingdee.BOS.Core.Metadata.EntityElement; +using Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel; namespace Demo.BillView { @@ -21,21 +17,25 @@ public class ProCompleteAnalysisDetail : AbstractDynamicFormPlugIn { bool did = false; + string FHMainICMOInterIDr = ""; + string FHMainICMOEntryID = ""; + string FHICMOInterID = ""; public override void OnLoad(EventArgs e) { base.OnLoad(e); if (this.View.OpenParameter.GetCustomParameter("FHMainICMOInterID") == null) { SearchList(); + ChangeColor(); } else { if (did) return; - string FHMainICMOInterIDr = this.View.OpenParameter.GetCustomParameter("FHMainICMOInterID").ToString();//涓荤敓浜ц鍗曚富鍐呯爜 - string FHMainICMOEntryID = this.View.OpenParameter.GetCustomParameter("FHMainICMOEntryID").ToString();// 涓荤敓浜ц鍗曞瓙鍐呯爜 - string FHICMOInterID = this.View.OpenParameter.GetCustomParameter("FHICMOInterID").ToString();//鏃ヨ鍒掕鍗曚富鍐呯爜 - string sql = string.Format(@"/*dialect*/select * from JIT_MOMaterReadysBill where FHMainICMOInterIDr ='{0}' and FHMainICMOEntryID ='{1}' and FHICMOInterID='{2}' order by FPlanDate, FHStockQty desc ,FHMaterID ", FHMainICMOInterIDr, FHMainICMOEntryID, FHICMOInterID); + FHMainICMOInterIDr = this.View.OpenParameter.GetCustomParameter("FHMainICMOInterID").ToString();//涓荤敓浜ц鍗曚富鍐呯爜 + FHMainICMOEntryID = this.View.OpenParameter.GetCustomParameter("FHMainICMOEntryID").ToString();// 涓荤敓浜ц鍗曞瓙鍐呯爜 + FHICMOInterID = this.View.OpenParameter.GetCustomParameter("FHICMOInterID").ToString();//鏃ヨ鍒掕鍗曚富鍐呯爜 + string sql = string.Format(@"/*dialect*/select * from view_JIT_MOMaterReadysBill where FHMainICMOInterIDr ='{0}' and FHMainICMOEntryID ='{1}' and FHICMOInterID='{2}' order by FPlanDate, FHStockQty desc ,FHMaterID ", FHMainICMOInterIDr, FHMainICMOEntryID, FHICMOInterID); DataTable dt = DBServiceHelper.ExecuteDataSet(this.Context, sql).Tables[0]; if (dt.Rows.Count > 0) { @@ -45,11 +45,13 @@ this.Model.SetValue("FSEQ", i + 1, i);//搴忓彿 this.Model.SetValue("FMateralDetailId", dt.Rows[i]["FHMATERID"], i); this.Model.SetValue("FPlanIssueCount", dt.Rows[i]["FSumPlanCount"], i);//璁″垝鍙戞枡鏁伴噺 - this.Model.SetValue("FCompleteCount", dt.Rows[i]["FCompleteCount"], i);//榻愬鏁伴噺 + this.Model.SetValue("FCompleteCount", dt.Rows[i]["FCompleteCount1"], i);//榻愬鏁伴噺 this.Model.SetValue("FLackCount", dt.Rows[i]["FLackCount"], i);//缂烘枡鏁伴噺 this.Model.SetValue("FPassableCount", dt.Rows[i]["FHLeftQty"].ToString(), i);//鍙敤鏁伴噺 this.Model.SetValue("FMateralCount", dt.Rows[i]["FHStockQty"].ToString(), i);//鐗╂枡鏁伴噺 + this.Model.SetValue("FOccupyCount", dt.Rows[i]["FOccupyCount"].ToString(), i);//鍗犵敤鏁伴噺 this.Model.SetValue("FCompleteDetailStatus", dt.Rows[i]["FComPlete"].ToString(), i);//鏄惁榻愬 + this.Model.SetValue("FIsHavePur", dt.Rows[i]["FIsHavePur"].ToString(), i);//鏄惁鏈夐噰璐鍗� this.Model.SetValue("FHMainICMOInterIDr", dt.Rows[i]["FHMainICMOInterIDr"].ToString(), i);//鐢熶骇璁㈠崟鍐呯爜 this.Model.SetValue("FPRDBillNo", dt.Rows[i]["FPRDBillNo"].ToString(), i);//鐢熶骇璁㈠崟鍐呯爜 this.Model.SetValue("FPlanDate", dt.Rows[i]["FPlanDate"].ToString(), i);//鏃ヨ鍒掓棩鏈� @@ -58,15 +60,35 @@ this.Model.SetValue("FOwnerId", dt.Rows[i]["FOwnerId"], i);//璐т富 } } - did = true; + + ChangeColor(); + did = true; } } + + private void ChangeColor() { + Entity entity = this.View.BillBusinessInfo.GetEntity("FEntity"); + //鍗曟嵁浣撲俊鎭浆鎹负鍒楄〃闆嗗悎 + DynamicObjectCollection entityDataObjoct = this.View.Model.GetEntityDataObject(entity); + EntryGrid grid = this.View.GetControl<EntryGrid>("FEntity"); + int _i = 0; + foreach (DynamicObject current in entityDataObjoct) + { + if (Convert.ToString(current["FCompleteDetailStatus"]) == "鏈綈濂�") + { + grid.SetRowBackcolor("#FF0000", _i); + } + _i++; + } + } + public override void BarItemClick(BarItemClickEventArgs e) { base.BarItemClick(e); if (e.BarItemKey.ToUpper() == "TBFILTER") { SearchList(); + ChangeColor(); } } /// <summary> @@ -94,8 +116,8 @@ /// </summary> public void SearchList() { - string sqlwhere = " where 1=1"; - string sql = string.Format(@"/*dialect*/select * from JIT_MOMaterReadysBill "); + string sqlwhere = $" where FHMainICMOInterIDr ='{FHMainICMOInterIDr}' and FHMainICMOEntryID ='{FHMainICMOEntryID}' and FHICMOInterID='{FHICMOInterID}'"; + string sql = string.Format(@"/*dialect*/select * from view_JIT_MOMaterReadysBill "); //鐗╂枡 if ((this.Model.GetValue("FMateralId") as DynamicObject) != null) { @@ -107,6 +129,10 @@ string FCompleteStatus = Convert.ToString(this.Model.GetValue("FCompleteStatus")); if (!string.IsNullOrEmpty(FCompleteStatus)) sqlwhere += $" and FComPlete='{FCompleteStatus}'"; + //鏈夋棤閲囪喘璁㈠崟 + string FIsHavePurs = Convert.ToString(this.Model.GetValue("FIsHavePurs")); + if (!string.IsNullOrEmpty(FIsHavePurs)) + sqlwhere += $" and FIsHavePur='{FIsHavePurs}'"; //鏃ヨ鍒掓棩鏈� string FPlanDate = Convert.ToString(this.Model.GetValue("FPlanDate2")); @@ -117,10 +143,17 @@ string PRDBillNo = Convert.ToString(this.Model.GetValue("FScOrderNo")); if (!string.IsNullOrEmpty(PRDBillNo)) sqlwhere += $" and FPRDBillNo='{PRDBillNo}'"; + sql += sqlwhere; sql += "order by FPlanDate, FHStockQty desc ,FHMaterID"; DataTable dt = DBServiceHelper.ExecuteDataSet(this.Context, sql).Tables[0]; - this.Model.DeleteEntryData("FEntity"); + //this.Model.DeleteEntryData("FEntity"); + while (this.Model.GetEntryRowCount("FEntity") > 0) + { + this.Model.DeleteEntryRow("FEntity", 0); + } + //this.View.Refresh(); + if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) @@ -129,11 +162,13 @@ this.Model.SetValue("FSEQ", i + 1, i);//搴忓彿 this.Model.SetValue("FMateralDetailId", dt.Rows[i]["FHMATERID"], i); this.Model.SetValue("FPlanIssueCount", dt.Rows[i]["FSumPlanCount"], i);//璁″垝鍙戞枡鏁伴噺 - this.Model.SetValue("FCompleteCount", dt.Rows[i]["FCompleteCount"], i);//榻愬鏁伴噺 + this.Model.SetValue("FCompleteCount", dt.Rows[i]["FCompleteCount1"], i);//榻愬鏁伴噺 this.Model.SetValue("FLackCount", dt.Rows[i]["FLackCount"], i);//缂烘枡鏁伴噺 this.Model.SetValue("FPassableCount", dt.Rows[i]["FHLeftQty"].ToString(), i);//鍙敤鏁伴噺 this.Model.SetValue("FMateralCount", dt.Rows[i]["FHStockQty"].ToString(), i);//鐗╂枡鏁伴噺 - this.Model.SetValue("FCompleteDetailStatus", dt.Rows[i]["FComPlete"].ToString(), i);//鏄惁榻愬 + this.Model.SetValue("FOccupyCount", dt.Rows[i]["FOccupyCount"].ToString(), i);//鍗犵敤鏁伴噺 + this.Model.SetValue("FCompleteDetailStatus", dt.Rows[i]["FComPlete"].ToString(), i);//鏄惁榻愬 + this.Model.SetValue("FIsHavePur", dt.Rows[i]["FIsHavePur"].ToString(), i);//鏄惁鏈夐噰璐鍗� this.Model.SetValue("FHMainICMOInterIDr", dt.Rows[i]["FHMainICMOInterIDr"].ToString(), i);//鐢熶骇璁㈠崟鍐呯爜 this.Model.SetValue("FPRDBillNo", dt.Rows[i]["FPRDBillNo"].ToString(), i);//鐢熶骇璁㈠崟鍐呯爜 this.Model.SetValue("FPlanDate", dt.Rows[i]["FPlanDate"].ToString(), i);//鏃ヨ鍒掓棩鏈� @@ -142,8 +177,11 @@ this.Model.SetValue("FOwnerId", dt.Rows[i]["FOwnerId"], i);//璐т富 } } - this.View.UpdateView(); + + //this.View.UpdateView(); did = true; } } } + + \ No newline at end of file -- Gitblit v1.9.1