From 74ab8260224fd69add7b0b7c98ad139b28136334 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期一, 01 十二月 2025 08:38:52 +0800
Subject: [PATCH] 提交

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Jobs/InventoryLockJob.cs |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Jobs/InventoryLockJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Jobs/InventoryLockJob.cs"
index 248f47e..495eef0 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Jobs/InventoryLockJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Jobs/InventoryLockJob.cs"
@@ -1,5 +1,9 @@
 锘縰sing Quartz;
 using SqlSugar;
+using SqlSugar.Extensions;
+using WIDESEA_Common.StockEnum;
+using WIDESEA_Model.Models;
+using WIDESEA_Model.Models.Basic;
 
 namespace WIDESEA_WMSServer.Jobs
 {
@@ -16,7 +20,24 @@
         }
         public Task Execute(IJobExecutionContext context)
         {
-           return Task.CompletedTask;
+
+            // 绗竴姝ワ細鏇存柊ValidDate鐨勫師鐢烻QL锛圫QL Server锛�
+            string updateSql = @"
+    UPDATE s
+    SET s.ValidDate = DATEADD(DAY, m.ValidityDays, s.CreateDate)
+    FROM Dt_StockInfoDetail s
+    INNER JOIN Dt_MaterialExpirationDate m ON SUBSTRING(s.MaterielCode, 1, 6) = m.MaterialCode
+    WHERE s.ValidDate IS NULL";
+            int updateValidDateResult = _db.Ado.ExecuteCommand(updateSql);
+
+            // 绗簩姝ワ細鏇存柊杩囨湡鐘舵�佺殑鍘熺敓SQL
+            string updateStatusSql = @"
+    UPDATE Dt_StockInfoDetail
+    SET Status = 98
+    WHERE ValidDate IS NOT NULL AND ValidDate < GETDATE()";
+            int updateStatusResult = _db.Ado.ExecuteCommand(updateStatusSql);
+
+            return Task.CompletedTask;
         }
     }
 }

--
Gitblit v1.9.3