From 9ae0890dd74771ba9edd44d4830e0de37f8d9938 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期五, 26 九月 2025 16:55:03 +0800
Subject: [PATCH] MES接口优化,老厂排程优化等
---
项目代码/WMS/WMSServices/WIDESEA_BasicService/Service/LocationInfoService.cs | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Service/LocationInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Service/LocationInfoService.cs"
index bdba1c5..a9a13df 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Service/LocationInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_BasicService/Service/LocationInfoService.cs"
@@ -60,13 +60,13 @@
List<Dt_LocationInfo> definedTypeLocations = locationInfos.Where(x => x.LocationType == palletType.ObjToInt()).ToList();
//鏈畾涔夌被鍨嬬殑绌鸿揣浣�
- List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList();
+ List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Columns).ToList();
if (locationInfos.Count * weightValue >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Count > 0)//濡傛灉宸插畾涔夌被鍨嬭揣浣嶆湭瓒呰繃姣斾緥锛屼笖鏈夋湭瀹氫箟绫诲瀷鐨勮揣浣�
{
if (palletType == PalletTypeEnum.LargePallet)
{
- undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList();
+ undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Columns % 2 == 1).ToList();
}
for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++)
{
@@ -82,7 +82,7 @@
}
else
{
- List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList();
+ List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Columns).ToList();
for (int i = 0; i < definedTypeEmptyLocations.Count; i++)
{
@@ -106,7 +106,7 @@
{
case PalletTypeEnum.LargePallet:
{
- Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == undefinedTypeEmptyLocation.Row && x.Layer == undefinedTypeEmptyLocation.Layer && x.Depth == undefinedTypeEmptyLocation.Depth && x.Column == undefinedTypeEmptyLocation.Column + 1);
+ Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == undefinedTypeEmptyLocation.Row && x.Layer == undefinedTypeEmptyLocation.Layer && x.Depth == undefinedTypeEmptyLocation.Depth && x.Columns == undefinedTypeEmptyLocation.Columns + 1);
if (nearLocation != null && nearLocation.LocationStatus == LocationStatusEnum.Free.ObjToInt() && DepthLocationIsEmpty(locationInfos, undefinedTypeEmptyLocation) != null)
{
Dt_LocationInfo? locationInfo = DepthLocationIsEmpty(locationInfos, undefinedTypeEmptyLocation);
@@ -175,7 +175,7 @@
locations[i].LocationType = palletType.ObjToInt();
}
- Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column + 1);
+ Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Columns == location.Columns + 1);
if (nearLocation != null)
{
List<Dt_LocationInfo> nearLocations = GetGroupLocations(locationInfos, nearLocation);
@@ -220,7 +220,7 @@
locations[i].LocationType = palletType.ObjToInt();
}
- Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column + 1);
+ Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Columns == location.Columns + 1);
if (nearLocation != null)
{
List<Dt_LocationInfo> nearLocations = GetGroupLocations(locationInfos, nearLocation);
@@ -252,7 +252,7 @@
int maxDepth = locationInfos.Max(x => x.Depth);
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);
+ Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Columns == location.Columns && x.Layer == location.Layer);
if (locationInfo != null)
{
groupLocations.Add(locationInfo);
@@ -261,7 +261,7 @@
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);
+ Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Columns == location.Columns && x.Layer == location.Layer);
if (locationInfo != null)
{
groupLocations.Add(locationInfo);
--
Gitblit v1.9.3