647556386
3 天以前 91ead18d0e92b6e1ed916c5159f3431bf2071a56
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -303,11 +303,11 @@
                _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, WIDESEA_Common.StockEnum.StockChangeType.MaterielGroup);
            }
            catch(Exception ex)
            catch (Exception ex)
            {
                _logger.LogInformation($"InboundTaskCompleted AddLocationStatusChangeRecord : {ex.Message} " );
                _logger.LogInformation($"InboundTaskCompleted AddLocationStatusChangeRecord : {ex.Message} ");
            }
                try
            try
            {
                foreach (var inboundOrder in inboundOrders)
                {
@@ -579,7 +579,7 @@
                {
                    _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforelocationStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum);
                }
                catch(Exception ex)
                catch (Exception ex)
                {
                    _logger.LogInformation($"InEmptyTaskCompleted AddLocationStatusChangeRecord : {ex.Message} ");
                }
@@ -696,7 +696,7 @@
                {
                    await Db.Deleteable(task).ExecuteCommandAsync();
                }
                await RecalculateOrderStatus(task.OrderNo);
                try
                {
@@ -757,8 +757,8 @@
        {
            try
            {
                // èŽ·å–å—å½±å“çš„è®¢å•æ˜Žç»†ID(去重)
                //var affectedDetailIds = returnLocks
                //    .Select(x => x.OrderDetailId)
@@ -999,7 +999,7 @@
                    _logger.LogInformation($"更新订单状态 - OrderNo: {orderNo}, æ—§çŠ¶æ€: {outboundOrder.OrderStatus}, æ–°çŠ¶æ€: {newStatus}");
                }
            }
            catch (Exception ex)
            {
@@ -1136,8 +1136,33 @@
                                allocatefeedmodel.Details.Add(detailModel);
                            }
                            var groupedResult = allocatefeedmodel.Details.GroupBy(item => new
                            {
                                item.WarehouseCode,
                                item.MaterialCode,
                                item.Unit,
                                item.LineNo
                            }).Select(group => new AllocateDtoDetail
                            {
                                 WarehouseCode = group.Key.WarehouseCode,
                                 MaterialCode = group.Key.MaterialCode,
                                 LineNo = group.Key.LineNo,
                                 Qty = group.Sum(x => x.Qty),
                                 Unit = group.Key.Unit,
                                 Barcodes = group.SelectMany(x => x.Barcodes)
                                                       .GroupBy(b => b.Barcode)
                                                       .Select(b => new BarcodeInfo
                                                       {
                                                           Barcode = b.Key,
                                                           BatchNo = b.First().BatchNo,
                                                           SupplyCode = b.First().SupplyCode,
                                                           Qty = b.Max(x => x.Qty),
                                                           Unit = b.First().Unit
                                                       }) .ToList()
                             }) .ToList();
                            allocatefeedmodel.Details = groupedResult;
                            var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel);
                          var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel);
                            if (result != null && result.code == 200)
                            {
                                await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>()
@@ -1222,6 +1247,31 @@
                                }
                                feedmodel.details.Add(detailModel);
                            }
                            var groupedResult = feedmodel.details.GroupBy(item => new
                            {
                                item.warehouseCode,
                                item.materialCode,
                                item.unit,
                                item.lineNo
                            }).Select(group => new FeedbackOutboundDetailsModel
                            {
                                warehouseCode = group.Key.warehouseCode,
                                materialCode = group.Key.materialCode,
                                lineNo = group.Key.lineNo,
                                qty = group.Sum(x => x.qty),
                                unit = group.Key.unit,
                                barcodes = group.SelectMany(x => x.barcodes)
                                                       .GroupBy(b => b.barcode)
                                                       .Select(b => new WIDESEA_DTO.Outbound.BarcodesModel
                                                       {
                                                           barcode = b.Key,
                                                           batchNo = b.First().batchNo,
                                                           supplyCode = b.First().supplyCode,
                                                           qty = b.Max(x => x.qty),
                                                           unit = b.First().unit
                                                       }).ToList()
                            }).ToList();
                            feedmodel.details = groupedResult;
                            var result = await _invokeMESService.FeedbackOutbound(feedmodel);
                            if (result != null && result.code == 200)