From 2ef8eda1ea4ef302d86dff34d722da0cce950eff Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周一, 09 12月 2024 16:34:02 +0800
Subject: [PATCH] 1

---
 LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs |   61 ++++++++++++++++++++++++++++++
 1 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs
index f828c06..29d2a93 100644
--- a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs
+++ b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs
@@ -353,6 +353,7 @@
             }
             WmsRecordUpiProcess wmsRecordUpi = new WmsRecordUpiProcess();
             wmsRecordUpi = singleUpi.Adapt<WmsRecordUpiProcess>();
+            wmsRecordUpi.Id = Yitter.IdGenerator.YitIdHelper.NextId();
             wmsRecordUpi.CreateTime = DateTime.Now;
             wmsRecordUpi.CreateUserName = _cretaorName;
             wmsRecordUpi.Location = "";
@@ -361,6 +362,7 @@
 
             WmsRecordUpiReplenish wmsRecordUpiNg = new WmsRecordUpiReplenish();
             wmsRecordUpiNg = singleUpi.Adapt<WmsRecordUpiReplenish>();
+            wmsRecordUpiNg.Id = Yitter.IdGenerator.YitIdHelper.NextId();
             wmsRecordUpiNg.CreateTime = DateTime.Now;
             wmsRecordUpiNg.CreateUserName = _cretaorName;
             wmsRecordUpiNg.OperRemark = "浜哄伐琛ユ澘";
@@ -643,5 +645,64 @@
         return package;
     }
 
+
+    /// <summary>
+    /// 鏍规嵁鍖呭彿锛屾煡璇㈡煇涓寘涓嬬殑鏉夸欢鏁版嵁
+    /// </summary>
+    /// <param name="input"></param>
+    /// <returns></returns>
+    [HttpPost]
+    [ApiDescriptionSettings(Name = "QueryUpiListByPackage")]
+    [Description("WmsCommonnQuery/QueryUpiListByPackage")]
+    public async Task<List<Mes_BatchOrderUPI_New>> QueryUpiListByPackage(QueryPackageInput input)
+    {
+        if (input == null || input.PackageCode == null)
+        {
+            throw Oops.Oh("鍙傛暟涓嶈兘涓虹┖");
+        }
+
+        var package = await _mesPackageGatherRep.AsQueryable().Where(x => x.PackageCode == input.PackageCode).FirstAsync();
+        if (package == null)
+        {
+            throw Oops.Oh($"娌℃湁鎵惧埌鍖呭彿{input.PackageCode}鐨勬眹鎬绘暟鎹�");
+        }
+
+        var upiList = await _mesBatchOrderUpiRep.AsQueryable().Where(x => x.PackageCode == input.PackageCode).ToListAsync();
+
+        return upiList;
+    }
+
+    /// <summary>
+    /// 鏍规嵁鏌愪釜Upi锛屾煡璇㈡煇涓寘涓嬬殑鏉夸欢鏁版嵁
+    /// </summary>
+    /// <param name="input"></param>
+    /// <returns></returns>
+    [HttpPost]
+    [ApiDescriptionSettings(Name = "QueryUpiListByUpi")]
+    [Description("WmsCommonnQuery/QueryUpiListByUpi")]
+    public async Task<List<Mes_BatchOrderUPI_New>> QueryUpiListByUpi(QueryUpiListByUpiInput input)
+    {
+        if (input == null || input.Upi == null)
+        {
+            throw Oops.Oh("鍙傛暟涓嶈兘涓虹┖");
+        }
+
+        var singleUpi = await _mesBatchOrderUpiRep.AsQueryable().Where(x => x.UPI == input.Upi).FirstAsync();
+        if (singleUpi == null)
+        {
+            throw Oops.Oh($"娌℃湁鎵惧埌閮ㄤ欢鏉$爜{input.Upi}鐨勬暟鎹�");
+        }
+
+        var package = await _mesPackageGatherRep.AsQueryable().Where(x => x.PackageCode == singleUpi.PackageCode).FirstAsync();
+        if (package == null)
+        {
+            throw Oops.Oh($"娌℃湁鎵惧埌鍖呭彿{singleUpi.PackageCode}鐨勬眹鎬绘暟鎹�");
+        }
+
+        var upiList = await _mesBatchOrderUpiRep.AsQueryable().Where(x => x.PackageCode == singleUpi.PackageCode).ToListAsync();
+
+        return upiList;
+    }
+
 }
 

--
Gitblit v1.9.3