Inheritance: com.Sconit.Entity.Dss.DssExportHistoryBase
        //protected override object Serialize(object obj)
        //{
        //    throw new NotImplementedException();
        //}

        #region Private Method
        public IList<DssExportHistory> ConvertList(IList<BillDetail> list, DssOutboundControl dssOutboundControl)
        {
            IList<DssExportHistory> result = new List<DssExportHistory>();
            if (list != null && list.Count > 0)
            {
                foreach (BillDetail billDetail in list)
                {
                    DssExportHistory dssExportHistory = new DssExportHistory();

                    dssExportHistory.DssOutboundControl = dssOutboundControl;
                    dssExportHistory.EventCode = BusinessConstants.DSS_EVENT_CODE_CREATE;
                    dssExportHistory.IsActive = true;
                    dssExportHistory.CreateDate = DateTime.Now;

                    dssExportHistory.OriginalId = billDetail.Id;
                    dssExportHistory.OrderNo = billDetail.ActingBill.OrderHead.OrderNo;
                    dssExportHistory.ReceiptNo = billDetail.ActingBill.ReceiptNo;
                    dssExportHistory.Item = billDetail.ActingBill.Item.Code;
                    dssExportHistory.Location = dssExportHistory.DssOutboundControl.UndefinedString1;//客户库位
                    dssExportHistory.Qty = billDetail.BilledQty;
                    dssExportHistory.EffectiveDate = billDetail.Bill.CreateDate.Date;
                    dssExportHistory.PartyTo = billDetail.Bill.BillAddress.Party.Code;//客户

                    dssExportHistory.DefinedString1 = billDetail.Bill.BillNo;//开票通知单号

                    dssExportHistory.KeyCode = DssHelper.GetBillKeyCode(dssExportHistory, billDetail.Bill.BillNo);

                    this.GetLoctransInfo(dssExportHistory);
                    result.Add(dssExportHistory);
                }
            }

            return result;
        }
Ejemplo n.º 2
0
        public DssExportHistory ConvertLocationTransactionToDssExportHistory(object obj, DssOutboundControl dssOutboundControl)
        {
            DssExportHistory dssExportHistory = new DssExportHistory();
            dssExportHistory.DssOutboundControl = dssOutboundControl;
            dssExportHistory.EventCode = BusinessConstants.DSS_EVENT_CODE_CREATE;
            dssExportHistory.IsActive = true;
            dssExportHistory.CreateDate = DateTime.Now;

            dssExportHistory.OriginalId = (int)((object[])obj)[0];
            dssExportHistory.OrderNo = (string)((object[])obj)[1];
            dssExportHistory.ReceiptNo = (string)((object[])obj)[2];
            dssExportHistory.Item = (string)((object[])obj)[3];
            dssExportHistory.Location = (string)((object[])obj)[4];
            dssExportHistory.Qty = (decimal)((object[])obj)[5];
            dssExportHistory.EffectiveDate = (DateTime)((object[])obj)[6];
            dssExportHistory.PartyFrom = (string)((object[])obj)[7];
            dssExportHistory.PartyTo = (string)((object[])obj)[8];

            //记录RefLoc
            if (((object[])obj).Length > 9)
            {
                dssExportHistory.ReferenceLocation = (string)((object[])obj)[9];
            }

            return dssExportHistory;
        }
        protected override object GetOutboundData(DssExportHistory dssExportHistory)
        {
            if (!commonOutboundMgr.CheckBillStatusValid(dssExportHistory.DefinedString1))
            {
                throw new BusinessErrorException("状态不合法");
            }

            return (object)dssExportHistory;
        }
Ejemplo n.º 4
0
        public override bool Equals(object obj)
        {
            DssExportHistory another = obj as DssExportHistory;

            if (another == null)
            {
                return(false);
            }
            else
            {
                return(this.OriginalId == another.OriginalId);
            }
        }
Ejemplo n.º 5
0
        protected override object GetOutboundData(DssExportHistory dssExportHistory)
        {
            if (dssExportHistory.ReferenceLocation == null || dssExportHistory.ReferenceLocation.Trim() == string.Empty)
            {
                throw new BusinessErrorException("目的库位为空");
            }
            if (dssExportHistory.Location == null || dssExportHistory.Location.Trim() == string.Empty)
            {
                throw new BusinessErrorException("来源库位为空");
            }

            return (object)dssExportHistory;
        }
