qinchulong
2024-10-12 7281004dc3854ed59e9164dcd27a59c8c2cf6667
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
namespace WIDESEA_WMSServer.Controllers;
 
/// <summary>
/// 任务操作接口
/// </summary>
[Route("api/Dt_Task")]
[ApiController]
public class Dt_TaskController : ApiBaseController<IDt_TaskService, Dt_Task>
{
    private readonly IHttpContextAccessor _httpContextAccessor;
    private readonly IDt_TaskService _taskService;
    private readonly IDt_LocationService _locationService;
 
    public Dt_TaskController(IDt_TaskService taskService,
        IHttpContextAccessor httpContextAccessor,
        IDt_LocationService locationService) : base(taskService)
    {
        _httpContextAccessor = httpContextAccessor;
        _taskService = taskService;
        _locationService = locationService;
    }
 
    /// <summary>
    /// 出库任务完成
    /// </summary>
    /// <param name="saveModel">出库数据</param>
    /// <returns>成功或失败</returns>
    [HttpGet, Route("CompleteTaskAsync"), AllowAnonymous]
    public async Task<WebResponseContent> CompleteTaskAsync(int taskNum)
    {
        return await _taskService.CompleteAsync(taskNum);
    }
 
    /// <summary>
    /// 检查是否需要进行移库
    /// </summary>
    /// <param name="taskNum">任务号</param>
    /// <returns>任务</returns>
    [HttpGet, Route("TransferCheckAsync"), AllowAnonymous]
    public async Task<WebResponseContent> TransferCheckAsync(int taskNum)
    {
        return new WebResponseContent().OK(data: await _locationService.TransferCheckAsync(taskNum));
    }
}