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/SysServer/StorageLocatServer.cs |   52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 51 insertions(+), 1 deletions(-)

diff --git a/Wms/WMS.BLL/SysServer/StorageLocatServer.cs b/Wms/WMS.BLL/SysServer/StorageLocatServer.cs
index 0b17705..c139dd7 100644
--- a/Wms/WMS.BLL/SysServer/StorageLocatServer.cs
+++ b/Wms/WMS.BLL/SysServer/StorageLocatServer.cs
@@ -62,6 +62,7 @@
                 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),
@@ -217,6 +221,52 @@
                 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
@@ -585,7 +635,7 @@
         {
             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 and WareHouseNo = @warehouseno";
                 
                 List<RoadwayDto> roadway = Db.Ado.SqlQuery<RoadwayDto>(str, new
                 {

--
Gitblit v1.8.0