pan
2025-11-16 e31ca4e3e1774b7ddb832e8ec498b5ada24b2608
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
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core;
using WIDESEA_Core.BaseController;
using WIDESEA_DTO.Outbound;
using WIDESEA_IOutboundService;
using WIDESEA_Model.Models;
 
namespace WIDESEA_WMSServer.Controllers.Outbound
{
 
    [Route("api/OutboundPicking")]
    [ApiController]
    public class OutboundPickingController : ApiBaseController<IOutboundPickingService, Dt_PickingRecord>
    {
        private readonly ISplitPackageService _splitPackageService;
        private readonly IOutStockLockInfoService _outStockLockInfoService;
        public OutboundPickingController(IOutboundPickingService service, ISplitPackageService splitPackageService, IOutStockLockInfoService outStockLockInfoService) : base(service)
        {
            _splitPackageService = splitPackageService;
            _outStockLockInfoService = outStockLockInfoService;
        }
        /// <summary>
        /// 获取托盘的出库状态
        /// </summary>
        [HttpPost("GetPalletOutboundStatus")]
        public async Task<WebResponseContent> GetPalletOutboundStatus(string palletCode)
        {
            return await Service.GetPalletOutboundStatus(palletCode);
        }
 
        /// <summary>
        /// 获取托盘的锁定信息
        /// </summary>
        [HttpPost("GetPalletLockInfos")]
        public async Task<WebResponseContent> GetPalletLockInfos(string palletCode)
        {
            var lockInfos = await _outStockLockInfoService.GetPalletLockInfos(palletCode);
            return WebResponseContent.Instance.OK(null, lockInfos);
        }
 
 
 
        [HttpPost("unpicked-list")]
        public async Task<WebResponseContent> GetUnpickedList([FromBody] ConfirmPickingDto dto)
        {
            var lists= await Service.GetUnpickedList(dto.OrderNo, dto.PalletCode);
            return WebResponseContent.Instance.OK("", lists);
        }
 
        [HttpPost("picked-list")]
        public async Task<WebResponseContent> GetPickedList([FromBody] ConfirmPickingDto dto)
        {
            var lists = await Service.GetPickedList(dto.OrderNo, dto.PalletCode);
            return WebResponseContent.Instance.OK("", lists);
        }
 
        [HttpPost("confirm-picking")]
        public async Task<WebResponseContent> ConfirmPicking([FromBody] ConfirmPickingDto dto)
        {
            return await Service.ConfirmPicking(dto.OrderNo, dto.PalletCode, dto.Barcode);
        }
 
        [HttpPost("picking-summary")]
        public async Task<WebResponseContent> GetPickingSummary([FromBody] ConfirmPickingDto dto)
        {
            var data = await Service.GetPickingSummary(dto);
            return WebResponseContent.Instance.OK("", data);
        }
 
        [HttpPost("split-package")]
        public async Task<WebResponseContent> SplitPackage([FromBody] SplitPackageDto dto)
        {
            return  await _splitPackageService.SplitPackage(dto);
          
        }
 
        [HttpPost("revert-split-package")]
        public async Task<WebResponseContent> RevertSplitPackage([FromBody] RevertSplitDto dto)
        {
           return  await _splitPackageService.RevertSplitPackage(dto.OriginalBarcode);
           
       
        }
 
        [HttpPost("split-package-info")]
        public async Task<WebResponseContent> GetSplitPackageInfo([FromBody] ConfirmPickingDto dto)
        {
          return  await _splitPackageService.GetSplitPackageInfo(dto.OrderNo, dto.PalletCode, dto.Barcode);
          
        }
 
 
        [HttpPost("return-to-stock")]
        public async Task<WebResponseContent> ReturnToStock( )
        {
            var data= "";
            return WebResponseContent.Instance.OK("", data);
        }
 
        [HttpPost("direct-outbound")]
        public async Task<WebResponseContent> DirectOutbound([FromBody] DirectOutboundRequest dto)
        {
           return await Service.DirectOutbound(dto);
 
        }
 
        ///// <summary>
        ///// 拣选确认
        ///// </summary>
        //[HttpPost("ConfirmPicking")]
        //public async Task<WebResponseContent> ConfirmPicking([FromBody] PickingConfirmRequest request)
        //{
        //    return await Service.ConfirmPicking(request);
        //}
        /// <summary>
        /// 验证条码并获取物料信息
        /// </summary>
        [HttpGet("ValidateBarcode")]
        public async Task<WebResponseContent> ValidateBarcode(string barcode)
        {
            return await Service.ValidateBarcode(barcode);
        }
 
 
        ///// <summary>
        ///// 直接出库
        ///// </summary>
        //[HttpPost("DirectOutbound")]
        //public async Task<WebResponseContent> DirectOutbound([FromBody] DirectOutboundRequest request)
        //{
        //    return await Service.DirectOutbound(request);
        //}
 
        /// <summary>
        /// 获取拣选历史
        /// </summary>
        [HttpGet("GetPickingHistory")]
        public async Task<WebResponseContent> GetPickingHistory(int orderId)
        {
            var history = await Service.GetPickingHistory(orderId);
            return WebResponseContent.Instance.OK(null, history);
        }
 
        /// <summary>
        /// 撤销拣选
        /// </summary>
        [HttpPost("CancelPicking")]
        public async Task<WebResponseContent> CancelPicking([FromBody] ConfirmPickingDto dto)
        {
            return await Service.CancelPicking(dto.OrderNo,dto.PalletCode,dto.Barcode);
        }
    }
}