王 垚
2021-02-28 dda3dd912d5507be2fc56f917d217096bd2775a4
src/BLL/Demo.BillView/PRD/ProCompleteAnalysisDetails.cs
@@ -18,14 +18,13 @@
    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 +33,10 @@
            {
                if (did)
                    return;
                  FHMainICMOInterIDr = this.View.OpenParameter.GetCustomParameter("FHMainICMOInterID").ToString();//主生产订单主内码
                  FHMainICMOEntryID = this.View.OpenParameter.GetCustomParameter("FHMainICMOEntryID").ToString();// 主生产订单子内码
                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_JIT_MOMaterReadysBill where FHMainICMOInterIDr ='{0}' and FHMainICMOEntryID ='{1}' and FHICMOInterID='{2}' order by FPlanDate, FHStockQty desc ,FHMaterID ", FHMainICMOInterIDr, FHMainICMOEntryID, FHICMOInterID);
                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 +62,12 @@
                        this.Model.SetValue("FErpClsID", dt.Rows[i]["FErpClsID"], i);//物料属性 
                    }
                }
                ChangeColor();
                 did = true;
            }
        }
        private void ChangeColor() {
        private void ChangeColor()
        {
            Entity entity = this.View.BillBusinessInfo.GetEntity("FEntity");
            //单据体信息转换为列表集合
            DynamicObjectCollection entityDataObjoct = this.View.Model.GetEntityDataObject(entity);
@@ -79,13 +77,11 @@
            {
                if (Convert.ToString(current["FCompleteDetailStatus"]) == "未齐套")
                {
                   // grid.SetRowBackcolor("#FF0000", _i);
                    grid.SetRowBackcolor("#71FF98CB", _i);
                }
                _i++;
            }
        }
        public override void BarItemClick(BarItemClickEventArgs e)
        {
            base.BarItemClick(e);
@@ -106,11 +102,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 +111,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)
            {
@@ -188,5 +179,4 @@
        }
    }
}