From 266e4bf654c55ce2f7e9271048e4625f1b8b49f6 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期一, 29 十二月 2025 14:36:08 +0800
Subject: [PATCH] Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs |   55 ++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 34 insertions(+), 21 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 d5dd7a6..67a1cdf 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"
@@ -43,12 +43,13 @@
         private readonly ILocationInfoService _locationInfoService;
         private readonly IDailySequenceService _dailySequenceService;
         private readonly IMaterialUnitService _materialUnitService;
+        private readonly IRepository<Dt_MaterielInfo> _materialInfoRepository;
         private readonly IOutStockLockInfoService _outStockLockInfoService;
         private readonly IOutboundOrderDetailService _outboundOrderDetailService;
         private readonly IRepository<Dt_Task> _taskRepository;
         private readonly ITask_HtyService _task_HtyService;
         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, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderDetailService outboundOrderDetailService, IRepository<Dt_Task> taskRepository, ITask_HtyService task_HtyService) : base(service)
+        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, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderDetailService outboundOrderDetailService, IRepository<Dt_Task> taskRepository, ITask_HtyService task_HtyService, IRepository<Dt_MaterielInfo> materialInfoRepository) : base(service)
         {
             this.erpApiService = erpApiService;
             _invokeMESService = invokeMESService;
@@ -62,11 +63,15 @@
             _outboundOrderDetailService = outboundOrderDetailService;
             _taskRepository = taskRepository;
             _task_HtyService = task_HtyService;
+            _materialInfoRepository = materialInfoRepository;
         }
 
         [HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate]
         public async Task<WebResponseContent> Test()
         {
+
+            //var seq = await _dailySequenceService.GetNextSequenceAsync();
+            //var SDDD= "WSLOT" + DateTime.Now.ToString("yyyyMMdd") + seq.ToString()?.PadLeft(5, '0');
 
             //var originalTask = _taskRepository.Db.Queryable<Dt_Task>().First();
 
@@ -91,23 +96,23 @@
             //var  ddddssss = "WSLOT" + DateTime.Now.ToString("yyyyMMddHHmmss") + ssss.ToString().PadLeft(5, '0');
             //erpApiService.GetSuppliersAsync();
 
-            erpApiService.GetMaterialUnitAsync();
+            // erpApiService.GetMaterialUnitAsync();
 
-            var sss = await _invokeMESService.NewMaterielToMes(new WIDESEA_DTO.Basic.MaterielToMesDTO
-            {
-                reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
-                reqCode = Guid.NewGuid().ToString(),
-                oldmaterialCode = "b001",
-                newmaterialCode = "Bar01",
-                unit = "A01",
-                operationType = 1,
-                supplyCode = "A0001",
-                batchNo = "A0002",
-                materialCode = "FC00001",
-                warehouseCode = "",
-                factoryArea = "A01",
-                qty =20,
-            });
+            //var sss = await _invokeMESService.NewMaterielToMes(new WIDESEA_DTO.Basic.MaterielToMesDTO
+            //{
+            //    reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
+            //    reqCode = Guid.NewGuid().ToString(),
+            //    oldmaterialCode = "b001",
+            //    newmaterialCode = "Bar01",
+            //    unit = "A01",
+            //    operationType = 1,
+            //    supplyCode = "A0001",
+            //    batchNo = "A0002",
+            //    materialCode = "FC00001",
+            //    warehouseCode = "",
+            //    factoryArea = "A01",
+            //    qty =20,
+            //});
 
             //await _eSSApiService.MoveContainerAsync(new WIDESEA_DTO.Basic.MoveContainerRequest
             //{
@@ -144,7 +149,7 @@
                 Dt_InboundOrder dt_InboundOrder = new Dt_InboundOrder() { Details = new List<Dt_InboundOrderDetail>() };
                 foreach (var detailitem in item.details)
                 {
-
+                    var materialName = _materialInfoRepository.QueryFirst(x => x.MaterielCode == detailitem.materialCode).MaterielName;
                     if (detailitem.barcodes != null && detailitem.barcodes.Any())
                     {
                         foreach (var barcode in detailitem.barcodes)
@@ -153,6 +158,7 @@
                             {
                                 lineNo = detailitem.lineNo,
                                 MaterielCode = detailitem.materialCode,
+                                MaterielName = materialName,
                                 SupplyCode = detailitem.supplyCode,
                                 BatchNo = detailitem.batchNo,
                                 Unit = detailitem.unit,
@@ -181,6 +187,7 @@
                             OrderQuantity = detailitem.qty,
                             BarcodeUnit = detailitem.unit,
                             BarcodeQty = detailitem.qty,
+                            MaterielName = materialName
                         };
                         dt_InboundOrder.Details.Add(inboundOrderDetail);
                     }
@@ -214,10 +221,16 @@
 
         }
 
-        [HttpPost, Route("UndoPalletGroup"), AllowAnonymous, MethodParamsValidate]
-        public WebResponseContent UndoPalletGroup(string palletCode)
+        [HttpPost, Route("UnPalletGroupBarcode"), AllowAnonymous, MethodParamsValidate]
+        public WebResponseContent UnPalletGroupBarcode(string orderNo)
         {
-            return Service.UndoPalletGroup(palletCode);
+            return Service.UnPalletGroupBarcode(orderNo);
+        }
+
+        [HttpPost, Route("UndoPalletGroup"), AllowAnonymous, MethodParamsValidate]
+        public WebResponseContent UndoPalletGroup(string palletCode,string barcode="")
+        {
+            return Service.UndoPalletGroup(palletCode,barcode);
         }
         /// <summary>
         /// 

--
Gitblit v1.9.3