12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using Autofac;
- using Bowin.Common.Log;
- using EMIS.CommonLogic.SystemServices;
- using EMIS.Web.Controls;
- using Senparc.Weixin.TenPay.V3;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace EMIS.Services.ScheduleJob
- {
- public class SynWeChatPayStatusJob : EAPServiceJob
- {
- #region 运行JOB
- /// <summary>
- /// 重写 MyJob 方法
- /// </summary>
- /// <returns></returns>
- protected override bool MyJob()
- {
- var result = true;
- try
- {
- LogHelper.WriteLog(LogType.ServiceLog, "----开始根据微信订单同步缴费状态-----");
- using (var scop = Program.AutofacContainer.BeginLifetimeScope())
- {
- IWechatPayServices WechatPayServices = scop.Resolve<IWechatPayServices>();
- var wecharPayList = WechatPayServices.SearchWeChatPayList();
- List<OrderQueryResult> orderList = new List<OrderQueryResult>();
- foreach (var wecharPay in wecharPayList)
- {
- OrderQueryResult query = WechatHelper.OrderQuery(wecharPay.OrderID);
- orderList.Add(query);
- }
- WechatPayServices.UpdateWeChatPay(orderList);
- }
- LogHelper.WriteLog(LogType.ServiceLog, "----结束根据微信订单同步缴费状态-----");
- }
- catch (System.Exception err)
- {
- LogHelper.WriteLog(LogType.ServiceLog, "----根据微信订单同步缴费状态处理异常-----");
- LogHelper.WriteLog(LogType.ServiceLog, err.Message);
- result = false;
- }
- return result;
- }
- #endregion
- }
- }
|