From 2f8a8a7b31c7e311d1824c76e2a67e2a128bc65b Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期四, 06 三月 2025 17:34:04 +0800
Subject: [PATCH] 成品入库任务,货位

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/MesProInOrderService.cs                                    |    8 +++-
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/6072017d-30e1-411f-8eb8-c9979222f9ad.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e3225869-67ec-44fe-945d-0dc842c706c8.vsidx |    0 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs                                        |   18 ++++++++
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e4d78ad4-62c0-46d7-8770-62e00cb5d23f.vsidx |    0 
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/717bcd11-9eb3-4dd7-9f56-66f8e333c9e1.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs                                           |   17 ++++++++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs                                         |   37 +++++++++++++++---
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/09cfc190-80e7-4be3-bf3e-9a6eaa1e00d1.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock                                  |    0 
 10 files changed, 71 insertions(+), 9 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/f4e55e4a-0dd0-4664-8aa1-102eb9ecc34b.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/717bcd11-9eb3-4dd7-9f56-66f8e333c9e1.vsidx"
similarity index 63%
rename from "\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/f4e55e4a-0dd0-4664-8aa1-102eb9ecc34b.vsidx"
rename to "\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/717bcd11-9eb3-4dd7-9f56-66f8e333c9e1.vsidx"
index 4730b2c..b122658 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/f4e55e4a-0dd0-4664-8aa1-102eb9ecc34b.vsidx"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/717bcd11-9eb3-4dd7-9f56-66f8e333c9e1.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs"
index 10bd4e9..9f175d4 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs"
@@ -56,7 +56,11 @@
         /// </summary>
         [Description("MES鎵嬪姩鎷i�夊嚭搴�")]
         MesHandPickOutbound = 220,
-
+        /// <summary>
+        /// 鎴愬搧鍑哄簱
+        /// </summary>
+        [Description("鎴愬搧鍑哄簱")]
+        OutProduct = 230,
         /// <summary>
         /// 閲囪喘鍏ュ簱
         /// </summary>
@@ -121,6 +125,18 @@
         InEmpty = 600,
 
         /// <summary>
+        /// 鎴愬搧鍏ュ簱
+        /// </summary>
+        [Description("鎴愬搧鍏ュ簱")]
+        InProduct = 610,
+
+        /// <summary>
+        /// 鎴愬搧浣欐枡鍥炲簱
+        /// </summary>
+        [Description("鎴愬搧浣欐枡鍥炲簱")]
+        InProductBack = 620,
+
+        /// <summary>
         /// 宸烽亾鍐呯Щ搴�
         /// </summary>
         [Description("宸烽亾鍐呯Щ搴�")]
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/09cfc190-80e7-4be3-bf3e-9a6eaa1e00d1.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/09cfc190-80e7-4be3-bf3e-9a6eaa1e00d1.vsidx"
new file mode 100644
index 0000000..ce1cf8b
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/09cfc190-80e7-4be3-bf3e-9a6eaa1e00d1.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/6072017d-30e1-411f-8eb8-c9979222f9ad.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/6072017d-30e1-411f-8eb8-c9979222f9ad.vsidx"
new file mode 100644
index 0000000..e237bcb
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/6072017d-30e1-411f-8eb8-c9979222f9ad.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e3225869-67ec-44fe-945d-0dc842c706c8.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e3225869-67ec-44fe-945d-0dc842c706c8.vsidx"
new file mode 100644
index 0000000..1759c6b
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e3225869-67ec-44fe-945d-0dc842c706c8.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e4d78ad4-62c0-46d7-8770-62e00cb5d23f.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e4d78ad4-62c0-46d7-8770-62e00cb5d23f.vsidx"
new file mode 100644
index 0000000..b9331c9
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e4d78ad4-62c0-46d7-8770-62e00cb5d23f.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock"
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock"
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
index 596b29e..0ab240e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
@@ -59,6 +59,11 @@
         /// </summary>
         [Description("MES鎵嬪姩鎷i�夊嚭搴�")]
         MesHandPickOutbound = 220,
+        /// <summary>
+        /// 鎴愬搧鍑哄簱
+        /// </summary>
+        [Description("鎴愬搧鍑哄簱")]
+        OutProduct = 230,
 
         /// <summary>
         /// 閲囪喘鍏ュ簱
@@ -112,6 +117,18 @@
         InEmpty = 600,
 
         /// <summary>
+        /// 鎴愬搧鍏ュ簱
+        /// </summary>
+        [Description("鎴愬搧鍏ュ簱")]
+        InProduct = 610,
+
+        /// <summary>
+        /// 鎴愬搧浣欐枡鍥炲簱
+        /// </summary>
+        [Description("鎴愬搧浣欐枡鍥炲簱")]
+        InProductBack = 620,
+
+        /// <summary>
         /// 宸烽亾鍐呯Щ搴�
         /// </summary>
         [Description("宸烽亾鍐呯Щ搴�")]
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/MesProInOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/MesProInOrderService.cs"
index 98b19b1..7bc2e90 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/MesProInOrderService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/MesProInOrderService.cs"
@@ -15,6 +15,7 @@
 using WIDESEA_IInboundRepository;
 using WIDESEA_IInboundService;
 using WIDESEA_IOutboundService;
+using WIDESEA_IStockRepository;
 using WIDESEA_Model.Models;
 
 namespace WIDESEA_InboundService
