From 4fc1be40676b5f9928da3a83bdb1c215d0584ae9 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期一, 06 四月 2026 11:15:13 +0800
Subject: [PATCH] Merge branch 'dev' of http://115.159.85.185:8098/r/SuZhouGuanHong/ShanMeiXinNengYuan into dev
---
Code/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs
index aff926c..d4b8ccf 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs
@@ -25,6 +25,7 @@
private readonly IRepository<Dt_Task> _taskRepository;
private readonly IRepository<Dt_StockInfo> _stockInfoRepository;
private readonly IRecordService _recordService;
+ private readonly IRepository<Dt_Warehouse> _warehouseRepository;
/// <summary>
/// 鏋勯�犲嚱鏁�
@@ -36,6 +37,7 @@
IRepository<Dt_LocationInfo> baseDal,
IRepository<Dt_Task> taskRepository,
IRepository<Dt_StockInfo> stockInfoRepository,
+ IRepository<Dt_Warehouse> warehouseRepository,
IMapper mapper,
IRecordService recordService) : base(baseDal)
{
@@ -43,6 +45,7 @@
_stockInfoRepository = stockInfoRepository;
_mapper = mapper;
_recordService = recordService;
+ _warehouseRepository = warehouseRepository;
}
/// <summary>
@@ -141,10 +144,10 @@
x.LocationStatus == LocationStatusEnum.Free.GetHashCode());
return locations?
- .OrderBy(x => x.Layer)
- .ThenByDescending(x => x.Depth)
- .ThenBy(x => x.Column)
- .ThenBy(x => x.Row)
+ .OrderByDescending(x => x.Depth) // 1. 娣卞害浼樺厛锛堜粠澶у埌灏忥級
+ .ThenBy(x => x.Layer) // 2. 灞傛暟
+ .ThenBy(x => x.Column) // 3. 鍒�
+ .ThenBy(x => x.Row) // 4. 琛�
.FirstOrDefault();
}
@@ -494,11 +497,18 @@
/// <param name="layer">灞傛暟</param>
/// <param name="depth">娣卞害</param>
/// <returns>璐т綅淇℃伅瀵硅薄</returns>
- private static Dt_LocationInfo CreateLocationInfo(string roadwayNo, int row, int col, int layer, int depth)
+ private Dt_LocationInfo CreateLocationInfo(string roadwayNo, int row, int col, int layer, int depth)
{
+ var warehouse = _warehouseRepository.QueryData(x => x.WarehouseCode == roadwayNo).FirstOrDefault();
+
+ if (warehouse == null)
+ {
+ throw new InvalidOperationException($"鏈壘鍒板贩閬撶紪鍙蜂负 {roadwayNo} 鐨勪粨搴撲俊鎭�");
+ }
+
return new Dt_LocationInfo
{
- WarehouseId = 0,
+ WarehouseId = warehouse.WarehouseId,
Row = row,
Column = col,
Layer = layer,
@@ -507,7 +517,7 @@
EnableStatus = EnableStatusEnum.Normal.GetHashCode(),
LocationStatus = LocationStatusEnum.Free.GetHashCode(),
LocationType = LocationTypeEnum.Undefined.GetHashCode(),
- LocationCode = $"{row:D3}-{col:D3}-{layer:D3}",
+ LocationCode = $"{roadwayNo}-{row:D3}-{col:D3}-{layer:D3}",
LocationName = $"{roadwayNo}宸烽亾{row:D3}琛寋col:D3}鍒梴layer:D3}灞倇depth:D2}娣�"
};
}
--
Gitblit v1.9.3