1
huangxiaoqiang
2025-10-20 63dcb7fc55d32960f643f4040900ce9a0e33536d
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
using WIDESEA_DTO;
 
namespace WIDESEA_WMSServer.Controllers.Task;
 
/// <summary>
/// 任务操作接口
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class TaskController : ApiBaseController<IDt_TaskService, Dt_Task>
{
    private readonly IHttpContextAccessor _httpContextAccessor;
    private readonly IDt_TaskService _taskService;
 
    public TaskController(IDt_TaskService service,
        IHttpContextAccessor httpContextAccessor) : base(service)
    {
        _httpContextAccessor = httpContextAccessor;
    }
 
    /// <summary>
    /// 任务完成
    /// </summary>
    /// <param name="saveModel">任务号</param>
    /// <returns>成功或失败</returns>
    [HttpGet, Route("CompleteTaskAsync"), AllowAnonymous]
    public async Task<WebResponseContent> CompleteTaskAsync(int taskNum)
    {
        return await Service.CompleteAsync(taskNum);
    }
    /// <summary>
    /// 请求入库任务
    /// </summary>
    /// <param name="input">请求数据</param>
    /// <returns></returns>
    [HttpPost, AllowAnonymous, Route("RequestInboundTaskAsync")]
    [TypeFilter(typeof(ThrottleFilter), Arguments = new object[] { 5 })]
    public async Task<WebResponseContent> RequestInboundTaskAsync([FromBody] RequestTaskDto input)
    {
        return await Service.RequestInboundTaskAsync(input);
    }
 
    /// <summary>
    /// 更新货位任务状态到下一个节点
    /// </summary>
    /// <param name="input">请求数据</param>
    /// <returns></returns>
    [HttpPost, AllowAnonymous, Route("RequestLocationAsync")]
    [TypeFilter(typeof(ThrottleFilter), Arguments = new object[] { 5 })]
    public async Task<WebResponseContent> RequestLocationAsync([FromBody] RequestTaskDto input)
    {
        return await Service.RequestLocationAsync(input);
    }
 
    /// <summary>
    /// 空托盘满盘出库请求
    /// </summary>
    /// <param name="request">请求数据</param>
    /// <returns></returns>
    [HttpPost, AllowAnonymous, Route("RequestOutboundTaskAsync")]
    [TypeFilter(typeof(ThrottleFilter), Arguments = new object[] { 5 })]
    public async Task<WebResponseContent> RequestOutboundTaskAsync([FromBody] RequestTaskDto taskDto)
    {
        return await Service.RequestOutboundTaskAsync(taskDto);
    }
 
    /// <summary>
    /// 任务状态修改
    /// </summary>
    /// <param name="input">请求数据</param>
    /// <returns></returns>
    [HttpPost,HttpGet,Route("UpdateTaskStatus") ,AllowAnonymous]
    [TypeFilter(typeof(ThrottleFilter), Arguments = new object[] { 5 })] 
    public async Task<WebResponseContent> UpdateTaskStatus([FromBody] UpdateStatusDto input)
    {
        return await Service.UpdateTaskStatus(input.TaskNum, input.TaskState);
    }
 
    /// <summary>
    /// 请求跨楼层任务2
    /// </summary>
    /// <param name="taskDto"></param>
    /// <returns></returns>
    [HttpPost, AllowAnonymous, Route("AcrossFloorTaskAsync")]
    public async Task<WebResponseContent> AcrossFloorTaskAsync([FromBody] RequestAcrossFloorTaskDto taskDto)
    {
        return await Service.AcrossFloorTaskAsync(taskDto);
    }
 
 
    [HttpPost, AllowAnonymous, Route("GetEmptyLocation")]
    [TypeFilter(typeof(ThrottleFilter), Arguments = new object[] { 5 })]
    public async Task<DtLocationInfo> GetEmptyLocation(string roadWay)
    {
        return await Service.GetEmptyLocation(roadWay);
    }
 
    [HttpPost, AllowAnonymous, Route("GetAGVEmptyCacheLocation")]
    [TypeFilter(typeof(ThrottleFilter), Arguments = new object[] { 5 })]
    public async Task<DtLocationInfo> GetAGVEmptyCacheLocation(int AreaId,DtLocationInfo location)
    {
        return await Service.GetAGVEmptyCacheLocation(AreaId,location);
    }
 
    [HttpPost, AllowAnonymous, Route("StackerIsNeedRelocationAsync")]
    [TypeFilter(typeof(ThrottleFilter), Arguments = new object[] { 5 })]
    public async Task<WebResponseContent> StackerIsNeedRelocationAsync([FromBody] RequestTaskDto taskDto)
    {
        return await Service.StackerIsNeedRelocationAsync(taskDto);
    }
 
    [HttpPost, AllowAnonymous, Route("AGVIsNeedRelocationAsync")]
    [TypeFilter(typeof(ThrottleFilter), Arguments = new object[] { 5 })]
    public async Task<WebResponseContent> AGVIsNeedRelocationAsync([FromBody] RequestTaskDto taskDto)
    {
        return await Service.AGVIsNeedRelocationAsync(taskDto);
    }
}