From c3d2666ddfe09fd79ccff9782e4cbba6cab35547 Mon Sep 17 00:00:00 2001 From: 杨张扬 <634643841@qq.com> Date: 星期二, 10 六月 2025 18:03:17 +0800 Subject: [PATCH] 库存管理的过期天数要改为过期小时、取消的任务不计入库存管理 --- wms/SpecHelper.cs | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/wms/SpecHelper.cs b/wms/SpecHelper.cs index 7779c2a..9803712 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}"); @@ -407,6 +407,12 @@ } } + /// <summary> + /// 璁$畻鏃堕棿宸�+ /// </summary> + /// <param name="start"></param> + /// <param name="end"></param> + /// <returns></returns> public static int CalculateDaysDifference(DateTime start, DateTime end) { try @@ -420,11 +426,12 @@ return 0; } - // 鑾峰彇鎬诲ぉ鏁帮紙鍖呮嫭灏忔暟閮ㄥ垎锛�- double totalDays = difference.TotalDays; + + // 鑾峰彇鎬诲皬鏃舵暟锛堝寘鎷皬鏁伴儴鍒嗭級 + double totalHours = difference.TotalHours; // 鍚戜笂鍙栨暣 - return (int)Math.Ceiling(totalDays); + return (int)Math.Ceiling(totalHours); } catch (Exception ex) { -- Gitblit v1.9.1