王 垚
2021-03-01 bc93df0c62be0e7c10417c490938135d0bad76dc
src/BLL/Demo.BillView/PRD/Pro_ScDayImport.cs
@@ -149,16 +149,17 @@
                            string fDayPlanBillNo = "";
                            string fCloseCount = "";
                            string fQtyLS = "";
                            sql = string.Format(@"select a.FID,FBILLNO,FSCOrderNo,FHMaterID,FHSourceID,a.FCloseCount,isnull((select SUM(isnull(FHQTY,0)) from SC_WORKBILLSORTBILLSub t2 where t2.FID = t1.FID and DATEDIFF(D,FHMASTERDATE,GETDATE())>0),0)FQTYLS  from Sc_WorkBillSortBillMain a JOIN T_BD_MATERIAL b ON a.FHMaterID = b.FMATERIALID
                            sql = string.Format(@"select a.FID,FBILLNO,FSCOrderNo,FHMaterID,FHSourceID,a.FCloseCount,isnull((select SUM(isnull(FHQTY,0)) from SC_WORKBILLSORTBILLSub t2 where t2.FID = a.FID and DATEDIFF(D,FHMASTERDATE,GETDATE())>0),0)FQTYLS  from Sc_WorkBillSortBillMain a JOIN T_BD_MATERIAL b ON a.FHMaterID = b.FMATERIALID
left join T_ENG_WORKCENTER c on a.FHSourceID=c.fid 
 where FSCOrderNo ='{0}' and b.FNUMBER ='{1}' and a.FSRCBILLENTRYSEQ ='{3}' and (isnull(c.FNUMBER,'') ='{2}' or (select count(*) from T_ENG_WORKCENTER where isnull(c.FNUMBER,'') ='{2}')=0)", dt.Rows[i][1].ToString(), dt.Rows[i][5].ToString(), dt.Rows[i][4].ToString(), dt.Rows[i][2].ToString());
                            LogHelper.Error(sql);
                            DataTable dayPlanDt = DBServiceHelper.ExecuteDataSet(Context, sql).Tables[0];
                            if (dayPlanDt.Rows.Count > 0)
                            {
                                fDayPlanID = dayPlanDt.Rows[0]["FID"].ToString();
                                fDayPlanBillNo = dayPlanDt.Rows[0]["FBILLNO"].ToString();
                                fCloseCount = dayPlanDt.Rows[0]["FCloseCount"].ToString();
                                fQtyLS = dayPlanDt.Rows[0]["FCloseCount"].ToString();
                                fQtyLS = dayPlanDt.Rows[0]["FQTYLS"].ToString();
                            }
                            //DynamicObject row = new DynamicObject(entity.DynamicObjectType);
                            this.Model.CreateNewEntryRow("FEntity");