Exemplo n.º 1
0
 public void Process()
 {
     try
     {
         List <BaseParkinfo> parkings = GetParkingBySupportAutoRefund();
         if (parkings.Count > 0)
         {
             List <OnlineOrder> models = OnlineOrderServices.QueryWaitRefund(parkings.Select(p => p.PKID).ToList(), DateTime.Now.Date);
             foreach (var item in models)
             {
                 if (item.SyncResultTimes < 3)
                 {
                     continue;
                 }
                 try
                 {
                     OnlineOrderServices.AutoRefund(item.OrderID, BackgroundWorkerManager.EnvironmentPath);
                 }
                 catch (Exception ex) {
                     TxtLogServices.WriteTxtLogEx("Background", "自动退款失败:orderId:{0},Message:{1},StackTrace:{2}", item.OrderID, ex.Message, ex.StackTrace);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ExceptionsServices.AddExceptionToDbAndTxt("Background", "后台工作线程处理退款异常", ex, LogFrom.WeiXin);
     }
 }