From 027b75833ae1bc3bd1bb597b18c65c9177fa62d4 Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期三, 17 十二月 2025 12:10:18 +0800
Subject: [PATCH] 1.WMS中添加自动打印开关

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs"
index f938292..5984e31 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/AspNetCoreSchedule.cs"
@@ -1,4 +1,5 @@
 锘縰sing 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);

--
Gitblit v1.9.3