pan
2025-12-01 13c22c3a105e051af9d0c76adfc2f95833a684a8
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs
@@ -27,11 +27,13 @@
using WIDESEA_DTO.Outbound;
using WIDESEA_IAllocateService;
using WIDESEA_IBasicService;
using WIDESEA_ICheckService;
using WIDESEA_IInboundService;
using WIDESEA_IOutboundService;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Basic;
using WIDESEA_Model.Models.Check;
namespace WIDESEA_OutboundService
{
@@ -59,7 +61,7 @@
        private readonly IRepository<Dt_InboundOrder> _inboundOrderRepository;
        private readonly IInboundOrderDetailService _inboundOrderDetailService;
        private readonly IRepository<Dt_WarehouseArea> _warehouseAreaRepository;
        private readonly IReCheckOrderService _reCheckOrderService;
        private readonly ILogger<OutboundPickingService> _logger;
        private Dictionary<string, string> stations = new Dictionary<string, string>
@@ -79,7 +81,7 @@
        public OutboundPickingService(IRepository<Dt_PickingRecord> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, IStockService stockService,
            IOutStockLockInfoService outStockLockInfoService, IStockInfoDetailService stockInfoDetailService, ILocationInfoService locationInfoService,
            IOutboundOrderDetailService outboundOrderDetailService, ISplitPackageService splitPackageService, IOutboundOrderService outboundOrderService,
            IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_InboundOrder> inboundOrderRepository, IInboundOrderDetailService inboundOrderDetailService, IRepository<Dt_WarehouseArea> warehouseAreaRepository) : base(BaseDal)
            IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_InboundOrder> inboundOrderRepository, IInboundOrderDetailService inboundOrderDetailService, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IReCheckOrderService reCheckOrderService) : base(BaseDal)
        {
            _unitOfWorkManage = unitOfWorkManage;
            _stockInfoService = stockInfoService;
@@ -99,6 +101,7 @@
            _inboundOrderRepository = inboundOrderRepository;
            _inboundOrderDetailService = inboundOrderDetailService;
            _warehouseAreaRepository = warehouseAreaRepository;
            _reCheckOrderService = reCheckOrderService;
        }
@@ -2024,16 +2027,16 @@
                           materialCode = group.Key.MaterielCode,
                           lineNo = group.Key.lineNo,
                           warehouseCode = group.Key.WarehouseCode,
                           qty = group.Sum(x => x.PickedQty),
                           currentDeliveryQty = group.Sum(x => x.PickedQty),
                           qty = group.Sum(x => x.BarcodeQty),
                           currentDeliveryQty = group.Sum(x => x.BarcodeQty),
                           unit = group.Key.Unit,
                           barcodes = group.Select(row => new WIDESEA_DTO.Outbound.BarcodesModel
                           {
                               barcode = row.CurrentBarcode,
                               supplyCode = row.SupplyCode,
                               batchNo = row.BatchNo,
                               unit = row.Unit,
                               qty = row.PickedQty
                               unit = row.BarcodeUnit,
                               qty = row.BarcodeQty
                           }).ToList()
                       }).ToList();
@@ -2828,7 +2831,7 @@
                        var detailModel = new FeedbackOutboundDetailsModel
                        {
                            materialCode = detail.MaterielCode,
                            lineNo = detail.lineNo, // æ³¨æ„ï¼šè¿™é‡Œå¯èƒ½éœ€è¦è°ƒæ•´å­—段名
                            lineNo = detail.lineNo,
                            warehouseCode = detail.WarehouseCode,
                            qty = detail.OverOutQuantity, // ä½¿ç”¨è®¢å•明细的已出库数量
                            currentDeliveryQty = detail.OverOutQuantity,
@@ -2838,8 +2841,8 @@
                                barcode = lockInfo.CurrentBarcode,
                                supplyCode = lockInfo.SupplyCode,
                                batchNo = lockInfo.BatchNo,
                                unit = lockInfo.Unit,
                                qty = lockInfo.PickedQty // æ¡ç çº§åˆ«çš„æ•°é‡ä»ç”¨é”å®šè®°å½•
                                unit = lockInfo.BarcodeUnit,
                                qty = lockInfo.BarcodeQty //
                            }).ToList()
                        };
@@ -2934,7 +2937,18 @@
                    return content = WebResponseContent.Instance.Error($"仓库中没有该{materielGroupDTO.WarehouseType}编号。");
                }
                if (materielGroupDTO.orderTypes == InOrderTypeEnum.ReCheck.ObjToInt())
                {
                    var dborder = _reCheckOrderService.Db.Queryable<Dt_ReCheckOrder>().First(x => x.OrderNo == materielGroupDTO.OrderNo);
                    if (dborder != null && dborder.SignSeq == 0)
                    {
                        return content.Error("只有拿到重检结果才能入库!");
                    }
                    else
                    {
                        return content.Error("没有找到重检单据数据。");
                    }
                }
                //  Dt_InboundOrder inboundOrder = GetInboundOrder(materielGroupDTO.OrderNo);
                var dbinboundOrderDetails = Db.Queryable<Dt_PickingRecord>().Where(x => x.OrderNo == materielGroupDTO.OrderNo && !x.IsCancelled && x.Barcode == materielGroupDTO.Barcodes).ToList();
@@ -2968,9 +2982,9 @@
                        InboundOrderNo = dbinboundOrderDetails.First()?.OrderNo,
                        UpperOrderNo = dbinboundOrderDetails.First()?.OrderNo,
                        SupplierId = dbinboundOrderDetails.First()?.SupplyCode,
                        OrderType = InOrderTypeEnum.InternalAllocat.ObjToInt(),
                        OrderType = materielGroupDTO.orderTypes,
                        BusinessType = InOrderTypeEnum.InternalAllocat.ObjToInt().ToString(),
                        BusinessType = materielGroupDTO.orderTypes.ToString(),
                        FactoryArea = dbinboundOrderDetails.First()?.FactoryArea,
                        Remark = "",
@@ -2980,7 +2994,7 @@
                }
                else
                {
                    dt_InboundOrder = new Dt_InboundOrder { Details = new List<Dt_InboundOrderDetail>() };
                    dt_InboundOrder = new Dt_InboundOrder { Details = new List<Dt_InboundOrderDetail>() };
                    inboindId = dbinbound.Id;
                }
@@ -3159,12 +3173,20 @@
        public bool HasSplitRecords { get; set; }
        public decimal RemainingLocksReturnQty { get; set; }
        public decimal PalletStockReturnQty { get; set; }
        public decimal SplitReturnQty { get; set; }
        public decimal TotalReturnQty { get; set; }
        // æœªåˆ†é…çš„锁定记录(如自动拆包产生的)
        public bool HasUnallocatedLocks { get; set; }
        public List<Dt_OutStockLockInfo> UnallocatedLocks { get; set; } = new List<Dt_OutStockLockInfo>();
        public decimal UnallocatedLocksReturnQty { get; set; }
        public List<Dt_OutStockLockInfo> RemainingLocks { get; set; } = new List<Dt_OutStockLockInfo>();
        public List<Dt_StockInfoDetail> PalletStockGoods { get; set; } = new List<Dt_StockInfoDetail>();
        public List<Dt_SplitPackageRecord> SplitRecords { get; set; } = new List<Dt_SplitPackageRecord>();
        public List<string> AllBarcodes { get; set; } = new List<string>();
        // ç©ºæ‰˜ç›˜ç›¸å…³å±žæ€§
        public bool IsEmptyPallet { get; set; }
        public bool HasActiveTasks { get; set; }