From f2392d984123a1402d6c9bab9e5452c7becc8d22 Mon Sep 17 00:00:00 2001
From: 雷神教育集团 <2244205553@qq.com>
Date: 星期五, 06 三月 2026 09:10:48 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhiHuiQiCe/LongDeLiLiKu

---
 项目代码/WMS/WMSServices/WIDESEA_WMSServer/appsettings.json                     |    1 
 项目代码/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_StationPackInfo.cs |    6 +
 项目代码/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs         |    5 
 项目资料/通信协议/二楼环线20250715.xlsx                                                 |    0 
 项目代码/WCS/WCSServices/WIDESEAWCS_TaskInfoService/PackaxisTaskService.cs      |  187 +++++++++++++++++++-----------------
 项目代码/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService.cs                 |    2 
 项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/成品仓/ConveyorLineJob_CPH.cs            |   10 +-
 项目代码/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs        |   38 ++++---
 8 files changed, 137 insertions(+), 112 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_StationPackInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_StationPackInfo.cs"
index ea0f089..5149343 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_StationPackInfo.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_StationPackInfo.cs"
@@ -78,6 +78,12 @@
         public int ExecutingNum { get; set; }
 
         /// <summary>
+        /// 鎺掑簭
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "鎺掑簭")]
+        public int OrderIndex { get; set; }
+
+        /// <summary>
         /// 鐮佸灈宸插畬鎴愭暟閲�
         /// </summary>
         [SugarColumn(IsNullable = false, ColumnDescription = "鐮佸灈宸插畬鎴愭暟閲�")]
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/PackaxisTaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/PackaxisTaskService.cs"
index 397d188..12bd851 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/PackaxisTaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/PackaxisTaskService.cs"
@@ -1,4 +1,5 @@
 锘縰sing Newtonsoft.Json;
+using SqlSugar;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -43,6 +44,7 @@
             _stationMangerRepository = stationMangerRepository;
             _unitOfWorkManage = unitOfWorkManage;
         }
+        private static object lock_reqPackTask = new object();
         /// <summary>
         /// 鍒嗛厤鐮佸灈浠诲姟
         /// </summary>
