From da2e6b77437a3f199e292477f70f1be4f7f3c6d8 Mon Sep 17 00:00:00 2001
From: admin <qiutairan163@163.com>
Date: 星期五, 21 十一月 2025 14:12:10 +0800
Subject: [PATCH] 格式化代码,去除多余catch
---
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs b/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
index 98006d1..bdd298f 100644
--- a/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -273,6 +273,7 @@
*/
var TypeLot = "1, 5, 6, 7"; //鎵规鍙负绌哄崟鎹被鍨�
+ int codeStrNum = 0;
try
{
if (model.Origin == "褰曞叆" || model.Origin == "瀵煎叆")
@@ -378,13 +379,16 @@
&& m.CreateTime.ToString("yyyyMM") == DateTime.Now.ToString("yyyyMM")).Max(m => m.BoxCodeStr);
if(string.IsNullOrWhiteSpace(maxBoxCodeStr))
{
- maxBoxCodeStr = "BK" + toDayTime.Substring(2, 4) + "0001";
+ string codeEndStr = (1 + codeStrNum).ToString().PadLeft(4, '0');
+ maxBoxCodeStr = "BK" + toDayTime.Substring(2, 4) + codeEndStr;
}
else
{
- maxBoxCodeStr = "BK" + (int.Parse(maxBoxCodeStr.Replace("BK", "")) + 1).ToString();
+ maxBoxCodeStr = "BK" + (int.Parse(maxBoxCodeStr.Replace("BK", "")) + 1 + codeStrNum).ToString();
}
detailModel.BoxCodeStr = maxBoxCodeStr;
+
+ codeStrNum++;
}
// 鍒ゆ柇鏄惁宸插瓨鍦ㄥ綋鍓嶆槑缁�
@@ -1535,10 +1539,10 @@
var response = HttpHelper.DoPost(url, jsonData, "鍏ュ簱鍗曞畬鎴愪笂浼�", "SAP");
- var obj = JsonConvert.DeserializeObject<ErpModel>(response);//瑙f瀽杩斿洖鏁版嵁
- if (obj.Success != 0)
+ var obj = JsonConvert.DeserializeObject<SapResultModel>(response);//瑙f瀽杩斿洖鏁版嵁
+ if (obj.RESULT != true)
{
- throw new Exception("涓婁紶澶辫触" + obj.Message);
+ throw new Exception("涓婁紶澶辫触" + obj.MESSAGE);
}
#endregion
--
Gitblit v1.8.0