Ejemplo n.º 6
0
        public override void CreateDssExportHistory(DssExportHistory dssExportHistory)
        {
            base.CreateDssExportHistory(dssExportHistory);

            #region Create details
            if (dssExportHistory.DssExportHistoryDetails != null && dssExportHistory.DssExportHistoryDetails.Count > 0)
            {
                foreach (var dssExportHistoryDetail in dssExportHistory.DssExportHistoryDetails)
                {
                    dssExportHistoryDetail.MstrId = dssExportHistory.Id;
                    this.dssExportHistoryDetailMgr.CreateDssExportHistoryDetail(dssExportHistoryDetail);
                }
            }
            #endregion
        }
Ejemplo n.º 7
0
        protected override object GetOutboundData(DssExportHistory dssExportHistory)
        {
            //if (dssExportHistory.Comments != "ISS-UNP2RCT-TR")
            //{
                if (dssExportHistory.ReferenceLocation == null || dssExportHistory.ReferenceLocation.Trim() == string.Empty)
                {
                    dssExportHistory.Comments = "来源库位为空";
                    throw new BusinessErrorException("来源库位为空");
                }
            //}
            if (dssExportHistory.Location == null || dssExportHistory.Location.Trim() == string.Empty)
            {
                throw new BusinessErrorException("目的库位为空");
            }

            return (object)dssExportHistory;
        }
 public virtual void CreateDssExportHistory(DssExportHistory entity)
 {
     entityDao.CreateDssExportHistory(entity);
 }
 public virtual void DeleteDssExportHistory(DssExportHistory entity)
 {
     Delete(entity);
 }
