From 6b4e3935dceb3a4b158c0005468a5c803df509be Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期一, 24 十一月 2025 10:14:13 +0800
Subject: [PATCH] 提交

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs            |    8 ++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs          |   11 +++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs          |   18 ++++++---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs               |   18 +++++++--
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/InboundOrderMenu.cs             |    5 ++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs |   30 ++++++++++++++-
 6 files changed, 77 insertions(+), 13 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_AllocateService/AllocateService.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_AllocateService/AllocateService.cs"
index 7d707ca..b720756 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_AllocateService/AllocateService.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_AllocateService/AllocateService.cs"
@@ -1,4 +1,5 @@
-锘縰sing Microsoft.Extensions.Logging;
+锘縰sing MailKit.Search;
+using Microsoft.Extensions.Logging;
 using SqlSugar;
 using SqlSugar.Extensions;
 using System;
@@ -88,8 +89,17 @@
                         var inboundOrders = ConvertToInboundOrders(allocateOrder);
                         await _inboundService.InbounOrderService.ReceiveInboundOrder(inboundOrders, 1);
                     }
-                    else if (businessType == BusinessTypeEnum.澶栭儴浠撳簱璋冩櫤浠�)
+                    else if (businessType == BusinessTypeEnum.澶栭儴浠撳簱璋冩櫤浠� || businessType == BusinessTypeEnum.鏅轰粨璋冩櫤浠�)
                     {
+                        if (businessType == BusinessTypeEnum.澶栭儴浠撳簱璋冩櫤浠�)
+                        {
+                            allocateOrder.OrderType = InOrderTypeEnum.Allocat.ObjToInt();
+                        }
+                        else if (businessType == BusinessTypeEnum.鏅轰粨璋冩櫤浠�)
+                        {
+                            allocateOrder.OrderType = InOrderTypeEnum.InternalAllocat.ObjToInt();
+                        }
+
                         var outboundOrders = ConvertToOutboundOrders(allocateOrder);
                         await _outboundService.OutboundOrderService.ReceiveOutboundOrder(outboundOrders, 1);
                     }
@@ -178,7 +188,7 @@
                 _unitOfWorkManage.BeginTran();
                 foreach (var item in deletePurchaseOrderDetails)
                 {
-                   // _allocateOrderDetailRepository.DeleteAndMoveIntoHty(item, OperateTypeEnum.鑷姩鍒犻櫎);
+                    // _allocateOrderDetailRepository.DeleteAndMoveIntoHty(item, OperateTypeEnum.鑷姩鍒犻櫎);
                     _allocateOrderDetailRepository.DeleteData(item);
                 }
 
@@ -241,7 +251,7 @@
                    InboundOrderNo=allocateOrder.OrderNo,
                    UpperOrderNo=allocateOrder.UpperOrderNo,
                    SupplierId=allocateOrder.SupplierId,
-                   OrderType=InOrderTypeEnum.Allocat.ObjToInt(),
+                   OrderType= allocateOrder.OrderType ,
                    OrderStatus=allocateOrder.OrderStatus,
                    CreateType=allocateOrder.CreateType,
                    BusinessType=allocateOrder.BusinessType,
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_Common/OrderEnum/InboundOrderMenu.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_Common/OrderEnum/InboundOrderMenu.cs"
index 4365b1b..9475672 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_Common/OrderEnum/InboundOrderMenu.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_Common/OrderEnum/InboundOrderMenu.cs"
@@ -72,9 +72,14 @@
         [Description("璋冩嫧鍏ュ簱鍗�")]
         Allocat = 115,
 
+
+
         [Description("閲嶆鍥炲簱")]
         ReCheck =116,
 
+        [Description("鏅轰粨璋冩櫤浠撳叆搴撳崟")]
+        InternalAllocat = 117,
+
         /// <summary>
         /// 閿�鍞��璐у崟
         /// </summary>
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_InboundService/InboundOrderService.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_InboundService/InboundOrderService.cs"
index 0d63ad2..a18a2fb 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_InboundService/InboundOrderService.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_InboundService/InboundOrderService.cs"
@@ -122,6 +122,10 @@
                     {
                         return WebResponseContent.Instance.Error($"鏈壘鍒板叆搴撳崟鏄庣粏淇℃伅");
                     }
