Example #1
0
        /// <summary>
        /// 过期转临停订单处理
        /// </summary>
        /// <param name="ioRecordIds"></param>
        /// <param name="operatorId"></param>
        /// <param name="dbOperator"></param>
        /// <returns></returns>
        public static bool AddExpiredToProStopOrder(List <string> ioRecordIds, string operatorId, DbOperator dbOperator)
        {
            if (ioRecordIds.Count == 0)
            {
                return(false);
            }

            IParkOrder       factory = ParkOrderFactory.GetFactory();
            List <ParkOrder> orders  = factory.QueryByIORecordIds(ioRecordIds);

            if (orders.Count == 0)
            {
                return(true);
            }

            bool result = factory.UpdateOrderStatusByIORecordIds(ioRecordIds, -1, dbOperator);

            if (!result)
            {
                return(false);
            }

            foreach (var item in orders)
            {
                item.OrderNo     = IdGenerator.Instance.GetId().ToString();
                item.TagID       = item.RecordID;
                item.Status      = 1;
                item.OrderSource = OrderSource.ManageOffice;
                item.OrderTime   = DateTime.Now;
                item.UserID      = operatorId;
                item.Amount      = item.Amount;
                item.PayAmount   = item.PayAmount;
                item.OldMoney    = item.OldMoney;
                item.NewMoney    = item.NewMoney;
                item.PayWay      = OrderPayWay.Cash;
                item.Remark      = "过期转临停关联订单记录:" + item.RecordID;
                item.PayTime     = DateTime.Now;
                item.CashTime    = item.PayTime;
                item.CashMoney   = item.CashMoney;
                item.PayTime     = DateTime.Now;
                ParkOrder order = factory.Add(item, dbOperator);
                if (order == null)
                {
                    return(false);
                }
            }
            return(true);
        }
Example #2
0
        public static List <ParkOrder> QueryByIORecordIds(List <string> recordIds)
        {
            IParkOrder factory = ParkOrderFactory.GetFactory();

            return(factory.QueryByIORecordIds(recordIds));
        }