Ejemplo n.º 10
0
        private IList<DssExportHistory> ConvertList(IList<BillDetail> list, DssOutboundControl dssOutboundControl)
        {
            DetachedCriteria criteria = DetachedCriteria.For(typeof(DssObjectMapping))
              .Add(Expression.Eq("Entity", "BillTo")).Add(Expression.Eq("ExternalSystem", "QAD"))
              .Add(Expression.Eq("ExternalEntity", "ShipTo"));

            IList<DssObjectMapping> dom = criteriaMgr.FindAll<DssObjectMapping>(criteria);
            IList<DssExportHistory> result = new List<DssExportHistory>();
            if (list != null && list.Count > 0)
            {
                foreach (BillDetail billDetail in list)
                {
                    DssExportHistory dssExportHistory = new DssExportHistory();

                    dssExportHistory.DssOutboundControl = dssOutboundControl;
                    dssExportHistory.EventCode = BusinessConstants.DSS_EVENT_CODE_CREATE;
                    dssExportHistory.IsActive = true;
                    dssExportHistory.CreateDate = DateTime.Now;

                    dssExportHistory.OriginalId = billDetail.Id;
                    dssExportHistory.OrderNo = billDetail.ActingBill.OrderNo;
                    dssExportHistory.ReceiptNo = billDetail.ActingBill.ReceiptNo;
                    dssExportHistory.Item = billDetail.ActingBill.Item.Code;
                    dssExportHistory.Location = dssExportHistory.DssOutboundControl.UndefinedString1;//客户库位
                    dssExportHistory.Qty = billDetail.BilledQty;
                    //dssExportHistory.EffectiveDate = billDetail.Bill.CreateDate.Date;
                    dssExportHistory.EffectiveDate = DateTime.Now;
                    dssExportHistory.PartyTo = billDetail.Bill.BillAddress.Party.Code;//客户

                    dssExportHistory.DefinedString1 = billDetail.Bill.BillNo;//开票通知单号
                    dssExportHistory.DefinedString2 = billDetail.Bill.BillAddress.Code; //BillTo
                    if (dom != null && dom.Count > 0)
                    {
                        DssObjectMapping sd = dom.Where(d => d.Code == billDetail.Bill.BillAddress.Code).FirstOrDefault();
                        dssExportHistory.DefinedString3 = sd.ExternalCode;  //Map到shipto
                    }

                    dssExportHistory.KeyCode = DssHelper.GetBillKeyCode(dssExportHistory, billDetail.Bill.BillNo);

                    this.GetLoctransInfo(dssExportHistory);
                    result.Add(dssExportHistory);
                }
            }

            return result;
        }
        public IList<DssExportHistory> ConvertList(IList<BillDetail> list, DssOutboundControl dssOutboundControl)
        {
            IList<DssExportHistory> result = new List<DssExportHistory>();
            if (list != null && list.Count > 0)
            {
                foreach (BillDetail billDetail in list)
                {
                    DssExportHistory dssExportHistory = new DssExportHistory();

                    dssExportHistory.DssOutboundControl = dssOutboundControl;
                    dssExportHistory.EventCode = BusinessConstants.DSS_EVENT_CODE_CREATE;
                    dssExportHistory.IsActive = true;
                    dssExportHistory.CreateDate = DateTime.Now;

                    dssExportHistory.OriginalId = billDetail.Id;
                    dssExportHistory.OrderNo = billDetail.ActingBill.OrderHead.OrderNo;
                    dssExportHistory.ReceiptNo = billDetail.ActingBill.ReceiptNo;
                    dssExportHistory.Item = billDetail.ActingBill.Item.Code;
                    dssExportHistory.Uom = billDetail.ActingBill.Uom.Code;
                    dssExportHistory.Qty = billDetail.BilledQty;
                    dssExportHistory.EffectiveDate = billDetail.ActingBill.EffectiveDate;
                    dssExportHistory.PartyFrom = billDetail.Bill.BillAddress.Party.Code;//供应商

                    dssExportHistory.DefinedString1 = billDetail.Bill.BillNo;//开票通知单号
                    dssExportHistory.DefinedString2 = billDetail.Currency.Code;//币种
                    dssExportHistory.DefinedString3 = billDetail.UnitPrice.ToString("0.########");//发票单价
                    dssExportHistory.DefinedString4 = billDetail.UnitPrice.ToString("0.########");//采购单价
                    dssExportHistory.DefinedString5 = billDetail.OrderAmount.ToString("0.########");//金额

                    dssExportHistory.KeyCode = DssHelper.GetBillKeyCode(dssExportHistory, billDetail.Bill.BillNo);

                    this.GetLoctransInfo(dssExportHistory);
                    result.Add(dssExportHistory);
                }
            }

            return result;
        }
Ejemplo n.º 12
0
        private void GetLoctransInfo(DssExportHistory dssExportHistory)
        {
            OrderLocationTransaction orderLocationTransaction =
                commonOutboundMgr.GetOrderLocationTransactionInfo(dssExportHistory.OrderNo, dssExportHistory.Item, BusinessConstants.IO_TYPE_OUT);

            if (orderLocationTransaction != null)
            {
                //dssExportHistory.Location = orderLocationTransaction.Location != null ? orderLocationTransaction.Location.Code : null;//发出库位
                dssExportHistory.PartyFrom = orderLocationTransaction.OrderDetail.OrderHead.PartyFrom.Code;//发出区域
            }
            else
            {
                ////归档库查找
                //DetachedCriteria criteria = DetachedCriteria.For(typeof(OrderLocationTransaction));
                //criteria.CreateAlias("OrderDetail", "od");
                //criteria.Add(Expression.Eq("od.OrderHead.OrderNo", dssExportHistory.OrderNo));
                //criteria.Add(Expression.Eq("Item.Code", dssExportHistory.Item));
                //criteria.Add(Expression.Eq("IOType", BusinessConstants.IO_TYPE_OUT));

                //IList<OrderLocationTransaction> result = archCriteriaMgr.FindAll<OrderLocationTransaction>(criteria);
                //if (result != null && result.Count > 0)
                //{
                //   orderLocationTransaction= result[0];
                //   dssExportHistory.PartyFrom = orderLocationTransaction.OrderDetail.OrderHead.PartyFrom.Code;//发出区域
                //}
                //else
                //{

                //}
                try
                {
                    SqlParameter[] sqlParameter = new SqlParameter[3];
                    sqlParameter[0] = new SqlParameter("@Item", SqlDbType.VarChar, 50);
                    sqlParameter[0].Value = dssExportHistory.Item;

                    sqlParameter[1] = new SqlParameter("@OrderNo", SqlDbType.VarChar, 50);
                    sqlParameter[1].Value = dssExportHistory.OrderNo;

                    sqlParameter[2] = new SqlParameter("@PartyFrom", SqlDbType.VarChar, 50);
                    sqlParameter[2].Direction = ParameterDirection.InputOutput;

                    sqlHelperDao.ExecuteStoredProcedure("GetPartyFrom", sqlParameter);

                    dssExportHistory.PartyFrom = sqlParameter[2].Value.ToString();
                }
                catch (Exception)
                {
                    dssExportHistory.PartyFrom = string.Empty;
                }
            }
        }
