ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs
@@ -107,6 +107,9 @@ [Description("å·²æ¸ ç")] å·²æ¸ ç = 33, [Description("æå¨è§£é")] æå¨è§£é = 66, [Description("è¿æ")] è¿æ =98, ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs
@@ -134,7 +134,6 @@ OrderNo = inboundOrder.InboundOrderNo, BusinessType = inboundOrder.BusinessType, ValidDate = inboundOrder.BusinessType == BusinessTypeEnum.å¤é¨ä»åºè°æºä».ToString() ? item.ValidDate : datevaliDate == null ? null : Convert.ToDateTime(DateTime.Now).AddDays(Convert.ToDouble(datevaliDate.ValidityDays)), //ValidDate = datevaliDate == null ? null : DateTime.Now.AddDays(datevaliDate.ValidityDays), }); item.ReceiptQuantity = item.BarcodeQty; ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs
@@ -549,7 +549,7 @@ private List<Dt_StockInfo> BuildStockQueryWithInfo(MaterielOutboundCalculationDTO materielCalc, string factoryArea) { // åºç¡æ¥è¯¢æ¡ä»¶ï¼ç©æç¼å·ãæ¹æ¬¡å·ï¼å¦ææä¾ï¼ãåºåæ°é>0 ISugarQueryable<Dt_StockInfoDetail> stockDetails = _stockDetailRepository.Db.Queryable<Dt_StockInfoDetail>().Where(x => x.MaterielCode == materielCalc.MaterielCode && x.StockQuantity > 0); ISugarQueryable<Dt_StockInfoDetail> stockDetails = _stockDetailRepository.Db.Queryable<Dt_StockInfoDetail>().Where(x => x.MaterielCode == materielCalc.MaterielCode && x.StockQuantity > 0 && (x.Status == (int)StockStatusEmun.å ¥åºå®æ || x.Status == (int)StockStatusEmun.æå¨è§£é)); // æ ¹æ®æ¡ä»¶æ·»å ä¾åºåç¼å·å¹é ï¼ä¸ä¸ºç©ºæ¶æéè¦å¹é ï¼ if (!string.IsNullOrEmpty(materielCalc.SupplyCode)) ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/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çåçSQLï¼SQL 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; ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Jobs/QuartzJobMildd.cs
@@ -34,6 +34,19 @@ Name = "AgvTaskJob", TriggerType = 0 }, new TasksQz() { Id = 2, AssemblyName = "WIDESEA_WMSServer", ClassName = "InventoryLockJob", CreateTime = DateTime.Now, IntervalSecond = 3, IsDeleted = false, IsStart = false, JobGroup = "WIDESEA_WMSServer", Name = "InventoryLockJob", TriggerType = 0 }, }; foreach (var item in allQzServices) ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
@@ -188,6 +188,7 @@ }); builder.Services.AddSingleton<IJobFactory, JobFactory>(); builder.Services.AddTransient<AgvTaskJob>();//Job使ç¨ç¬æ¶ä¾èµæ³¨å ¥ builder.Services.AddTransient<InventoryLockJob>();//Job使ç¨ç¬æ¶ä¾èµæ³¨å ¥ builder.Services.AddSingleton<ISchedulerCenter, SchedulerCenterServer>(); builder.Services.AddQuartz(q => @@ -202,13 +203,13 @@ .WithIdentity("ErpJob-trigger") .WithCronSchedule("0 0 10,14,20 * * ?")); var inventoryLockJobKey = new JobKey("InventoryLockJob"); q.AddJob<InventoryLockJob>(opts => opts.WithIdentity(inventoryLockJobKey)); //var inventoryLockJobKey = new JobKey("InventoryLockJob"); //q.AddJob<InventoryLockJob>(opts => opts.WithIdentity(inventoryLockJobKey)); q.AddTrigger(opts => opts .ForJob(inventoryLockJobKey) .WithIdentity("InventoryLockJob-trigger") .WithCronSchedule("0 0/10 * * * ?")); // æ¯10åéæ§è¡ä¸æ¬¡ //q.AddTrigger(opts => opts // .ForJob(inventoryLockJobKey) // .WithIdentity("InventoryLockJob-trigger") // .WithCronSchedule("0 0/10 * * * ?")); // æ¯10åéæ§è¡ä¸æ¬¡ }); builder.Services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true);