From a9cddcd1e3e8ae51f68a885326cfce3247fdbd66 Mon Sep 17 00:00:00 2001 From: yyk <2336760928@qq.com> Date: 星期五, 23 八月 2024 09:20:47 +0800 Subject: [PATCH] 调整批量添加储位接口。 --- Wms/WMS.BLL/SysServer/StorageLocatServer.cs | 33 ++++++++++++++++++++++++++------- 1 files changed, 26 insertions(+), 7 deletions(-) diff --git a/Wms/WMS.BLL/SysServer/StorageLocatServer.cs b/Wms/WMS.BLL/SysServer/StorageLocatServer.cs index fbbdd73..43ffec1 100644 --- a/Wms/WMS.BLL/SysServer/StorageLocatServer.cs +++ b/Wms/WMS.BLL/SysServer/StorageLocatServer.cs @@ -59,7 +59,7 @@ .ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏� - var data = LocatRst.GetAllByOrderPageAsync(item, limit, page, out int counts) + var data = LocatRst.GetAllByOrderPage(item, limit, page, out int counts) .Includes(x => x.WareHouseInfo) .Includes(x => x.AreaInfo) .Includes(x => x.RoadwayInfo) @@ -120,11 +120,11 @@ } - public bool EditStorageLocat(EditLocateVm model,string url ,int userId) + public bool EditStorageLocat(EditLocateVm model, string url, int userId) { try { - var bl = LocatRst.EditStorageLocat(model.Id, model.Status, model.Flag, model.Temperature,url, userId); + var bl = LocatRst.EditStorageLocat(model.Id, model.Status, model.Flag, model.Temperature, url, userId); return bl; } @@ -137,6 +137,7 @@ /// <summary> /// 娣诲姞鍌ㄤ綅淇℃伅锛堢珛浣撳簱锛夌敤浜庡紑鍙戜汉鍛樻坊鍔犲熀纭�淇℃伅 /// </summary> + /// <param name="index">褰撳墠鎺掓暟</param> /// <param name="houseNo">浠撳簱鍙�</param> /// <param name="roadwayNo">宸烽亾鍙�</param> /// <param name="areaNo">鍖哄煙鍙�</param> @@ -146,14 +147,14 @@ /// <param name="dept">娣卞害</param> /// <param name="userId">鎿嶄綔浜�</param> /// <returns></returns> - public async Task<int> AddStorageLocat(string houseNo, string roadwayNo, string areaNo, int row, int col, int layer, string dept, int userId) + public async Task<int> AddStorageLocat(int index, string houseNo, string roadwayNo, string areaNo, int row, int col, int layer, string dept, int userId) { try { var q = 0; //R01 -01 -01 -02 //宸烽亾鈥撴帓-鍒�-灞� - for (int r = 13; r <= row; r++)//鎺� + for (int r = index; r <= row; r++)//鎺� { var r1 = "1"; if (r < 10) @@ -233,12 +234,30 @@ try { var q = 0; + var depth = 0; + var depthString = ""; // 鎺�(缁�)寰幆 for (int i = 1; i <= model.Row; i++) { // 鍒楀惊鐜� for (int z = 1; z <= model.Col; z++) { + if (z == 1) + { + depth += 1; + if (depth >= 10) + { + depthString = depth.ToString(); + } + else if (depth < 10) + { + depthString = "0" + depth.ToString(); + } + else { + //鍏朵綑鏉′欢 + } + } + q += await LocatRst.AddAsync(new SysStorageLocat() { // 鍖哄煙+鎺�+鍒�+灞� @@ -250,7 +269,7 @@ AisleOne = "1", AisleTwo = "", Flag = "0", - Depth = z.ToString(), + Depth = depthString, Row = i, Column = z, Layer = 1, @@ -267,7 +286,7 @@ } } - public bool EditStorageLocatList(EditLocateListVm model,string url, int userId) + public bool EditStorageLocatList(EditLocateListVm model, string url, int userId) { try { -- Gitblit v1.8.0