From f1d726e3de8f15cdfe30d4ca5fbba733d73a1e56 Mon Sep 17 00:00:00 2001
From: 刘磊 <1161824510@qq.com>
Date: 星期六, 17 一月 2026 09:58:33 +0800
Subject: [PATCH] 同步

---
 项目代码/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/pushOrderInfo.cs |   79 ++++++++++++++++++++-------------------
 1 files changed, 41 insertions(+), 38 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/pushOrderInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/pushOrderInfo.cs"
index e7e9b59..2232232 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/pushOrderInfo.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/pushOrderInfo.cs"
@@ -18,9 +18,6 @@
 
 namespace WIDESEA_StoragIntegrationServices
 {
-    /// <summary>
-    /// 鎬昏宸ュ崟淇℃伅
-    /// </summary>
     public partial class MESService
     {
         public WebResponseContent pushOrderInfo(object json)
@@ -35,6 +32,7 @@
 
                 var ListTaskDto = new List<WMSTaskDTO>();
                 var ListTask = new List<Dt_Task>();
+                var ListAssemblyOrderInfo = new List<Dt_AssemblyOrderInfo>();
                 foreach (var item in result.data)
                 {
                     var palletStockInfos = _palletStockInfoRepository.QueryData(x => x.OrderID == item.workOrderNo);
@@ -87,48 +85,53 @@
 
                     }
 
-
+                    Dt_AssemblyOrderInfo assemblyOrderInfo = new Dt_AssemblyOrderInfo
+                    {
+                        biwMaterial = item.biwMaterial,
+                        CreateDate = DateTime.Now,
+                        Creater = "System",
+                        orderType = item.orderType,
+                        pbMaterial = item.pbMaterial,
+                        plantCode = result.plantCode,
+                        pvi = item.pvi,
+                        sequenceNo = item.sequenceNo,
+                        spare1 = item.spare1,
+                        spare2 = item.spare2,
+                        spare3 = item.spare3,
+                        splitStrategy = result.splitStrategy,
+                        vehicleCharacteristic = item.vehicleCharacteristic,
+                        vehicleCode = item.vehicleCode,
+                        vehicleOrderNo = item.vehicleOrderNo,
+                        workOrderNo = item.workOrderNo,
+                        workOrderSendStatus = item.workOrderSendStatus,  //1-鎺掍骇 2-鎾ゅ洖
+                    };
+                    ListAssemblyOrderInfo.Add(assemblyOrderInfo);
                 }
-
-                pushOrderInfo orderInfo = new pushOrderInfo
-                {
-
-                };
-
-                Dt_OutOrder outOrder = new()
-                {
-                    CreateDate = DateTime.Now,
-                    Creater = "System",
-                    Status = 1,
-                    //UpperOutOrderId = result.workOrderNo,
-                    OrderNumber = result.data[0].workOrderNo,
-                    WarehouseId = 1,
-                    OrderDate = DateTime.Now,
-                    UpperOutOrderId = 1,
-                    Remarks = "娴嬭瘯璁㈠崟"
-
-                };
-
-
-                var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
-                var wmsBase = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue;
-                var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.ReceiveTask)?.ConfigValue;
-                if (wmsBase == null || ipAddress == null)
-                {
-                    throw new InvalidOperationException("WMS IP 鏈厤缃�");
-                }
-                var wmsIpAddress = wmsBase + ipAddress;
-
-                var WCSresult = HttpHelper.PostAsync(wmsIpAddress, ListTaskDto.ToJsonString()).Result;
-                var content = JsonConvert.DeserializeObject<WebResponseContent>(WCSresult);
 
                 _unitOfWorkManage.BeginTran();
-                _OutOrderRepository.AddData(outOrder);
-                _taskRepository.AddData(ListTask);
+                if (ListTaskDto.Count > 0)
+                {
+                    var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
+                    var wmsBase = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue;
+                    var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.ReceiveTask)?.ConfigValue;
+                    if (wmsBase == null || ipAddress == null)
+                    {
+                        throw new InvalidOperationException("WMS IP 鏈厤缃�");
+                    }
+                    var wmsIpAddress = wmsBase + ipAddress;
 
+                    var WCSresult = HttpHelper.PostAsync(wmsIpAddress, ListTaskDto.ToJsonString()).Result;
+                    var content = JsonConvert.DeserializeObject<WebResponseContent>(WCSresult);
+
+                    _taskRepository.AddData(ListTask);
+                }
+                _assemblyOrderInfoRepository.AddData(ListAssemblyOrderInfo);
                 _unitOfWorkManage.CommitTran();
 
                 responseContent.OK();
+
+                LogFactory.GetLog("鎬昏宸ュ崟淇℃伅").Info(true, $"\r\r--------------------------------------");
+                LogFactory.GetLog("鎬昏宸ュ崟淇℃伅").Info(true, json.ToJsonString());
             }
             catch (Exception ex)
             {

--
Gitblit v1.9.3