From bdf0a4186a361172de94090b51bbb3ffa6a38241 Mon Sep 17 00:00:00 2001
From: chenwenkai <1084072318@qq.com>
Date: Wed, 6 Nov 2024 14:24:41 +0800
Subject: [PATCH] =?UTF-8?q?=E6=88=90=E5=93=81=E8=B0=83=E6=8B=A8=E5=85=A5?=
=?UTF-8?q?=E5=BA=93=E6=94=B9=E4=B8=BA=E6=89=AB=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Dto/Inputs/OutsourcedPartsInstockInput.cs | 4 ++++
.../Tnb.WarehouseMgr/WmsPDACarryBindService.cs | 14 +++++++++-----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/OutsourcedPartsInstockInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/OutsourcedPartsInstockInput.cs
index a954b603..6df2f9ad 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/OutsourcedPartsInstockInput.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/OutsourcedPartsInstockInput.cs
@@ -22,6 +22,10 @@
///
public string? startlocation_id { get; set; }
///
+ /// 起点code
+ ///
+ public string? startlocation_code { get; set; }
+ ///
/// 需求单据
///
public string? source_id { get; set; }
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs
index 85e33fb6..23e4931d 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryBindService.cs
@@ -186,11 +186,15 @@ namespace Tnb.WarehouseMgr
{
throw new AppFriendlyException("成品调拨明细id不可为空", 500);
}
- if (string.IsNullOrEmpty(input.startlocation_id))
+ if (string.IsNullOrEmpty(input.startlocation_code))
{
throw new AppFriendlyException("起点不可为空", 500);
}
+ var baseLocation = await _db.Queryable().Where(r => r.location_code == input.startlocation_code).FirstAsync();
+ if (baseLocation == null)
+ throw new AppFriendlyException($"未找到编号{input.startlocation_code}的库位", 500);
+
WmsTransferInstockD wmsTransferInstockD = await _db.Queryable().Where(r => r.id == input.source_id).FirstAsync();
if (wmsTransferInstockD.status == WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID)
{
@@ -208,7 +212,7 @@ namespace Tnb.WarehouseMgr
WmsPointH sPoint = null!;
WmsPointH ePoint = null!;
- sPoint = await _db.Queryable().FirstAsync(it => it.location_id == input.startlocation_id);
+ sPoint = await _db.Queryable().FirstAsync(it => it.location_id == baseLocation.id);
if (endLocations?.Count > 0)
{
WmsCarryH carry = await _db.Queryable().SingleAsync(it => it.carry_code == input.carry_code);
@@ -303,20 +307,20 @@ namespace Tnb.WarehouseMgr
if (endLocationId != null)
{
//查询库位表
- BasLocation location = await _db.Queryable().SingleAsync(it => it.id == input.startlocation_id);
+ BasLocation location = await _db.Queryable().SingleAsync(it => it.id == baseLocation.id);
{
//载具加锁,增加库位信息
_ = await _db.Updateable().SetColumns(it => new WmsCarryH
{
carry_status = ((int)EnumCarryStatus.占用).ToString(),
is_lock = 1,
- location_id = input.startlocation_id,
+ location_id = baseLocation.id,
location_code = location.location_code
}).Where(it => it.id == wmsCarryH.id).ExecuteCommandAsync();
}
//所有库位加锁
- string?[] ids = new[] { input.startlocation_id, endLocationId };
+ string?[] ids = new[] { baseLocation.id, endLocationId };
_ = await _db.Updateable().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
BasMaterial basMaterial = await _db.Queryable().FirstAsync(it => it.id == input.material_id);