增加取消任务接口
This commit is contained in:
@ -175,6 +175,63 @@ namespace WCS.BLL.Services.Service
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取消同步的任务
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ResponseCommon<object>> cancelOrderMXL4(CancelRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (request.matSN == null || request.matSN.Count <= 0)
|
||||
{
|
||||
return new ResponseCommon<object>
|
||||
{
|
||||
Code = 300,
|
||||
Message = $"未取消需要操作的物料条码!"
|
||||
};
|
||||
}
|
||||
|
||||
var needCancelTasks = DbHelp.db.Queryable<CurrentTask>()
|
||||
.Where(t => request.matSN.Contains(t.MatSN))
|
||||
.ToList();
|
||||
needCancelTasks.ForEach(t => t.IsCancel = true);
|
||||
//获取当前
|
||||
try
|
||||
{
|
||||
DbHelp.db.BeginTran();
|
||||
DbHelp.db.Updateable(needCancelTasks).ExecuteCommand();
|
||||
DbHelp.db.CommitTran();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DbHelp.db.RollbackTran();
|
||||
return new ResponseCommon<object>
|
||||
{
|
||||
Code = 300,
|
||||
Message = $"操作失败:{ex.Message}"
|
||||
};
|
||||
}
|
||||
//发送任务至各个标签 交给后台线程来做
|
||||
return new ResponseCommon<object>
|
||||
{
|
||||
Code = 200,
|
||||
Message = "success"
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseCommon<object>
|
||||
{
|
||||
Code = 201,
|
||||
Message = "操作失败:" + ex.Message,
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public async Task<ResponseCommon> refreshInventoryRequest(RefreshInventoryRequest request)
|
||||
{
|
||||
try
|
||||
|
Reference in New Issue
Block a user