pan
2025-11-15 4476740c214edb7ab667c48fcab00488fbdd9879
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
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>
        [HttpGet("GetPalletOutboundStatus")]
        public async Task<WebResponseContent> GetPalletOutboundStatus(string palletCode)
        {
            return await Service.GetPalletOutboundStatus(palletCode);
        }
 
        /// <summary>
        /// 获取托盘的锁定信息
        /// </summary>
        [HttpGet("GetPalletLockInfos")]
        public async Task<WebResponseContent> GetPalletLockInfos(string palletCode)
        {
            var lockInfos = await _outStockLockInfoService.GetPalletLockInfos(palletCode);
            return WebResponseContent.Instance.OK(null, lockInfos);
        }
 
 
 
        [HttpGet("unpicked-list")]
        public async Task<WebResponseContent> GetUnpickedList(string orderNo, string palletCode)
        {
            var lists= await Service.GetUnpickedList(orderNo, palletCode);
            return WebResponseContent.Instance.OK("", lists);
        }
 
        [HttpGet("picked-list")]
        public async Task<WebResponseContent> GetPickedList(string orderNo, string palletCode)
        {
            var lists = await Service.GetPickedList(orderNo, 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);
        }
 
        [HttpGet("picking-summary")]
        public async Task<WebResponseContent> GetPickingSummary(string orderNo)
        {
            var data = await Service.GetPickingSummary(orderNo);
            return WebResponseContent.Instance.OK("", data);
        }
 
        ///// <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("SplitPackage")]
        public async Task<WebResponseContent> SplitPackage([FromBody] SplitPackageDto request)
        {
            return await _splitPackageService.SplitPackage(request);
        }
 
        ///// <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] CancelPickingRequest request)
        {
            return await Service.CancelPicking(request);
        }
    }
}