From e2b0f85331c972a77ed6e0e179d736c4c6eb1abc Mon Sep 17 00:00:00 2001 From: 王 垚 <1402714037@qq.com> Date: 星期日, 21 三月 2021 15:34:26 +0800 Subject: [PATCH] 代码上传 --- src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs | 83 +++++++++++++++++++++++++++++++---------- 1 files changed, 63 insertions(+), 20 deletions(-) diff --git a/src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs b/src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs index 2286bd4..310984d 100644 --- a/src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs +++ b/src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs @@ -1,18 +1,15 @@ -锘縰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; +using ZD.Cloud.Logger; namespace Demo.BillView { @@ -21,21 +18,26 @@ public class ProCompleteAnalysisDetail : AbstractDynamicFormPlugIn { bool did = false; + string FHMainICMOInterIDr = ""; + string FHMainICMOEntryID = ""; + string FHICMOInterID = ""; public override void OnLoad(EventArgs e) { + LogHelper.Info("[榻愬鍒嗘瀽鏄庣粏鍔犺浇鍒楄〃]"); 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,28 +47,52 @@ 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);//鏃ヨ鍒掓棩鏈� this.Model.SetValue("FOrgId", dt.Rows[i]["FHStockOrgID"], i);//搴撳瓨缁勭粐 this.Model.SetValue("FOwnerTypeId", dt.Rows[i]["FOwnerTypeId"], i);//璐т富绫诲瀷 this.Model.SetValue("FOwnerId", dt.Rows[i]["FOwnerId"], i);//璐т富 + this.Model.SetValue("FErpClsID", dt.Rows[i]["FErpClsID"], 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); + grid.SetRowBackcolor("#71FF98CB", _i); + } + _i++; + } + } + public override void BarItemClick(BarItemClickEventArgs e) { base.BarItemClick(e); if (e.BarItemKey.ToUpper() == "TBFILTER") { SearchList(); + ChangeColor(); } } /// <summary> @@ -94,8 +120,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 +133,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 +147,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,21 +166,27 @@ 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);//鏃ヨ鍒掓棩鏈� this.Model.SetValue("FOrgId", dt.Rows[i]["FHStockOrgID"], i);//搴撳瓨缁勭粐 this.Model.SetValue("FOwnerTypeId", dt.Rows[i]["FOwnerTypeId"], i);//璐т富绫诲瀷 + this.Model.SetValue("FErpClsID", dt.Rows[i]["FErpClsID"], i);//鐗╂枡灞炴�� 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