+                    if (inboundOrder.OrderStatus != InOrderStatusEnum.鏈紑濮�.ObjToInt())
+                    {
+                        return WebResponseContent.Instance.Error($"璇ヨ鍗曠姸鎬佷笉鍏佽淇敼");
+                    }
                     List<Dt_InboundOrderDetail> inboundOrderDetails = new List<Dt_InboundOrderDetail>();
                     List<Dt_InboundOrderDetail> updateInboundOrderDetails = new List<Dt_InboundOrderDetail>();
                     List<int> detailIds = new List<int>();
@@ -226,6 +230,10 @@
                     {
                         return WebResponseContent.Instance.Error($"鏈壘鍒板叆搴撳崟鏄庣粏淇℃伅");
                     }
+                    if (inboundOrder.OrderStatus != InOrderStatusEnum.鏈紑濮�.ObjToInt())
+                    {
+                        return WebResponseContent.Instance.Error($"璇ヨ鍗曠姸鎬佷笉鍏佽鍒犻櫎");
+                    }
                     //Db.DeleteNav(inboundOrder).Include(x => x.Details).ExecuteCommand();
                     _unitOfWorkManage.BeginTran();
                     //BaseDal.DeleteAndMoveIntoHty(inboundOrder, OperateTypeEnum.鑷姩鍒犻櫎);
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_OutboundService/OutboundOrderService.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_OutboundService/OutboundOrderService.cs"
index 7fd87d6..15ba41a 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_OutboundService/OutboundOrderService.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_OutboundService/OutboundOrderService.cs"
@@ -3,6 +3,8 @@
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Extensions.Logging;
 using SqlSugar;
+using SqlSugar.Extensions;
+using WIDESEA_Common.OrderEnum;
 using WIDESEA_Core;
 using WIDESEA_Core.BaseRepository;
 using WIDESEA_Core.BaseServices;
@@ -94,6 +96,10 @@
                 if (outboundOrder.Details == null || outboundOrder.Details.Count == 0)
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒板嚭搴撳崟鏄庣粏淇℃伅");
+                }
+                if (outboundOrder.OrderStatus != OutOrderStatusEnum.鏈紑濮�.ObjToInt())
+                {
+                    return WebResponseContent.Instance.Error($"璇ヨ鍗曠姸鎬佷笉鍏佽淇敼");
                 }
                 List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>();
                 List<Dt_OutboundOrderDetail> updateoutboundOrderDetails = new List<Dt_OutboundOrderDetail>();
@@ -195,7 +201,10 @@
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒板嚭搴撳崟鏄庣粏淇℃伅");
                 }
-
+                if (outboundOrder.OrderStatus != OutOrderStatusEnum.鏈紑濮�.ObjToInt())
+                {
+                    return WebResponseContent.Instance.Error($"璇ヨ鍗曠姸鎬佷笉鍏佽鍒犻櫎");
+                }
                 _unitOfWorkManage.BeginTran();
                 //BaseDal.DeleteAndMoveIntoHty(outboundOrder, OperateTypeEnum.鑷姩鍒犻櫎);
                 foreach (var item in outboundOrder.Details)
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_Outbound.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_Outbound.cs"
index 8b0eb09..d479cef 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_Outbound.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_Outbound.cs"
@@ -182,7 +182,7 @@
             else
             {
                 throw new Exception("鏃犲簱瀛�");
-            }    
+            }
             return (tasks, stockInfos, orderDetails, outStockLockInfos, locationInfos);
         }
 