@@ -51,103 +53,106 @@
         /// <returns></returns>
         public WebResponseContent ReqPackTask(string barCode,string deviceCode)
         {
-            WebResponseContent content= new WebResponseContent();
-            try
+            lock (lock_reqPackTask)
             {
-                Dt_Packinfo packinfo = _packinfoRepository.QueryFirst(x=>x.BarCode==barCode && x.PackStatus==StationOccupiedEnum.None.ObjToInt());
-                if (packinfo==null)
+                WebResponseContent content = new WebResponseContent();
+                try
                 {
-                    return content.Error($"鏈壘鍒版潯鐮亄barCode}");
-                }
-                List<Dt_StationPackInfo> stationPackInfos = _stationPackInfoRepository.QueryData();
-                Dt_StationPackInfo? stationPackInfo=stationPackInfos.FirstOrDefault(x=>x.PackType==packinfo.PackType && x.OrderNo==packinfo.OrderNo && x.AssignNum<x.PackNum);
-                //濡傛灉璁㈠崟鐩稿悓銆佸灈鍨嬩竴鑷村苟涓斿垎閰嶆暟閲忓皯浜庣爜鍨涚粨鎵樻暟閲忓垯鍒嗛厤鍒颁竴璧�
-                if (stationPackInfo!=null)
-                {
-                    Dt_PackaxisTask packaxisTask = new Dt_PackaxisTask()
+                    Dt_Packinfo packinfo = _packinfoRepository.QueryFirst(x => x.BarCode == barCode && x.PackStatus == StationOccupiedEnum.None.ObjToInt());
+                    if (packinfo == null)
                     {
-                        DeviceCode=deviceCode,
-                        SourceAddress= "2421",
-                        BarCode=barCode,
-                        CurrentAddress= "2421",
-                        TargetAddress=stationPackInfo.StationCode,
-                        NextAddress=stationPackInfo.LineCode,
-                        TaskState =TaskStatusEnum.Line_Executing.ObjToInt(),
-                        PackLength=packinfo.Length,
-                        PackWidth=packinfo.Width,
-                        PackHeight=packinfo.Height,
-                        PackType=packinfo.PackType,
-                        Dispatchertime=DateTime.Now,
-                    };
-                    stationPackInfo.AssignNum += 1;
-                    stationPackInfo.ExecutingNum += 1;
-                    packinfo.PackStatus = StationOccupiedEnum.Sure.ObjToInt();
-                    _unitOfWorkManage.BeginTran();
-                    //鏇存柊鐮佸灈鎵ц宸ヤ綅
-                    _stationPackInfoRepository.UpdateData(stationPackInfo);
-                    //鏇存柊寰呯爜鍨涗俊鎭〃
-                    _packinfoRepository.UpdateData(packinfo);
-                    //娣诲姞鐮佸灈浠诲姟
-                    BaseDal.AddData(packaxisTask);
-                    _unitOfWorkManage.CommitTran();
-                    return content.OK(barCode, packaxisTask);
-                }
-                else//鍒嗛厤鏂板伐浣�
-                {
-                    //鑾峰彇褰撳墠绌虹洏鍑嗗鐨勭爜鍨涘伐浣�
-                    List<string> stations = _stationMangerRepository.QueryData(x => x.StationDeviceCode == "CLC_CP" && x.IsOccupied == StationOccupiedEnum.None.ObjToInt()).Select(x => x.StationCode).ToList();
-                    //鑾峰彇鐮佸灈閰嶇疆琛ㄦ煡璇㈡湁閰嶇疆鐨勭爜鍨涘伐浣�
-                    List<Dt_Packaxis> packaxes = _packaxisRepository.QueryData(x => x.PackType == packinfo.PackType);
-                    if (packaxes.Count==0)
-                    {
-                        return content.Error("鏈壘鍒扮爜鍨涘潗鏍囬厤缃�");
+                        return content.Error($"鏈壘鍒版潯鐮亄barCode}");
                     }
-                    List<string> packStations = packaxes.Select(x => x.StationCode).ToList();
-                    Dt_StationPackInfo? packInfoAssign = stationPackInfos.Where(x => x.PackType == 0 && x.AssignNum == 0 && stations.Contains(x.StationCode) && packStations.Contains(x.StationCode)).OrderByDescending(x => x.StationCode).FirstOrDefault();
-                    if (packInfoAssign == null)
+                    List<Dt_StationPackInfo> stationPackInfos = _stationPackInfoRepository.QueryData();
+                    Dt_StationPackInfo? stationPackInfo = stationPackInfos.FirstOrDefault(x => x.PackType == packinfo.PackType && x.OrderNo == packinfo.OrderNo && x.AssignNum < x.PackNum);
+                    //濡傛灉璁㈠崟鐩稿悓銆佸灈鍨嬩竴鑷村苟涓斿垎閰嶆暟閲忓皯浜庣爜鍨涚粨鎵樻暟閲忓垯鍒嗛厤鍒颁竴璧�
+                    if (stationPackInfo != null)
                     {
-                        return content.Error("鏈壘鍒板彲鍒嗛厤鍨涗綅");
+                        Dt_PackaxisTask packaxisTask = new Dt_PackaxisTask()
+                        {
+                            DeviceCode = deviceCode,
+                            SourceAddress = "2421",
+                            BarCode = barCode,
+                            CurrentAddress = "2421",
+                            TargetAddress = stationPackInfo.StationCode,
+                            NextAddress = stationPackInfo.LineCode,
+                            TaskState = TaskStatusEnum.Line_Executing.ObjToInt(),
+                            PackLength = packinfo.Length,
+                            PackWidth = packinfo.Width,
+                            PackHeight = packinfo.Height,
+                            PackType = packinfo.PackType,
+                            Dispatchertime = DateTime.Now,
+                        };
+                        stationPackInfo.AssignNum += 1;
+                        stationPackInfo.ExecutingNum += 1;
+                        packinfo.PackStatus = StationOccupiedEnum.Sure.ObjToInt();
+                        _unitOfWorkManage.BeginTran();
+                        //鏇存柊鐮佸灈鎵ц宸ヤ綅
+                        _stationPackInfoRepository.UpdateData(stationPackInfo);
+                        //鏇存柊寰呯爜鍨涗俊鎭〃
+                        _packinfoRepository.UpdateData(packinfo);
+                        //娣诲姞鐮佸灈浠诲姟
+                        BaseDal.AddData(packaxisTask);
+                        _unitOfWorkManage.CommitTran();
+                        return content.OK(barCode, packaxisTask);
                     }
-                    packInfoAssign.PackType = packinfo.PackType;
-                    packInfoAssign.OrderNo = packinfo.OrderNo;
-                    packInfoAssign.MakeCode = packinfo.MakeCode;
-                    packInfoAssign.MaterielCode = packInfoAssign.MaterielCode;
-                    packInfoAssign.PackNum = packaxes.FirstOrDefault(x=>x.StationCode== packInfoAssign.StationCode).PackNum;
-                    Dt_PackaxisTask packaxisTask = new Dt_PackaxisTask()
+                    else//鍒嗛厤鏂板伐浣�
                     {
-                        DeviceCode = deviceCode,
-                        SourceAddress = "2421",
-                        BarCode = barCode,
-                        CurrentAddress = "2421",
-                        TargetAddress = packInfoAssign.StationCode,
-                        NextAddress = packInfoAssign.LineCode,
-                        TaskState = TaskStatusEnum.Line_Executing.ObjToInt(),
-                        PackLength = packinfo.Length,
-                        PackWidth = packinfo.Width,
-                        PackHeight = packinfo.Height,
-                        PackType = packinfo.PackType,
-                        Dispatchertime = DateTime.Now,
-                    };
-                    packInfoAssign.AssignNum += 1;
-                    packInfoAssign.ExecutingNum += 1;
-                    packinfo.PackStatus = StationOccupiedEnum.Sure.ObjToInt();
-                    _unitOfWorkManage.BeginTran();
-                    //鏇存柊鐮佸灈鎵ц宸ヤ綅
-                    _stationPackInfoRepository.UpdateData(packInfoAssign);
-                    //鏇存柊寰呯爜鍨涗俊鎭〃
-                    _packinfoRepository.UpdateData(packinfo);
-                    //娣诲姞鐮佸灈浠诲姟
-                    BaseDal.AddData(packaxisTask);
-                    _unitOfWorkManage.CommitTran();
-                    return content.OK(barCode, packaxisTask);
+                        //鑾峰彇褰撳墠绌虹洏鍑嗗鐨勭爜鍨涘伐浣�
+                        List<string> stations = _stationMangerRepository.QueryData(x => x.StationDeviceCode == "CLC_CP" && x.IsOccupied == StationOccupiedEnum.None.ObjToInt()).Select(x => x.StationCode).ToList();
+                        //鑾峰彇鐮佸灈閰嶇疆琛ㄦ煡璇㈠彲鍒嗛厤骞跺凡閰嶇疆鐨勭爜鍨涘伐浣�
+                        List<Dt_Packaxis> packaxes = _packaxisRepository.QueryData(x => x.PackType == packinfo.PackType && stations.Contains(x.StationCode));
+                        if (packaxes.Count == 0)
+                        {
+                            return content.Error("鏈壘鍒板彲鍒嗛厤鐮佸灈閰嶇疆");
+                        }
+                        List<string> packStations = packaxes.Select(x => x.StationCode).ToList();
+                        Dt_StationPackInfo? packInfoAssign = stationPackInfos.Where(x => x.PackType == 0 && x.AssignNum == 0 && packStations.Contains(x.StationCode)).OrderBy(x => x.OrderIndex).FirstOrDefault();
+                        if (packInfoAssign == null)
+                        {
+                            return content.Error("鏈壘鍒板彲鍒嗛厤鍨涗綅");
+                        }
+                        packInfoAssign.PackType = packinfo.PackType;
+                        packInfoAssign.OrderNo = packinfo.OrderNo;
+                        packInfoAssign.MakeCode = packinfo.MakeCode;
+                        packInfoAssign.MaterielCode = packInfoAssign.MaterielCode;
+                        packInfoAssign.PackNum = packaxes.FirstOrDefault(x => x.StationCode == packInfoAssign.StationCode).PackNum;
+                        Dt_PackaxisTask packaxisTask = new Dt_PackaxisTask()
+                        {
+                            DeviceCode = deviceCode,
+                            SourceAddress = "2421",
+                            BarCode = barCode,
+                            CurrentAddress = "2421",
+                            TargetAddress = packInfoAssign.StationCode,
+                            NextAddress = packInfoAssign.LineCode,
+                            TaskState = TaskStatusEnum.Line_Executing.ObjToInt(),
+                            PackLength = packinfo.Length,
+                            PackWidth = packinfo.Width,
+                            PackHeight = packinfo.Height,
+                            PackType = packinfo.PackType,
+                            Dispatchertime = DateTime.Now,
+                        };
+                        packInfoAssign.AssignNum += 1;
+                        packInfoAssign.ExecutingNum += 1;
+                        packinfo.PackStatus = StationOccupiedEnum.Sure.ObjToInt();
+                        _unitOfWorkManage.BeginTran();
+                        //鏇存柊鐮佸灈鎵ц宸ヤ綅
+                        _stationPackInfoRepository.UpdateData(packInfoAssign);
+                        //鏇存柊寰呯爜鍨涗俊鎭〃
+                        _packinfoRepository.UpdateData(packinfo);
+                        //娣诲姞鐮佸灈浠诲姟
+                        BaseDal.AddData(packaxisTask);
+                        _unitOfWorkManage.CommitTran();
+                        return content.OK(barCode, packaxisTask);
+                    }
                 }
+                catch (Exception ex)
+                {
+                    _unitOfWorkManage.RollbackTran();
+                    content.Error(ex.Message);
+                }
+                return content;
             }
