From b2d25faa69ee7e9f24b6ac98d3b4dcbddada70bc Mon Sep 17 00:00:00 2001
From: yuyou_x <2336760928@qq.com>
Date: 星期四, 14 三月 2024 13:37:15 +0800
Subject: [PATCH] 修改pda托盘绑定同一物料多批次 无法具体选中批次问题。
---
Wms/WMS.BLL/SysServer/StorageLocatServer.cs | 160 +++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 137 insertions(+), 23 deletions(-)
diff --git a/Wms/WMS.BLL/SysServer/StorageLocatServer.cs b/Wms/WMS.BLL/SysServer/StorageLocatServer.cs
index 0b17705..c8826e5 100644
--- a/Wms/WMS.BLL/SysServer/StorageLocatServer.cs
+++ b/Wms/WMS.BLL/SysServer/StorageLocatServer.cs
@@ -17,11 +17,11 @@
namespace WMS.BLL.SysServer
{
- public class StorageLocatServer:DbHelper<SysStorageLocat>,IStorageLocatServer
+ public class StorageLocatServer : DbHelper<SysStorageLocat>, IStorageLocatServer
{
private static readonly SqlSugarScope Db = DataContext.Db;
public IStorageLocatRepository LocatRst { get; set; }
- public StorageLocatServer(IStorageLocatRepository locatRst):base(Db)
+ public StorageLocatServer(IStorageLocatRepository locatRst) : base(Db)
{
LocatRst = locatRst;
}
@@ -42,7 +42,7 @@
/// <param name="limit"></param>
/// <param name="count"></param>
/// <returns></returns>
- public List<LocatDto> GetStorageLocatList(string houseNo, string roadwayNo, string areaNo, string status, string flag,string locat, int? row, int? col, int? layer, int page, int limit,out int count)
+ public List<LocatDto> GetStorageLocatList(string houseNo, string roadwayNo, string areaNo, string status, string flag, string locat, int? row, int? col, int? layer, int page, int limit, out int count)
{
try
{
@@ -58,10 +58,11 @@
.AndIF(layer != null, it => it.Layer == layer)
.ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏�
-
- var data = LocatRst.GetAllByOrderPageAsync(item, limit, page,out int counts)
+
+ var data = LocatRst.GetAllByOrderPageAsync(item, limit, page, out int counts)
.Includes(x => x.WareHouseInfo)
.Includes(x => x.AreaInfo)
+ .Includes(x => x.RoadwayInfo)
.Includes(x => x.TemperatureInfo)
.Includes(x => x.CreateUserInfo)
.Includes(x => x.UpdateUserInfo).ToList();
@@ -70,8 +71,11 @@
{
Id = m.Id,
LocatNo = m.LocatNo,
+ WareHouseNo = m.WareHouseNo,
WareHouseName = m.WareHouseInfo == null ? "" : m.WareHouseInfo.WareHouseName,
RoadwayNo = m.RoadwayNo,
+ RoadwayName = m.RoadwayInfo == null ? "" : m.RoadwayInfo.RoadwayName,
+ AreaNo = m.AreaNo,
AreaName = m.AreaInfo == null ? "" : m.AreaInfo.AreaName,
Status = m.Status,
StatusName = GetStatus(m.Status),
@@ -115,7 +119,7 @@
}
}
-
+
public bool EditStorageLocat(EditLocateVm model, int userId)
{
try
@@ -125,7 +129,7 @@
return bl;
}
catch (Exception e)
- {
+ {
throw new Exception(e.Message);
}
}
@@ -183,12 +187,12 @@
c1 = c.ToString();
}
var area = l <= 7 ? "A12" : "A11";//鍖哄煙
- for (int d = 1; d<= int.Parse(dept); d++) //娣卞害
+ for (int d = 1; d <= int.Parse(dept); d++) //娣卞害
{
var s = "0" + d;//娣卞害
q += await LocatRst.AddAsync(new SysStorageLocat()
{
- LocatNo = r1 + c1 + l1+s,
+ LocatNo = r1 + c1 + l1 + s,
WareHouseNo = houseNo,
RoadwayNo = roadwayNo,
AreaNo = area,
@@ -201,11 +205,11 @@
CreateUser = userId
});
}
-
-
-
+
+
+
}
}
}
@@ -217,11 +221,57 @@
throw new Exception(e.Message);
}
}
+
+ /// <summary>
+ /// 娣诲姞鍌ㄤ綅淇℃伅锛堝钩搴擄級鐢ㄤ簬寮�鍙戜汉鍛樻坊鍔犲熀纭�淇℃伅
+ /// </summary>
+ /// <param name="model"></param>
+ /// <param name="userId"></param>
+ /// <returns></returns>
+ public async Task<int> AddPkStorageLocat(AddLocateVm model, int userId)
+ {
+ try
+ {
+ var q = 0;
+ // 鎺�(缁�)寰幆
+ for (int i = 1; i <= model.Row; i++)
+ {
+ // 鍒楀惊鐜�
+ for (int z = 1; z <= model.Col; z++)
+ {
+ q += await LocatRst.AddAsync(new SysStorageLocat()
+ {
+ // 鍖哄煙+鎺�+鍒�+灞�
+ LocatNo = model.AreaNo + i.ToString().PadLeft(2, '0') + z.ToString().PadLeft(2, '0') + "01",
+ WareHouseNo = model.HouseNo,
+ RoadwayNo = "",
+ AreaNo = model.AreaNo,
+ Status = "0",
+ AisleOne = "1",
+ AisleTwo = "",
+ Flag = "0",
+ Depth = z.ToString(),
+ Row = i,
+ Column = z,
+ Layer = 1,
+ CreateUser = userId
+ }); ;
+ }
+ }
+
+ return q;
+ }
+ catch (Exception e)
+ {
+ throw new Exception(e.Message);
+ }
+ }
+
public bool EditStorageLocatList(EditLocateListVm model, int userId)
{
try
{
- var bl = LocatRst.EditStorageLocatList(model.Id, model.Status, model.Flag,model.Temperature ,userId);
+ var bl = LocatRst.EditStorageLocatList(model.Id, model.Status, model.Flag, model.Temperature, userId);
return bl;
}
@@ -314,14 +364,14 @@
{
var list = Db.Queryable<SysStorageLocat>().Where(m =>
m.IsDel == "0" && m.WareHouseNo == wareHouseNo && m.RoadwayNo == roadway && m.Row == int.Parse(row) && m.Depth == depth).ToList();
-
+
return list;
}
catch (Exception e)
{
throw new Exception(e.Message);
}
-
+
}
/// <summary>
@@ -334,20 +384,20 @@
public int GetMaxLayer(string wareHouseNo, string roadway, string row)
{
try
- {
+ {
var road = roadway.Substring(1, roadway.Length - 1);
var num = int.Parse(road);
var rows = (num - 1) * 2 + int.Parse(row);//鎺�
var maxLayer = Db.Queryable<SysStorageLocat>().Where(m =>
- m.IsDel == "0" && m.WareHouseNo == wareHouseNo && m.RoadwayNo == roadway && m.Row == int.Parse(row)).Max(m=>m.Layer);
+ m.IsDel == "0" && m.WareHouseNo == wareHouseNo && m.RoadwayNo == roadway && m.Row == int.Parse(row)).Max(m => m.Layer);
return maxLayer;
}
catch (Exception e)
{
throw new Exception(e.Message);
- }
+ }
}
/// <summary>
@@ -398,7 +448,7 @@
return depthlist;
}
-
+
/// <summary>
/// 鑾峰彇搴撲綅鍗犳瘮(鍦�)
@@ -557,7 +607,7 @@
{
//鏍规嵁浠撳簱鍙蜂互鍙婂贩閬撳彿鑾峰彇鍌ㄤ綅鍚勭姸鎬佹暟鎹�
string str = "select Row,Status,COUNT(Status) StatusNum from SysStorageLocat where WareHouseNo = @warehouseno and RoadwayNo = @roadwayno group by Row,Status order by Row,Status";
-
+
List<GetLocateVm> getLocateVms = Db.Ado.SqlQuery<GetLocateVm>(str, new
{
warehouseno = wareHouseNo, //浠撳簱鍙�
@@ -585,8 +635,13 @@
{
try
{
- string str = "select RoadwayNo,RoadwayName from SysStorageRoadway where IsDel = @isdel and WareHouseNo = @warehouseno";
-
+ string str = "select RoadwayNo,RoadwayName,WareHouseNo from SysStorageRoadway where IsDel = @isdel";
+
+ if (!string.IsNullOrWhiteSpace(wareHouseNo))
+ {
+ str += " and WareHouseNo = @warehouseno";
+ }
+
List<RoadwayDto> roadway = Db.Ado.SqlQuery<RoadwayDto>(str, new
{
isdel = "0", //鏄惁鍒犻櫎
@@ -628,7 +683,7 @@
model.LocatNo = locatNo;
model.Status = storageLocat.Status;
model.PalletNo = stockDetailList[0].PalletNo;
-
+
List<LocateGoodsInfoVm> goodsList = new List<LocateGoodsInfoVm>();
foreach (var item in stockDetailList)
{
@@ -705,5 +760,64 @@
throw new Exception(e.Message);
}
}
+
+ #region 骞冲簱鍥句緥
+
+ /// <summary>
+ /// 鑾峰彇鍌ㄤ綅淇℃伅(骞冲簱鍥句緥)
+ /// </summary>
+ /// <param name="wareHouseNo">浠撳簱</param>
+ /// <param name="row">鎺�</param>
+ /// <returns></returns>
+ public List<SysStorageLocat> GetFlatLibraryLegend(string wareHouseNo, string row)
+ {
+ try
+ {
+ //涓�妤煎尯鍩�
+ //List<string> row1 = new List<string>()
+ //{
+ // "B01",
+ // "B02",
+ // "B03",
+ // "B04",
+ // "B05",
+ // "B06",
+ // "B07",
+ //};
+ ////浜屾ゼ鍖哄煙
+ //List<string> row3 = new List<string>()
+ //{
+ // "B11",
+ // "B12",
+ // "B13",
+ // "B14",
+ // "B15",
+ //};
+ string row1 = "'B01','B02','B03','B04','B05','B06','B07'";
+ string row3 = "'B11','B12','B13','B14','B15'";
+ string str = $"select * from SysStorageLocat where IsDel = '0' and WareHouseNo = '{wareHouseNo}' and ";
+ if (row == "1")
+ {
+ str += $" AreaNo in ({row1})";
+ }
+ else if (row == "3")
+ {
+ str += $" AreaNo in ({row3})";
+ }
+
+ var list = Db.Ado.SqlQuery<SysStorageLocat>(str);
+
+ //var list = Db.Queryable<SysStorageLocat>().Where(m => m.IsDel == "0" && m.WareHouseNo == wareHouseNo && row == "1" ? row1.Contains(m.AreaNo) : row3.Contains(m.AreaNo)).ToList();
+
+ return list;
+ }
+ catch (Exception e)
+ {
+ throw new Exception(e.Message);
+ }
+
+ }
+
+ #endregion
}
}
--
Gitblit v1.8.0