From 6ed0553e8d5bc38b728979c2078d3cbffdc88bf2 Mon Sep 17 00:00:00 2001 From: 杨张扬 <634643841@qq.com> Date: 星期五, 30 五月 2025 17:10:03 +0800 Subject: [PATCH] 1.双钱-规格时间配置这个,过期时间使用小时 --- wms/SpecHelper.cs | 38 +++++++++++++++++++++++++++++++++++--- 1 files changed, 35 insertions(+), 3 deletions(-) diff --git a/wms/SpecHelper.cs b/wms/SpecHelper.cs index cc88f6b..bd4bc53 100644 --- a/wms/SpecHelper.cs +++ b/wms/SpecHelper.cs @@ -77,7 +77,7 @@ var log = JsonConvert.SerializeObject(model); if (model != null) { - model.EXPIRATION = System.DateTime.Now.AddMinutes(GetExportTime(model.SPEC)); + model.EXPIRATION = System.DateTime.Now.AddHours(GetExportTime(model.SPEC)); if (db.Insertable<TN_EquipProDetail>(model).ExecuteCommand() > 0) { @@ -326,7 +326,7 @@ { db.Deleteable<TN_InventoryM>(target).ExecuteCommand(); } - model.EXPIRATION = System.DateTime.Now.AddMinutes(GetExportTime(model.SPEC)); + model.EXPIRATION = System.DateTime.Now.AddHours(GetExportTime(model.SPEC)); if (db.Insertable<TN_InventoryM>(model).ExecuteCommand() > 0) { LogHelper.Info($"鎻掑叆WMS搴撳瓨鏄庣粏鎴愬姛锛寋log}"); @@ -368,7 +368,14 @@ LogHelper.Info($"鏇存柊WMS搴撳瓨鏄庣粏鐨勫叆搴撴椂闂达紝澶辫触锛屽鍣ㄥ彿锛歿cntId}"); } } - + else + { + LogHelper.Info($"鏇存柊WMS搴撳瓨鏄庣粏鐨勫叆搴撴椂闂达紝澶辫触锛屽鍣ㄥ彿锛歿cntId}锛孴N_InventoryM涓虹┖"); + } + } + else + { + LogHelper.Info($"鏇存柊WMS搴撳瓨鏄庣粏鐨勫叆搴撴椂闂达紝澶辫触锛屽鍣ㄥ彿锛歿cntId}锛孴N_CG_Detail涓虹┖"); } } catch (Exception ex) @@ -399,5 +406,30 @@ LogHelper.Error("鏇存柊WMS搴撳瓨鏄庣粏鐨勮繃鏈熸椂闂村け璐�, ex); } } + + public static int CalculateDaysDifference(DateTime start, DateTime end) + { + try + { + // 璁$畻鎬绘椂闂村樊 + TimeSpan difference = end - start; + + // 濡傛灉宸�涓鸿礋锛坋nd鏃╀簬start锛夛紝杩斿洖0 + if (difference.TotalDays < 0) + { + return 0; + } + + // 鑾峰彇鎬诲ぉ鏁帮紙鍖呮嫭灏忔暟閮ㄥ垎锛�+ double totalDays = difference.TotalDays; + + // 鍚戜笂鍙栨暣 + return (int)Math.Ceiling(totalDays); + } + catch (Exception ex) + { + return 0; + } + } } } -- Gitblit v1.9.1