-            catch (Exception ex)
-            {
-                _unitOfWorkManage.RollbackTran();
-                content.Error(ex.Message);
-            }
-            return content;
         }
         /// <summary>
         /// 鐮佸灈缁撴墭骞朵笂浼犵爜鍨涘伐浣嶇爜鍨涙槑缁嗘暟鎹�
@@ -288,4 +293,10 @@
 
 >>>>>>> main
     }
+    public class MDCount
+    {
+        public string MDNo { get; set; }
+
+        public int Count { get; set; }
+    }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPH.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPH.cs"
index 409cbbb..3669f76 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPH.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPH.cs"
@@ -97,7 +97,7 @@
                                     {
                                         shouldRestart = false;
                                         Dt_StationManger? RequestIn = stationMangers.FirstOrDefault(x => x.StationDeviceCode == device.DeviceCode && x.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt());
-                                        WriteError($"绾跨▼ {Thread.CurrentThread.ManagedThreadId}","寮�濮嬫墽琛�");
+                                        WriteInfo($"绾跨▼ {Thread.CurrentThread.ManagedThreadId}鍒嗗灈鍙�","寮�濮嬫墽琛�");
                                         while (true)
                                         {
                                             if (RequestIn != null)
@@ -111,7 +111,7 @@
                                                     if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo <= 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.R_BoxCode) && conveyorLineInfoRead.R_Request == 1)
                                                     {
                                                         //鍒ゆ柇鏄惁浠诲姟宸茬粡瀛樺湪
-                                                        Dt_PackaxisTask packaxisTask = _packaxisTaskRepository.QueryFirst(x => x.BarCode == conveyorLineInfoRead.R_BoxCode.Trim() && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt());
+                                                        Dt_PackaxisTask packaxisTask = _packaxisTaskRepository.Db.Queryable<Dt_PackaxisTask>().Where(x => x.BarCode == conveyorLineInfoRead.R_BoxCode.Trim() && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt()).First();
                                                         if (packaxisTask != null)
                                                         {
                                                             //鍐欏叆鎵ц鏁版嵁
@@ -165,7 +165,7 @@
                                     }
                                     catch (Exception ex)
                                     {
-                                        WriteError($"绾跨▼ {Thread.CurrentThread.ManagedThreadId}", $"寮傚父:{ex.Message}");
+                                        WriteInfo($"绾跨▼ {Thread.CurrentThread.ManagedThreadId}鍒嗗灈鍙�", $"寮傚父:{ex.Message}");
                                         Thread.Sleep(1500);
                                         shouldRestart = true;
                                     }
@@ -182,7 +182,7 @@
                                         shouldRestart = false;
                                         //鑾峰彇鎵�鏈夌爜鍨涘彛
                                         List<Dt_StationManger> stationMangersMD = stationMangers.Where(x => x.StationDeviceCode == device.DeviceCode && x.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt()).ToList();
-                                        WriteError($"绾跨▼ {Thread.CurrentThread.ManagedThreadId}", "寮�濮嬫墽琛�");
+                                        WriteInfo($"绾跨▼ {Thread.CurrentThread.ManagedThreadId}鐮佸灈鍙�", "寮�濮嬫墽琛�");
                                         while (true)
                                         {
                                             if (stationMangersMD.Count > 0)
@@ -230,7 +230,7 @@
                                     }
                                     catch (Exception ex)
                                     {
-                                        WriteError($"绾跨▼ {Thread.CurrentThread.ManagedThreadId}", $"寮傚父:{ex.Message}");
+                                        WriteInfo($"绾跨▼ {Thread.CurrentThread.ManagedThreadId}鐮佸灈鍙�", $"寮傚父:{ex.Message}");
                                         Thread.Sleep(1500);
                                         shouldRestart = true;
                                     }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService.cs"
index e98dcbd..7005cf9 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService.cs"
@@ -195,7 +195,7 @@
                         return content;
                     }
                     //鑾峰彇鎵�鏈夌殑鍑哄簱璇︽儏鍒ゆ柇鏄惁婊¤冻鍑哄簱閲忓皬浜�5涓囦笖灏忎簬17鍗�
