From c4885ceaf477654dc0d2c02c7235c6ca683e08d4 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期六, 15 十一月 2025 17:47:40 +0800
Subject: [PATCH] 字段优化,板材货位限制
---
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 158 insertions(+), 12 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs"
index 7042b06..ccc5b9a 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs"
@@ -36,7 +36,7 @@
Dt_PalletTypeInfo? palletTypeInfo = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.PalletType == palletType && x.WarehouseId == warehouseId);
if (palletTypeInfo == null)
{
- if (warehouse.WarehouseCode == WarehouseEnum.HA153.ToString() && warehouse.WarehouseCode == WarehouseEnum.HA71.ToString() && warehouse.WarehouseCode == WarehouseEnum.HA60.ToString())
+ if (warehouse.WarehouseCode == WarehouseEnum.HA153.ToString() || warehouse.WarehouseCode == WarehouseEnum.HA71.ToString())
{
palletTypeInfo = new Dt_PalletTypeInfo()
{
@@ -274,9 +274,9 @@
List<Dt_PalletTypeInfo> palletTypeInfos = _basicRepository.PalletTypeInfoRepository.QueryData(x => x.WarehouseId == warehousId);
Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == warehousId);
Dt_PalletTypeInfo? palletTypeInfo = palletTypeInfos.FirstOrDefault(x => x.PalletType == palletType && x.WarehouseId == warehousId);
- if (palletTypeInfo == null || warehouse.WarehouseCode == WarehouseEnum.HA60.ToString())
+ if (palletTypeInfo == null)
{
- if (warehouse.WarehouseCode == WarehouseEnum.HA153.ToString() || warehouse.WarehouseCode == WarehouseEnum.HA71.ToString() || warehouse.WarehouseCode == WarehouseEnum.HA60.ToString())
+ if (warehouse.WarehouseCode == WarehouseEnum.HA153.ToString() || warehouse.WarehouseCode == WarehouseEnum.HA71.ToString())
{
palletTypeInfo = new Dt_PalletTypeInfo()
{
@@ -329,7 +329,7 @@
}
}
- if (palletTypeInfos.FirstOrDefault(x => x.LocaitonCount == 2) != null)
+ if (palletTypeInfo.LocaitonCount == 2)
{
Dt_LocationInfo? nearLocation;
if (palletTypeInfo.IsOdd)
@@ -465,10 +465,52 @@
for (int j = location.Depth + 1; j <= maxDepth; j++)
{
Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == (row + 1));
- if (j == 3 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6))
+ #region 娴嬭瘯鏋躲�丳P鍒ゆ柇鍚岀粍璐т綅
+ if (j == 3 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 2 || row == 5))
{
- locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && (x.Row == row + 2 || x.Row == row - 2));
+ if (row <= maxDepth)
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1);
+ }
+ else
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1);
+ }
}
+ if (j == 3 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 3 || row == 4))
+ {
+ if (row <= maxDepth)
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 2);
+ }
+ else
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 2);
+ }
+ }
+ if (j == 2 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6))
+ {
+ if (row <= maxDepth)
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1);
+ }
+ else
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1);
+ }
+ }
+ if (j == 2 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 3 || row == 4))
+ {
+ if (row <= maxDepth)
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1);
+ }
+ else
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1);
+ }
+ }
+ #endregion
if (locationInfo != null)
{
groupLocations.Add(locationInfo);
@@ -478,10 +520,41 @@
for (int j = location.Depth - 1; j >= 1; j--)
{
Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == (row -1));
- if (j == 1 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 3 || row == 4))
+ #region 娴嬭瘯鏋躲�丳P鍒ゆ柇鍚岀粍璐т綅
+ if (j == 1 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6))
{
- locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && (x.Row == row + 2 || x.Row == row - 2));
+ if (row <= maxDepth)
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 2);
+ }
+ else
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 2);
+ }
}
+ if (j == 1 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 2 || row == 5))
+ {
+ if (row <= maxDepth)
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1);
+ }
+ else
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1);
+ }
+ }
+ if (j == 2 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6))
+ {
+ if (row <= maxDepth)
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1);
+ }
+ else
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1);
+ }
+ }
+ #endregion
if (locationInfo != null)
{
groupLocations.Add(locationInfo);
@@ -505,10 +578,52 @@
for (int j = location.Depth + 1; j <= maxDepth; j++)
{
Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && (x.Row == row + 1 || x.Row == row - 1));
- if (j == 3 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6))
+ #region 娴嬭瘯鏋躲�丳P鍒ゆ柇鍚岀粍璐т綅
+ if (j == 3 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 2 || row == 5))
{
- locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && (x.Row == row + 2 || x.Row == row - 2));
+ if (row <= maxDepth)
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1);
+ }
+ else
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1);
+ }
}
+ if (j == 3 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 3 || row == 4))
+ {
+ if (row <= maxDepth)
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 2);
+ }
+ else
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 2);
+ }
+ }
+ if (j == 2 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6))
+ {
+ if (row <= maxDepth)
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1);
+ }
+ else
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1);
+ }
+ }
+ if (j == 2 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 3 || row == 4))
+ {
+ if (row <= maxDepth)
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1);
+ }
+ else
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1);
+ }
+ }
+ #endregion
if (locationInfo != null)
{
groupLocations.Add(locationInfo);
@@ -518,10 +633,41 @@
for (int j = location.Depth - 1; j >= 1; j--)
{
Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && (x.Row == row + 1 || x.Row == row - 1));
- if (j == 1 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 3 || row == 4))
+ #region 娴嬭瘯鏋躲�丳P鍒ゆ柇鍚岀粍璐т綅
+ if (j == 1 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6))
{
- locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && (x.Row == row + 2 || x.Row == row - 2));
+ if (row <= maxDepth)
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 2);
+ }
+ else
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 2);
+ }
}
+ if (j == 1 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 2 || row == 5))
+ {
+ if (row <= maxDepth)
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1);
+ }
+ else
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1);
+ }
+ }
+ if (j == 2 && (location.RoadwayNo.Contains("CSJ") || location.RoadwayNo.Contains("PP")) && (row == 1 || row == 6))
+ {
+ if (row <= maxDepth)
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row <= maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row + 1);
+ }
+ else
+ {
+ locationInfo = locationInfos.FirstOrDefault(x => x.Row > maxDepth && x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row - 1);
+ }
+ }
+ #endregion
if (locationInfo != null)
{
groupLocations.Add(locationInfo);
--
Gitblit v1.9.3