From b5d7c95fefb1c0df40a9623511237d4d4271e5e0 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周一, 09 12月 2024 10:55:51 +0800 Subject: [PATCH] 22 --- LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs | 59 +++++++++++++++++++++++++++++ LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/Dto/QueryUpiListByUpiInput.cs | 17 ++++++++ 2 files changed, 76 insertions(+), 0 deletions(-) diff --git a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/Dto/QueryUpiListByUpiInput.cs b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/Dto/QueryUpiListByUpiInput.cs new file mode 100644 index 0000000..4755281 --- /dev/null +++ b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/Dto/QueryUpiListByUpiInput.cs @@ -0,0 +1,17 @@ +锘縰sing Admin.NET.Core; +using System.ComponentModel.DataAnnotations; + +namespace Admin.NET.Application; + + +public class QueryUpiListByUpiInput +{ + + /// <summary> + /// 閮ㄤ欢鏉$爜 + /// </summary> + public virtual string Upi { get; set; } + +} + + 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 dd6ee35..29d2a93 100644 --- a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs +++ b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs @@ -645,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