-                    List<Dt_OutStockLockInfo> outStockLockInfos = _outboundRepository.OutStockLockInfoRepository.QueryData(x=>x.OrderType==OutOrderTypeEnum.OutSGPick.ObjToInt() && x.Status<=OutLockStockStatusEnum.鍏抽棴.ObjToInt());
+                    List<Dt_OutStockLockInfo> outStockLockInfos = _outboundRepository.OutStockLockInfoRepository.QueryData(x=>x.OrderType==OutOrderTypeEnum.OutSGPick.ObjToInt() && x.Status<OutLockStockStatusEnum.鍏抽棴.ObjToInt());
                     decimal sumAssignQty = outStockLockInfos.Sum(x => x.AssignQuantity);
                     int outCount= outStockLockInfos.Select(x=>x.PalletCode).Distinct().Count();
                     if (sumAssignQty < AppSettings.Get("OutSGLength").ObjToInt() && outCount < AppSettings.Get("OutSGCount").ObjToInt())
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
index c5848e0..2aa16e7 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
@@ -367,7 +367,8 @@
                 BSTStockInfoDTO bSTStockInfoDTO = bSTResponse.Data ?? throw new Exception($"涓�鏈烢RP鏈繑鍥瀧stockInfoOld.PalletCode}鐨勫簱瀛樹俊鎭�");
                 stockInfoOld.IsPick = WhetherEnum.False.ObjToInt();
                 decimal stockLength = bSTStockInfoDTO.StockMeter;
