From 3a33dd4767b20bd233714d35e1b0912f91e3546a Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@DESKTOP-5BIMHQ3>
Date: 星期三, 21 二月 2024 10:49:22 +0800
Subject: [PATCH] PDA托盘绑定增加托盘验证
---
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs | 84 +++++++++++++++++++++++++++++++++---------
1 files changed, 66 insertions(+), 18 deletions(-)
diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
index 116e879..074999f 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -1281,6 +1281,30 @@
}
}
+ /// <summary>
+ /// 楠岃瘉鍌ㄤ綅鍦板潃(鍦扮爜)鏄惁鍙敤
+ /// </summary>
+ /// <param name="locatNo">鍌ㄤ綅缂栫爜</param>
+ /// <returns></returns>
+ public string CheckLocatNo(string locatNo)
+ {
+ try
+ {
+ string strMsg = "";
+ var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == locatNo && w.Status == "0" && w.WareHouseNo == "W02");
+ if (storageLocat == null)
+ {
+ throw new Exception("-1:鍦扮爜(鍌ㄤ綅淇℃伅)涓嶅瓨鍦ㄦ垨闈炵┖闂茬姸鎬侊紝璇锋牳鏌�!");
+ }
+
+ return strMsg;
+ }
+ catch (Exception ex)
+ {
+ throw new Exception(ex.Message);
+ }
+ }
+
//鏍规嵁绠辩爜鑾峰彇鐗╂枡銆佹壒娆°�佹暟閲忕瓑淇℃伅
public PdaPalletNoCheckDto GetBoxInfoByBoxNo(string boxNo)
{
@@ -1792,6 +1816,12 @@
{
throw new Exception("鏈煡璇㈠埌鎵樼洏淇℃伅锛岃鏍稿疄锛�");
}
+ //鍒ゆ柇鎵樼洏鏄惁鍦ㄥ簱澶�
+ var stockDetail = Db.Queryable<DataStockDetail>().First(m => m.IsDel == "0" && m.PalletNo == model.PalletNo);
+ if (stockDetail != null && !string.IsNullOrEmpty(stockDetail.WareHouseNo))
+ {
+ throw new Exception("璇ユ墭鐩樻湭鍦ㄥ簱澶栵紝璇锋牳瀹烇紒");
+ }
// 楠岃瘉鍏ュ簱鍗曟槑缁嗘槸鍚﹀瓨鍦�
var detail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" && m.Id == model.AsnDetailId && m.ASNNo == model.AsnNo && m.LotNo.Contains(model.LotNo));
if (detail == null)
@@ -1892,6 +1922,7 @@
throw new Exception("-1:褰撳墠鎵樼洏姝e湪鎵ц涓紝缁戝畾澶辫触锛岃鏍稿疄!");
}
bindId = bind.Id;
+ bind.Qty += model.SkuQty;
}
#region 绠辩爜淇℃伅
@@ -1926,6 +1957,7 @@
// 鏇存敼绠辨敮鍏崇郴琛�
decimal factQty = 0.00m;//鎵樼洏鎬绘暟閲�
+ //鎴愬搧缁勬墭
if (model.SkuQty == 0)
{
var boxGroup = boxInfoList.GroupBy(m => m.BoxNo).ToList();
@@ -1985,7 +2017,7 @@
var sqlString = string.Empty;
if (factQty == 0)
{
- sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{bind.Qty}' where id = '{model.AsnDetailId}';";
+ sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{model.SkuQty}' where id = '{model.AsnDetailId}';";
}
else
{
@@ -2053,6 +2085,13 @@
//楠岃瘉搴撳瓨鏄惁鎷ユ湁璇ユ墭淇℃伅
if (stockDetail != null && stockDetail.Count > 0)
{
+ foreach (var item in stockDetail)
+ {
+ if (!string.IsNullOrEmpty(item.WareHouseNo))
+ {
+ throw new Exception("璇ユ墭鐩樻湭鍦ㄥ簱澶栵紝璇锋牳鏌�!");
+ }
+ }
iscount = 1; //鍥炴祦鍏ュ簱
}
#endregion
@@ -2084,22 +2123,6 @@
Db.BeginTran();//寮�鍚簨鍔�
if (iscount == 0)//姝e父鍏ュ簱
{
- #region 绠辩爜淇℃伅
- var boxInfoList = Db.Queryable<BllBoxInfo>().Where(w => w.IsDel == "0" && w.ASNNo == model.ASNNo).ToList();
- //楠岃瘉绠辩爜淇℃伅鏄惁瀛樺湪
- if (boxInfoList.Count <= 0)
- {
- throw new Exception("绠辩爜淇℃伅涓嶅瓨鍦紝璇锋牳鏌�!");
- }
- foreach (var item in boxInfoList)
- {
- item.Status = "2"; // 鏀瑰彉绠辨敮鍏崇郴琛ㄧ姸鎬侊細宸插叆搴�
- item.UpdateTime = serverTime;
- item.UpdateUser = model.CreateUser;
- }
- Db.Updateable(boxInfoList).ExecuteCommand();
- #endregion
-
#region 鍏ュ簱鎬诲崟淇℃伅
var notice = Db.Queryable<BllArrivalNotice>().First(a => a.IsDel == "0" && a.Status != "3" && a.ASNNo == model.ASNNo);
//楠岃瘉鍏ュ簱鍗曟�诲崟鏄惁鍏抽棴
@@ -2111,6 +2134,30 @@
if (notice.Status == "3")
{
throw new Exception("鍏ュ簱鍗曟�诲崟宸插叧闂紝璇锋牳鏌�!");
+ }
+ #endregion
+
+ #region 绠辩爜淇℃伅
+ var boxInfoList = Db.Queryable<BllBoxInfo>().Where(w => w.IsDel == "0" && w.ASNNo == model.ASNNo).ToList();
+ // type 0:鎴愬搧鍏ュ簱 1:閲囪喘鍏ュ簱 2:涓棿鍝佸叆搴� 3:閫�璐у叆搴� 4:杞﹂棿浣欐枡閫�鍥炲叆搴� 5:鍏跺畠鍏ュ簱 6:浠e偍鍏ュ簱 7:瀵勫瓨鍏ュ簱
+ if (notice.Type == "2" || notice.Type == "6" || notice.Type == "7")
+ {
+ // 涓嶈创鐮佺墿鏂� 鏃犻渶楠岃瘉绠辩爜淇℃伅
+ }
+ else
+ {
+ //楠岃瘉绠辩爜淇℃伅鏄惁瀛樺湪
+ if (boxInfoList.Count <= 0)
+ {
+ throw new Exception("绠辩爜淇℃伅涓嶅瓨鍦紝璇锋牳鏌�!");
+ }
+ foreach (var item in boxInfoList)
+ {
+ item.Status = "2"; // 鏀瑰彉绠辨敮鍏崇郴琛ㄧ姸鎬侊細宸插叆搴�
+ item.UpdateTime = serverTime;
+ item.UpdateUser = model.CreateUser;
+ }
+ Db.Updateable(boxInfoList).ExecuteCommand();
}
#endregion
@@ -2202,7 +2249,7 @@
ASNDetailNo = (int)bindInfo.ASNDetailNo,
WareHouseNo = "W02",
RoadwayNo = "",
- AreaNo = "",
+ AreaNo = storageLocat.AreaNo,
LocatNo = model.LocatNo,
PalletNo = model.PalletNo,
PalletNo2 = bindInfo.PalletNo2,
@@ -2227,6 +2274,7 @@
{
stId = detailModel.Id;
detailModel.LocatNo = model.LocatNo;
+ detailModel.AreaNo = storageLocat.AreaNo;
detailModel.UpdateTime = serverTime;
detailModel.UpdateUser = (int)model.CreateUser;
// 鍙樻洿鍌ㄤ綅鍦板潃
--
Gitblit v1.8.0