@@ -24,10 +25,12 @@
         public IMesProInOrderRepository Repository => BaseDal;
         private readonly IUnitOfWorkManage _unitOfWorkManage;
         private readonly IInboundRepository _inboundRepository;
-        public MesProInOrderService(IMesProInOrderRepository BaseDal, IUnitOfWorkManage unitOfWorkManag, IInboundRepository inboundRepository) : base(BaseDal)
+        private readonly IStockRepository _stockRepository;
+        public MesProInOrderService(IMesProInOrderRepository BaseDal, IUnitOfWorkManage unitOfWorkManag, IInboundRepository inboundRepository, IStockRepository stockRepository) : base(BaseDal)
         {
             _unitOfWorkManage = unitOfWorkManag;
             _inboundRepository = inboundRepository;
+            _stockRepository = stockRepository;
         }
         /// <summary>
         /// 鎴愬搧鍏ュ簱鎵爜
@@ -41,7 +44,7 @@
             try
             {
                 //鑾峰彇瀵瑰簲MES鎴愬搧鍏ュ簱鍗曟嵁
-                Dt_MesProInOrder mesProInOrder = BaseDal.Db.Queryable<Dt_MesProInOrder>().Includes(x => x.Details).First();
+                Dt_MesProInOrder mesProInOrder = BaseDal.Db.Queryable<Dt_MesProInOrder>().Where(x => x.Id == Id).Includes(x => x.Details).First();
                 if (mesProInOrder==null)
                 {
                     return content.Error("褰撳墠MES鍏ュ簱鍗曟嵁涓嶅瓨鍦�");
@@ -67,6 +70,7 @@
                 {
                     return content.Error($"褰撳墠鍏ュ簱璁㈠崟鏁伴噺婧㈠嚭{(OverPCSQty + model.OKPCSQTY.ObjToInt())- SumPCSQty}");
                 }
+
                 proInOrderDetail.OverInQuantity += model.OKPCSQTY.ObjToInt();
                 _inboundRepository.MesProInOrderDetailRepository.UpdateData(proInOrderDetail);
                 return content.OK($"鍐呭寘{proInOrderDetail.BagNo}宸叉壂鏁伴噺锛歿proInOrderDetail.OverInQuantity},鍓╀綑锛歿proInOrderDetail.OKPCSQTY-proInOrderDetail.OverInQuantity}");
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs"
index 519fc8e..5039413 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs"
@@ -29,6 +29,7 @@
 using WIDESEA_DTO.Task;
 using WIDESEA_DTO.Stock;
 using SqlSugar;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
 
 namespace WIDESEA_TaskInfoService
 {
@@ -975,7 +976,12 @@
                 {
                     return content.Error("鏈壘鍒颁粨搴撲俊鎭�");
                 }
-                //鍒ゆ柇鏄惁MES鍐呭寘淇℃伅鏄惁閲嶅
+                Dt_LocationInfo locationInfo = _basicRepository.LocationInfoRepository.QueryFirst(x => x.WarehouseId == warehouse.WarehouseId);
+                if (locationInfo==null)
+                {
+                    return content.Error($"鏈壘鍒皗warehouse.WarehouseCode}璐т綅淇℃伅");
+                }
+                //鍐呭寘淇℃伅缁勭洏
                 List<Dt_MesProInOrderDetail> mesProInOrderDetails = new List<Dt_MesProInOrderDetail>();
                 foreach (var item in bagInfoModel.BagDetails)
                 {
@@ -1020,13 +1026,36 @@
                     PalletCode = bagInfoModel.BatchNo,
                     PalletType = 1,
                     WarehouseId = warehouse.WarehouseId,
-                    StockStatus = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt(),
+                    StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt(),
                     proStockInfoDetails = proStockInfoDetails
                 };
+                //鍒嗛厤璐т綅
+                locationInfo = _basicService.LocationInfoService.AssignLocation(locationInfo.RoadwayNo, ((PalletTypeEnum)proStockInfo.PalletType).ObjToInt(), proStockInfo.WarehouseId);
+                Dt_Task newTask = new Dt_Task()
+                {
+                    CurrentAddress = bagInfoModel.WorkCenter,
+                    Grade = 0,
+                    NextAddress = locationInfo.LocationCode,
+                    PalletCode = proStockInfo.PalletCode,
+                    Roadway = locationInfo.RoadwayNo,
+                    SourceAddress = bagInfoModel.WorkCenter,
+                    TargetAddress = locationInfo.LocationCode,
+                    TaskType = TaskTypeEnum.InProduct.ObjToInt(),
+                    TaskStatus = TaskStatusEnum.New.ObjToInt(),
+                    WarehouseId = warehouse.WarehouseId,
+                    PalletType = proStockInfo.PalletType
+                };
+                locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt();
+                
                 _unitOfWorkManage.BeginTran();
+                int taskId = BaseDal.AddData(newTask);
+                newTask.TaskId = taskId;
+                _basicRepository.LocationInfoRepository.UpdateData(locationInfo);
                 Db.InsertNav(mesProInOrder).Include(x => x.Details).ExecuteCommand();
                 Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand();
                 _unitOfWorkManage.CommitTran();
+                //鎺ㄩ�佷换鍔�
+                PushTasksToWCS(new List<Dt_Task> { newTask });
                 return content.OK("鎺ユ敹鎴愬姛");
             }
             catch (Exception ex)
@@ -1618,9 +1647,5 @@
                 return WebResponseContent.Instance.Error(ex.Message);
             }
         }
-
-
-
-
     }
 }

--
Gitblit v1.9.3