From bdd84cc48ba7b2527584c44d174da8e7d20c5375 Mon Sep 17 00:00:00 2001
From: zhaowc <526854230@qq.com>
Date: 星期三, 18 九月 2024 16:37:13 +0800
Subject: [PATCH] 增加对申请入库时对平库库位的校验
---
Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs | 60 ++++++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 40 insertions(+), 20 deletions(-)
diff --git a/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs b/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
index 4c0e2f0..69e37ea 100644
--- a/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
@@ -33,7 +33,7 @@
#region 鎺ュ彛鏂规硶
- //JC23缁戝畾鐗╂枡鎵樼洏鍗冲鍔犲簱瀛�
+ //JC26缁戝畾鐗╂枡鎵樼洏鍗冲鍔犲簱瀛�
public void BindPalletStock(BoxPalletBindVm model, int userId)
{
try
@@ -72,10 +72,10 @@
{
throw new Exception("鍗曟嵁鍙蜂笉鍙负绌�!");
}
- if (model.AsnDetailNo == 0)
- {
- throw new Exception("鍗曟嵁鏄庣粏涓嶅彲涓虹┖!");
- }
+ //if (model.AsnDetailNo == 0)
+ //{
+ // throw new Exception("鍗曟嵁鏄庣粏涓嶅彲涓虹┖!");
+ //}
//鏍规嵁鍗曟嵁鍙疯幏鍙栧叆搴撳崟鎬诲崟
notice = Db.Queryable<BllArrivalNotice>().First(a => a.IsDel == "0" && a.ASNNo == model.AsnNo && a.OrderCode == model.OrderCode);
if (notice.Status != "0" && notice.Status != "1" && notice.Status != "2")
@@ -91,11 +91,13 @@
throw new Exception("鎵规涓嶈兘涓虹┖!");
}
// 楠岃瘉鍏ュ簱鍗曟槑缁嗘槸鍚﹀瓨鍦�
- detail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" && m.Id == model.AsnDetailNo && m.ASNNo == model.AsnNo && m.LotNo == model.LotNo && m.SkuNo == model.SkuNo);
+ detail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0"
+ && m.ASNNo == model.AsnNo && m.LotNo == model.LotNo && m.SkuNo == model.SkuNo);
if (detail == null)
{
throw new Exception("褰撳墠鐗╂枡鍙婃壒娆′笌鍗曟嵁鏃犲叧鑱旓紝璇锋牳瀹�!");
}
+ model.AsnDetailNo = detail.Id;
}
@@ -227,7 +229,9 @@
BllQualityInspect quality = new BllQualityInspect();
if (model.Type == "0")
{
- quality = Db.Queryable<BllQualityInspect>().Where(a => a.IsDel == "0" && a.SkuNo == detail.SkuNo && a.LotNo == detail.LotNo).OrderByDescending(a => a.CreateTime).First();
+ quality = Db.Queryable<BllQualityInspect>()
+ .Where(a => a.IsDel == "0" && a.SkuNo == detail.SkuNo && a.LotNo == detail.LotNo)
+ .OrderByDescending(a => a.CreateTime).First();
}
DataStockDetail sd1 = null;
@@ -265,7 +269,7 @@
InspectQty = 0,
ASNNo = bind.ASNNo,
ASNDetailNo = bind.ASNDetailNo,
- WareHouseNo = "",//鎵�灞炰粨搴�
+ WareHouseNo = "W01",//鎵�灞炰粨搴�
RoadwayNo = "",//鎵�灞炲贩閬�
AreaNo = "",//鎵�灞炲尯鍩�
LocatNo = "",//鍌ㄤ綅鍦板潃
@@ -444,8 +448,8 @@
Standard = box.Standard,
PackageStandard = box.PackageStandard,
StoreTime = box.StoreTime,
- QtyCount = (int)box.QtyCount,
- QtyOrd = (int)box.QtyOrd,
+ QtyCount = box.QtyCount,
+ QtyOrd = box.QtyOrd,
CreateUser = userId,
CreateTime = comTime,
};
@@ -593,7 +597,7 @@
#endregion
- #region 鎵樼洏缁戝畾
+ #region 缁勬墭鏀惰揣
public List<PalletBindDto> GetPalletBindList(PalletBindVm model, out int count)
{
try
@@ -602,8 +606,17 @@
if (!string.IsNullOrWhiteSpace(model.SkuNo) || !string.IsNullOrWhiteSpace(model.SkuName))
{
- var detailList = Db.Queryable<BllArrivalNoticeDetail>().Where(m => m.IsDel == "0" && m.SkuNo.Contains(model.SkuNo.Trim()) && m.SkuName.Contains(model.SkuName.Trim())).Select(m => m.Id).Distinct().ToList();
+ var detailList = Db.Queryable<BllArrivalNoticeDetail>()
+ .Where(m => m.IsDel == "0" && m.SkuNo.Contains(model.SkuNo.Trim()) && m.SkuName.Contains(model.SkuName.Trim()))
+ .Select(m => m.Id).Distinct().ToList();
strList = detailList;
+ if (strList.Count <= 0)
+ {
+ // 鐗╂枡缂栫爜銆佸悕绉版绱㈠け璐ョ洿鎺ヨ繑鍥瀗ull
+ count = 0;
+ return null;
+ }
+
}
Expression<Func<BllPalletBind, bool>> item = Expressionable.Create<BllPalletBind>()
.AndIF(!string.IsNullOrWhiteSpace(model.ASNNo), it => it.ASNNo.Contains(model.ASNNo.Trim()))
@@ -615,7 +628,7 @@
.AndIF(!string.IsNullOrWhiteSpace(model.LotNo), it => it.LotNo.Contains(model.LotNo.Trim()))
.AndIF(!string.IsNullOrWhiteSpace(model.LotText), it => it.LotText.Contains(model.LotText.Trim()))
.AndIF(!string.IsNullOrWhiteSpace(model.StartTime), it => it.CreateTime >= Convert.ToDateTime(model.StartTime))
- .AndIF(!string.IsNullOrWhiteSpace(model.EndTime), it => it.CreateTime <= Convert.ToDateTime(model.EndTime))
+ .AndIF(!string.IsNullOrWhiteSpace(model.EndTime), it => it.CreateTime <= Convert.ToDateTime(model.EndTime).AddDays(1))
.AndIF(!string.IsNullOrWhiteSpace(model.Status), it => it.Status == model.Status)
.And(m => m.IsDel == "0")
.ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏�
@@ -625,9 +638,10 @@
.LeftJoin<BllArrivalNoticeDetail>((a, b) => a.ASNDetailNo == b.Id)
.LeftJoin<SysUserInfor>((a, b, c) => a.CreateUser == c.Id)
.LeftJoin<SysUserInfor>((a, b, c, d) => a.UpdateUser == d.Id)
- //.LeftJoin<SysStorageLocat>((a, b, c, d, e) => a.LocatNo == e.LocatNo)
+ .LeftJoin<SysStorageLocat>((a, b, c, d, e) => a.LocatNo == e.LocatNo)
+ .LeftJoin<SysWareHouse>((a, b, c, d, e,f) => a.WareHouseNo == f.WareHouseNo)
//.LeftJoin<BllBoxInfo>((a, b, c, d, e, f) => a.Id == e.BindNo)
- .Select((a, b, c, d) => new PalletBindDto()
+ .Select((a, b, c, d,e,f) => new PalletBindDto()
{
Id = a.Id,
ASNNo = a.ASNNo,
@@ -639,6 +653,7 @@
LocatNo = a.LocatNo,
RoadwayNo = a.RoadwayNo,
WareHouseNo = a.WareHouseNo,
+ WareHouseName = a.WareHouseNo+"-"+f.WareHouseName,
Qty = a.Qty,
FullQty = a.FullQty,
SamplingQty = a.SamplingQty,
@@ -672,6 +687,7 @@
throw new Exception(ex.Message);
}
}
+
public List<BoxInfoDto> GetBoxInfoList(BoxInfoVm model, out int count)
{
@@ -1362,7 +1378,7 @@
.AndIF(!string.IsNullOrWhiteSpace(layer), m => m.Layer == int.Parse(layer))
.AndIF(!string.IsNullOrWhiteSpace(locateNo), m => m.LocatNo.Contains(locateNo))
.And(m => m.IsDel == "0" && m.Status == "0" && m.Flag == "0" && m.WareHouseNo == houseNo)
- .And(m => m.AreaNo == categoryAreaNo)
+ .And(m => categoryAreaNo.Contains(m.AreaNo))
.ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏�
var total = 0;
var list = Db.Queryable<SysStorageLocat>().Where(item).OrderByDescending(a => a.Depth).OrderBy(a => a.Column)
@@ -1547,7 +1563,9 @@
throw new Exception("璇烽�夋嫨鎵�灞炰粨搴�");
}
//楠岃瘉鏄惁涓哄钩搴撳叆搴�
- if (houseNo == "W02")
+ var houseType = Db.Queryable<SysWareHouse>().First(a => a.WareHouseNo == houseNo);//鑾峰彇浠撳簱绫诲瀷
+ //楠岃瘉鏄惁涓哄钩搴撳叆搴�
+ if (houseType.Type == "2")
{
throw new Exception("骞冲簱璇蜂娇鐢≒DA鎵嬫寔杩涜骞冲簱鍏ュ簱");
}
@@ -1720,18 +1738,18 @@
var sku = skuList.FirstOrDefault(m => m.SkuNo == skuNo);
if (sku == null)
{
- throw new Exception("鐗╂枡淇℃伅涓湭鏌ヨ鍒板叆搴撳崟鏄庣粏鍖呭惈鐨勭墿鏂欎俊鎭紝涓嶅彲鍏ュ簱");
+ throw new Exception("鐗╂枡缂栫爜涓嶅瓨鍦紝涓嶅彲鍏ュ簱");
}
//鍒ゆ柇鐗╂枡鏄惁鍚湁绫诲埆淇℃伅
if (string.IsNullOrWhiteSpace(sku.CategoryNo))
{
- throw new Exception($"鐗╂枡锛歿sku.SkuNo}鏈煡璇㈠埌绫诲埆淇℃伅");
+ throw new Exception($"鐗╂枡锛歿sku.SkuNo}鏈缃被鍒�,涓嶅彲鍏ュ簱");
}
var skuCategory = skuCategoryList.FirstOrDefault(m => m.CategoryNo == sku.CategoryNo);
if (skuCategory == null)
{
- throw new Exception($"鏈湪绫诲埆淇℃伅涓煡璇㈠埌鐗╂枡锛歿sku.SkuNo}鍖呭惈鐨勭被鍒�");
+ throw new Exception($"{sku.SkuNo}鐗╂枡绫诲埆涓嶅瓨鍦紝涓嶅彲鍏ュ簱");
}
var areaStr = skuCategory.AreaNo.Split(",");
@@ -1936,6 +1954,8 @@
Db.Updateable(bindModel).ExecuteCommand();
asnNo = stockModel.ASNNo;
}
+
+
}
}
foreach (DataStockDetail stockModel in stockDetail)
--
Gitblit v1.8.0