王 垚
2021-02-28 156e06ad46f0e4cb61c5f74553f6c2bc51e21a04
src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs
@@ -18,14 +18,14 @@
    public class ProCompleteAnalysisDetail : AbstractDynamicFormPlugIn
    {
        bool did = false;
        string FHMainICMOInterIDr = "";
        string FHMainICMOEntryID = "";
        string FHICMOInterID = "";
        string FHICMOInterID = "";//日计划工单内码
        string tempName = "JIT_MOMaterReadysBill";//表名称
        public override void OnLoad(EventArgs e)
        {
            LogHelper.Info("[齐套分析明细加载列表]");
            base.OnLoad(e);
            if (this.View.OpenParameter.GetCustomParameter("FHMainICMOInterID") == null)
            if (this.View.OpenParameter.GetCustomParameter("FHICMOInterID") == null)
            {
                SearchList();
                ChangeColor();
@@ -34,10 +34,10 @@
            {
                if (did)
                    return;
                  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);
                if (this.View.OpenParameter.GetCustomParameter("tempName") != null)
                    tempName = this.View.OpenParameter.GetCustomParameter("tempName")?.ToString();//表名
                FHICMOInterID = this.View.OpenParameter.GetCustomParameter("FHICMOInterID").ToString();//日计划订单主内码
                string sql = string.Format(@"/*dialect*/select * from view_{0} where  FHICMOInterID='{1}' order by FPlanDate, FHStockQty desc ,FHMaterID ", tempName, FHICMOInterID);
                DataTable dt = DBServiceHelper.ExecuteDataSet(this.Context, sql).Tables[0];
                if (dt.Rows.Count > 0)
                {
@@ -63,13 +63,13 @@
                        this.Model.SetValue("FErpClsID", dt.Rows[i]["FErpClsID"], i);//物料属性 
                    }
                }
                ChangeColor();
                 did = true;
                did = true;
            }
        }
        private void ChangeColor() {
        private void ChangeColor()
        {
            Entity entity = this.View.BillBusinessInfo.GetEntity("FEntity");
            //单据体信息转换为列表集合
            DynamicObjectCollection entityDataObjoct = this.View.Model.GetEntityDataObject(entity);
@@ -79,13 +79,15 @@
            {
                if (Convert.ToString(current["FCompleteDetailStatus"]) == "未齐套")
                {
                   // grid.SetRowBackcolor("#FF0000", _i);
                    grid.SetRowBackcolor("#71FF98CB", _i);
                }
                else
                {
                    grid.SetRowBackcolor("#ffffff", _i);
                }
                _i++;
            }
        }
        public override void BarItemClick(BarItemClickEventArgs e)
        {
            base.BarItemClick(e);
@@ -106,11 +108,6 @@
            base.EntityRowClick(e);
            DynamicFormShowParameter formPa = new DynamicFormShowParameter();
            formPa.FormId = "paez_CompleteAnalysisMateriel";
            /* jsonModel.Add("FHMainICMOInterID", FMainInterID);//主生产订单主内码
             jsonModel.Add("FHMainICMOEntryID", FMainEntryID);//主生产订单子内码
             jsonModel.Add("FHICMOInterID", FDayPlanWorkID);//日计划订单主内码
            current["FMatrailId_Id"].ToString(), current["FHMainSourceInterID"].ToString(), current["FHMainSourceEntryID"].ToString(), current["FDayPlanWorkID"].ToString())
            */
            formPa.CustomParams.Add("FHMainICMOInterIDr", Convert.ToString(this.View.Model.GetValue("FHMainICMOInterIDr", e.Row).ToString()));
            formPa.CustomParams.Add("FMatrailId", Convert.ToString((this.View.Model.GetValue("FMateralDetailId", e.Row) as DynamicObject)["Id"].ToString()));
            this.View.ShowForm(formPa);
@@ -120,8 +117,8 @@
        /// </summary>
        public void SearchList()
        {
            string sqlwhere = $" where FHMainICMOInterIDr ='{FHMainICMOInterIDr}' and FHMainICMOEntryID ='{FHMainICMOEntryID}' and FHICMOInterID='{FHICMOInterID}'";
            string sql = string.Format(@"/*dialect*/select * from view_JIT_MOMaterReadysBill  ");
            string sqlwhere = $" where  FHICMOInterID='{FHICMOInterID}'";
            string sql = string.Format($"/*dialect*/select * from view_{tempName}");
            //物料
            if ((this.Model.GetValue("FMateralId") as DynamicObject) != null)
            {
@@ -178,7 +175,7 @@
                    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("FErpClsID", dt.Rows[i]["FErpClsID"], i);//物料属性
                    this.Model.SetValue("FOwnerId", dt.Rows[i]["FOwnerId"], i);//货主 
                }
            }
@@ -189,4 +186,3 @@
    }
}