From 97a9ad53c6d1ac097f46f0b5d4d4d53547c9efe4 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期五, 21 十一月 2025 16:18:21 +0800
Subject: [PATCH] 1

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/ERPStockInfoService.cs |  114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 111 insertions(+), 3 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/ERPStockInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/ERPStockInfoService.cs"
index 73ca89d..8946b57 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/ERPStockInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/ERPStockInfoService.cs"
@@ -1,4 +1,5 @@
-锘縰sing SharpCompress.Compressors.ADC;
+锘縰sing MailKit.Search;
+using SharpCompress.Compressors.ADC;
 using SqlSugar;
 using System;
 using System.Collections.Generic;
@@ -6,17 +7,26 @@
 using System.Linq.Expressions;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEA_DTO.ERP;
+using WIDESEA_IOrderRepository;
+using WIDESEA_IOrderServices;
 using WIDESEA_IStorageBasicServices.Stock;
 using WIDESEA_Model.Models.ERP;
+using WIDESEA_Model.Models.Order;
+using WIDESEA_OrderRepository;
 
 namespace WIDESEA_StorageBasicServices
 {
-    public partial class ERPStockInfoService: IERPStockInfoService
+    public partial class ERPStockInfoService : IERPStockInfoService
     {
         private readonly IUnitOfWorkManage _unitOfWorkManage;
-        public ERPStockInfoService(IUnitOfWorkManage unitOfWorkManage)
+        private readonly IDt_InboundOrderService _inboundOrderService;
+        private readonly IDt_InboundOrderRepository _inboundOrderRepository;
+        public ERPStockInfoService(IUnitOfWorkManage unitOfWorkManage, IDt_InboundOrderService inboundOrderService, IDt_InboundOrderRepository inboundOrderRepository)
         {
             _unitOfWorkManage = unitOfWorkManage;
+            _inboundOrderService = inboundOrderService;
+            _inboundOrderRepository = inboundOrderRepository;
         }
         public virtual PageGridData<WMS_鐢ㄥ弸搴撳瓨涓�瑙堣〃_ST> GetPageData(PageDataOptions options)
         {
@@ -28,5 +38,103 @@
                 .ToPageList(options.Page, options.Rows, ref totalCount);
             return new PageGridData<WMS_鐢ㄥ弸搴撳瓨涓�瑙堣〃_ST>(totalCount, data);
         }
+        public WebResponseContent printOrderNo(List<WMS_鐢ㄥ弸搴撳瓨涓�瑙堣〃_ST> models)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                List<Dt_InboundOrder> inboundOrders = new List<Dt_InboundOrder>();
+                foreach (var model in models)
+                {
+                    Dt_InboundOrder inboundOrder = new Dt_InboundOrder()
+                    {
+                        OrderNo = _inboundOrderService.GetOrderPintCode("OrderNoIn"),
+                        UpperOrderNo = "",
+                        DemandClassification = "",
+                        OrderType = "鎵嬪姩寤哄崟",
+                        WareHouseId = model.浠撳簱缂栫爜,
+                        WarehouseName = model.浠撳簱鍚嶇О,
+                        Datetime = DateTime.Now.ToString(),
+                        LineNumber = 0,
+                        ProductDrawingNumber = model.浜у搧鍥惧彿,
+                        MaterialNo = model.鏂欏彿,
+                        MaterialName = model.鍝佸悕,
+                        Weight = model.鍗曢噸,
+                        Specs = model.瑙勬牸,
+                        Unit = model.鍗曚綅,
+                        Texture = model.鐢ㄥ弸鏉愯川,
+                        Quantity = model.搴撳瓨鏁伴噺
+                    };
+                    inboundOrders.Add(inboundOrder);
+                }
+                _inboundOrderRepository.AddData(inboundOrders);
+                _inboundOrderService.PrintInbound(inboundOrders);
+                return content.OK("鎵撳嵃鎴愬姛");
+            }
+            catch (Exception ex)
+            {
+                return content.Error("鎵撳嵃澶辫触锛岃鑱旂郴绠$悊鍛�");
+            }
+        }
+
+        public WebResponseContent SplitprintOrderNo(int num, WMS_鐢ㄥ弸搴撳瓨涓�瑙堣〃_ST model)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                if (model == null || model.搴撳瓨鏁伴噺 < num || model.搴撳瓨鏁伴噺 - num == 0)
+                {
+                    return content.Error("鎷嗗垎涓嶅悎娉�");
+                }
+                List<Dt_InboundOrder> inboundOrders = new List<Dt_InboundOrder>()
+                {
+                    new Dt_InboundOrder()
+                    {
+                        OrderNo = _inboundOrderService.GetOrderPintCode("OrderNoIn"),
+                        UpperOrderNo = "",
+                        DemandClassification = "",
+                        OrderType = "鎵嬪姩寤哄崟",
+                        WareHouseId = model.浠撳簱缂栫爜,
+                        WarehouseName = model.浠撳簱鍚嶇О,
+                        Datetime = DateTime.Now.ToString(),
+                        LineNumber = 0,
+                        ProductDrawingNumber = model.浜у搧鍥惧彿,
+                        MaterialNo = model.鏂欏彿,
+                        MaterialName = model.鍝佸悕,
+                        Weight = model.鍗曢噸,
+                        Specs = model.瑙勬牸,
+                        Unit = model.鍗曚綅,
+                        Texture = model.鐢ㄥ弸鏉愯川,
+                        Quantity = model.搴撳瓨鏁伴噺-num
+                    },
+                    new Dt_InboundOrder()
+                    {
+                        OrderNo = _inboundOrderService.GetOrderPintCode("OrderNoIn"),
+                        UpperOrderNo = "",
+                        DemandClassification = "",
+                        OrderType = "鎵嬪姩寤哄崟",
+                        WareHouseId = model.浠撳簱缂栫爜,
+                        WarehouseName = model.浠撳簱鍚嶇О,
+                        Datetime = DateTime.Now.ToString(),
+                        LineNumber = 0,
+                        ProductDrawingNumber = model.浜у搧鍥惧彿,
+                        MaterialNo = model.鏂欏彿,
+                        MaterialName = model.鍝佸悕,
+                        Weight = model.鍗曢噸,
+                        Specs = model.瑙勬牸,
+                        Unit = model.鍗曚綅,
+                        Texture = model.鐢ㄥ弸鏉愯川,
+                        Quantity = num
+                    }
+                };
+                _inboundOrderRepository.AddData(inboundOrders);
+                _inboundOrderService.PrintInbound(inboundOrders);
+                return content.OK("鎵撳嵃鎴愬姛");
+            }
+            catch (Exception ex)
+            {
+                return content.Error("鎵撳嵃澶辫触锛岃鑱旂郴绠$悊鍛�");
+            }
+        }
     }
 }

--
Gitblit v1.9.3