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 | 136 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 135 insertions(+), 1 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 2343cc0..29d2a93 100644
--- a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs
+++ b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsCommonnQuery/WmsCommonnQueryService.cs
@@ -9,6 +9,7 @@
using Admin.NET.Application.Service.WmsTask.WmsRbLineTask.Dto;
using Admin.NET.Application.Service.WmsCommonnQuery.Dto;
using System.Collections.Generic;
+using Admin.NET.Application.CommonHelper;
namespace Admin.NET.Application;
/// <summary>
@@ -26,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
@@ -34,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;
@@ -44,6 +50,7 @@
_mesOrderGatherRep = mesOrderGatherRep;
_mesPackage_UnLine_RecordRep = mesPackage_UnLine_RecordRep;
_mesPackage_LineQueueRep = mesPackage_LineQueueRep;
+ _wmsRecordUpiProcessRep = wmsRecordUpiProcessRep;
}
/// <summary>
@@ -310,7 +317,7 @@
/// <summary>
- /// 涓嶅垎椤垫煡璇㈡壒娆$己鏂欐竻鍗� 涓嶉綈鍖�
+ /// 浜哄伐琛ユ澘鍔ㄤ綔
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
@@ -325,6 +332,45 @@
{
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)
+ {
+ //鎵ц浜哄伐琛ユ澘鍔ㄤ綔
+ var client = await WCFServiceHelper.GetWCFService_SAPCC_Client(_sysConfigRep);
+ var res = await client.WriteStation_AllowInAsync();
+ if (res.result == false)
+ {
+ 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
+ {
+ throw Oops.Oh($"鏉夸欢'{input.UPI}'涓嶅湪缂哄寘娓呭崟涓�");
}
return resJson;
@@ -341,6 +387,11 @@
public async Task<SqlSugarPagedList<WmsShortageListOutput>> ShortagePage(KittingListInput input)
{
var listRes = await GetShortageListCore(input);
+ if (listRes?.Count > 0)
+ {
+ listRes = listRes.WhereIF(!string.IsNullOrWhiteSpace(input.Info5), u => u.Info5 == input.Info5).ToList();
+ listRes = listRes.WhereIF(!string.IsNullOrWhiteSpace(input.DetailName), u => u.DetailName == input.DetailName).ToList();
+ }
// 杩涜鍒嗛〉澶勭悊
var totalCount = listRes.Count; // 鑾峰彇鎬绘暟
var pagedList = listRes
@@ -570,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