From b31f32fbfb25c77567e3853e05ca114dd2a00fbe Mon Sep 17 00:00:00 2001 From: chengsc <Demo@DESKTOP-CPA90BF> Date: 星期一, 14 十月 2024 18:58:22 +0800 Subject: [PATCH] 修改问题 --- Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs | 139 +++++++++++++++++++++++++++++++--------------- 1 files changed, 94 insertions(+), 45 deletions(-) diff --git a/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs b/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs index de6e0ad..3448fe9 100644 --- a/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs +++ b/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs @@ -710,11 +710,11 @@ } else { - var labelCount = label.Where(m => m.ASNDetailNo == imId).ToList(); - if (labelCount.Count <= 0) - { - throw new Exception("褰撳墠鍗曟嵁鏄庣粏杩樻湭鐢熸垚鏍囩锛岃閫夋嫨閲嶇疆鎵规閫夐」涓衡�樻槸鈥欙紱"); - } + //var labelCount = label.Where(m => m.ASNDetailNo == imId).ToList(); + //if (labelCount.Count <= 0) + //{ + // throw new Exception("褰撳墠鍗曟嵁鏄庣粏杩樻湭鐢熸垚鏍囩锛岃閫夋嫨閲嶇疆鎵规閫夐」涓衡�樻槸鈥欙紱"); + //} //maxLotNoStr = labelCount.Max(a => a.LotNo); maxLotNoStr = asnList.LotNo; //if (string.IsNullOrWhiteSpace(maxLotNoStr)) @@ -881,11 +881,11 @@ } else { - var labelCount = label.Where(m => m.ASNDetailNo == imId).ToList(); - if (labelCount.Count <= 0) - { - throw new Exception("褰撳墠鍗曟嵁鏄庣粏杩樻湭鐢熸垚鏍囩锛岃閫夋嫨閲嶇疆鎵规閫夐」涓衡�樻槸鈥欙紱"); - } + //var labelCount = label.Where(m => m.ASNDetailNo == imId).ToList(); + //if (labelCount.Count <= 0) + //{ + // throw new Exception("褰撳墠鍗曟嵁鏄庣粏杩樻湭鐢熸垚鏍囩锛岃閫夋嫨閲嶇疆鎵规閫夐」涓衡�樻槸鈥欙紱"); + //} //maxCodestr2 = labelCount.Max(a => a.LotNo); ; maxCodestr2 = asnList.LotNo; @@ -1698,17 +1698,17 @@ throw new Exception("褰撳墠鍗曟嵁鎵规鐨勬爣绛惧凡鏈夊凡浣跨敤锛屼笉鑳藉垹闄�"); } - foreach (var item in asnList) - { - if (string.IsNullOrWhiteSpace(item.LotNo)) - { - continue; - } + //foreach (var item in asnList) + //{ + // if (string.IsNullOrWhiteSpace(item.LotNo)) + // { + // continue; + // } - item.LotNo = ""; - Db.Updateable(item).ExecuteCommand(); + // item.LotNo = ""; + // Db.Updateable(item).ExecuteCommand(); - } + //} Db.Deleteable(labelList).ExecuteCommand(); } else //鍒犻櫎鍥哄畾鎵规鏍囩 @@ -1719,37 +1719,37 @@ throw new Exception("褰撳墠鍗曟嵁鎵规鐨勬爣绛惧凡鏈夊凡浣跨敤锛屼笉鑳藉垹闄�"); } - foreach (var item in asnList) - { - if (string.IsNullOrWhiteSpace(item.LotNo) || item.LotNo!=lotNo) - { - continue; - } + //foreach (var item in asnList) + //{ + // if (string.IsNullOrWhiteSpace(item.LotNo) || item.LotNo!=lotNo) + // { + // continue; + // } - var strList = item.LotNo.Split(";"); - var updateLotNo = ""; - foreach (var str in strList) - { - if (string.IsNullOrWhiteSpace(str) || str == lotNo) - { - continue; - } + // var strList = item.LotNo.Split(";"); + // var updateLotNo = ""; + // foreach (var str in strList) + // { + // if (string.IsNullOrWhiteSpace(str) || str == lotNo) + // { + // continue; + // } - if (string.IsNullOrWhiteSpace(updateLotNo)) - { - updateLotNo = str; - } - else - { - updateLotNo += ";" + str; - } + // if (string.IsNullOrWhiteSpace(updateLotNo)) + // { + // updateLotNo = str; + // } + // else + // { + // updateLotNo += ";" + str; + // } - } + // } - item.LotNo = updateLotNo; - Db.Updateable(item).ExecuteCommand(); + // item.LotNo = updateLotNo; + // Db.Updateable(item).ExecuteCommand(); - } + //} Db.Deleteable(labelList).ExecuteCommand(); } @@ -1771,5 +1771,54 @@ } } + + //缂栬緫鏍囩鏁伴噺 + public void EditLabelQty(int id, string qty, int userId) + { + try + { + if (string.IsNullOrWhiteSpace(qty)) + { + throw new Exception("缂栬緫鏁伴噺涓嶅彲涓虹┖"); + } + var qtyData = 0m; + var isOk = decimal.TryParse(qty, out qtyData); + var boxInfo = Db.Queryable<BllBoxInfo>().First(m => m.IsDel == "0" && m.Id == id); + if (boxInfo == null) + { + throw new Exception("鏈煡璇㈠埌璇ユ爣绛句俊鎭�"); + } + + if (isOk) + { + if (qtyData <= 0) + { + throw new Exception("鏁伴噺涓嶈兘灏忎簬绛変簬0"); + } + boxInfo.Qty = qtyData; + + Db.Updateable(boxInfo).ExecuteCommand(); + } + else + { + throw new Exception("鏁伴噺杞崲澶辫触"); + } + + var msg = $"缂栬緫浜嗙鍙凤細{boxInfo.BoxNo}"; + if (!string.IsNullOrWhiteSpace(boxInfo.BoxNo3)) + { + msg += $"銆佹敮鍙凤細{boxInfo.BoxNo3}"; + } + msg += "鐨勬爣绛炬暟閲忎俊鎭�"; + + new OperationASNServer().AddLogOperationAsn("鍏ュ簱浣滀笟", "鐗╂枡鏍囩", boxInfo.BoxNo, "缂栬緫", msg, userId); + } + catch (Exception e) + { + throw new Exception(e.Message); + } + } + + } } -- Gitblit v1.8.0