覃楚胧
5 天以前 2a78fec08d73995a10d0c1c97690eb3deabf2b8a
ÏîÄ¿´úÂë/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)
            {
@@ -1135,7 +1135,34 @@
                                allocatefeedmodel.Details.Add(detailModel);
                            }
                            }
                            var groupedResult = allocatefeedmodel.Details
                                .GroupBy(item => new { item.WarehouseCode, item.MaterialCode, item.Unit, item.LineNo })
                                .Select(group =>  {
                                    var deduplicatedBarcodes = 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();
                                    return new AllocateDtoDetail
                                    {
                                        WarehouseCode = group.Key.WarehouseCode,
                                        MaterialCode = group.Key.MaterialCode,
                                        LineNo = group.Key.LineNo,
                                        Qty = deduplicatedBarcodes.Sum(b => b.Qty),
                                        Unit = group.Key.Unit,
                                        Barcodes = deduplicatedBarcodes
                                    };
                                }).ToList();
                            allocatefeedmodel.Details = groupedResult;
                            var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel);
                            if (result != null && result.code == 200)
@@ -1222,6 +1249,32 @@
                                }
                                feedmodel.details.Add(detailModel);
                            }
                            var groupedResult = feedmodel.details
                               .GroupBy(item => new { item.warehouseCode, item.materialCode, item.unit, item.lineNo })
                               .Select(group => {
                                   var deduplicatedBarcodes = 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();
                                   return new FeedbackOutboundDetailsModel
                                   {
                                       warehouseCode = group.Key.warehouseCode,
                                       materialCode = group.Key.materialCode,
                                       lineNo = group.Key.lineNo,
                                       qty = deduplicatedBarcodes.Sum(b => b.qty),
                                       unit = group.Key.unit,
                                       barcodes = deduplicatedBarcodes
                                   };
                               }).ToList();
                            feedmodel.details = groupedResult;
                            var result = await _invokeMESService.FeedbackOutbound(feedmodel);
                            if (result != null && result.code == 200)