using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Web; using Quartz; namespace dccdc.jobs { public class jkzdqtzJob : IJob { public Task Execute(IJobExecutionContext context) { try { log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType).Info("作业开始执行:"+DateTime.Now); //throw new NotImplementedException(); var bll = new BLL.jkzdqtxBll(); // throw new NotImplementedException(); var txszlist = bll.gettxszlist(); List alldtslist = new List(); foreach (var sz in txszlist) { List dtslist = bll.gettxlist(sz); foreach (var dtx in dtslist) { if (sz.wxtx == 1 && !string.IsNullOrEmpty(dtx.openid)) { new Controllers.WeiXinController().sendtxmsg(sz, dtx); } if (sz.dxtx == 1 && !string.IsNullOrEmpty(dtx.mobile)) { new Controllers.WeiXinController().sendtxmsgdx(sz, dtx); } bll.logtx(sz, dtx); } } } catch(Exception ex) { log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType).Info(ex.Message + ex.StackTrace); } return new Task(() => { }); } } }