Ejemplo n.º 13
0
        protected virtual void ObjectMapping(DssExportHistory dssExportHistory)
        {
            string entityParty = BusinessConstants.DSS_ENTITY_PARTY;
            string entityLocation = BusinessConstants.DSS_ENTITY_LOCATION;
            string entitySite = BusinessConstants.DSS_ENTITY_SITE;
            string defaultSite = dssExportHistory.DssOutboundControl.ExternalSystem.UndefinedString1;
            string extSysCode = dssExportHistory.DssOutboundControl.ExternalSystem.Code;
            string location = dssExportHistory.Location;
            string refLocation = dssExportHistory.ReferenceLocation;
            string partyFrom = dssExportHistory.PartyFrom;
            string partyTo = dssExportHistory.PartyTo;

            if (partyFrom == BusinessConstants.SYSTEM_REGION)
            {
                if (refLocation != null && refLocation != BusinessConstants.SYSTEM_LOCATION_INSPECT && refLocation != BusinessConstants.SYSTEM_LOCATION_REJECT)
                {
                    partyFrom = locationMgr.LoadLocation(refLocation).Region.Code;
                }
                else if (location != BusinessConstants.SYSTEM_LOCATION_INSPECT && location != BusinessConstants.SYSTEM_LOCATION_REJECT)
                {
                    partyFrom = locationMgr.LoadLocation(location).Region.Code;
                }
            }
            if (partyTo == BusinessConstants.SYSTEM_REGION)
            {
                if (location != BusinessConstants.SYSTEM_LOCATION_INSPECT && location != BusinessConstants.SYSTEM_LOCATION_REJECT)
                {
                    partyTo = locationMgr.LoadLocation(location).Region.Code;
                }
                else if (refLocation != null && refLocation != BusinessConstants.SYSTEM_LOCATION_INSPECT && refLocation != BusinessConstants.SYSTEM_LOCATION_REJECT)
                {
                    partyTo = locationMgr.LoadLocation(refLocation).Region.Code;
                }
            }

            //供应商,来源区域 => Site
            dssExportHistory.PartyFrom = this.GetMappingExternalCode(entityParty, extSysCode, partyFrom, entitySite, partyFrom);
            //客户,目的区域 => Site
            dssExportHistory.PartyTo = this.GetMappingExternalCode(entityParty, extSysCode, partyTo, entitySite, partyTo);
            //库位
            dssExportHistory.Location = this.GetMappingExternalCode(entityLocation, extSysCode, location, location);

            //移库来源库位
            if (dssExportHistory.ReferenceLocation != null && dssExportHistory.ReferenceLocation.Trim() != string.Empty)
            {
                dssExportHistory.ReferenceLocation = this.GetMappingExternalCode(entityLocation, extSysCode, refLocation, refLocation);
            }
        }
        private void GetLoctransInfo(DssExportHistory dssExportHistory)
        {
            OrderLocationTransaction orderLocationTransaction =
                commonOutboundMgrE.GetOrderLocationTransactionInfo(dssExportHistory.OrderNo, dssExportHistory.Item, BusinessConstants.IO_TYPE_OUT);

            if (orderLocationTransaction != null)
            {
                //dssExportHistory.Location = orderLocationTransaction.Location != null ? orderLocationTransaction.Location.Code : null;//发出库位
                dssExportHistory.PartyFrom = orderLocationTransaction.OrderDetail.OrderHead.PartyFrom.Code;//发出区域
            }
        }
        private void GetLoctransInfo(DssExportHistory dssExportHistory,bool isReject)
        {
            OrderLocationTransaction orderLocationTransaction =
                commonOutboundMgr.GetOrderLocationTransactionInfo(dssExportHistory.OrderNo, dssExportHistory.Item, BusinessConstants.IO_TYPE_IN);

            if (orderLocationTransaction != null)
            {
                dssExportHistory.Location = orderLocationTransaction.Location != null ? orderLocationTransaction.Location.Code : null;//收货库位
                if(!isReject)
                dssExportHistory.PartyTo = orderLocationTransaction.OrderDetail.OrderHead.PartyTo.Code;//收货区域
            }
        }
 public virtual void UpdateDssExportHistory(DssExportHistory entity)
 {
     Update(entity);
 }
        private IList<DssExportHistory> ConvertList(IList list, DssOutboundControl dssOutboundControl)
        {
            IList<DssExportHistory> result = new List<DssExportHistory>();
            if (list != null && list.Count > 0)
            {
                foreach (object obj in list)
                {
                    DssExportHistory dssExportHistory = new DssExportHistory();

                    dssExportHistory.DssOutboundControl = dssOutboundControl;
                    dssExportHistory.EventCode = BusinessConstants.DSS_EVENT_CODE_CREATE;
                    dssExportHistory.IsActive = true;
                    dssExportHistory.CreateDate = DateTime.Now;

                    dssExportHistory.OriginalId = (int)((object[])obj)[0];
                    dssExportHistory.OrderNo = (string)((object[])obj)[1];
                    dssExportHistory.ReceiptNo = (string)((object[])obj)[2];
                    dssExportHistory.Item = (string)((object[])obj)[3];
                    dssExportHistory.Qty = (decimal)((object[])obj)[4];
                    dssExportHistory.EffectiveDate = (DateTime)((object[])obj)[5];
                    dssExportHistory.PartyFrom = (string)((object[])obj)[6];

                    if ((string)((object[])obj)[8] == BusinessConstants.SYSTEM_LOCATION_REJECT)
                    {
                        dssExportHistory.PartyTo = (string)((object[])obj)[7];
                       // this.GetLoctransInfo(dssExportHistory);
                        this.GetLoctransInfo(dssExportHistory,true);//10-15上线

                        dssExportHistory.KeyCode = orderHeadMgr.LoadOrderHead(dssExportHistory.OrderNo).ExternalOrderNo;
                    }
                    else
                    {
                        dssExportHistory.PartyTo = (string)((object[])obj)[6];
                        this.GetLoctransInfo(dssExportHistory);

                        dssExportHistory.KeyCode = this.GetKeyCode(dssExportHistory, dssExportHistory.ReceiptNo);
                    }

                    result.Add(dssExportHistory);
                }
            }

            return result;
        }
 public virtual void DeleteDssExportHistory(DssExportHistory entity)
 {
     entityDao.DeleteDssExportHistory(entity);
 }
