修改任务表isStart为int类型
This commit is contained in:
parent
0e83ba64ce
commit
07ea3d1c48
@ -137,7 +137,7 @@ namespace ZR.Admin.WebApi.Controllers
|
|||||||
throw new CustomException($"api地址不能为空");
|
throw new CustomException($"api地址不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tasksQz.IsStart)
|
if (tasksQz.IsStart == 1)
|
||||||
{
|
{
|
||||||
throw new CustomException($"该任务正在运行中,请先停止在更新");
|
throw new CustomException($"该任务正在运行中,请先停止在更新");
|
||||||
}
|
}
|
||||||
@ -205,7 +205,7 @@ namespace ZR.Admin.WebApi.Controllers
|
|||||||
|
|
||||||
if (taskResult.Code == 200)
|
if (taskResult.Code == 200)
|
||||||
{
|
{
|
||||||
tasksQz.IsStart = true;
|
tasksQz.IsStart = 1;
|
||||||
_tasksQzService.Update(tasksQz);
|
_tasksQzService.Update(tasksQz);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ namespace ZR.Admin.WebApi.Controllers
|
|||||||
|
|
||||||
if (taskResult.Code == 200)
|
if (taskResult.Code == 200)
|
||||||
{
|
{
|
||||||
tasksQz.IsStart = false;
|
tasksQz.IsStart = 0;
|
||||||
_tasksQzService.Update(tasksQz);
|
_tasksQzService.Update(tasksQz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,12 +28,10 @@ namespace ZR.Admin.WebApi.Extensions
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static IApplicationBuilder UseAddTaskSchedulers(this IApplicationBuilder app)
|
public static IApplicationBuilder UseAddTaskSchedulers(this IApplicationBuilder app)
|
||||||
{
|
{
|
||||||
//var _tasksQzService = (ISysTasksQzService)App.GetRequiredService(typeof(ISysTasksQzService));
|
|
||||||
|
|
||||||
ITaskSchedulerServer _schedulerServer = app.ApplicationServices.GetRequiredService<ITaskSchedulerServer>();
|
ITaskSchedulerServer _schedulerServer = app.ApplicationServices.GetRequiredService<ITaskSchedulerServer>();
|
||||||
|
|
||||||
//var tasks = _tasksQzService.GetList(m => m.IsStart);
|
var tasks = SqlSugar.IOC.DbScoped.SugarScope.Queryable<Model.System.SysTasks>()
|
||||||
var tasks = SqlSugar.IOC.DbScoped.SugarScope.Queryable<Model.System.SysTasks>().Where(m => m.IsStart).ToList();
|
.Where(m => m.IsStart == 1).ToList();
|
||||||
|
|
||||||
//程序启动后注册所有定时任务
|
//程序启动后注册所有定时任务
|
||||||
foreach (var task in tasks)
|
foreach (var task in tasks)
|
||||||
|
|||||||
@ -97,7 +97,7 @@ namespace ZR.Model.System
|
|||||||
/// 默认 : 0
|
/// 默认 : 0
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "是否启动")]
|
[Display(Name = "是否启动")]
|
||||||
public bool IsStart { get; set; }
|
public int IsStart { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 传入参数
|
/// 传入参数
|
||||||
|
|||||||
@ -19,7 +19,7 @@ namespace ZR.Service.System
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int AddTasks(SysTasks parm)
|
public int AddTasks(SysTasks parm)
|
||||||
{
|
{
|
||||||
parm.IsStart = false;
|
parm.IsStart = 0;
|
||||||
|
|
||||||
SetAssembleName(parm);
|
SetAssembleName(parm);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user