-                if (weight != bSTStockInfoDTO.Qty && weight < stockInfoOld.InitialWeight)
+                decimal errWeight = Math.Abs(weight - bSTStockInfoDTO.Qty);
+                if (weight != bSTStockInfoDTO.Qty && weight < stockInfoOld.InitialWeight && errWeight <= AppSettings.Get("ErrWeight").ObjToInt())
                 {
                     Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterialSourceId == stockInfoOld.MaterielId);
                     int gramWeight = (int)(materielInfo.MaterielWeight * 1000);
@@ -376,7 +377,7 @@
                         Paper_code = stockInfoOld.PalletCode,
                         Estimate_weight = bSTStockInfoDTO.Qty,
                         Actual_weight = weight,
-                        Error_weight = Math.Abs(weight - bSTStockInfoDTO.Qty),
+                        Error_weight = errWeight,
                         Weigh_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                         Operator = "LiKu",
                         Width = bSTStockInfoDTO.W,
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
index f665f95..adae872 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
@@ -947,6 +947,7 @@
         public WebResponseContent ReceiveOutBound(List<OutMESOrderDTO> outMESOrderDTOs)
         {
             WebResponseContent content = new WebResponseContent();
+            string ErrorMsg = "";
             try
             {
                 if (outMESOrderDTOs == null || outMESOrderDTOs.Count <= 0)
@@ -976,11 +977,11 @@
                 //鑾峰彇鎵�鏈夊姞宸ヤ腑蹇�
                 List<Dt_MakeCenterInfo> makeCenterInfos = _basicRepository.MakeCenterInfoRepository.QueryData();
 
-                OutMESOrderDTO? CheckMaterialCode = outMESOrderDTOs.FirstOrDefault(x => !materielInfos.Select(x => x.MaterielCode).Contains(x.MaterialCode));
-                if (CheckMaterialCode != null)
-                {
-                    return content.Error($"鐗╂枡缂栫爜{nameof(OutMESOrderDTO.MaterialCode)}:{CheckMaterialCode.MaterialCode}淇℃伅涓嶅瓨鍦�");
-                }
+                //OutMESOrderDTO? CheckMaterialCode = outMESOrderDTOs.FirstOrDefault(x => !materielInfos.Select(x => x.MaterielCode).Contains(x.MaterialCode));
+                //if (CheckMaterialCode != null)
+                //{
+                //    return content.Error($"鐗╂枡缂栫爜{nameof(OutMESOrderDTO.MaterialCode)}:{CheckMaterialCode.MaterialCode}淇℃伅涓嶅瓨鍦�");
+                //}
                 OutMESOrderDTO? CheckMakeCenterCode = outMESOrderDTOs.FirstOrDefault(x => !makeCenterInfos.Select(x => x.MakeCode).Contains(x.MakeCode));
                 if (CheckMakeCenterCode!=null)
                 {
@@ -991,17 +992,23 @@
                 {
                     return content.Error($"棰嗘枡璁″垝{nameof(OutMESOrderDTO.OutDetailId)}:{OldoutMESOrder.OutDetailId}淇℃伅宸插瓨鍦�");
                 }
-                List<Dt_OutMESOrder> AddoutMESOrders = outMESOrderDTOs.Select(x => _mapper.Map<Dt_OutMESOrder>(x)).ToList();
-                foreach (var item in AddoutMESOrders)
+                List<Dt_OutMESOrder> AddoutMESOrders = new List<Dt_OutMESOrder>();
+                foreach (var item in outMESOrderDTOs)
                 {
-                    Dt_MaterielInfo materielInfo = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterialCode);
-                    Dt_MakeCenterInfo makeCenterInfo=makeCenterInfos.FirstOrDefault(x => x.MakeCode == item.MakeCode);
-                    item.MakeArea = makeCenterInfo.MakeArea;
-                    item.WarehouseId = materielInfo.WarehouseId;
-                    item.MaterielUnit = materielInfo.MaterielUnit;
-                    item.AssistUnitCode = materielInfo.AssistUnitCode;
+                    Dt_MaterielInfo? materielInfo = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterialCode);
+                    if (materielInfo==null)
+                    {
+                        ErrorMsg += $"鐗╂枡缂栫爜:{item.MaterialCode}淇℃伅涓嶅瓨鍦�;";
+                        continue;
+                    }
+                    Dt_MakeCenterInfo makeCenterInfo = makeCenterInfos.FirstOrDefault(x => x.MakeCode == item.MakeCode);
+                    Dt_OutMESOrder outMESOrder = _mapper.Map<Dt_OutMESOrder>(item);
+                    outMESOrder.MakeArea = makeCenterInfo.MakeArea;
+                    outMESOrder.WarehouseId = materielInfo.WarehouseId;
+                    outMESOrder.MaterielUnit = materielInfo.MaterielUnit;
+                    outMESOrder.AssistUnitCode = materielInfo.AssistUnitCode;
+                    AddoutMESOrders.Add(outMESOrder);
                 }
-                
                 _unitOfWorkManage.BeginTran();
                 //鎿嶄綔鏁版嵁锛屽苟鍒嗛厤闇�姹傚簱瀛�
                 _outboundRepository.OutMESOrderRepository.AddData(AddoutMESOrders);
@@ -1090,8 +1097,7 @@
                 //    }
                 //}
                 _unitOfWorkManage.CommitTran();
-                
-                return content.OK("鎺ユ敹鎴愬姛");
+                return content.OK(ErrorMsg.IsNullOrEmpty()? "鎺ユ敹鎴愬姛" : $"淇℃伅锛歿ErrorMsg}");
             }
             catch (Exception ex)
             {
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/appsettings.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/appsettings.json"
index abfe8ec..75c0435 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/appsettings.json"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/appsettings.json"
@@ -33,6 +33,7 @@
   "ExpMinutes": 360,
   "QuartzJobAutoStart": true,
   "OutSGLength": "50000",
+  "ErrWeight": "60", //璇樊閲嶉噺涓嶈秴杩�
   "OutSGCount": "17",
   "PDAVersion": "4",
   "WebSocketPort": 9296
diff --git "a/\351\241\271\347\233\256\350\265\204\346\226\231/\351\200\232\344\277\241\345\215\217\350\256\256/\344\272\214\346\245\274\347\216\257\347\272\27720250715.xlsx" "b/\351\241\271\347\233\256\350\265\204\346\226\231/\351\200\232\344\277\241\345\215\217\350\256\256/\344\272\214\346\245\274\347\216\257\347\272\27720250715.xlsx"
index ea4da57..b176c23 100644
--- "a/\351\241\271\347\233\256\350\265\204\346\226\231/\351\200\232\344\277\241\345\215\217\350\256\256/\344\272\214\346\245\274\347\216\257\347\272\27720250715.xlsx"
+++ "b/\351\241\271\347\233\256\350\265\204\346\226\231/\351\200\232\344\277\241\345\215\217\350\256\256/\344\272\214\346\245\274\347\216\257\347\272\27720250715.xlsx"
Binary files differ

--
Gitblit v1.9.3