Ejemplo n.º 1
0
        //获取DB2中的数据
        public void GetDBData()
        {
            // ProdCatcher = new DB2OperDataCatcher<FBProd>("SMVIEW.FBPROD_M", DB2) { Conditions="where prodcat_ident='Production' and identifier not like 'SL%'"};
            //ProdList = ProdCatcher.GetEntities().EntityList.Select(s=>s.Identifier).ToList();
            //v2 LotCatcher = new DB2OperDataCatcher<Report28_Lot>("ISTRPT.Report28_Lot", DB2) { Conditions=string.Format("where prodspec_id not like 'SL%'")};
            //v3 LotCatcher = new DB2OperDataCatcher<Report28_Lot>("ISTRPT.Report28_LotV2", DB2);//v2
            LotCatcher = new DB2OperDataCatcher <Report28_Lot>("ISTRPT.Report28_LotV2", DB2)
            {
                Conditions = "where lot_inv_state in ('OnFloor','NonProBank')"
            };
            lotList = LotCatcher.GetEntities().EntityList;
            var curList  = lotList.Where(w => w.Source == "Cur");
            var ystdList = lotList.Where(w => w.Source == "Ystd");

            lotList_Prod_Cur   = curList.Where(w => w.Lot_Type == "Production");
            lotList_Prod_Ystd  = ystdList.Where(w => w.Lot_Type == "Production");
            lotList_Other_Cur  = curList.Where(w => w.Lot_Type != "Production");
            lotList_Other_Ystd = ystdList.Where(w => w.Lot_Type != "Production");
            //   if (lotList.Count() == 0) throw new Exception("没有Active的Production Lot");
            var cond = string.Join("','", lotList.Select(s => s.ProdSpec_ID).Distinct());

            FlowCatcher = new DB2OperDataCatcher <Report28_Flow>("ISTRPT.Report28_Flow", DB2)
            {
                Conditions = string.Format("where prodspec_id in ('{0}') order by mainpd_id,ope_no", cond)
            };
            flowList   = FlowCatcher.GetEntities().EntityList;
            OutCatcher = new DB2OperDataCatcher <RPT_WipChart_TargetOut>("ISTRPT.RPT_WIPCHART_TARGETOUT", DB2);
            outList    = OutCatcher.GetEntities().EntityList;
        }
 void GetDB()
 {
     // string x = PostModel.OpeNo;
     LotCatcher = new DB2OperDataCatcher <Report28_LotDetail>("ISTRPT.Report28_LotDetailV2", DB2)
     {
         Conditions = string.Format("where lot_id in ('{0}') ", string.Join("','", PostModel.LotList))
     };
     LotInfoList = LotCatcher.GetEntities().EntityList;
     //var lotList_1 = LotInfoList.Select(s => s.Lot_ID).Distinct();
     //if (PostModel.LotList.Count() > lotList_1.Count())
     //{
     //    var splitLots = PostModel.LotList.Except(lotList_1);
     //    SplitCaseCatcher = new DB2OperDataCatcher<Report28_LotDetail>("ISTRPT.Report28_SplitLotDetail", DB2) { Conditions = string.Format("where lot_id in ('{0}') and ope_no='{1}'", string.Join("','", splitLots),PostModel.OpeNo) };
     //    SplitInfoList = SplitCaseCatcher.GetEntities().EntityList;
     //}
 }