From 927ce822017ff8459be84b742d519970ca614096 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期五, 24 十月 2025 17:18:56 +0800
Subject: [PATCH] 1

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs |  205 ++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 184 insertions(+), 21 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
index 9b5afe4..b6f7c0b 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
@@ -52,8 +52,8 @@
     private readonly IDt_AreaInfoRepository _areaInfoRepository; //鍖哄煙
     private readonly IDt_StationManagerRepository _stationManagerRepository;
     private readonly ISys_ConfigService _configService;
-    private readonly IDt_OutboundOrderRepository _outorderRepository;
-    private readonly IDt_OutboundOrderDetailRepository _outorderdetailRepository;
+    private readonly IDt_OtherOutboundOrderRepository _OtheroutorderRepository;
+    private readonly IDt_OtherOutboundOrderDetailRepository _OtheroutorderdetailRepository;
 
     public Dt_TaskService(IDt_TaskRepository BaseDal,
                                 IUnitOfWorkManage unitOfWorkManage,
@@ -68,8 +68,8 @@
                                 IStockInfoDetailRepository stockInfoDetailRepository,
                                 IDt_StationManagerRepository stationManagerRepository,
                                 ISys_ConfigService configService,
-                                IDt_OutboundOrderRepository outorderRepository,
-                                IDt_OutboundOrderDetailRepository outorderdetailRepository) : base(BaseDal)
+                                IDt_OtherOutboundOrderRepository OtheroutorderRepository,
+                                IDt_OtherOutboundOrderDetailRepository OtheroutorderdetailRepository) : base(BaseDal)
     {
         _unitOfWorkManage = unitOfWorkManage;
         _stockInfoRepository = stockInfoRepository;
@@ -83,8 +83,8 @@
         _stockInfoDetailRepository = stockInfoDetailRepository;
         _stationManagerRepository = stationManagerRepository;
         _configService = configService;
-        _outorderRepository = outorderRepository;
-        _outorderdetailRepository = outorderdetailRepository;
+        _OtheroutorderRepository = OtheroutorderRepository;
+        _OtheroutorderdetailRepository = OtheroutorderdetailRepository;
     }
 
     #region 澶栭儴鎺ュ彛鏂规硶
@@ -519,11 +519,11 @@
         Dt_Task taskNew = new Dt_Task();
         if (StartAddress.Floor != location.Floor)
         {
-            taskNew = RequestAcrossFloorTask(StartAddress, location, (int)TaskInboundTypeEnum.Inbound, taskDto.PalletCode);
+            taskNew = RequestAcrossFloorTask(StartAddress, location, (int)TaskInboundTypeEnum.Inbound, taskDto);
         }
         else
         {
-            taskNew = RequestAGVCarryTask(StartAddress, location, (int)TaskInboundTypeEnum.Inbound, taskDto.PalletCode);
+            taskNew = RequestAGVCarryTask(StartAddress, location, (int)TaskInboundTypeEnum.Inbound, taskDto);
         }
         return taskNew;
 
@@ -731,9 +731,9 @@
             Roadway = "SC1",
             TargetAddress = location.LocationCode,
             Dispatchertime = DateTime.Now,
-            MaterialNo = "",
+            MaterialNo = taskDto.MaterielCode,
             NextAddress = station.stationChildCode,
-            OrderNo = null,
+            OrderNo = taskDto.OrderNo,
             PalletCode = taskDto.PalletCode,
             SourceAddress = taskDto.Position,
             CurrentAddress = taskDto.Position,
@@ -756,11 +756,11 @@
         Dt_Task taskNew = new Dt_Task();
         if (StartAddress.Floor != location.Floor)
         {
-            taskNew = RequestAcrossFloorTask(StartAddress, location, taskDto.TaskType, taskDto.PalletCode);
+            taskNew = RequestAcrossFloorTask(StartAddress, location, taskDto.TaskType, taskDto);
         }
         else
         {
-            taskNew = RequestAGVCarryTask(StartAddress, location, taskDto.TaskType, taskDto.PalletCode);
+            taskNew = RequestAGVCarryTask(StartAddress, location, taskDto.TaskType,  taskDto);
         }
         return taskNew;
 
