yanjinhui
2026-02-28 4e839ad077304eaecb6dfb35fdc9b0d30a209a76
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
using Autofac.Core;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using WIDESEAWCS_Core;
using WIDESEAWCS_DTO.WMS;
using WIDESEAWCS_ITaskInfoService;
 
namespace WIDESEAWCS_Server.Controllers.WMS
{
    [Route("api/[controller]")]
    [ApiController]
    public class WMSController : ControllerBase
    {
        private readonly ITaskService _taskService;
        public WMSController(ITaskService taskService)
        {
            _taskService = taskService;
        }
        /// <summary>
        /// WMS下发任务
        /// </summary>
        /// <param name="taskDTOs"></param>
        /// <returns></returns>
        [HttpPost, Route("ReceiveTask"), AllowAnonymous]
        public object ReceiveWMSTask([FromBody] List<WMSTasksDTO> taskDTOs)
        {
            WebResponseContent content = _taskService.ReceiveWMSTask(taskDTOs);
            if (!content.Status)
            {
                return new
                {
                    code = "404",
                    msg = content.Message
                };
            }
            else
            {
                return new
                {
                    code = "0",
                    msg = content.Message,
                    data = content.Data
                };
            }
        }
 
        /// <summary>
        /// 取消任务
        /// </summary>
        /// <param name="wMSCancelTask"></param>
        /// <returns></returns>
        [HttpPost, Route("CancelWMSTask"), AllowAnonymous]
        public object CancelWMSTask([FromBody] WMSCancelTask wMSCancelTask)
        {
            WebResponseContent content = _taskService.CancelWMSTask(wMSCancelTask);
            if (!content.Status)
            {
                return new
                {
                    code = "404",
                    msg = content.Message
                };
            }
            else
            {
                return new
                {
                    code = "0",
                    msg = content.Message,
                    data = content.Data
                };
            }
        }
 
        /// <summary>
        /// 修改任务优先级
        /// </summary>
        /// <param name="updateTaskPriority"></param>
        /// <returns></returns>
        [HttpPost, Route("UpdateWMSTaskPriority"), AllowAnonymous]
        public object UpdateWMSTaskPriority([FromBody] WMSUpdateTaskPriority updateTaskPriority)
        {
            WebResponseContent content = _taskService.UpdateWMSTaskPriority(updateTaskPriority);
            if (!content.Status)
            {
                return new
                {
                    code = "404",
                    msg = content.Message
                };
            }
            else
            {
                return new
                {
                    code = "0",
                    msg = content.Message,
                    data = content.Data
                };
            }
        }
 
        /// <summary>
        /// 修改库位分区 
        /// </summary>
        /// <param name="WMSUpdateLocationArea"></param>
        /// <returns></returns>
        [HttpPost, Route("ModifyWMSLayoutZone"), AllowAnonymous]
        public object ModifyWMSLayoutZone([FromBody] WMSUpdateLocationArea wMSUpdateLocationArea)
        {
            WebResponseContent content = _taskService.ModifyWMSLayoutZone(wMSUpdateLocationArea);
            if (!content.Status)
            {
                return new
                {
                    code = "404",
                    msg = content.Message
                };
            }
            else
            {
                return new
                {
                    code = "0",
                    msg = content.Message,
                    data = content.Data
                };
            }
        }
 
        /// <summary>
        /// 区域库位信息查询
        /// </summary>
        /// <param name="AreaCode">区域号</param>
        /// <returns></returns>
        [HttpPost, Route("LocationInquiry"), AllowAnonymous]
        public object  LocationInquiry(string AreaCode)
        {
            WebResponseContent content = _taskService.LocationInquiry(AreaCode);
            if (!content.Status)
            {
                return new
                {
                    code = "404",
                    msg = content.Message
                };
            }
            else
            {
                return new
                {
                    code = "0",
                    msg = content.Message,
                    data = content.Data
                };
            }
        }
    }
}