From c1f92d034bee8c989ee99519fac9cbe01a71d242 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期二, 02 十二月 2025 17:46:00 +0800
Subject: [PATCH] 提交

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index 76d06f2..cc02019 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -18,6 +18,7 @@
 using AutoMapper;
 using Dm.filter;
 using MailKit.Search;
+using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Logging;
 using Newtonsoft.Json;
 using Org.BouncyCastle.Asn1.Ocsp;
@@ -1059,17 +1060,20 @@
                                     Barcode = item.CurrentBarcode,
                                     SupplyCode = item.SupplyCode,
                                     BatchNo = item.BatchNo,
-                                    Unit = item.BarcodeUnit,
+                                    Unit = detail.BarcodeUnit,
                                     Qty = 0
                                 };
                                 // 鍗曚綅涓嶄竴鑷存椂杞崲
-                                if (item.BarcodeUnit != item.Unit)
+                                if (detail.BarcodeUnit != detail.Unit)
                                 {
-                                    var convertResult = await _materialUnitService.ConvertAsync(item.MaterielCode, item.PickedQty, item.Unit, item.BarcodeUnit);
+                                    var convertResult = await _materialUnitService.ConvertAsync(item.MaterielCode, item.PickedQty, detail.Unit, detail.BarcodeUnit);
                                     barModel.Unit = convertResult.Unit;
                                     barModel.Qty = convertResult.Quantity;
                                 }
-
+                                else
+                                {
+                                    barModel.Qty = item.PickedQty;
+                                }
                                 detailModel.Qty += barModel.Qty;
                                 detailModel.Barcodes.Add(barModel);
                             }
@@ -1140,18 +1144,22 @@
                                     barcode = item.CurrentBarcode,
                                     supplyCode = item.SupplyCode,
                                     batchNo = item.BatchNo,
-                                    unit = item.BarcodeUnit,
+                                    unit = detail.BarcodeUnit,
                                     qty = item.PickedQty
                                 };
                                 // 鍗曚綅涓嶄竴鑷存椂杞崲
-                                if (item.BarcodeUnit != item.Unit)
+                                if (detail.BarcodeUnit != detail.Unit)
                                 {
-                                    var convertResult = await _materialUnitService.ConvertAsync(item.MaterielCode, item.PickedQty, item.Unit, item.BarcodeUnit);
+                                    var convertResult = await _materialUnitService.ConvertAsync(item.MaterielCode, item.PickedQty, detail.Unit, detail.BarcodeUnit);
                                     barModel.unit = convertResult.Unit;
                                     barModel.qty = convertResult.Quantity;
                                 }
+                                else
+                                {
+                                    barModel.qty = item.PickedQty;
+                                }
 
-                                detailModel.qty += barModel.qty;
+                                    detailModel.qty += barModel.qty;
                                 detailModel.currentDeliveryQty += barModel.qty;
                                 detailModel.barcodes.Add(barModel);
                             }

--
Gitblit v1.9.3