王 垚
2021-03-23 6cb6d56102ce66fc348655c112d9f178c08aaeb8
src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs
@@ -9,6 +9,7 @@
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
{
@@ -17,8 +18,12 @@
    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)
            {
@@ -29,10 +34,10 @@
            {
                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)
                {
@@ -42,18 +47,20 @@
                        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);//物料属性
                    }
                }
@@ -72,7 +79,8 @@
            {
                if (Convert.ToString(current["FCompleteDetailStatus"]) == "未齐套")
                {
                    grid.SetRowBackcolor("#FF0000", _i);
                   // grid.SetRowBackcolor("#FF0000", _i);
                    grid.SetRowBackcolor("#71FF98CB", _i);
                }
                _i++;
            }
@@ -112,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)
            {
@@ -125,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"));
@@ -135,6 +147,7 @@
            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];
@@ -153,16 +166,19 @@
                    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);//货主 
                }
            }
@@ -172,3 +188,5 @@
        }
    }
}