@@ -834,7 +834,7 @@
     #endregion
 
     #region 璇锋眰璺ㄦゼ灞備换鍔�
-    public Dt_Task RequestAcrossFloorTask(DtLocationInfo StartAddress, DtLocationInfo EndAddress, int TaskType, string palletCode)
+    public Dt_Task RequestAcrossFloorTask(DtLocationInfo StartAddress, DtLocationInfo EndAddress, int TaskType,  RequestTaskDto taskDto)
     {
         WebResponseContent content = new WebResponseContent();
 
@@ -845,10 +845,10 @@
             Roadway = "AGV",
             TargetAddress = EndAddress.LocationCode,
             Dispatchertime = DateTime.Now,
-            MaterialNo = "",
+            MaterialNo = taskDto.MaterielCode,
             NextAddress = next.stationChildCode,
-            OrderNo = null,
-            PalletCode = palletCode,
+            OrderNo = taskDto.OrderNo,
+            PalletCode = taskDto.PalletCode,
             SourceAddress = StartAddress.LocationCode,
             CurrentAddress = StartAddress.LocationCode,
             TaskState = (int)TaskAcrossFloorStatusEnum.CarryNew,
@@ -865,7 +865,7 @@
     #endregion
 
     #region 璇锋眰AGV鎼繍浠诲姟
-    public Dt_Task RequestAGVCarryTask(DtLocationInfo StartAddress, DtLocationInfo EndAddress, int TaskType, string palletCode)
+    public Dt_Task RequestAGVCarryTask(DtLocationInfo StartAddress, DtLocationInfo EndAddress, int TaskType, RequestTaskDto taskDto)
     {
         WebResponseContent content = new WebResponseContent();
 
@@ -875,10 +875,10 @@
             Roadway = "AGV",
             TargetAddress = EndAddress.LocationCode,
             Dispatchertime = DateTime.Now,
-            MaterialNo = "",
+            MaterialNo = taskDto.MaterielCode,
             NextAddress = EndAddress.LocationCode,
-            OrderNo = null,
-            PalletCode = palletCode,
+            OrderNo = taskDto.OrderNo,
+            PalletCode = taskDto.PalletCode,
             SourceAddress = StartAddress.LocationCode,
             CurrentAddress = StartAddress.LocationCode,
             TaskState = (int)TaskAGVCarryStatusEnum.CarryNew,
@@ -1159,7 +1159,54 @@
         return wcsBasez + address;
     }
 
-    public async Task<WebResponseContent> SendERPTaskCompletion(string palletCode)
+    /// <summary>
+    /// 鐢熶骇棰嗘枡
+    /// </summary>
+    /// <param name="palletCode"></param>
+    /// <returns></returns>
+    public async Task<WebResponseContent> ERPProduction(string palletCode)
+    {
+        WebResponseContent content = new WebResponseContent();
+        try
+        {
+            DtStockInfo stock = await _stockInfoRepository.QueryFirstNavAsync(x => x.PalletCode == palletCode);
+            Dt_Task task = await BaseDal.QueryFirstAsync(x => x.PalletCode == palletCode);
+            MaterialRequisition allocate = new MaterialRequisition
+            {
+                context = new Context
+                {
+                    CultureName = "zh-CN",
+                    EntCode = "001",
+                    OrgCode = "102",
+                    UserCode = "MH0551"
+                },
+                documentTypeCode = "TransIn002",
+                businessDate = DateTime.Now.ToString("yyyy-MM-dd"),
+                isApproved = true,
+
+                issueList = new List<issueList>()
+                {
+                    new issueList
+                    {
+                        PickListID = task.OrderNo,
+                        WhCode = "204",
+                        IssueQty = task.OrderNo,
+                    }
+                }
+            };
+            return content.OK(data: allocate);
+        }
+        catch (Exception ex)
+        {
+            return content.Error(ex.Message);
+        }
+    }
+    /// <summary>
+    /// 璋冩嫧
+    /// </summary>
+    /// <param name="palletCode"></param>
+    /// <returns></returns>
+    public async Task<WebResponseContent> ERPAllocate(string palletCode)
     {
         WebResponseContent content = new WebResponseContent();
         try
@@ -1193,7 +1240,123 @@
             return content.Error(ex.Message);
         }
     }
