From 07774c70a65bed6bacf936bdd66f756ba9c7f266 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期二, 02 十二月 2025 10:15:48 +0800
Subject: [PATCH] 提交

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs |   77 ++++++++++++++++++++++++++++++++------
 1 files changed, 65 insertions(+), 12 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs"
index d00daf2..d17e070 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs"
@@ -2,9 +2,11 @@
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
 using SqlSugar;
 using System.Net;
 using System.Threading.Tasks;
+using WIDESEA_BasicService;
 using WIDESEA_Common.OrderEnum;
 using WIDESEA_Core;
 using WIDESEA_Core.Attributes;
@@ -28,18 +30,40 @@
         private readonly WIDESEA_IBasicService.IErpApiService erpApiService;
 
         private readonly WIDESEA_IBasicService.IInvokeMESService _invokeMESService;
-
+        public readonly IInboundService _inboundService;
         private readonly IESSApiService _eSSApiService;
-        public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService) : base(service)
+        private readonly ILocationInfoService _locationInfoService;
+        private readonly IDailySequenceService _dailySequenceService;
+        private readonly IMaterialUnitService _materialUnitService;
+        private readonly ILogger<InboundOrderController> _logger;
+        public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService, ILogger<InboundOrderController> logger, IMaterialUnitService materialUnitService, IInboundService inboundService) : base(service)
         {
             this.erpApiService = erpApiService;
             _invokeMESService = invokeMESService;
             _eSSApiService = eSSApiService;
+            _dailySequenceService = dailySequenceService;
+            _locationInfoService = locationInfoService;
+            _logger = logger;
+            _materialUnitService = materialUnitService;
+            _inboundService = inboundService;
         }
 
         [HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate]
         public async Task<WebResponseContent> Test()
         {
+
+            // Service.Db.Deleteable<Dt_InboundOrder>().Where(x=>x.UpperOrderNo== "12020251100040").ExecuteCommand();
+            //_inboundService.InboundOrderDetailService.Db.Deleteable<Dt_InboundOrderDetail>()
+            // .Where(p => SqlFunc.Subqueryable<Dt_InboundOrder>().Where(s => s.Id == p.OrderId && s.UpperOrderNo == "12020251100040").Any()).ExecuteCommand();
+
+            var purchaseToStockResult = await _materialUnitService.ConvertPurchaseToStockAsync("100513-00303", 1);
+
+            var pdddurchaseToStockResult = await _materialUnitService.ConvertFromToStockAsync("100513-00303", "W013", 1);
+
+            //var sddd = _locationInfoService.AssignLocation();
+            //var code = sddd.LocationCode;
+            //var ssss=await _dailySequenceService.GetNextSequenceAsync();
+            //var  ddddssss = "WSLOT" + DateTime.Now.ToString("yyyyMMddHHmmss") + ssss.ToString().PadLeft(5, '0');
             //erpApiService.GetSuppliersAsync();
 
             //erpApiService.GetMaterialUnitAsync();
@@ -59,12 +83,17 @@
             //      qty = "20.0",
             //  });
 
-            await _eSSApiService.MoveContainerAsync(new WIDESEA_DTO.Basic.MoveContainerRequest
-            {
-                slotCode = "3-5",
-                containerCode = "A000008006"
-            });
-            //  erpApiService.GetMaterialInfoAsy2nc(new WIDESEA_DTO.Basic.MaterialRequest());
+            //await _eSSApiService.MoveContainerAsync(new WIDESEA_DTO.Basic.MoveContainerRequest
+            //{
+            //    slotCode = "3-5",
+            //    containerCode = "A000008009"
+            //});
+
+            //await erpApiService.GetSuppliersAsync();
+            //await erpApiService.GetMaterialUnitAsync();
+            //await  erpApiService.GetMaterialInfoAsync(new WIDESEA_DTO.Basic.MaterialRequest());
+
+
             return WebResponseContent.Instance.OK();
         }
 
@@ -74,10 +103,14 @@
         /// <param name="model"></param>
         /// <returns></returns>
         [HttpPost, Route("ReceiveInboundOrder"), AllowAnonymous, MethodParamsValidate]
-        public WebResponseContent ReceiveInboundOrder([FromBody] InboundRequestModel model)
+        public async Task<WebResponseContent> ReceiveInboundOrder([FromBody] InboundRequestModel model)
         {
+            if(model.inBounds == null || !model.inBounds.Any())
+            {
+                return WebResponseContent.Instance.Error("鍏ュ簱鍗曚笉鑳戒负绌�");
+            }
 
-
+            _logger.LogInformation("InboundOrderController ReceiveInboundOrder:  " +  JsonConvert.SerializeObject(model));
             List<Dt_InboundOrder> inboundOrders = new List<Dt_InboundOrder>();
 
             foreach (var item in model.inBounds)
@@ -119,7 +152,9 @@
                             BatchNo = detailitem.batchNo,
                             Unit = detailitem.unit,
                             WarehouseCode = detailitem.warehouseCode,
-                            OrderQuantity = detailitem.qty
+                            OrderQuantity = detailitem.qty,
+                            BarcodeUnit = detailitem.unit,
+                            BarcodeQty = detailitem.qty,
                         };
                         dt_InboundOrder.Details.Add(inboundOrderDetail);
                     }
@@ -133,7 +168,7 @@
                 inboundOrders.Add(dt_InboundOrder);
             }
 
-            var content = Service.ReceiveInboundOrder(inboundOrders, model.operationType);
+            var content =await Service.ReceiveInboundOrder(inboundOrders, model.operationType);
 
             if (content.Status) return WebResponseContent.Instance.OK(200);
             else return WebResponseContent.Instance.Error(content.Message);
@@ -152,6 +187,12 @@
             return content;
 
         }
+
+        [HttpPost, Route("UndoPalletGroup"), AllowAnonymous, MethodParamsValidate]
+        public WebResponseContent UndoPalletGroup(string palletCode)
+        {
+            return Service.UndoPalletGroup(palletCode);
+        }
         /// <summary>
         /// 
         /// </summary>
@@ -166,5 +207,17 @@
 
         }
 
+        [HttpPost, Route("UnPalletQuantity"), AllowAnonymous, MethodParamsValidate]
+        public WebResponseContent UnPalletQuantity(string orderNo)
+        {
+            return Service.UnPalletQuantity(orderNo);
+        }
+
+        [HttpPost, Route("BatchOrderFeedbackToMes"), AllowAnonymous]
+        public async Task<WebResponseContent> BatchOrderFeedbackToMes([FromBody]  BatchOrderFeedbackToMesDto request)
+        {
+           return await _invokeMESService.BatchOrderFeedbackToMes(request.orderNos, request.inout);
+        }
+
     }
 }

--
Gitblit v1.9.3