From 266e4bf654c55ce2f7e9271048e4625f1b8b49f6 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期一, 29 十二月 2025 14:36:08 +0800
Subject: [PATCH] Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Jobs/InventoryLockJob.cs | 26 +++++++-------------------
1 files changed, 7 insertions(+), 19 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 495eef0..240cea6 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"
@@ -4,37 +4,25 @@
using WIDESEA_Common.StockEnum;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Basic;
+using WIDESEA_WMSServer.Jobs;
-namespace WIDESEA_WMSServer.Jobs
+namespace WIDESEA_WMSServer
{
[DisallowConcurrentExecution]
public class InventoryLockJob : IJob
{
- private readonly ILogger<ErpJob> _logger;
private readonly ISqlSugarClient _db;
- public InventoryLockJob(ILogger<ErpJob> logger, ISqlSugarClient db )
+ public InventoryLockJob(ISqlSugarClient db)
{
- _logger = logger;
_db = db;
-
}
public Task Execute(IJobExecutionContext context)
{
-
- // 绗竴姝ワ細鏇存柊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()";
+ UPDATE Dt_StockInfoDetail
+ SET Status = 98
+ WHERE ValidDate IS NOT NULL AND ValidDate < GETDATE()
+ AND Status = 6";
int updateStatusResult = _db.Ado.ExecuteCommand(updateStatusSql);
return Task.CompletedTask;
--
Gitblit v1.9.3