@@ -206,7 +206,7 @@
                 if (stockInfos != null && stockInfos.Count > 0 && outboundOrderDetails != null && outboundOrderDetails.Count > 0 && outStockLockInfos != null && outStockLockInfos.Count > 0 && locationInfos != null && locationInfos.Count > 0)
                 {
                     stockInfos.ForEach(x =>
-                    {                        
+                    {
                         x.StockStatus = StockStatusEmun.鍑哄簱閿佸畾.ObjToInt();
                     });
                     outboundOrderDetails.ForEach(x =>
@@ -218,8 +218,11 @@
                     {
                         _outboundOrderService.Repository.UpdateData(outboundOrder);
                     }
-                    outboundOrder.Operator = App.User.UserName;
-                    outboundOrder.OrderStatus = OutOrderStatusEnum.鍑哄簱涓�.ObjToInt();
+                    else
+                    {
+                        outboundOrder.OrderStatus = OutOrderStatusEnum.鍑哄簱涓�.ObjToInt();
+                    }
+                    outboundOrder.Operator = App.User.UserName;                
                     _outboundOrderService.Repository.UpdateData(outboundOrder);
                     WebResponseContent content = _outboundOrderDetailService.LockOutboundStockDataUpdate(stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos, tasks: tasks);
 
@@ -240,8 +243,11 @@
                     {
                         _outboundOrderService.Repository.UpdateData(outboundOrder);
                     }
+                    else
+                    {
+                        outboundOrder.OrderStatus = OutOrderStatusEnum.鍑哄簱涓�.ObjToInt();
+                    }
                     outboundOrder.Operator = App.User.UserName;
-                    outboundOrder.OrderStatus = OutOrderStatusEnum.鍑哄簱涓�.ObjToInt();
                     _outboundOrderService.Repository.UpdateData(outboundOrder);
                     _outboundOrderDetailService.Repository.UpdateData(outboundOrderDetails);
                 }
@@ -488,7 +494,7 @@
                 (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundOrderDetailService.AssignStockOutbound(outboundOrderDetail, stockSelectViews);
                 if (result.Item1 != null && result.Item1.Count > 0)
                 {
-                    Dt_OutboundOrder outboundOrder = _outboundOrderService .Repository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId);
+                    Dt_OutboundOrder outboundOrder = _outboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId);
                     TaskTypeEnum typeEnum = outboundOrder.OrderType switch
                     {
                         (int)OutOrderTypeEnum.Issue => TaskTypeEnum.Outbound,
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/TaskInfo/TaskController.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/TaskInfo/TaskController.cs"
index adfa518..966db0e 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/TaskInfo/TaskController.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/TaskInfo/TaskController.cs"
@@ -1,8 +1,11 @@
-锘縰sing Microsoft.AspNetCore.Authorization;
+锘縰sing MailKit.Search;
+using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
+using System.Diagnostics;
 using System.Threading.Tasks;
 using WIDESEA_Common.CommonEnum;
+using WIDESEA_Common.TaskEnum;
 using WIDESEA_Core;
 using WIDESEA_Core.Attributes;
 using WIDESEA_Core.BaseController;
@@ -24,7 +27,30 @@
         {
         }
 
- 
+        [HttpPost, Route("AddTestTask"), AllowAnonymous, MethodParamsValidate]
+        public  WebResponseContent AddTest(WMSTaskDTO wMSTaskDTO)
+        {
+            Dt_Task task = new Dt_Task
+            {
+                PalletCode           =wMSTaskDTO.  PalletCode      ,  
+                PalletType           =wMSTaskDTO.  PalletType      ,
+                Roadway              = "t",
+                TaskType             =wMSTaskDTO.  TaskType        ,
+                TaskStatus           =wMSTaskDTO.  TaskStatus      ,
+                SourceAddress        =wMSTaskDTO.  SourceAddress   ,
+                TargetAddress        =wMSTaskDTO.  TargetAddress   ,
+                CurrentAddress       = "t",
+                NextAddress          ="t"   ,
+                WarehouseId          =wMSTaskDTO.  WarehouseId     ,
+                OrderNo              ="testt"         ,
+                Grade                =wMSTaskDTO.  Grade           ,
+                Dispatchertime       = DateTime.Now  ,
+
+            };
+
+            Service.AddData(task);
+            return WebResponseContent.Instance.OK();
+        }
 
         [HttpPost, Route("PalletOutboundTask"), AllowAnonymous, MethodParamsValidate]                           
         public async Task<WebResponseContent> PalletOutboundTask(string endStation, string palletCode = "")

--
Gitblit v1.9.3