From 0f1717cbe5c788c294a53cd4df6f819ca0236500 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期一, 09 三月 2026 10:42:27 +0800
Subject: [PATCH] 优化成品仓逻辑
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs | 48 ++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 46 insertions(+), 2 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs"
index e1707b7..58bc5ae 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs"
@@ -1,10 +1,13 @@
-锘縰sing System;
+锘縰sing SqlSugar;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using WIDESEAWCS_Common.LocationEnum;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
+using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IBasicInfoService;
using WIDESEAWCS_Model.Models;
@@ -15,7 +18,48 @@
public RGVLocationInfoService(IRepository<Dt_RGVLocationInfo> BaseDal) : base(BaseDal)
{
}
-
+ private Dictionary<string, OrderByType> _emptyAssignOrderBy = new Dictionary<string, OrderByType>()
+ {
+ { nameof(Dt_RGVLocationInfo.Depth), OrderByType.Desc },
+ { nameof(Dt_RGVLocationInfo.Layer), OrderByType.Asc },
+ //{ nameof(Dt_RGVLocationInfo.Column), OrderByType.Asc },
+ { nameof(Dt_RGVLocationInfo.Row), OrderByType.Asc },
+ };
+ private Dictionary<string, OrderByType> _DepthAscOrderBy = new Dictionary<string, OrderByType>()
+ {
+ { nameof(Dt_RGVLocationInfo.Depth), OrderByType.Asc },
+ };
public IRepository<Dt_RGVLocationInfo> Repository => BaseDal;
+
+ public List<Dt_RGVLocationInfo> GetFreeLocationInfos()
+ {
+ return BaseDal.QueryData(x => x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt(), _emptyAssignOrderBy);
+ }
+ /// <summary>
+ /// 鏌ユ壘鍏ュ簱鍙敤璐т綅
+ /// </summary>
+ /// <param name="AreaCode"></param>
+ /// <returns></returns>
+ public Dt_RGVLocationInfo GetInFreeLocationInfo(string AreaCode)
+ {
+ Dt_RGVLocationInfo? rGVLocationInfo = BaseDal.QueryFirst(x => x.WarehouseId.ToString() == AreaCode && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt(), _emptyAssignOrderBy);
+ #region 鍒ゆ柇宸烽亾鏄惁鏈夎揣
+ if (rGVLocationInfo != null)
+ {
+ List<string> NoRoadwayNos = new List<string>();
+ while (true)
+ {
+ Dt_RGVLocationInfo dt_RGVLocationInfo = BaseDal.QueryFirst(x => x.RoadwayNo == rGVLocationInfo.RoadwayNo && x.Depth < rGVLocationInfo.Depth && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt(), _emptyAssignOrderBy);
+ if (dt_RGVLocationInfo == null) return rGVLocationInfo;
+
+ rGVLocationInfo = BaseDal.QueryFirst(x => x.RoadwayNo == dt_RGVLocationInfo.RoadwayNo && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.Depth > dt_RGVLocationInfo.Depth && x.LocationStatus == LocationStatusEnum.Free.ObjToInt(), _DepthAscOrderBy);
+ dt_RGVLocationInfo = BaseDal.QueryFirst(x => x.RoadwayNo == rGVLocationInfo.RoadwayNo && x.Depth > rGVLocationInfo.Depth && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt(), _emptyAssignOrderBy);
+ if (dt_RGVLocationInfo == null) return rGVLocationInfo;
+
+ }
+ }
+ #endregion
+ return rGVLocationInfo;
+ }
}
}
--
Gitblit v1.9.3