Ejemplo n.º 19
0
        private IList<DssExportHistory> ProcessRctInp(IList<LocationTransaction> inpTr)
        {
            IList<DssExportHistory> dssExportHistoryList = new List<DssExportHistory>();
            if (inpTr != null && inpTr.Count > 0)
            {
                //var issList = inpTr
                //    .Where(i => StringHelper.Eq(i.TransactionType, BusinessConstants.CODE_MASTER_LOCATION_TRANSACTION_TYPE_VALUE_ISS_INP))
                //    .ToList();
                var rctList = inpTr
                    .Where(i => StringHelper.Eq(i.TransactionType, BusinessConstants.CODE_MASTER_LOCATION_TRANSACTION_TYPE_VALUE_RCT_INP))
                    .ToList();

                foreach (var rctinp in rctList)
                {
                    DssExportHistory dssExportHistory = new DssExportHistory();
                    dssExportHistory.OriginalId = rctinp.Id;
                    dssExportHistory.OrderNo = rctinp.OrderNo;
                    dssExportHistory.PartyFrom = rctinp.PartyFrom;
                    dssExportHistory.PartyTo = rctinp.PartyTo;
                    //if(rctinp.TransactionType=="RCT-INP")
                    //dssExportHistory.PartyTo = rctinp.RefLocation!=string.Empty?
                    //    locationMgr.LoadLocation(rctinp.RefLocation).Region.Code:rctinp.PartyTo;//20120829 djin
                    //else
                    //    dssExportHistory.PartyTo = rctinp.PartyTo;
                    dssExportHistory.Location = rctinp.Location;
                    dssExportHistory.ReferenceLocation = rctinp.RefLocation;
                    dssExportHistory.EffectiveDate = rctinp.EffectiveDate;
                    dssExportHistory.Item = rctinp.Item;
                    dssExportHistory.Qty = rctinp.Qty;

                    //#region 获取来源库位

                    //#region 报验
                    //if (rctinp.Location == BusinessConstants.SYSTEM_LOCATION_INSPECT)
                    //{
                    //    dssExportHistory.PartyFrom = locationMgr.LoadLocation(rctinp.RefLocation).Region.Code;
                    //    dssExportHistory.PartyTo = dssExportHistory.PartyFrom;
                    //}
                    //#endregion

                    //#region 判定
                    //else if (rctinp.RefLocation == BusinessConstants.SYSTEM_LOCATION_INSPECT)
                    //{
                    //    dssExportHistory.PartyTo = locationMgr.LoadLocation(rctinp.Location).Region.Code;
                    //    dssExportHistory.PartyFrom = dssExportHistory.PartyTo;
                    //}
                    //#endregion
                    //#endregion

                    dssExportHistoryList.Add(dssExportHistory);
                }
            }

            #region 映射
            //先得出refloc的值,在遍历mapping
            var refLocation = (from a in dssExportHistoryList select a.ReferenceLocation).Distinct().ToList();
            foreach (var rf in refLocation)
            {
                string regionCode = string.Empty;
                Location loc = locationMgr.LoadLocation(rf);
                if (loc != null)
                {
                    regionCode = loc.Region.Code;
                    foreach (DssExportHistory dss in dssExportHistoryList)
                    {
                        if (dss.ReferenceLocation == rf)
                            dss.PartyTo = regionCode;
                    }
                }
                else//refLoc没有region的不转换
                {
                    ArrayList delList = new ArrayList();
                    for (int i = 0; i < dssExportHistoryList.Count; i++)
                    {
                        if (dssExportHistoryList[i].ReferenceLocation == rf)
                            delList.Add(dssExportHistoryList[i]);
                    }
                    foreach (DssExportHistory item in delList)
                    {
                        log.Error("没有找到" + item.ReferenceLocation + "的Region;ID:" + item.Id);
                        dssExportHistoryList.Remove(item);
                    }
                }
            }
            #endregion

            return dssExportHistoryList;
        }
        public IList<DssExportHistory> ConvertList(IList list, DssOutboundControl dssOutboundControl)
        {
            IList<DssExportHistory> result = new List<DssExportHistory>();
            if (list != null && list.Count > 0)
            {
                foreach (object obj in list)
                {
                    DssExportHistory dssExportHistory = new DssExportHistory();

                    dssExportHistory.DssOutboundControl = dssOutboundControl;
                    dssExportHistory.EventCode = BusinessConstants.DSS_EVENT_CODE_CREATE;
                    dssExportHistory.IsActive = true;
                    dssExportHistory.CreateDate = DateTime.Now;

                    dssExportHistory.OriginalId = (int)((object[])obj)[0];
                    dssExportHistory.OrderNo = (string)((object[])obj)[1];
                    dssExportHistory.ReceiptNo = (string)((object[])obj)[2];
                    dssExportHistory.Item = (string)((object[])obj)[3];
                    dssExportHistory.Qty = (decimal)((object[])obj)[4];
                    dssExportHistory.EffectiveDate = (DateTime)((object[])obj)[5];
                    dssExportHistory.PartyFrom = (string)((object[])obj)[6];
                    this.GetLoctransInfo(dssExportHistory);

                    dssExportHistory.KeyCode = this.GetKeyCode(dssExportHistory, dssExportHistory.ReceiptNo);

                    result.Add(dssExportHistory);
                }
            }

            return result;
        }
 private void GetAccount(DssExportHistory dssExportHistory)
 {
     MiscOrder miscOrder = miscOrderMgrE.LoadMiscOrder(dssExportHistory.OrderNo);
     if (miscOrder != null)
     {
         dssExportHistory.DefinedString1 = miscOrder.SubjectList.SubjectCode;//账户
         dssExportHistory.DefinedString2 = miscOrder.SubjectList.AccountCode;//分账户
         dssExportHistory.DefinedString3 = miscOrder.SubjectList.CostCenterCode;//成本中心
         dssExportHistory.DefinedString4 = miscOrder.ProjectCode;//项目
     }
 }
 public virtual void UpdateDssExportHistory(DssExportHistory entity)
 {
     entityDao.UpdateDssExportHistory(entity);
 }
        public IList<DssExportHistory> ProcessRctInp(IList<LocationTransaction> inpTr)
        {
            IList<DssExportHistory> dssExportHistoryList = new List<DssExportHistory>();
            if (inpTr != null && inpTr.Count > 0)
            {
                var issList = inpTr
                    .Where(i => StringHelper.Eq(i.TransactionType, BusinessConstants.CODE_MASTER_LOCATION_TRANSACTION_TYPE_VALUE_ISS_INP))
                    .ToList();
                var rctList = inpTr
                    .Where(i => StringHelper.Eq(i.TransactionType, BusinessConstants.CODE_MASTER_LOCATION_TRANSACTION_TYPE_VALUE_RCT_INP))
                    .ToList();

                foreach (var rctinp in rctList)
                {
                    DssExportHistory dssExportHistory = new DssExportHistory();
                    dssExportHistory.OriginalId = rctinp.Id;
                    dssExportHistory.OrderNo = rctinp.OrderNo;
                    dssExportHistory.PartyTo = rctinp.PartyTo;
                    dssExportHistory.Location = rctinp.Location;
                    dssExportHistory.EffectiveDate = rctinp.EffectiveDate;
                    dssExportHistory.Item = rctinp.Item;
                    dssExportHistory.Qty = rctinp.Qty;

                    #region 获取来源库位
                    //todo
                    var query = issList.Where(i => StringHelper.Eq(i.OrderNo, rctinp.OrderNo)
                        && StringHelper.Eq(i.Item, rctinp.Item)
                        && i.Id < rctinp.Id)
                        .OrderByDescending(i => i.Id);
                    if (query.Count() > 0)
                    {
                        var issinp = query.First();
                        dssExportHistory.PartyFrom = issinp.PartyFrom;
                        dssExportHistory.ReferenceLocation = issinp.Location;
                    }
                    #endregion

                    dssExportHistoryList.Add(dssExportHistory);
                }
            }

            return dssExportHistoryList;
        }
        private string GetKeyCode(DssExportHistory dssExportHistory, string receiptNo)
        {
            if (dssExportHistory.DssOutboundControl.ExternalSystem.Code == BusinessConstants.DSS_SYSTEM_CODE_QAD)
            {
                //string prefix = receiptNo.Substring(0, 1);
                //if (dssExportHistory.DssOutboundControl.ExternalSystem.Prefix1 != null && dssExportHistory.DssOutboundControl.ExternalSystem.Prefix1.Trim() != string.Empty)
                //    prefix = dssExportHistory.DssOutboundControl.ExternalSystem.Prefix1;

                //string keyCode = prefix + dssExportHistory.ReceiptNo.Remove(0, receiptNo.Length - 5);
                //return numberControlMgr.GenerateNumber(keyCode, 2);

                return this.GetIpNo(receiptNo);
            }
            else
            {
                return receiptNo;
            }
        }
Ejemplo n.º 25
0
 protected abstract object GetOutboundData(DssExportHistory dssExportHistory);
 protected override object GetOutboundData(DssExportHistory dssExportHistory)
 {
     return (object)dssExportHistory;
 }
 public virtual void CreateDssExportHistory(DssExportHistory entity)
 {
     Create(entity);
 }