修改单伸位满入获取仓位流程

This commit is contained in:
mtf committed 2026-11-06 18:43:21 +08:00
1 parent b6c3ef8b2c
commit 471300768e
1 file changed
+28 -1
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@@ -520,6 +520,33 @@ namespace HHWMS.Web
public ResponseResult<dynamic> GetMoveLocation(Location outter)
{
// 新增:单边位、单伸位直接查找空仓位
var roadwayType = GetRoadwayType(outter.RoadWay);
if (roadwayType == 1 || roadwayType == 2)
{
var location = DC.Set<Location>()
.AsNoTracking()
.Where(l => l.RoadWay == outter.RoadWay
&& l.Type == outter.Type
&& l.ID != outter.ID
&& !l.IsStop
&& l.Status == LocationStatusEnum.未锁
&& l.ContainerStatus == LocationStatus.空仓位
&& l.RowFlag == RowFlagEnum.Outer
&& l.Height >= outter.Height
&& l.Code != null && l.Code != "")
.OrderBy(l => Math.Abs(outter.Line - l.Line))
.ThenBy(l => l.Layer)
.FirstOrDefault();
if (location == null)
return ResponseResult<dynamic>.Error("找不到可用的移库仓位!");
return ResponseResult<dynamic>.Success(
new { LocationCode = location.Code });
}
// 查找移库仓位
// 一次性获取所需的所有数据,避免多次查询数据库
var locationPairs = DC.Set<Location>()