王 垚
2021-02-04 3bdc41a3c5a0857b04c1ee4d6f7cc515d1983820
src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs
@@ -17,6 +17,9 @@
    public class ProCompleteAnalysisDetail : AbstractDynamicFormPlugIn
    {
        bool did = false;
        string FHMainICMOInterIDr = "";
        string FHMainICMOEntryID = "";
        string FHICMOInterID = "";
        public override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
@@ -29,10 +32,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)
                {
@@ -48,6 +51,7 @@
                        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);//日计划日期   
@@ -112,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)
            {
@@ -125,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"));
@@ -135,6 +143,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];
@@ -157,7 +166,9 @@
                    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);//日计划日期