Пример #1
0
        private void ProcessMesBomDetailOut(ScmsTableIndex scmsTableIndex)
        {
            IList <MesBom> bomList = GetTransferBom();

            if (bomList != null && bomList.Count > 0)
            {
                foreach (MesBom mesBom in bomList)
                {
                    try
                    {
                        IList <MesBomDetail> scmsBomDetailList = mesBomDetailMgr.GetBomDetailList(mesBom);
                        if (scmsBomDetailList != null && scmsBomDetailList.Count > 0)
                        {
                            foreach (MesBomDetail mesBomDetail in scmsBomDetailList)
                            {
                                ScmsBom scmsBom = scmsBomMgr.LoadScmsBom(mesBomDetail.Bom.Code, mesBomDetail.Item.Code);
                                if (scmsBom == null)
                                {
                                    scmsBom                = new ScmsBom();
                                    scmsBom.Bom            = mesBomDetail.Bom.Code;
                                    scmsBom.Flag           = mesBomDetail.IsActive ? MesDssConstants.SCMS_MES_FLAG_SCMS_UPDATED : MesDssConstants.SCMS_MES_FLAG_SCMS_DELETE;
                                    scmsBom.ItemCode       = mesBomDetail.Item.Code;
                                    scmsBom.LastModifyDate = DateTime.Now;
                                    scmsBom.LastModifyUser = userMgr.GetMonitorUser().Code;
                                    scmsBom.Qty            = mesBomDetail.RateQty;

                                    scmsBomMgr.CreateScmsBom(scmsBom);
                                }
                                else
                                {
                                    //DJIN 20120817
                                    scmsBom.Flag           = mesBomDetail.IsActive || !mesBomDetail.EndDate.HasValue ? MesDssConstants.SCMS_MES_FLAG_SCMS_UPDATED : MesDssConstants.SCMS_MES_FLAG_SCMS_DELETE;
                                    scmsBom.LastModifyDate = DateTime.Now;
                                    scmsBom.LastModifyUser = userMgr.GetMonitorUser().Code;
                                    scmsBom.Qty            = mesBomDetail.RateQty;

                                    scmsBomMgr.UpdateScmsBom(scmsBom);
                                }
                            }
                        }
                        mesBom.TransferFlag = false;

                        mesBomMgr.UpdateBom(mesBom);
                    }
                    catch (Exception e)
                    {
                        log.Error(mesBom.Code + " create exception", e);
                        continue;
                    }
                }
            }

            scmsTableIndexMgr.Complete(scmsTableIndex);
        }
Пример #2
0
 public virtual void UpdateScmsBom(ScmsBom entity)
 {
     entityDao.Update(entity);
 }
Пример #3
0
 public virtual void DeleteScmsBom(ScmsBom entity)
 {
     entityDao.Delete(entity);
 }
Пример #4
0
 public virtual void CreateScmsBom(ScmsBom entity)
 {
     entityDao.Create(entity);
 }