tijian_tieying/web/dccdc/jobs/jkzdqtzJob.cs
2025-02-20 12:14:39 +08:00

47 lines
1.8 KiB
C#

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<Models.ProfessionalExamRegisterModel> alldtslist = new List<Models.ProfessionalExamRegisterModel>();
foreach (var sz in txszlist)
{
List<Models.ProfessionalExamRegisterModel> 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(() =>
{
});
}
}
}