master
zhangxiaofeng 7 months ago
parent 17afcd4dc7
commit dfa985f7e0

@ -1,4 +1,5 @@
using SqlSugar;
using EntrustSettle.Model.Logs;
using SqlSugar;
using System;
namespace EntrustSettle.Model.Models
@ -6,6 +7,8 @@ namespace EntrustSettle.Model.Models
/// <summary>
/// 任务日志表
/// </summary>
[SplitTable(SplitType.Year)] //按月分表 (自带分表支持 年、季、月、周、日)
[SugarTable("taskslog_{year}{month}{day}")]
public class TasksLog : BaseEntity
{
/// <summary>

@ -63,7 +63,7 @@ namespace EntrustSettle.Tasks
var model = await _tasksQzServices.QueryById(jobid);
if (model != null)
{
if(_tasksLogServices != null) await _tasksLogServices.Add(tasksLog);
if(_tasksLogServices != null) await _tasksLogServices.AddSplit(tasksLog);
model.RunTimes += 1;
if (model.TriggerType == 0) model.CycleHasRunTimes += 1;
if (model.TriggerType == 0 && model.CycleRunTimes != 0 && model.CycleHasRunTimes >= model.CycleRunTimes) model.IsStart = false;//循环完善,当循环任务完成后,停止该任务,防止下次启动再次执行

Loading…
Cancel
Save