Beispiel #1
0
        private void ProcessSaleOrderStatus(OPC_Sale saleOrder, OrderStatusResultDto saleStatus)
        {
            if (saleStatus == null)
            {
                Log.Error("Sale Order has no return info!");
                return;
            }
            var processor = SaleOrderStatusProcessorFactory.Create(int.Parse(saleStatus.Status));

            processor.Process(saleOrder.SaleOrderNo, saleStatus);
        }
Beispiel #2
0
        private void Process(OPC_Sale opc_Sale)
        {
            OrderStatusResultDto saleStatus = null;

            try
            {
                saleStatus = _remoteRepository.GetOrderStatusById(opc_Sale);
                ProcessSaleOrderStatus(opc_Sale, saleStatus);
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
 public override void Process(string rmaNo, OrderStatusResultDto statusResult)
 {
     using (var db = new YintaiHZhouContext())
     {
         var saleRMA = db.OPC_RMA.FirstOrDefault(o => o.RMANo == rmaNo);
         if (saleRMA.Status == (int)EnumRMAStatus.ShoppingGuideReceive || saleRMA.Status == (int)EnumRMAStatus.PayVerify)
         {
             return;
         }
         saleRMA.Status      = (int)EnumRMAStatus.ShoppingGuideReceive;
         saleRMA.UpdatedDate = DateTime.Now;
         saleRMA.UpdatedUser = -100;
         db.SaveChanges();
     }
 }
Beispiel #4
0
 public override void Process(string saleOrderNo, OrderStatusResultDto statusResult)
 {
     using (var db = new YintaiHZhouContext())
     {
         var saleOrder = db.OPC_Sale.FirstOrDefault(o => o.SaleOrderNo == saleOrderNo);
         if (saleOrder.Status != (int)EnumSaleOrderStatus.PrintSale)
         {
             return;
         }
         saleOrder.Status      = (int)_status;
         saleOrder.UpdatedDate = DateTime.Now;
         saleOrder.UpdatedUser = -100;
         db.SaveChanges();
     }
 }
Beispiel #5
0
 private void Process(OPC_RMA opc_SaleRMA)
 {
     try
     {
         OrderStatusResultDto saleStatus = _remoteRepository.GetRMAStatusById(opc_SaleRMA);
         if (saleStatus != null)
         {
             ProcessSaleRMAStatus(opc_SaleRMA, saleStatus);
         }
     }
     catch (Exception e)
     {
         Log.Error(e);
     }
 }
Beispiel #6
0
        /// <summary>
        /// OPC_SaleRMA  RMACashStatus 入收银状态 Status 退货单状态
        /// OPC_RMA    RMACashNum 、RMACashDate、Status 退货单状态
        /// </summary>
        /// <param name="rmaNo"></param>
        /// <param name="statusResult"></param>
        public override void Process(string rmaNo, OrderStatusResultDto statusResult)
        {
            using (var db = new YintaiHZhouContext())
            {
                var saleRMA = db.OPC_RMA.FirstOrDefault(t => t.RMANo == rmaNo);
                saleRMA.RMACashStatus = (int)EnumCashStatus.Cashed;
                saleRMA.RMAStatus     = (int)EnumReturnGoodsStatus.Valid;
                saleRMA.RMACashDate   = statusResult.PosTime;
                saleRMA.RMACashNum    = statusResult.PosSeqNo;
                saleRMA.UpdatedDate   = DateTime.Now;
                saleRMA.UpdatedUser   = -100;

                db.SaveChanges();

                if (string.IsNullOrEmpty(statusResult.Products_SaleCodes))
                {
                    Log.ErrorFormat("没有销售码信息,退货单号{0}", rmaNo);
                    return;
                }

                Log.Error("**************************************");
                Log.ErrorFormat(statusResult.Products_SaleCodes);
                Log.Error("**************************************");

                var slices = ParseProductIdAndPosCode(statusResult.Products_SaleCodes);

                foreach (var slice in slices)
                {
                    var productId = slice.Key;
                    var detail    =
                        db.OPC_RMADetail.Where(x => x.RMANo == rmaNo)
                        .Join(db.OPC_Stock.Where(s => s.SourceStockId == productId), d => d.StockId, s => s.Id,
                              (o, s) => o)
                        .FirstOrDefault();
                    if (detail != null)
                    {
                        detail.ProdSaleCode = slice.Value;
                        db.SaveChanges();
                    }
                }
            }
        }
Beispiel #7
0
        /// <summary>
        /// 销售单收银状态从单品系统同步回来,目前未做销售单明细表商品销售码的回写。
        /// 信息部回传格式有问题,需要调整后再依据他们的结果调整。 wxh comment on 2014-04-20 17:45:00
        /// </summary>
        /// <param name="saleOrderNo"></param>
        /// <param name="statusResult"></param>
        public override void Process(string saleOrderNo, OrderStatusResultDto statusResult)
        {
            using (var db = new YintaiHZhouContext())
            {
                var saleOrder = db.OPC_Sale.FirstOrDefault(t => t.SaleOrderNo == saleOrderNo);
                if (saleOrder == null)
                {
                    return;
                }
                saleOrder.CashStatus  = (int)EnumCashStatus.Cashed;
                saleOrder.UpdatedDate = DateTime.Now;
                saleOrder.UpdatedUser = SystemDefine.SystemUser;
                saleOrder.CashNum     = statusResult.PosSeqNo;
                saleOrder.CashDate    = statusResult.PosTime;
                db.SaveChanges();

                if (!IsSystemProductOrder(db, saleOrderNo))
                {
                    return;
                }

                var slices = ParseProductIdAndPosCode(statusResult.Products_SaleCodes);

                foreach (var slice in slices)
                {
                    var productId = slice.Key;
                    var detail    =
                        db.OPC_SaleDetail.Where(x => x.SaleOrderNo == saleOrderNo)
                        .Join(db.OPC_Stock.Where(s => s.SourceStockId == productId), d => d.StockId, s => s.Id,
                              (o, s) => o)
                        .FirstOrDefault();
                    if (detail != null)
                    {
                        detail.ProdSaleCode = slice.Value;
                        db.SaveChanges();
                    }
                }
            }
        }
 public override void Process(string RMANo, OrderStatusResultDto statusResult)
 {
 }
Beispiel #9
0
 public abstract void Process(string saleOrderNo, OrderStatusResultDto statusResult);
Beispiel #10
0
        private void ProcessSaleRMAStatus(OPC_RMA saleRMA, OrderStatusResultDto saleStatus)
        {
            var processor = RMAStatusProcessorFactory.Create(int.Parse(saleStatus.Status));

            processor.Process(saleRMA.RMANo, saleStatus);
        }