From e6b190354191122069b1a0518f050d6504f7ec5e Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期三, 11 二月 2026 15:29:39 +0800
Subject: [PATCH] 重构WMS服务并简化逻辑
---
Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs | 30 ++++++++++++------------------
1 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs
index 31d8b0d..81e2309 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs
@@ -1,5 +1,4 @@
-锘縰sing AutoMapper;
-using WIDESEA_Common.StockEnum;
+锘縰sing WIDESEA_Common.StockEnum;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_IStockService;
@@ -9,49 +8,44 @@
{
public partial class StockInfoService : ServiceBase<Dt_StockInfo, IRepository<Dt_StockInfo>>, IStockInfoService
{
- private readonly IMapper _mapper;
-
public IRepository<Dt_StockInfo> Repository => BaseDal;
- public StockInfoService(IRepository<Dt_StockInfo> BaseDal, IMapper mapper) : base(BaseDal)
+ public StockInfoService(IRepository<Dt_StockInfo> BaseDal) : base(BaseDal)
{
- _mapper = mapper;
}
/// <summary>
/// 鑾峰彇搴撳瓨淇℃伅鍒楄〃锛堝嚭搴撴棩鏈熷皬浜庡綋鍓嶆椂闂翠笖搴撳瓨鐘舵�佷负鍏ュ簱瀹屾垚鐨勮褰曪級
/// </summary>
- /// <returns></returns>
public async Task<List<Dt_StockInfo>> GetStockInfoAsync()
{
- return await BaseDal.QueryDataAsync(x => x.OutboundDate < DateTime.Now && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.GetHashCode());
+ return await BaseDal.QueryDataAsync(x =>
+ x.OutboundDate < DateTime.Now &&
+ x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.GetHashCode());
}
/// <summary>
/// 鑾峰彇搴撳瓨淇℃伅鍒楄〃锛堝嚭搴撴棩鏈熷皬浜庡綋鍓嶆椂闂翠笖搴撳瓨鐘舵�佷负鍏ュ簱瀹屾垚鐨勮褰曪紝涓斾粨搴揑D鍖归厤锛�
/// </summary>
- /// <param name="WarehouseId"></param>
- /// <returns></returns>
- public async Task<List<Dt_StockInfo>> GetStockInfoAsync(int WarehouseId)
+ public async Task<List<Dt_StockInfo>> GetStockInfoAsync(int warehouseId)
{
- return await BaseDal.QueryDataAsync(x => x.OutboundDate < DateTime.Now && x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.GetHashCode() && x.WarehouseId == WarehouseId);
+ return await BaseDal.QueryDataAsync(x =>
+ x.OutboundDate < DateTime.Now &&
+ x.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.GetHashCode() &&
+ x.WarehouseId == warehouseId);
}
/// <summary>
/// 鑾峰彇搴撳瓨淇℃伅锛堟牴鎹墭鐩樼爜鏌ヨ锛�
/// </summary>
- /// <param name="PalletCode"></param>
- /// <returns></returns>
- public async Task<Dt_StockInfo> GetStockInfoAsync(string PalletCode)
+ public async Task<Dt_StockInfo> GetStockInfoAsync(string palletCode)
{
- return await BaseDal.QueryFirstAsync(x => x.PalletCode == PalletCode);
+ return await BaseDal.QueryFirstAsync(x => x.PalletCode == palletCode);
}
/// <summary>
/// 鏇存柊搴撳瓨鏁版嵁
/// </summary>
- /// <param name="stockInfo"></param>
- /// <returns></returns>
public async Task<bool> UpdateStockAsync(Dt_StockInfo stockInfo)
{
return await BaseDal.UpdateDataAsync(stockInfo);
--
Gitblit v1.9.3