From dbdee689acd9f622bbe62201976e095c7228967d Mon Sep 17 00:00:00 2001
From: liuying <1427574514@qq.com>
Date: 周二, 10 12月 2024 13:41:00 +0800
Subject: [PATCH] pda
---
LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 114 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 ea8e8b1..29d2a93 100644
--- a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs
+++ b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs
@@ -27,6 +27,8 @@
private readonly SqlSugarRepository<Mes_Order_Gather> _mesOrderGatherRep;
private readonly SqlSugarRepository<Mes_Package_UnLine_Record> _mesPackage_UnLine_RecordRep;
private readonly SqlSugarRepository<Mes_Package_LineQueue> _mesPackage_LineQueueRep;
+ private readonly SqlSugarRepository<WmsRecordUpiReplenish> _wmsRecordUpiReplenishRep;
+ private readonly SqlSugarRepository<WmsRecordUpiProcess> _wmsRecordUpiProcessRep;
public WmsCommonnQueryService(SqlSugarRepository<WmsRbLineTask> wmsRbLineTaskRep, SqlSugarRepository<WmsStockQuan> wmsStockQuanRep
, SqlSugarRepository<Mes_Package_Gather> mesPackageGatherRep
@@ -35,8 +37,11 @@
, SqlSugarRepository<Mes_Order_Gather> mesOrderGatherRep
, SqlSugarRepository<Mes_Package_UnLine_Record> mesPackage_UnLine_RecordRep
, SqlSugarRepository<Mes_Package_LineQueue> mesPackage_LineQueueRep
+ , SqlSugarRepository<WmsRecordUpiReplenish> wmsRecordUpiReplenishRep
+ , SqlSugarRepository<WmsRecordUpiProcess> wmsRecordUpiProcessRep
)
{
+ _wmsRecordUpiReplenishRep = wmsRecordUpiReplenishRep;
_sysConfigRep = sysConfigRep;
_mesPackageGatherRep = mesPackageGatherRep;
_wmsRbLineTaskRep = wmsRbLineTaskRep;
@@ -45,6 +50,7 @@
_mesOrderGatherRep = mesOrderGatherRep;
_mesPackage_UnLine_RecordRep = mesPackage_UnLine_RecordRep;
_mesPackage_LineQueueRep = mesPackage_LineQueueRep;
+ _wmsRecordUpiProcessRep = wmsRecordUpiProcessRep;
}
/// <summary>
@@ -327,6 +333,7 @@
resJson = listRes.FirstOrDefault(u => u.UPI == input.UPI);
//var filteredResult = listRes.FirstOrDefault(u => u.UPI == input.UPI);
}
+ var _cretaorName = App.User.FindFirst(ClaimConst.RealName)?.Value;
if (resJson != null)
{
//鎵ц浜哄伐琛ユ澘鍔ㄤ綔
@@ -336,6 +343,30 @@
{
throw Oops.Oh("琛ユ澘宸ヤ綅鍏佽杩涙澘璇锋眰澶辫触:" + res.resMsg);
}
+ //*/
+
+ //璁板綍琛ユ澘璁板綍鍜屾澘浠跺饱鍘�
+ var singleUpi = await _mesBatchOrderUpiRep.AsQueryable().Where(x => x.UPI == input.UPI).FirstAsync();
+ if (singleUpi == null)
+ {
+ throw Oops.Oh($"娌℃湁鎵惧埌閮ㄤ欢鏉$爜{input.UPI}鐨勬暟鎹�");
+ }
+ WmsRecordUpiProcess wmsRecordUpi = new WmsRecordUpiProcess();
+ wmsRecordUpi = singleUpi.Adapt<WmsRecordUpiProcess>();
+ wmsRecordUpi.Id = Yitter.IdGenerator.YitIdHelper.NextId();
+ wmsRecordUpi.CreateTime = DateTime.Now;
+ wmsRecordUpi.CreateUserName = _cretaorName;
+ wmsRecordUpi.Location = "";
+ wmsRecordUpi.OperRemark = "浜哄伐琛ユ澘";
+ await _wmsRecordUpiProcessRep.InsertAsync(wmsRecordUpi);
+
+ WmsRecordUpiReplenish wmsRecordUpiNg = new WmsRecordUpiReplenish();
+ wmsRecordUpiNg = singleUpi.Adapt<WmsRecordUpiReplenish>();
+ wmsRecordUpiNg.Id = Yitter.IdGenerator.YitIdHelper.NextId();
+ wmsRecordUpiNg.CreateTime = DateTime.Now;
+ wmsRecordUpiNg.CreateUserName = _cretaorName;
+ wmsRecordUpiNg.OperRemark = "浜哄伐琛ユ澘";
+ await _wmsRecordUpiReplenishRep.InsertAsync(wmsRecordUpiNg);
}
else
{
@@ -590,5 +621,88 @@
return groupedResult; // 杩斿洖鍒嗙粍缁撴灉
}
+
+ /// <summary>
+ /// 鏌ヨ鍖呮暟鎹�
+ /// </summary>
+ /// <param name="input"></param>
+ /// <returns></returns>
+ [HttpPost]
+ [ApiDescriptionSettings(Name = "QueryPackage")]
+ [Description("WmsCommonnQuery/QueryPackage")]
+ public async Task<Mes_Package_Gather> QueryPackage(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}鐨勬眹鎬绘暟鎹�");
+ }
+ 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