| | |
| | | [Description("å·²æ¸
ç")] |
| | | å·²æ¸
ç = 33, |
| | | |
| | | [Description("æå¨è§£é")] |
| | | æå¨è§£é = 66, |
| | | |
| | | [Description("è¿æ")] |
| | | è¿æ =98, |
| | | |
| | |
| | | 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; |
| | |
| | | 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)) |
| | |
| | | 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()"; |
| | | WHERE ValidDate IS NOT NULL AND ValidDate < GETDATE() |
| | | AND Status = 6"; |
| | | int updateStatusResult = _db.Ado.ExecuteCommand(updateStatusSql); |
| | | |
| | | return Task.CompletedTask; |
| | |
| | | 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) |
| | |
| | | }); |
| | | builder.Services.AddSingleton<IJobFactory, JobFactory>(); |
| | | builder.Services.AddTransient<AgvTaskJob>();//Job使ç¨ç¬æ¶ä¾èµæ³¨å
¥ |
| | | builder.Services.AddTransient<InventoryLockJob>();//Job使ç¨ç¬æ¶ä¾èµæ³¨å
¥ |
| | | builder.Services.AddSingleton<ISchedulerCenter, SchedulerCenterServer>(); |
| | | |
| | | builder.Services.AddQuartz(q => |
| | |
| | | .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); |