From 5ce969ed34e91c931cce38e2feb5d2c208633a96 Mon Sep 17 00:00:00 2001
From: chengsc <Demo@DESKTOP-CPA90BF>
Date: 星期日, 03 十一月 2024 18:34:53 +0800
Subject: [PATCH] 修改问题
---
Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs | 148 +++++++++++++++++++++++++++++++++----------------
1 files changed, 99 insertions(+), 49 deletions(-)
diff --git a/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs b/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
index de6e0ad..9ccdc0a 100644
--- a/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs
@@ -297,6 +297,7 @@
CreateTime = a.CreateTime,
UpdateTime = a.UpdateTime
})
+ .OrderByDescending(a=>a.BoxNo)
.OrderByDescending(a => a.CreateTime)
.ToOffsetPage(model.Page, model.Limit, ref total);
count = total;
@@ -464,7 +465,7 @@
CreateTime = a.CreateTime,
UpdateTime = a.UpdateTime
- }).OrderByDescending(a => a.CreateTime).OrderBy(a => a.BoxNo).ToOffsetPage(model.Page, model.Limit, ref total);
+ }).OrderBy(a => a.BoxNo).OrderByDescending(a => a.CreateTime).ToOffsetPage(model.Page, model.Limit, ref total);
count = total;
return data;
}
@@ -710,18 +711,18 @@
}
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))
//{
// maxLotNoStr = toDayTime.Substring(2, 6) + "0001";
//}
- //maxBoxCode = label.Where(m => m.LotNo == maxLotNoStr).Max(a => a.BoxNo);
+ maxBoxCode = label.Where(m => m.LotNo == maxLotNoStr).Max(a => a.BoxNo);
}
}
@@ -881,11 +882,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;
@@ -893,8 +894,8 @@
//{
// maxCodestr2 = toDayTime2.Substring(2, 6) + "0001";
//}
- //maxboxcode2 = label.Where(m => m.LotNo == maxCodestr2).Max(a => a.BoxNo);//绠卞彿;
- //maxboxcode3 = label.Where(m => m.LotNo == maxCodestr2).Max(a => a.BoxNo3);//鏀彿;
+ maxboxcode2 = label.Where(m => m.LotNo == maxCodestr2).Max(a => a.BoxNo);//绠卞彿;
+ maxboxcode3 = label.Where(m => m.LotNo == maxCodestr2).Max(a => a.BoxNo3);//鏀彿;
}
}
@@ -1698,17 +1699,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 +1720,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 +1772,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