yangpeixing
昨天 027b75833ae1bc3bd1bb597b18c65c9177fa62d4
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs
@@ -1,4 +1,5 @@
using AngleSharp.Dom;
using Magicodes.ExporterAndImporter.Excel.Utility.TemplateExport;
using MailKit.Search;
using Masuit.Tools;
using Microsoft.Extensions.Hosting;
@@ -39,7 +40,9 @@
        private readonly IDt_AllocateOutboundOrderService _allocateOutboundOrderService;
        private Timer _timer;
        public MyBackgroundService(ILogger<MyBackgroundService> logger, ILocationInfoRepository locationRepository, IStockInfoRepository stockInfoRepository,IDt_TaskRepository taskRepository,ISys_ConfigService configService,IDt_InboundOrderRepository inboundOrderRepository,IDt_AllocateOutboundOrderRepository allocateoutboundorderRepository,IDt_ProductionOutboundOrderRepository productionOutboundOrderRepository,IUnitOfWorkManage unitOfWorkManage, IDt_ProductionOutboundOrderService productionOutboundOrderService, IDt_AllocateOutboundOrderService allocateOutboundOrderService)
        private readonly PrintStatusContainer _printStatusContainer;
        public MyBackgroundService(ILogger<MyBackgroundService> logger, ILocationInfoRepository locationRepository, IStockInfoRepository stockInfoRepository,IDt_TaskRepository taskRepository,ISys_ConfigService configService,IDt_InboundOrderRepository inboundOrderRepository,IDt_AllocateOutboundOrderRepository allocateoutboundorderRepository,IDt_ProductionOutboundOrderRepository productionOutboundOrderRepository,IUnitOfWorkManage unitOfWorkManage, IDt_ProductionOutboundOrderService productionOutboundOrderService, IDt_AllocateOutboundOrderService allocateOutboundOrderService, PrintStatusContainer printStatusContainer)
        {
            _logger = logger;
            _locationRepository = locationRepository;
@@ -52,6 +55,11 @@
            _unitOfWorkManage = unitOfWorkManage;
            _productionOutboundOrderService = productionOutboundOrderService;
            _allocateOutboundOrderService = allocateOutboundOrderService;
            _printStatusContainer = printStatusContainer;
        }
        public MyBackgroundService()
        {
        }
        public Task StartAsync(CancellationToken cancellationToken)
@@ -88,7 +96,7 @@
                            MaterialNo = item.料号,
                            MaterialName = item.品名,
                            Weight = item.单重,
                            WareHouseId = item.存储地点ID,
                            WareHouseId = item.入库仓库编码,
                            Specs = item.规格,
                            Unit = item.单位,
                            Texture = item.用友材质,
@@ -118,6 +126,7 @@
                            x.Texture = item.用友材质;
                            x.Quantity = item.入库数量;
                            x.OrderStatus = item.单据状态;
                            x.WareHouseId = item.入库仓库编码;
                            inboundOrderUpdate.Add(x);
                        }
                    }
@@ -307,12 +316,18 @@
                if (inboundOrderAdd.Count > 0)
                {
                    PrintInbound(inboundOrderAdd);
                    if (_printStatusContainer.AutomaticPrint)
                    {
                        PrintInbound(inboundOrderAdd);
                    }
                    _inboundOrderRepository.AddData(inboundOrderAdd);
                }
                if (inboundOrderUpdate.Count > 0)
                {
                    PrintInbound(inboundOrderUpdate);
                    if (_printStatusContainer.AutomaticPrint)
                    {
                        PrintInbound(inboundOrderUpdate);
                    }
                    _inboundOrderRepository.UpdateData(inboundOrderUpdate);
                }
@@ -361,6 +376,8 @@
            return Task.CompletedTask;
        }
        public void PrintInbound(List<Dt_InboundOrder> orders)
        {
            var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);