From a83781bc4e66b8b3bf19fb371d7da7bede0a5b25 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期一, 01 十二月 2025 13:55:45 +0800
Subject: [PATCH] 提交

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs |   38 ++++++++++++++++++++++++++------------
 1 files changed, 26 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_TaskInfoService/TaskService.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_TaskInfoService/TaskService.cs"
index bcdc51f..c391d2d 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_TaskInfoService/TaskService.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_TaskInfoService/TaskService.cs"
@@ -95,7 +95,7 @@
 
         public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList();
 
-        public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService) : base(BaseDal)
+        public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository) : base(BaseDal)
         {
             _mapper = mapper;
             _unitOfWorkManage = unitOfWorkManage;
@@ -113,6 +113,7 @@
             _invokeMESService = invokeMESService;
             _outStockLockInfoService = outStockLockInfoService;
             _allocateService = allocateService;
+            _OutboundBatchRepository = outboundBatchRepository;
         }
 
 
@@ -277,7 +278,7 @@
                         if (inboundOrder != null && inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt())
                         {
                             var allocate = _allocateService.Repository.QueryData(x => x.OrderNo == inboundOrder.InboundOrderNo).First();
-                            var feedmodel = new AllocateDto
+                            var allocatefeedmodel = new AllocateDto
                             {
                                 ReqCode = Guid.NewGuid().ToString(),
                                 ReqTime = DateTime.Now.ToString(),
@@ -310,9 +311,9 @@
                                        Unit = row.Unit
                                    }).ToList()
                                }).ToList();
-                            feedmodel.Details = groupedData;
+                            allocatefeedmodel.Details = groupedData;
 
-                            var result = await _invokeMESService.FeedbackAllocate(feedmodel);
+                            var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel);
                             if (result != null && result.code == 200)
                             {
                                 _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 })
@@ -324,6 +325,13 @@
                     }
                     else if (inboundOrder.OrderType == InOrderTypeEnum.ReCheck.ObjToInt()) //閲嶆鍏ュ簱
                     {
+
+                    }
+                    else if (inboundOrder.OrderType == InOrderTypeEnum.InternalAllocat.ObjToInt()) //鏅轰粨璋冩櫤浠�
+                    {
+                        _logger.LogInformation($"InboundTaskCompleted 鍥炲啓MES  : {inboundOrder.InboundOrderNo }  ,ordertype: {InOrderTypeEnum.InternalAllocat.ObjToInt()} "  );
+
+
 
                     }
                     else
@@ -384,6 +392,13 @@
             return WebResponseContent.Instance.OK();
         }
 
+
+        public async Task<WebResponseContent> OutAllocateTaskCompleted(Dt_Task task)
+        {
+            _logger.LogInformation($"TaskService  OutAllocateTaskCompleted: {task.TaskNum}");
+
+           return  await OutboundTaskCompleted(task);          
+        }
         public async Task<WebResponseContent> OutboundTaskCompleted(Dt_Task task)
         {
             _logger.LogInformation($"TaskService  OutboundTaskCompleted: {task.TaskNum}");
@@ -585,6 +600,7 @@
                 bool allCompleted = true;
                 foreach (var detail in orderDetails)
                 {
+                    _logger.LogInformation($"TaskService  HandleOutboundOrderToMESCompletion: {outboundOrder.OrderNo} , {detail.NeedOutQuantity}");
                     if (detail.OverOutQuantity < detail.NeedOutQuantity)
                     {
                         allCompleted = false;
@@ -609,7 +625,7 @@
                     if (outboundOrder.OrderType == OutOrderTypeEnum.Allocate.ObjToInt())
                     {
                         var allocate = _allocateService.Repository.QueryData(x => x.UpperOrderNo == outboundOrder.UpperOrderNo).First();
-                        var feedmodel = new AllocateDto
+                        var allocatefeedmodel = new AllocateDto
                         {
                             ReqCode = Guid.NewGuid().ToString(),
                             ReqTime = DateTime.Now.ToString(),
@@ -652,10 +668,9 @@
                                 }).ToList()
                             };
 
-                            feedmodel.Details.Add(detailModel);
+                            allocatefeedmodel.Details.Add(detailModel);
                         }
-
-                        var result = await _invokeMESService.FeedbackAllocate(feedmodel);
+                        var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel);
                         if (result != null && result.code == 200)
                         {
                             await _outboundOrderDetailService.Db.Updateable<Dt_OutboundOrderDetail>()
@@ -672,7 +687,7 @@
                     }
                     else if (outboundOrder.OrderType == OutOrderTypeEnum.ReCheck.ObjToInt())
                     {
-
+                        //涓嶇敤鍥炰紶
                     }
                     else
                     {
@@ -713,14 +728,13 @@
                                     barcode = lockInfo.CurrentBarcode,
                                     supplyCode = lockInfo.SupplyCode,
                                     batchNo = lockInfo.BatchNo,
-                                    unit = lockInfo.Unit,
-                                    qty = lockInfo.PickedQty // 鏉$爜绾у埆鐨勬暟閲忎粛鐢ㄩ攣瀹氳褰�
+                                    unit = lockInfo.BarcodeUnit,
+                                    qty = lockInfo.BarcodeQty // 鏉$爜绾у埆鐨勬暟閲忎粛鐢ㄩ攣瀹氳褰�
                                 }).ToList()
                             };
 
                             feedmodel.details.Add(detailModel);
                         }
-
                         var result = await _invokeMESService.FeedbackOutbound(feedmodel);
                         if (result != null && result.code == 200)
                         {

--
Gitblit v1.9.3