+    /// <summary>
+    /// 鏉傚彂
+    /// </summary>
+    /// <param name="palletCode"></param>
+    /// <returns></returns>
+    public async Task<WebResponseContent> ERPMixedSend(string palletCode)
+    {
+        WebResponseContent content = new WebResponseContent();
+        try
+        {
+            DtStockInfo stock = await _stockInfoRepository.QueryFirstNavAsync(x => x.PalletCode == palletCode);
+            Allocate allocate = new Allocate
+            {
+                context = new Context
+                {
+                    CultureName = "zh-CN",
+                    EntCode = "001",
+                    OrgCode = "102",
+                    UserCode = "MH0551"
+                },
+                documentTypeCode = "TransIn002",
+                businessDate = DateTime.Now.ToString("yyyy-MM-dd"),
+                isApproved = true,
 
+                transferInList = stock.StockInfoDetails.Select(item => new transferInList
+                {
+                    ItemCode = item.MaterielCode,
+                    TransInWHCode = item.Warehouse,
+                    TransInQty = item.Quantity,
+                    TransOutWHCode = "001",
+                }).ToList()
+            };
+            return content.OK(data: allocate);
+        }
+        catch (Exception ex)
+        {
+            return content.Error(ex.Message);
+        }
+    }
+    /// <summary>
+    /// 鏉傛敹
+    /// </summary>
+    /// <param name="palletCode"></param>
+    /// <returns></returns>
+    public async Task<WebResponseContent> ERPMixedReceive(string palletCode)
+    {
+        WebResponseContent content = new WebResponseContent();
+        try
+        {
+            DtStockInfo stock = await _stockInfoRepository.QueryFirstNavAsync(x => x.PalletCode == palletCode);
+            Allocate allocate = new Allocate
+            {
+                context = new Context
+                {
+                    CultureName = "zh-CN",
+                    EntCode = "001",
+                    OrgCode = "102",
+                    UserCode = "MH0551"
+                },
+                documentTypeCode = "TransIn002",
+                businessDate = DateTime.Now.ToString("yyyy-MM-dd"),
+                isApproved = true,
+
+                transferInList = stock.StockInfoDetails.Select(item => new transferInList
+                {
+                    ItemCode = item.MaterielCode,
+                    TransInWHCode = item.Warehouse,
+                    TransInQty = item.Quantity,
+                    TransOutWHCode = "001",
+                }).ToList()
+            };
+            return content.OK(data: allocate);
+        }
+        catch (Exception ex)
+        {
+            return content.Error(ex.Message);
+        }
+    }
+    /// <summary>
+    /// 閫�鏂�
+    /// </summary>
+    /// <param name="palletCode"></param>
+    /// <returns></returns>
+    public async Task<WebResponseContent> ERPreturnMaterialList(string palletCode)
+    {
+        WebResponseContent content = new WebResponseContent();
+        try
+        {
+            DtStockInfo stock = await _stockInfoRepository.QueryFirstNavAsync(x => x.PalletCode == palletCode);
+            Allocate allocate = new Allocate
+            {
+                context = new Context
+                {
+                    CultureName = "zh-CN",
+                    EntCode = "001",
+                    OrgCode = "102",
+                    UserCode = "MH0551"
+                },
+                documentTypeCode = "TransIn002",
+                businessDate = DateTime.Now.ToString("yyyy-MM-dd"),
+                isApproved = true,
+
+                transferInList = stock.StockInfoDetails.Select(item => new transferInList
+                {
+                    ItemCode = item.MaterielCode,
+                    TransInWHCode = item.Warehouse,
+                    TransInQty = item.Quantity,
+                    TransOutWHCode = "001",
+                }).ToList()
+            };
+            return content.OK(data: allocate);
+        }
+        catch (Exception ex)
+        {
+            return content.Error(ex.Message);
+        }
+    }
 
     #endregion
 

--
Gitblit v1.9.3