Inheritance: MesBomDetailBase
 public virtual void UpdateBomDetail(MesBomDetail entity)
 {
     entityDao.UpdateBomDetail(entity);
 }
 public virtual void CreateBomDetail(MesBomDetail entity)
 {
     entityDao.CreateBomDetail(entity);
 }
 public virtual void DeleteBomDetail(MesBomDetail entity)
 {
     entityDao.DeleteBomDetail(entity);
 }
示例#4
0
 public IList<MesBom> GetRelatedBomDetail(MesBomDetail mesBomDetail)
 {
     List<MesBom> mesBomList = new List<MesBom>();
     if (mesBomDetail.Item.IsMes)
     {
         mesBomList.Add(mesBomDetail.Bom);
     }
     IList<MesBomDetail> mesBomDetailList = this.GetAllBomDetailList(null, mesBomDetail.Bom.Code);
     if (mesBomDetailList != null && mesBomDetailList.Count > 0)
     {
         foreach (MesBomDetail mb in mesBomDetailList)
         {
             mesBomList.AddRange(GetRelatedBomDetail(mb));
         }
     }
     return mesBomList;
 }
示例#5
0
        public List<MesBomDetail> GetBomDetailList(MesBom mesBom)
        {
            MesBom topBom = mesBomMgr.LoadBom(mesBom.Code, true);
            List<MesBomDetail> mesBomDetailList = new List<MesBomDetail>();
            if (topBom.BomDetails != null && topBom.BomDetails.Count > 0)
            {
                foreach (MesBomDetail mesBomDetail in topBom.BomDetails)
                {
                    if (mesBomDetail.StructureType == BusinessConstants.CODE_MASTER_BOM_DETAIL_TYPE_VALUE_N)
                    {
                        mesBomDetailList.Add(mesBomDetail);
                    }
                    else if (mesBomDetail.StructureType == BusinessConstants.CODE_MASTER_BOM_DETAIL_TYPE_VALUE_X)
                    {
                        List<MesBomDetail> xBomDetail = GetBomDetailList(mesBomDetail.Bom.Code, mesBomDetail.Item.Code);
                        mesBomDetailList.AddRange(xBomDetail);
                    }
                }
            }

            var query = mesBomDetailList.Select(l => new
            {
                Bom = l.Bom,
                Item = l.Item,
                RateQty = (from m in mesBomDetailList
                           where m.Bom.Code.Trim().ToUpper() == l.Bom.Code.Trim().ToUpper()
                           && m.Item.Code.Trim().ToUpper() == l.Item.Code.Trim().ToUpper()
                           && m.IsActive == l.IsActive
                           select m.RateQty).Sum(),
                IsActive = l.IsActive
            }).Distinct();

            List<MesBomDetail> list = new List<MesBomDetail>();
            foreach (var item in query)
            {
                MesBomDetail mesBomDetail = new MesBomDetail();
                mesBomDetail.Bom = item.Bom;
                mesBomDetail.Item = item.Item;
                mesBomDetail.RateQty = item.RateQty;
                mesBomDetail.IsActive = item.IsActive;
                list.Add(mesBomDetail);
            }
            return list;
        }
示例#6
0
        public List<MesBomDetail> GetBomDetailList(string bomCode, string itemCode)
        {
            List<MesBomDetail> mesBomDetailList = new List<MesBomDetail>();
            IList<MesBomDetail> bomDetailList = GetNextLevelBomDetail(itemCode);
            foreach (MesBomDetail scmsBomDetail in bomDetailList)
            {
                if (scmsBomDetail.StructureType == BusinessConstants.CODE_MASTER_BOM_DETAIL_TYPE_VALUE_N)
                {
                    MesBomDetail bomDetail = new MesBomDetail();
                    bomDetail.Bom = mesBomMgr.LoadBom(bomCode);
                    bomDetail.Item = scmsBomDetail.Item;
                    bomDetail.RateQty = scmsBomDetail.RateQty;
                    bomDetail.IsActive = scmsBomDetail.IsActive;
                    mesBomDetailList.Add(bomDetail);

                }
                else if (scmsBomDetail.StructureType == BusinessConstants.CODE_MASTER_BOM_DETAIL_TYPE_VALUE_X)
                {
                    List<MesBomDetail> xBomDetailList = GetBomDetailList(bomCode, scmsBomDetail.Item.Code);
                    mesBomDetailList.AddRange(xBomDetailList);
                }
            }

            return mesBomDetailList;
        }
        private object Deserialize(DssImportHistory dssImportHistory, bool isUpdate)
        {
            Item bomItem = this.itemMgr.CheckAndLoadItem(dssImportHistory[1]);//bom头
            Item item = this.itemMgr.CheckAndLoadItem(dssImportHistory[2]);//零件号
            if (item.IsMes && bomItem.IsMes)
            {
                MesBomDetail mesBomDetail = new MesBomDetail();
                mesBomDetail.Bom = this.LoadMesBom(dssImportHistory[1]);//Bom代码
                mesBomDetail.Item = item;

                mesBomDetail.StartDate = dssImportHistory[4] != null ?
                    DssHelper.GetDate(dssImportHistory[4], BusinessConstants.DSS_SYSTEM_CODE_QAD) : new DateTime(2000, 1, 1);

                if (isUpdate)
                {
                    mesBomDetail.RateQty = decimal.Parse(dssImportHistory[5]);//用量
                    mesBomDetail.StructureType = this.GetStructureType(dssImportHistory[6], BusinessConstants.DSS_SYSTEM_CODE_QAD);//类型

                    if (dssImportHistory[8] != null) mesBomDetail.EndDate = DssHelper.GetDate(dssImportHistory[8], BusinessConstants.DSS_SYSTEM_CODE_QAD);//结束日期
                }
                return mesBomDetail;
            }
            else
            {
                BomDetail bomDetail = new BomDetail();
                bomDetail.Bom = this.LoadBom(dssImportHistory[1]);//Bom代码
                bomDetail.Item = item;//零件号
                bomDetail.Reference = dssImportHistory[3];//参考
                bomDetail.StartDate = dssImportHistory[4] != null ?
                    DssHelper.GetDate(dssImportHistory[4], BusinessConstants.DSS_SYSTEM_CODE_QAD) : new DateTime(2000, 1, 1);

                if (isUpdate)
                {
                    bomDetail.RateQty = decimal.Parse(dssImportHistory[5]);//用量
                    bomDetail.StructureType = this.GetStructureType(dssImportHistory[6], BusinessConstants.DSS_SYSTEM_CODE_QAD);//类型

                    if (dssImportHistory[8] != null) bomDetail.EndDate = DssHelper.GetDate(dssImportHistory[8], BusinessConstants.DSS_SYSTEM_CODE_QAD);//结束日期

                    //回冲方式从零件上取
                    bomDetail.BackFlushMethod = bomDetail.Item.BackFlushMethod;
                    bomDetail.ScrapPercentage = decimal.Parse(dssImportHistory[10]) / 100;//废品百分比

                    bomDetail.Operation = int.Parse(dssImportHistory[12]);

                }

                #region 默认值
                bomDetail.Uom = bomDetail.Item.Uom;
                bomDetail.Priority = 0;
                bomDetail.NeedPrint = true;
                bomDetail.IsShipScanHu = false;

                #endregion

                return bomDetail;
            }
        }
 public virtual void UpdateBomDetail(MesBomDetail entity)
 {
     Update(entity);
 }
 public virtual void DeleteBomDetail(MesBomDetail entity)
 {
     Delete(entity);
 }
 public virtual void CreateBomDetail(MesBomDetail entity)
 {
     Create(entity);
 }