From 9a886d711d8b21adc335fdf8c39350584c7ba6fd Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 14 十月 2025 02:12:14 +0800
Subject: [PATCH] 更新代码,取消MES出库单号同步标识,平库转立库功能,寄售周期判断取消,精品标识等

---
 代码管理/WMS/WIDESEA_WMSClient/src/extension/taskinfo/extend/relocationTask.vue         |    2 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesBagInfoModel.cs                       |    6 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_ProStockInfoDetail.cs      |    5 
 代码管理/WMS/WIDESEA_WMSClient/src/views/stock/ProStockView.vue                         |    8 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/ProOutOrderDetailService.cs      |    4 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs                   |   41 +
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs |    4 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Reloaction.cs        |    4 
 代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/proOutboundOrderDetail.vue |   18 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs          |    8 
 代码管理/WMS/WIDESEA_WMSClient/src/views/inbound/mesProInOrder.vue                      |    8 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_MesProInOrderDetail.cs   |    5 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs          |   19 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IStockRepository/IProStockInfoRepository.cs      |    2 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockInfoService.cs              |   63 ---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IProStockInfoService.cs            |    2 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/成品仓/AGV_CPExtend.cs                     |  387 ++++++----------------
 代码管理/WMS/WIDESEA_WMSClient/src/views/inbound/mesProInOrderDetail.vue                |   99 ++---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesProductService.cs             |   30 +
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs                 |    4 
 代码管理/WMS/WIDESEA_WMSClient/src/views/outbound/proOutOrderDetail.vue                 |  276 ++++++---------
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/ProStockInfoRepository.cs        |    5 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IProOutOrderDetailService.cs    |    2 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MES/MesController.cs       |    2 
 24 files changed, 378 insertions(+), 626 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/AGV_CPExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/AGV_CPExtend.cs"
index 2ad1a7e..c42b857 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/AGV_CPExtend.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/AGV_CPExtend.cs"
@@ -28,153 +28,33 @@
                     var newTasksIn = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.AGV_Execute.ObjToInt()) && x.TaskType>=TaskTypeEnum.Inbound.ObjToInt() && nameof(AGV_CPJob).Contains(x.DeviceCode) && !string.IsNullOrEmpty(x.DeviceCode) && x.TaskType!=999).ToList().OrderByDescending(x => x.Grade).ThenBy(x => x.CreateDate).ToList();
                     if (newTasksIn.Count>0)
                     {
-                        foreach (var task in newTasksIn)
-                        {
-                            try
-                            {
-                                if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
-                                    task.CurrentAddress = GetAGVAddress(task.CurrentAddress);
-                                else
-                                    task.NextAddress = GetAGVAddress(task.NextAddress);
-                                AgvTaskDTO taskDTO = new AgvTaskDTO()
-                                {
-                                    TaskCode = task.AgvTaskNum,
-                                    ReqCode = DateTime.Now.ToString("yyMMdd") + task.AgvTaskNum,
-                                    TaskTyp = task.TaskType < TaskTypeEnum.Inbound.ObjToInt() ? "CPC" : "CPR",
-                                    ctnrCode = task.PalletCode,
-                                    PositionCodePath = new List<CodePath>()
-                                    {
-                                        new CodePath()
-                                        {
-                                            type = "05",
-                                            positionCode = task.CurrentAddress
-                                        },
-                                        new CodePath()
-                                        {
-                                            type = "05",
-                                            positionCode = task.NextAddress
-                                        }
-                                    }
-                                };
-                                if (taskDTO.TaskTyp== "CPC")
-                                {
-                                    taskDTO.Priority = task.Grade.ToString();
-                                }
-                                if (task.GroupId.IsNotEmptyOrNull())
-                                {
-                                    taskDTO.GroupId=task.GroupId;
-                                }
-                                if (task.TaskType==TaskTypeEnum.OutMesRworkProduct.ObjToInt())
-                                {
-                                    taskDTO.Priority = "127";
-                                }
-                                //鍙戦�丄GV浠诲姟
-                                WebResponseContent content = _taskService.AgvSendTask(taskDTO, APIEnum.Agv_CPSendTask);
-                                if (!content.Status)
-                                    throw new Exception(content.Message);
-                                if (taskDTO.TaskTyp == "CPC")
-                                {
-                                    task.Dispatchertime = DateTime.Now;
-                                    _taskService.UpdateTask(task, TaskStatusEnum.AGV_Executing);
-                                }
-                                else
-                                {
-                                    task.Dispatchertime = DateTime.Now;
-                                    _taskService.UpdateTask(task, TaskStatusEnum.AGV_Takeing);
-                                }
-                                Thread.Sleep(500);
-                            }
-                            catch (Exception ex)
-                            {
-                                task.TaskState = TaskStatusEnum.Exception.ObjToInt();
-                                task.ExceptionMessage = ex.Message;
-                            }
-                        }
-                        if (newTasksIn.Count > 0)
-                        {
-                            _taskService.UpdateData(newTasksIn);
-                        }
+                        SendAgvTasks(newTasksIn);
                     }
                 }
                 #endregion
+                DateTime _taskStartTime = DateTime.Today;
                 #region 鍑哄簱鎺ㄩ�佷换鍔�1绾�
                 {
-                    var newTasksOut1 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress=="5236").OrderByDescending(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList();
+                    //鎸夋椂闂存煡鎵�
+                    var timeTasksOut1 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5236" && x.CreateDate<= _taskStartTime).OrderByDescending(x => x.Grade).ThenBy(x => x.CreateDate).Take(5).ToList();
+
+                    //鏂板垱寤轰换鍔�
+                    var newTasksOut1 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress=="5236").OrderByDescending(x => x.Grade).ThenBy(x => x.CreateDate).Take(5).ToList();
+
+                    var pushTasks1= timeTasksOut1.Count<=0 ? newTasksOut1 : timeTasksOut1;
+                    //褰撳墠绾夸綋浠诲姟
                     var downTasksOut1 = AllTasks.Where(x => (x.TaskState > TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5236").ToList();
+
                     Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.AGVStationCode == "5236");
                     IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                     if (device != null)
                     {
                         OtherDevice otherDevice = (OtherDevice)device;
                         short stationCurrentStatus = device.Communicator.Read<short>("DB29.112");
-                        if (newTasksOut1.Count > 0 && downTasksOut1.Count <= 0 && stationCurrentStatus == 1)
+                        if (pushTasks1.Count > 0 && downTasksOut1.Count <= 0 && stationCurrentStatus == 1)
                         {
-                            foreach (var task in newTasksOut1)
-                            {
-                                try
-                                {
-                                    if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
-                                        task.CurrentAddress = GetAGVAddress(task.CurrentAddress);
-                                    else
-                                        task.NextAddress = GetAGVAddress(task.NextAddress);
-                                    AgvTaskDTO taskDTO = new AgvTaskDTO()
-                                    {
-                                        TaskCode = task.AgvTaskNum,
-                                        ReqCode = DateTime.Now.ToString("yyMMdd") + task.AgvTaskNum,
-                                        TaskTyp = task.TaskType < TaskTypeEnum.Inbound.ObjToInt() ? "CPC" : "CPR",
-                                        ctnrCode = task.PalletCode,
-                                        PositionCodePath = new List<CodePath>()
-                                    {
-                                        new CodePath()
-                                        {
-                                            type = "05",
-                                            positionCode = task.CurrentAddress
-                                        },
-                                        new CodePath()
-                                        {
-                                            type = "05",
-                                            positionCode = task.NextAddress
-                                        }
-                                    }
-                                    };
-                                    if (taskDTO.TaskTyp == "CPC")
-                                    {
-                                        taskDTO.Priority = task.Grade.ToString();
-                                    }
-                                    if (task.GroupId.IsNotEmptyOrNull())
-                                    {
-                                        taskDTO.GroupId = task.GroupId;
-                                    }
-                                    if (task.TaskType == TaskTypeEnum.OutMesRworkProduct.ObjToInt())
-                                    {
-                                        taskDTO.Priority = "127";
-                                    }
-                                    //鍙戦�丄GV浠诲姟
-                                    WebResponseContent content = _taskService.AgvSendTask(taskDTO, APIEnum.Agv_CPSendTask);
-                                    if (!content.Status)
-                                        throw new Exception(content.Message);
-                                    if (taskDTO.TaskTyp == "CPC")
-                                    {
-                                        task.Dispatchertime = DateTime.Now;
-                                        _taskService.UpdateTask(task, TaskStatusEnum.AGV_Executing);
-                                    }
-                                    else
-                                    {
-                                        task.Dispatchertime = DateTime.Now;
-                                        _taskService.UpdateTask(task, TaskStatusEnum.AGV_Takeing);
-                                    }
-                                }
-                                catch (Exception ex)
-                                {
-                                    task.TaskState = TaskStatusEnum.Exception.ObjToInt();
-                                    task.ExceptionMessage = ex.Message;
-                                }
-                            }
-                            if (newTasksOut1.Count > 0)
-                            {
-                                _taskService.UpdateData(newTasksOut1);
-                            }
-                            WriteInfo("5236", $"1绾�5236鏃犱换鍔★紝鐘舵�亄stationCurrentStatus}鍙笅鍙戯紝涓嬪彂浠诲姟锛歿newTasksOut1.Select(x => x.TaskNum)}");
+                            SendAgvTasks(pushTasks1);
+                            WriteInfo("5236", $"1绾�5236鏃犱换鍔★紝鐘舵�亄stationCurrentStatus}鍙笅鍙戯紝涓嬪彂浠诲姟锛歿pushTasks1.Select(x => x.TaskNum)}");
                         }
                     }
                     
@@ -182,174 +62,56 @@
                 #endregion
                 #region 鍑哄簱鎺ㄩ�佷换鍔�2绾�
                 {
-                    var newTasksOut2 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5243").OrderByDescending(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList();
+                    //鎸夋椂闂存煡鎵�
+                    var timeTasksOut2 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5243" && x.CreateDate <= _taskStartTime).OrderByDescending(x => x.Grade).ThenBy(x => x.CreateDate).Take(5).ToList();
+
+                    //鏂板垱寤轰换鍔�
+                    var newTasksOut2 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5243").OrderByDescending(x => x.Grade).ThenBy(x => x.CreateDate).Take(5).ToList();
+
+                    var pushTasks2 = timeTasksOut2.Count <= 0 ? newTasksOut2 : timeTasksOut2;
+
+                    //褰撳墠绾夸綋浠诲姟
                     var downTasksOut2 = AllTasks.Where(x => (x.TaskState > TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5243").ToList();
+
                     Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.AGVStationCode == "5243");
                     IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                     if (device != null)
                     {
                         OtherDevice otherDevice = (OtherDevice)device;
                         short stationCurrentStatus = device.Communicator.Read<short>("DB29.126");
-                        if (newTasksOut2.Count > 0 && downTasksOut2.Count <= 0 && stationCurrentStatus == 1)
+                        if (pushTasks2.Count > 0 && downTasksOut2.Count <= 0 && stationCurrentStatus == 1)
                         {
-                            foreach (var task in newTasksOut2)
-                            {
-                                try
-                                {
-                                    if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
-                                        task.CurrentAddress = GetAGVAddress(task.CurrentAddress);
-                                    else
-                                        task.NextAddress = GetAGVAddress(task.NextAddress);
-                                    AgvTaskDTO taskDTO = new AgvTaskDTO()
-                                    {
-                                        TaskCode = task.AgvTaskNum,
-                                        ReqCode = DateTime.Now.ToString("yyMMdd") + task.AgvTaskNum,
-                                        TaskTyp = task.TaskType < TaskTypeEnum.Inbound.ObjToInt() ? "CPC" : "CPR",
-                                        ctnrCode = task.PalletCode,
-                                        PositionCodePath = new List<CodePath>()
-                                    {
-                                        new CodePath()
-                                        {
-                                            type = "05",
-                                            positionCode = task.CurrentAddress
-                                        },
-                                        new CodePath()
-                                        {
-                                            type = "05",
-                                            positionCode = task.NextAddress
-                                        }
-                                    }
-                                    };
-                                    if (taskDTO.TaskTyp == "CPC")
-                                    {
-                                        taskDTO.Priority = task.Grade.ToString();
-                                    }
-                                    if (task.GroupId.IsNotEmptyOrNull())
-                                    {
-                                        taskDTO.GroupId = task.GroupId;
-                                    }
-                                    if (task.TaskType == TaskTypeEnum.OutMesRworkProduct.ObjToInt())
-                                    {
-                                        taskDTO.Priority = "127";
-                                    }
-                                    //鍙戦�丄GV浠诲姟
-                                    WebResponseContent content = _taskService.AgvSendTask(taskDTO, APIEnum.Agv_CPSendTask);
-                                    if (!content.Status)
-                                        throw new Exception(content.Message);
-                                    if (taskDTO.TaskTyp == "CPC")
-                                    {
-                                        task.Dispatchertime = DateTime.Now;
-                                        _taskService.UpdateTask(task, TaskStatusEnum.AGV_Executing);
-                                    }
-                                    else
-                                    {
-                                        task.Dispatchertime = DateTime.Now;
-                                        _taskService.UpdateTask(task, TaskStatusEnum.AGV_Takeing);
-                                    }
-                                }
-                                catch (Exception ex)
-                                {
-                                    task.TaskState = TaskStatusEnum.Exception.ObjToInt();
-                                    task.ExceptionMessage = ex.Message;
-                                }
-                            }
-                            if (newTasksOut2.Count > 0)
-                            {
-                                _taskService.UpdateData(newTasksOut2);
-                            }
-                            WriteInfo("5243", $"2绾�5243鏃犱换鍔★紝鐘舵�亄stationCurrentStatus}鍙笅鍙戯紝涓嬪彂浠诲姟锛歿newTasksOut2.Select(x => x.TaskNum)}");
+                            SendAgvTasks(pushTasks2);
+                            WriteInfo("5243", $"2绾�5243鏃犱换鍔★紝鐘舵�亄stationCurrentStatus}鍙笅鍙戯紝涓嬪彂浠诲姟锛歿pushTasks2.Select(x => x.TaskNum)}");
                         }
-                        //else
-                        //{
-                        //    WriteInfo(nameof(AGV_CPJob), $"2绾挎棤浠诲姟锛岀姸鎬亄stationCurrentStatus}");
-                        //}
                     }
 
                 }
                 #endregion
                 #region 鍑哄簱鎺ㄩ�佷换鍔�3绾�
                 {
-                    var newTasksOut3 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5250").OrderByDescending(x => x.Grade).ThenBy(x => x.GroupId).Take(5).ToList();
+                    //鎸夋椂闂存煡鎵�
+                    var timeTasksOut3 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5250" && x.CreateDate <= _taskStartTime).OrderByDescending(x => x.Grade).ThenBy(x => x.CreateDate).Take(5).ToList();
+
+                    //鏂板垱寤轰换鍔�
+                    var newTasksOut3 = AllTasks.Where(x => (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5250").OrderByDescending(x => x.Grade).ThenBy(x => x.CreateDate).Take(5).ToList();
+
+                    var pushTasks3 = timeTasksOut3.Count <= 0 ? newTasksOut3 : timeTasksOut3;
+
+                    //褰撳墠绾夸綋浠诲姟
                     var downTasksOut3 = AllTasks.Where(x => (x.TaskState > TaskStatusEnum.New.ObjToInt()) && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.NextAddress == "5250").ToList();
+
                     Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.AGVStationCode == "5250");
                     IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
                     if (device != null)
                     {
                         OtherDevice otherDevice = (OtherDevice)device;
                         short stationCurrentStatus = device.Communicator.Read<short>("DB29.140");
-                        if (newTasksOut3.Count > 0 && downTasksOut3.Count <= 0 && stationCurrentStatus == 1)
+                        if (pushTasks3.Count > 0 && downTasksOut3.Count <= 0 && stationCurrentStatus == 1)
                         {
-                            foreach (var task in newTasksOut3)
-                            {
-                                try
-                                {
-                                    if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
-                                        task.CurrentAddress = GetAGVAddress(task.CurrentAddress);
-                                    else
-                                        task.NextAddress = GetAGVAddress(task.NextAddress);
-                                    AgvTaskDTO taskDTO = new AgvTaskDTO()
-                                    {
-                                        TaskCode = task.AgvTaskNum,
-                                        ReqCode = DateTime.Now.ToString("yyMMdd") + task.AgvTaskNum,
-                                        TaskTyp = task.TaskType < TaskTypeEnum.Inbound.ObjToInt() ? "CPC" : "CPR",
-                                        ctnrCode = task.PalletCode,
-                                        PositionCodePath = new List<CodePath>()
-                                    {
-                                        new CodePath()
-                                        {
-                                            type = "05",
-                                            positionCode = task.CurrentAddress
-                                        },
-                                        new CodePath()
-                                        {
-                                            type = "05",
-                                            positionCode = task.NextAddress
-                                        }
-                                    }
-                                    };
-                                    if (taskDTO.TaskTyp == "CPC")
-                                    {
-                                        taskDTO.Priority = task.Grade.ToString();
-                                    }
-                                    if (task.GroupId.IsNotEmptyOrNull())
-                                    {
-                                        taskDTO.GroupId = task.GroupId;
-                                    }
-                                    if (task.TaskType == TaskTypeEnum.OutMesRworkProduct.ObjToInt())
-                                    {
-                                        taskDTO.Priority = "127";
-                                    }
-                                    //鍙戦�丄GV浠诲姟
-                                    WebResponseContent content = _taskService.AgvSendTask(taskDTO, APIEnum.Agv_CPSendTask);
-                                    if (!content.Status)
-                                        throw new Exception(content.Message);
-                                    if (taskDTO.TaskTyp == "CPC")
-                                    {
-                                        task.Dispatchertime = DateTime.Now;
-                                        _taskService.UpdateTask(task, TaskStatusEnum.AGV_Executing);
-                                    }
-                                    else
-                                    {
-                                        task.Dispatchertime = DateTime.Now;
-                                        _taskService.UpdateTask(task, TaskStatusEnum.AGV_Takeing);
-                                    }
-                                }
-                                catch (Exception ex)
-                                {
-                                    task.TaskState = TaskStatusEnum.Exception.ObjToInt();
-                                    task.ExceptionMessage = ex.Message;
-                                }
-                            }
-                            if (newTasksOut3.Count > 0)
-                            {
-                                _taskService.UpdateData(newTasksOut3);
-                            }
-                            WriteInfo("5250", $"3绾�5250鏃犱换鍔★紝鐘舵�亄stationCurrentStatus}鍙笅鍙戯紝涓嬪彂浠诲姟锛歿newTasksOut3.Select(x => x.TaskNum)}");
+                            SendAgvTasks(pushTasks3);
+                            WriteInfo("5250", $"3绾�5250鏃犱换鍔★紝鐘舵�亄stationCurrentStatus}鍙笅鍙戯紝涓嬪彂浠诲姟锛歿pushTasks3.Select(x => x.TaskNum)}");
                         }
-                        //else
-                        //{
-                        //    WriteInfo(nameof(AGV_CPJob), $"3绾挎棤浠诲姟锛岀姸鎬亄stationCurrentStatus}");
-                        //}
                     }
 
                 }
@@ -498,6 +260,75 @@
             }
         }
         /// <summary>
+        /// 涓嬪彂AGV浠诲姟
+        /// </summary>
+        /// <param name="tasks"></param>
+        public void SendAgvTasks(List<Dt_Task> tasks)
+        {
+            foreach (var task in tasks)
+            {
+                try
+                {
+                    if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
+                        task.CurrentAddress = GetAGVAddress(task.CurrentAddress);
+                    else
+                        task.NextAddress = GetAGVAddress(task.NextAddress);
+                    AgvTaskDTO taskDTO = new AgvTaskDTO()
+                    {
+                        TaskCode = task.AgvTaskNum,
+                        ReqCode = DateTime.Now.ToString("yyMMdd") + task.AgvTaskNum,
+                        TaskTyp = task.TaskType < TaskTypeEnum.Inbound.ObjToInt() ? "CPC" : "CPR",
+                        ctnrCode = task.PalletCode,
+                        PositionCodePath = new List<CodePath>()
+                                    {
+                                        new CodePath()
+                                        {
+                                            type = "05",
+                                            positionCode = task.CurrentAddress
+                                        },
+                                        new CodePath()
+                                        {
+                                            type = "05",
+                                            positionCode = task.NextAddress
+                                        }
+                                    }
+                    };
+                    if (taskDTO.TaskTyp == "CPC")
+                    {
+                        taskDTO.Priority = task.Grade.ToString();
+                    }
+                    if (task.GroupId.IsNotEmptyOrNull())
+                    {
+                        taskDTO.GroupId = task.GroupId;
+                    }
+                    if (task.TaskType == TaskTypeEnum.OutMesRworkProduct.ObjToInt())
+                    {
+                        taskDTO.Priority = "127";
+                    }
+                    //鍙戦�丄GV浠诲姟
+                    WebResponseContent content = _taskService.AgvSendTask(taskDTO, APIEnum.Agv_CPSendTask);
+                    if (!content.Status)
+                        throw new Exception(content.Message);
+                    if (taskDTO.TaskTyp == "CPC")
+                    {
+                        task.Dispatchertime = DateTime.Now;
+                        _taskService.UpdateTask(task, TaskStatusEnum.AGV_Executing);
+                    }
+                    else
+                    {
+                        task.Dispatchertime = DateTime.Now;
+                        _taskService.UpdateTask(task, TaskStatusEnum.AGV_Takeing);
+                    }
+                }
+                catch (Exception ex)
+                {
+                    task.TaskState = TaskStatusEnum.Exception.ObjToInt();
+                    task.ExceptionMessage = ex.Message;
+                    _taskService.UpdateTask(task, TaskStatusEnum.Exception);
+                }
+            }
+        }
+        /// <summary>
         /// 鑾峰彇AGV鍦板潃
         /// </summary>
         /// <param name="Address"></param>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/proOutboundOrderDetail.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/proOutboundOrderDetail.vue"
index e3357c4..906509c 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/proOutboundOrderDetail.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/proOutboundOrderDetail.vue"
@@ -4,8 +4,8 @@
       v-model="dialogFormVisible"
       :on-model-close="closeCustomModel"
       :lazy="true"
-      width="20%"
-      :padding="15"
+      width="25%"
+      :padding="20"
       title="閫夋嫨鍑哄簱绾夸綋"
     >   
         <div> 
@@ -187,6 +187,7 @@
       formFields1: {
         LineCode: "",
         Grade: "0",
+        IsFineWorks: "0",
       },
       formRules1:[[
           {
@@ -208,6 +209,15 @@
           {
             title: "鏄惁浼樺厛",
             field: "Grade",
+            data: [],
+            required: false,
+            type: "switch",
+          },
+        ],
+          [
+          {
+            title: "鎸囧畾绮惧搧",
+            field: "IsFineWorks",
             data: [],
             required: false,
             type: "switch",
@@ -489,12 +499,13 @@
       var keys = this.selection.map((item) => item.id); // 鑾峰彇閫変腑琛岀殑id
 
       this.http
-        .post("api/Task/OutProductTask?stationCode="+this.formFields1.LineCode +"&grade="+this.formFields1.Grade, keys, "鏁版嵁澶勭悊涓�")
+        .post("api/Task/OutProductTask?stationCode="+this.formFields1.LineCode +"&grade="+this.formFields1.Grade+"&isFineWorks="+this.formFields1.isFineWorks, keys, "鏁版嵁澶勭悊涓�")
         .then((x) => {
           if (!x.status) return this.$message.error(x.message);
           this.$message.success("鎿嶄綔鎴愬姛");
           this.formFields1.LineCode="";
           this.formFields1.Grade="0";
+          this.formFields1.isFineWorks="0";
           this.dialogFormVisible=false;
           this.$parent.refresh();
           this.showDetialBox = false;
@@ -558,6 +569,7 @@
     closeCustomModel() {
       this.formFields1.LineCode="";
       this.formFields1.Grade="0";
+      this.formFields1.isFineWorks="0";
           this.dialogFormVisible=false;
           this.$parent.refresh();
     },
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/taskinfo/extend/relocationTask.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/taskinfo/extend/relocationTask.vue"
index 24adf36..96b0bdb 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/taskinfo/extend/relocationTask.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/taskinfo/extend/relocationTask.vue"
@@ -5,7 +5,7 @@
         :lazy="true"
         width="600px"
         :padding="15"
-        title="鎵撳嵃"
+        title="鎵嬪姩绉诲簱"
       >
         <div>
           <el-form>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/mesProInOrder.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/mesProInOrder.vue"
index e389f02..d23d3f9 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/mesProInOrder.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/mesProInOrder.vue"
@@ -244,6 +244,14 @@
         width: 150,
         align: "left",
       },
+      {
+          field: "isFineWorks",
+          title: "鏄惁绮惧搧",
+          type: "string",
+          width: 80,
+          align: "left",
+          bind: { key: "enableEnum", data: [] },
+        },
     {
         field: "overInQuantity",
         title: "涓婃灦鏁伴噺",
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/mesProInOrderDetail.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/mesProInOrderDetail.vue"
index 89816c8..f9a8ab3 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/mesProInOrderDetail.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/inbound/mesProInOrderDetail.vue"
@@ -18,79 +18,46 @@
       sortName: "id",
     });
     const editFormFields = ref({
-      deviceCode: "",
-      deviceName: "",
-      deviceType: "",
-      deviceStatus: "",
-      deviceIp: "",
-      devicePort: "",
-      devicePlcType: "",
-      deviceRemark: "",
+      
     });
     const editFormOptions = ref([
       [
-        {
-          title: "鐗╂枡缂栧彿",
-          required: true,
-          field: "materielCode",
-          type: "string",
-        },
-        {
-          title: "鍗曟嵁缂栧彿",
-          required: true,
-          field: "materielName",
-          type: "string",
-        },
-        {
-          title: "鎵规鍙�",
-          required: true,
-          field: "orderNo",
-          type: "string",
-        },
-        {
-          title: "搴忓垪鍙�",
-          required: true,
-          field: "serialNumber",
-          type: "string",
-        },
-      ],
-      
+        
+      ]
     ]);
     const searchFormFields = ref({
-      materielCode: "",
-      materielName: "",
-      orderNo: "",
+      bagNo: "",
+      productCode: "",
+      isFineWorks: "",
+      productVersion: "",
+      dateCode: "",
+      lotNumber: "",
+      saleOrder: "",
+      createDate: "",
     });
     const searchFormOptions = ref([
       [
-        { title: "鐗╂枡缂栧彿", field: "materielCode" },
-        { title: "鐗╂枡鍚嶇О", field: "materielName" },
-        { title: "鍗曟嵁缂栧彿", field: "orderNo" },
+        { title: "鍐呭寘鍙�", field: "bagNo",type:"like" },
+        { title: "浜у搧缂栫爜", field: "productCode", type: "like" },
+        { title: "鏄惁绮惧搧", field: "isFineWorks" ,type: "select",
+          dataKey: "enableEnum",
+          data: [],},
+        { title: "鐗堟湰", field: "productVersion",type:"like" },
+      ],
+      [
+        
+        { title: "鍛ㄦ湡", field: "dateCode", type: "like" },
+        { title: "鎵规", field: "lotNumber" , type: "like"},
+        { title: "ERP宸ュ崟", field: "saleOrder" , type: "like"},
+        { title: "鍒涘缓鏃堕棿", field: "createDate", type: "datetime" },
       ],
     ]);
     const columns = ref([
       {
-        field: "id",
-        title: "Id",
-        type: "int",
-        width: 90,
-        hidden: true,
-        readonly: true,
-        require: true,
-        align: "left",
-      },
-      {
-        field: "orderId",
-        title: "鍏ュ簱鍗曚富閿�",
-        type: "string",
-        width: 90,
-        align: "left",
-      },
-      {
         field: "bagNo",
         title: "鍐呭寘鍙�",
         type: "string",
-        width: 150,
+        width: 180,
         align: "left",
       },
       {
@@ -100,6 +67,14 @@
         width: 150,
         align: "left",
       },
+      {
+          field: "isFineWorks",
+          title: "鏄惁绮惧搧",
+          type: "string",
+          width: 80,
+          align: "left",
+          bind: { key: "enableEnum", data: [] },
+        },
     {
         field: "overInQuantity",
         title: "涓婃灦鏁伴噺",
@@ -190,12 +165,6 @@
         type: "string",
         width: 200,
         align: "left",
-      }, {
-        field: "remark",
-        title: "澶囨敞",
-        type: "string",
-        width: 200,
-        align: "left",
       },
       {
         field: "creater",
@@ -217,6 +186,7 @@
         type: "string",
         width: 100,
         align: "left",
+        hidden: true,
       },
       {
         field: "modifyDate",
@@ -224,6 +194,7 @@
         type: "datetime",
         width: 160,
         align: "left",
+        hidden: true,
       },
       {
         field: "remark",
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/outbound/proOutOrderDetail.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/outbound/proOutOrderDetail.vue"
index bc10867..1ede0d6 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/outbound/proOutOrderDetail.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/outbound/proOutOrderDetail.vue"
@@ -85,176 +85,132 @@
       ],
     ]);
     const searchFormFields = ref({
-      deviceCode: "",
+      pCode: "",
       deviceType: "",
       deviceStatus: "",
     });
     const searchFormOptions = ref([
       [
-        { title: "璁惧缂栧彿", field: "deviceCode" },
+        { title: "浜у搧缂栫爜", field: "pCode", type: "like" },
         { title: "璁惧绫诲瀷", field: "deviceType" },
         { title: "璁惧鐘舵��", field: "deviceStatus" },
       ],
     ]);
     const columns = ref([
-      {
-        field: "id",
-        title: "Id",
-        type: "int",
-        width: 90,
-        hidden: true,
-        readonly: true,
-        align: "left",
-      },
-      {
-        field: "proOrderId",
-        title: "鍑哄簱鍗曚富閿�",
-        type: "string",
-        width: 90,
-        align: "left",
-        hidden: true,
-      },
-      {
-        field: "rowId",
-        title: "鍑哄簱鍗曡鍙�",
-        type: "int",
-        width: 150,
-        align: "left",
-      },
-      {
-        field: "proOrderDetailStatus",
-        title: "璁㈠崟鏄庣粏鐘舵��",
-        type: "int",
-        width: 180,
-        align: "left",
-      },
-      {
-        field: "saleOrder",
-        title: "閿�鍞鍗曞彿",
-        type: "string",
-        width: 150,
-        align: "left",
-      },
-      {
-        field: "customer",
-        title: "瀹㈡埛",
-        type: "string",
-        width: 90,
-        align: "left",
-      },
-      {
-        field: "factoryCode",
-        title: "宸ュ巶",
-        type: "string",
-        width: 90,
-        align: "left",
-      },
-      {
-        field: "pCode",
-        title: "浜у搧缂栫爜",
-        type: "string",
-        width: 120,
-        align: "left",
-      },
-      {
-        field: "dateCode",
-        title: "浜у搧鍛ㄦ湡",
-        type: "string",
-        width: 120,
-        align: "left",
-      },
-      {
-        field: "pVer",
-        title: "浜у搧鐗堟湰",
-        type: "string",
-        width: 200,
-        align: "left",
-      },
-      {
-        field: "pLot",
-        title: "浜у搧鎵规",
-        type: "string",
-        width: 200,
-        align: "left",
-      },
-      {
-        field: "qtyPcs",
-        title: "鍚堟牸PCS鏁�",
-        type: "string",
-        width: 120,
-        align: "left",
-      },
-      {
-        field: "overQtyPcs",
-        title: "宸插嚭鏁伴噺",
-        type: "string",
-        width: 120,
-        align: "left",
-      },
-      {
-        field: "xQty",
-        title: "x鏉挎暟",
-        type: "string",
-        width: 120,
-        align: "left",
-      },
-      {
-        field: "xSite",
-        title: "x鏉夸綅",
-        type: "string",
-        width: 120,
-        align: "left",
-      },
-      {
-        field: "unit",
-        title: "鍗曚綅",
-        type: "string",
-        width: 120,
-        align: "left",
-      },
-      {
-        field: "spareQty",
-        title: "澶囧搧鏁�",
-        type: "string",
-        width: 120,
-        align: "left",
-      },
-
-      {
-        field: "creater",
-        title: "鍒涘缓浜�",
-        type: "string",
-        width: 90,
-        align: "left",
-      },
-      {
-        field: "createDate",
-        title: "鍒涘缓鏃堕棿",
-        type: "datetime",
-        width: 160,
-        align: "left",
-      },
-      {
-        field: "modifier",
-        title: "淇敼浜�",
-        type: "string",
-        width: 100,
-        align: "left",
-      },
-      {
-        field: "modifyDate",
-        title: "淇敼鏃堕棿",
-        type: "datetime",
-        width: 160,
-        align: "left",
-      },
-      {
-        field: "remark",
-        title: "澶囨敞",
-        type: "string",
-        width: 100,
-        align: "left",
-      },
+    {
+          field: "id",
+          title: "Id",
+          type: "int",
+          width: 90,
+          hidden: true,
+          readonly: true,
+          require: true,
+          align: "left",
+        },
+        {
+          field: "proOrderId",
+          title: "鍑哄簱鍗曚富閿�",
+          type: "string",
+          width: 90,
+          align: "left",
+          hidden: true,
+        },
+        {
+          field: "pCode",
+          title: "浜у搧缂栫爜",
+          type: "string",
+          width: 150,
+          align: "left",
+        },
+        {
+          field: "pVer",
+          title: "浜у搧鐗堟湰",
+          type: "string",
+          width: 90,
+          align: "left",
+        },
+        {
+          field: "saleOrder",
+          title: "閿�鍞鍗曞彿",
+          type: "string",
+          width: 90,
+          align: "left",
+        },
+        {
+          field: "orderQuantity",
+          title: "鍗曟嵁鏁伴噺",
+          type: "string",
+          width: 90,
+          align: "left",
+          edit: { type: "number" },
+          required: true,
+        },
+        {
+          field: "rowNo",
+          title: "琛屽彿",
+          type: "string",
+          width: 90,
+          align: "left",
+          edit: { type: "number" },
+          required: true,
+        },
+        {
+          field: "lockQuantity",
+          title: "閿佸畾鏁伴噺",
+          type: "int",
+          width: 120,
+          align: "left",
+        },
+        {
+          field: "overOutQuantity",
+          title: "宸插嚭鏁伴噺",
+          type: "string",
+          width: 200,
+          align: "left",
+        },
+        {
+          field: "proOrderDetailStatus",
+          title: "璁㈠崟鏄庣粏鐘舵��",
+          type: "string",
+          width: 180,
+          align: "left",
+          bind: { key: "orderDetailStatusEnum", data: [] },
+        },
+        {
+          field: "creater",
+          title: "鍒涘缓浜�",
+          type: "string",
+          width: 90,
+          align: "left",
+        },
+        {
+          field: "createDate",
+          title: "鍒涘缓鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
+        },
+        {
+          field: "modifier",
+          title: "淇敼浜�",
+          type: "string",
+          width: 100,
+          align: "left",
+        },
+        {
+          field: "modifyDate",
+          title: "淇敼鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
+        },
+        {
+          field: "remark",
+          title: "澶囨敞",
+          type: "string",
+          width: 100,
+          align: "left",
+        },
     ]);
     const detail = ref({
       cnName: "#detailCnName",
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/stock/ProStockView.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/stock/ProStockView.vue"
index c1da3d8..9018810 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/stock/ProStockView.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/stock/ProStockView.vue"
@@ -108,6 +108,14 @@
           align: "left",
           bind: { key: "proStockAttributeEnum", data: [] },
         },
+        {
+          field: "isFineWorks",
+          title: "鏄惁绮惧搧",
+          type: "string",
+          width: 80,
+          align: "left",
+          bind: { key: "enableEnum", data: [] },
+        },
         // {
         //   field: "roadwayNo",
         //   title: "宸烽亾缂栧彿",
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesBagInfoModel.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesBagInfoModel.cs"
index 502e3a0..892676a 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesBagInfoModel.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesBagInfoModel.cs"
@@ -33,7 +33,7 @@
         public List<MESBagDetail> BagDetails { get; set; }
     }
     /// <summary>
-    /// MES鍐呭寘鍏ュ簱
+    /// MES澶栧寘鍏ュ簱
     /// </summary>
     public class MesBoxInfoModel
     {
@@ -103,6 +103,10 @@
         /// 鍐呭寘鏄庣粏
         /// </summary>
         public List<MESBagItem> BagItems { get; set; }
+        /// <summary>
+        /// 鏄惁绮惧搧
+        /// </summary>
+        public int IsFineWorks { get; set; }
     }
     /// <summary>
     /// 鍐呭寘鏄庣粏
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IProOutOrderDetailService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IProOutOrderDetailService.cs"
index b94d169..b2aa7ea 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IProOutOrderDetailService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IProOutOrderDetailService.cs"
@@ -17,7 +17,7 @@
         /// <summary>
         /// 鍒嗛厤搴撳瓨澶勭悊璐т綅鏁版嵁
         /// </summary>
-        (List<Dt_ProStockInfo>, List<Dt_ProOutOrderDetail>, List<Dt_OutProStockInfo>, List<Dt_LocationInfo>) AssignProStockOut(List<Dt_ProOutOrderDetail> proOutOrderDetails);
+        (List<Dt_ProStockInfo>, List<Dt_ProOutOrderDetail>, List<Dt_OutProStockInfo>, List<Dt_LocationInfo>) AssignProStockOut(List<Dt_ProOutOrderDetail> proOutOrderDetails, bool isFineWorks = false);
         /// <summary>
         /// 鍑哄簱浠诲姟鏁版嵁澶勭悊
         /// </summary>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockRepository/IProStockInfoRepository.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockRepository/IProStockInfoRepository.cs"
index 05fcc95..c004082 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockRepository/IProStockInfoRepository.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockRepository/IProStockInfoRepository.cs"
@@ -13,7 +13,7 @@
         /// <summary>
         /// 鏌ユ壘鍙敤搴撳瓨
         /// </summary>
-        List<Dt_ProStockInfo> GetProStocks(Dt_ProOutOrderDetail proOutOrderDetail,List<string> locationInfos);
+        List<Dt_ProStockInfo> GetProStocks(Dt_ProOutOrderDetail proOutOrderDetail,List<string> locationInfos, bool isFineWorks = false);
         /// <summary>
         /// 鑾峰彇鎴愬搧搴撳瓨
         /// </summary>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IProStockInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IProStockInfoService.cs"
index bc5158f..c01cce4 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IProStockInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IStockService/IProStockInfoService.cs"
@@ -22,7 +22,7 @@
         /// <summary>
         /// 鏌ユ壘鍙敤搴撳瓨
         /// </summary>
-        List<Dt_ProStockInfo> GetUseableStocks(int warehoseId, Dt_ProOutOrderDetail proOutOrderDetail);
+        List<Dt_ProStockInfo> GetUseableStocks(int warehoseId, Dt_ProOutOrderDetail proOutOrderDetail, bool isFineWorks = false);
         /// <summary>
         /// 鑾峰彇鍑哄簱搴撳瓨
         /// </summary>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
index b844fc7..f1d6d3e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
@@ -337,7 +337,7 @@
         /// MES鎴愬搧鍐呭寘淇℃伅鎺ユ敹
         /// </summary>
         /// <returns></returns>
-        MesResponseContent BagInfoSync(MesBagInfoModel bagInfoModel);
+        MesResponseContent BagInfoSync(MesBagInfoModel bagInfoModel, string formSign = "");
         /// <summary>
         /// MES鎴愬搧澶栧寘淇℃伅鎺ユ敹
         /// </summary>
@@ -377,7 +377,7 @@
         /// <param name="ProOutNo">鍑哄簱璁㈠崟鍙�</param>
         /// <param name="StationCode">绔欏彴鍦板潃</param>
         /// <returns></returns>
-        Task<WebResponseContent> OutProductTask(int[] keys, string StationCode, int Grade);
+        Task<WebResponseContent> OutProductTask(int[] keys, string StationCode, int Grade, bool isFineWorks = false);
         Task<WebResponseContent> OutProScrapTask(int[] keys, string StationCode, int Grade);
         /// <summary>
         /// 鎴愬搧浣欐枡閫�搴撳叆浠�
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs"
index 04c3cb0..a71f332 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs"
@@ -194,10 +194,9 @@
                     {
                         //float stockMaxQty = stockInfo.Details.Max(x => x.StockQuantity);
                         //float stockMinQty = stockInfo.Details.Min(x => x.StockQuantity);
-                        Dt_StockInfoDetail? addstockInfoDetail = stockInfo.Details?.FirstOrDefault();
-                        addstockInfoDetail.Id = 0;
-                        addstockInfoDetail.StockQuantity = (takeStockOrderDetail.Qty - takeStockOrderDetail.SysQty);
-                        addStockDetails.Add(addstockInfoDetail);
+                        Dt_StockInfoDetail addstockInfoDetail = stockInfo.Details.OrderByDescending(x=>x.Id).FirstOrDefault();
+                        addstockInfoDetail.StockQuantity = takeStockOrderDetail.Qty;
+                        updateStockDetails.Add(addstockInfoDetail);
                     }
                     else if (takeStockOrderDetail.Qty==0) //鐩樹簭
                     {
@@ -266,14 +265,6 @@
                     {
                         _stockInfoDetailRepository.DeleteAndMoveIntoHty(delStockDetails, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
                     }
-                    if (addStockDetails.Count>0)
-                    {
-                        addStockDetails.ForEach(x =>
-                        {
-                            x.Status = StockStatusEmun.鐩樼偣搴撳瓨瀹屾垚.ObjToInt();
-                        });
-                        _stockInfoDetailRepository.AddData(addStockDetails);
-                    }
                     if (updateStockDetails.Count>0)
                     {
                         updateStockDetails.ForEach(x =>
@@ -299,12 +290,12 @@
                             Createtime = takeStockOrder.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"),
                             Details = new List<TakeDetailsItem>()
                         };
-                        foreach (var item in takeStockOrderDetails)
+                        foreach (var item in takeStockOrderDetails.Where(x=>x.Qty!=x.SysQty))
                         {
                             TakeDetailsItem takeDetailsItem = new TakeDetailsItem()
                             {
                                 MaterialsCode = item.MaterielCode,
-                                LocationCode = item.LocationCode,
+                                LocationCode = warehouse.WarehouseCode,
                                 Lotno = item.BatchNo,
                                 Sysqty = item.SysQty.ObjToDecimal(),
                                 Qty = item.Qty.ObjToDecimal()
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_MesProInOrderDetail.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_MesProInOrderDetail.cs"
index 5150702..c0de1d9 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_MesProInOrderDetail.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_MesProInOrderDetail.cs"
@@ -102,6 +102,11 @@
         [SugarColumn(IsNullable = true, ColumnDescription = "鍖呰鏃堕棿")]
         public DateTime PackingDate { get; set; }
         /// <summary>
+        /// 鏄惁绮惧搧
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "鏄惁绮惧搧")]
+        public int IsFineWorks { get; set; }
+        /// <summary>
         /// 澶囨敞
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")]
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_ProStockInfoDetail.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_ProStockInfoDetail.cs"
index ef5ebb5..deacb36 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_ProStockInfoDetail.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_ProStockInfoDetail.cs"
@@ -137,6 +137,11 @@
         [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "閿�鍞寚娲剧増鏈�")]
         public string SpecifyVer { get; set; }
         /// <summary>
+        /// 鏄惁绮惧搧
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "鏄惁绮惧搧")]
+        public int IsFineWorks { get; set; }
+        /// <summary>
         /// 澶囨敞
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")]
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/ProOutOrderDetailService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/ProOutOrderDetailService.cs"
index cb4e9f8..ce55e05 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/ProOutOrderDetailService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/ProOutOrderDetailService.cs"
@@ -95,7 +95,7 @@
         /// <summary>
         /// 鍒嗛厤搴撳瓨澶勭悊璐т綅鏁版嵁
         /// </summary>
-        public (List<Dt_ProStockInfo>, List<Dt_ProOutOrderDetail>, List<Dt_OutProStockInfo>, List<Dt_LocationInfo>) AssignProStockOut(List<Dt_ProOutOrderDetail> proOutOrderDetails)
+        public (List<Dt_ProStockInfo>, List<Dt_ProOutOrderDetail>, List<Dt_OutProStockInfo>, List<Dt_LocationInfo>) AssignProStockOut(List<Dt_ProOutOrderDetail> proOutOrderDetails, bool isFineWorks = false)
         {
             List<Dt_ProStockInfo> outStocks = new List<Dt_ProStockInfo>();
             List<Dt_OutProStockInfo> outProStockInfos = new List<Dt_OutProStockInfo>();
@@ -110,7 +110,7 @@
             {
                 float needQty = item.QtyPcs;
                 //鏌ユ壘鍙敤搴撳瓨
-                List<Dt_ProStockInfo> stockInfoss = _stockInfoService.ProStockInfoService.GetUseableStocks(proOutOrder.WarehouseId, item);
+                List<Dt_ProStockInfo> stockInfoss = _stockInfoService.ProStockInfoService.GetUseableStocks(proOutOrder.WarehouseId, item, isFineWorks);
                 if (!stockInfoss.Any())
                 {
                     throw new Exception("鏈壘鍒板彲鍒嗛厤搴撳瓨");
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/ProStockInfoRepository.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/ProStockInfoRepository.cs"
index 7063262..12f8f19 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/ProStockInfoRepository.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/ProStockInfoRepository.cs"
@@ -22,11 +22,10 @@
             _basicRepository = basicRepository;
         }
         //鏍规嵁鏄庣粏鏁版嵁鏌ユ壘鍙敤搴撳瓨搴撳瓨
-        public List<Dt_ProStockInfo> GetProStocks(Dt_ProOutOrderDetail proOutOrderDetail,List<string> locationInfos)
+        public List<Dt_ProStockInfo> GetProStocks(Dt_ProOutOrderDetail proOutOrderDetail,List<string> locationInfos, bool isFineWorks = false)
         {
             List<Dt_ProStockInfo>? proStockInfos = null;
             bool isCanLot= string.IsNullOrEmpty(proOutOrderDetail.PLot);
-            bool isCanDate = string.IsNullOrEmpty(proOutOrderDetail.DateCode);
             bool isCanVer = string.IsNullOrEmpty(proOutOrderDetail.OutSpecifyVer);
             ////鍒ゆ柇瀹㈡埛鍑哄叆瑙勫垯
             //Dt_CustomerInfo customerInfo = _basicRepository.CustomerInfoRepository.QueryFirst(x=>x.Code== proOutOrderDetail.Customer);
@@ -57,7 +56,7 @@
                     v.ProductCode == proOutOrderDetail.PCode
                     && v.ProductVersion.StartsWith(proOutOrderDetail.PVer.Substring(0,1)) 
                     && (isCanLot ? isCanLot : v.ProductCode == proOutOrderDetail.PLot)
-                    && (isCanDate ? isCanDate : v.DateCode == proOutOrderDetail.DateCode)
+                    && (isFineWorks ? !isCanLot : v.IsFineWorks == 1)
                 ))
                 .ToList();
             //}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockInfoService.cs"
index 9321114..30b840b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/ProStockInfoService.cs"
@@ -97,10 +97,10 @@
             return content;
         }
         //鏌ユ壘鍙敤搴撳瓨
-        public List<Dt_ProStockInfo> GetUseableStocks(int warehoseId,Dt_ProOutOrderDetail proOutOrderDetail)
+        public List<Dt_ProStockInfo> GetUseableStocks(int warehoseId,Dt_ProOutOrderDetail proOutOrderDetail, bool isFineWorks = false)
         {
             List<string> locationCodes = _basicRepository.LocationInfoRepository.GetCanOutLocationCodes(warehoseId);
-            return BaseDal.GetProStocks(proOutOrderDetail,locationCodes);
+            return BaseDal.GetProStocks(proOutOrderDetail,locationCodes, isFineWorks);
         }
         /// <summary>
         /// MES鎻愬簱鍙敤搴撳瓨
@@ -126,10 +126,8 @@
         {
             List<Dt_ProStockInfo> assignOutStocks =new List<Dt_ProStockInfo>();
             bool isCanLot = string.IsNullOrEmpty(outOrderDetail.PLot);
-            bool isCanDate = string.IsNullOrEmpty(outOrderDetail.DateCode);
             float stockTotalQuantity = stockInfos.Select(x => x.proStockInfoDetails.Where(x => x.ProductCode == outOrderDetail.PCode && x.ProductVersion.StartsWith(outOrderDetail.PVer.Substring(0, 1))
-                            && (isCanLot ? isCanLot : x.ProductCode == outOrderDetail.PLot)
-                            && (isCanDate ? isCanDate : x.DateCode == outOrderDetail.DateCode))
+                            && (isCanLot ? isCanLot : x.ProductCode == outOrderDetail.PLot))
                         .Sum(v => v.StockPcsQty - v.OutboundQuantity)).Sum(x => x);
             //stockInfos = stockInfos.OrderBy(x => x.Id).ToList();
             
@@ -141,14 +139,12 @@
                     Dt_ProStockInfo stockInfo = stockInfos[index];
                     float useableStockQuantity = stockInfo.proStockInfoDetails
                         .Where(x => x.ProductCode == outOrderDetail.PCode && x.ProductVersion.StartsWith(outOrderDetail.PVer.Substring(0,1))
-                            && (isCanLot ? isCanLot : x.ProductCode == outOrderDetail.PLot)
-                            && (isCanDate ? isCanDate : x.DateCode == outOrderDetail.DateCode))
+                            && (isCanLot ? isCanLot : x.ProductCode == outOrderDetail.PLot))
                         .Sum(x => x.StockPcsQty - x.OutboundQuantity);
                     if (useableStockQuantity < needQuantity && useableStockQuantity >0)
                     {
                         stockInfo.proStockInfoDetails.Where(x => x.ProductCode == outOrderDetail.PCode && x.ProductVersion.StartsWith(outOrderDetail.PVer.Substring(0, 1))
-                            && (isCanLot ? isCanLot : x.ProductCode == outOrderDetail.PLot)
-                            && (isCanDate ? isCanDate : x.DateCode == outOrderDetail.DateCode)).ToList().ForEach(x => x.OutboundQuantity = x.StockPcsQty);
+                            && (isCanLot ? isCanLot : x.ProductCode == outOrderDetail.PLot)).ToList().ForEach(x => x.OutboundQuantity = x.StockPcsQty);
                         needQuantity -= useableStockQuantity;
                     }
                     else
@@ -158,8 +154,7 @@
                             //婊¤冻鏉′欢杩涜鍒嗛厤
                             if ((x.StockPcsQty > x.OutboundQuantity)
                                 && x.ProductCode == outOrderDetail.PCode && x.ProductVersion.StartsWith(outOrderDetail.PVer.Substring(0, 1)) 
-                                && (isCanLot ? isCanLot : x.ProductCode == outOrderDetail.PLot)
-                                && (isCanDate ? isCanDate : x.DateCode == outOrderDetail.DateCode))
+                                && (isCanLot ? isCanLot : x.ProductCode == outOrderDetail.PLot))
                             {
                                 if (x.StockPcsQty - x.OutboundQuantity >= needQuantity)
                                 {
@@ -182,52 +177,6 @@
                     index++;
                 }
             }
-            #region 鎴愬搧鍙敤搴撳瓨涓嶈冻涓嶈繘琛屽垎閰�
-            //else
-            //{
-            //    for (int i = 0; i < stockInfos.Count; i++)
-            //    {
-            //        Dt_ProStockInfo stockInfo = stockInfos[i];
-            //        float useableStockQuantity = stockInfo.proStockInfoDetails
-            //            .Where(x => x.ProductCode == outOrderDetail.PCode && x.ProductVersion == outOrderDetail.PVer
-            //                && (isCanLot ? isCanLot : x.BagNo == outOrderDetail.PLot)
-            //                && (isCanDate ? isCanDate : x.DateCode == outOrderDetail.DateCode))
-            //            .Sum(x => x.StockPcsQty - x.OutboundQuantity);
-            //        if (useableStockQuantity < needQuantity)
-            //        {
-            //            stockInfo.proStockInfoDetails.ForEach(x => x.OutboundQuantity = x.StockPcsQty);
-            //            needQuantity -= useableStockQuantity;
-            //        }
-            //        else
-            //        {
-            //            stockInfo.proStockInfoDetails.ForEach(x =>
-            //            {
-            //                if (x.StockPcsQty > x.OutboundQuantity && x.ProductCode == outOrderDetail.PCode && x.ProductVersion == outOrderDetail.PVer
-            //                    && (isCanLot ? isCanLot : x.BagNo == outOrderDetail.PLot)
-            //                    && (isCanDate ? isCanDate : x.DateCode == outOrderDetail.DateCode))
-            //                {
-            //                    if (x.StockPcsQty - x.OutboundQuantity >= needQuantity)
-            //                    {
-            //                        x.OutboundQuantity += needQuantity;
-            //                        needQuantity = 0;
-            //                    }
-            //                    else
-            //                    {
-            //                        needQuantity -= (x.StockPcsQty - x.OutboundQuantity);
-            //                        x.OutboundQuantity = x.StockPcsQty;
-            //                    }
-            //                }
-            //            });
-            //        }
-            //        stockInfo.proStockInfoDetails.ForEach(x =>
-            //        {
-            //            x.OutDetailSaleNo = outOrderDetail.SaleOrder;
-            //            x.OutDetailId = outOrderDetail.Id;
-            //        });
-            //        assignOutStocks.Add(stockInfo);
-            //    }
-            //}
-            #endregion
             residueQuantity = needQuantity;
             return assignOutStocks;
         }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesProductService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesProductService.cs"
index f24d033..7b1f8e9 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesProductService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesProductService.cs"
@@ -30,7 +30,7 @@
         /// MES鎴愬搧鍏ュ簱鍗曟帴鏀�
         /// </summary>
         /// <returns></returns>
-        public MesResponseContent BagInfoSync(MesBagInfoModel bagInfoModel)
+        public MesResponseContent BagInfoSync(MesBagInfoModel bagInfoModel, string formSign = "")
         {
             MesResponseContent content = new MesResponseContent();
             try
@@ -111,6 +111,7 @@
                             ERPOrder = child.ERPOrder,
                             SaleOrder = child.SaleOrder,
                             MoNumber = child.MoNumber,
+                            IsFineWorks=item.IsFineWorks,
                         };
                         mesProInOrderDetails.Add(mesProInOrderDetail);
                     }
@@ -177,18 +178,21 @@
                 newTask.TaskId = taskId;
                 Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand();
                 //涓婁紶ERP
-                WebResponseContent responseContent = _inboundOrderService.FeedbackProIn(mesProInOrder);
+                if (string.IsNullOrEmpty(formSign))
+                {
+                    WebResponseContent responseContent = _inboundOrderService.FeedbackProIn(mesProInOrder);
+                    if (!responseContent.Status)
+                    {
+                        //mesProInOrder.UpErpStatus = WhetherEnum.False.ObjToInt();
+                        //mesProInOrder.Remark = responseContent.Message;
+                        throw new Exception(responseContent.Message);
+                    }
+                    else
+                    {
+                        mesProInOrder.UpErpStatus = WhetherEnum.True.ObjToInt();
+                    }
+                }
                 _proInStatisticsService.SaveStatic(bagInfoModel);
-                if (!responseContent.Status)
-                {
-                    //mesProInOrder.UpErpStatus = WhetherEnum.False.ObjToInt();
-                    //mesProInOrder.Remark = responseContent.Message;
-                    throw new Exception(responseContent.Message);
-                }
-                else
-                {
-                    mesProInOrder.UpErpStatus = WhetherEnum.True.ObjToInt();
-                }
                 Db.InsertNav(mesProInOrder).Include(x => x.Details).ExecuteCommand();
                 _unitOfWorkManage.CommitTran();
                 //鎺ㄩ�佷换鍔�
@@ -440,7 +444,7 @@
             mesShipOrderDetails.Add(orderDetail);
             MesShipmentOrderSync shipmentOrderSync = new MesShipmentOrderSync()
             {
-                ShipmentOrder = proOutOrder.ProOutOrderNo+"-"+ outProStockInfo.TaskNum,
+                ShipmentOrder = proOutOrder.ProOutOrderNo,
                 PlantShipDate = proOutOrder.PlantShipDate.ToString("yyyy-MM-dd HH:mm:ss"),
                 Customer = proOutOrderDetail.EndCustomer,
                 FactoryCode = proOutOrderDetail.FactoryCode,
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index f94a2e9..bd1d916 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -360,7 +360,7 @@
                 });
                 //鏇存柊浠诲姟鐘舵��
                 task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
-                
+                FeedBackWCSTaskCompleted(taskNum);
                 _unitOfWorkManage.BeginTran();
                 BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.浜哄伐瀹屾垚 : OperateTypeEnum.鑷姩瀹屾垚);
                 _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId);
@@ -391,7 +391,7 @@
                         _inboundOrderService.FeedbackInboundOrder(inboundOrder.Id);
                     }
                 }
-                FeedBackWCSTaskCompleted(taskNum);
+                
                 return WebResponseContent.Instance.OK();
             }
             catch (Exception ex)
@@ -496,8 +496,8 @@
                     x.ProOutDetailStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
                 });
 
-                #region todo:涓存椂鏇存柊鎵�鏈夌爺鍙戣浆鎴愬搧
-                if (proStockInfo.ProStockAttribute == ProStockAttributeEnum.鐮斿彂.ObjToInt())
+                #region todo:涓存椂鏇存柊鎵�鏈夌爺鍙戞垨灏炬暟杞垚鍝�
+                if (proStockInfo.ProStockAttribute == ProStockAttributeEnum.鐮斿彂.ObjToInt() || proStockInfo.ProStockAttribute == ProStockAttributeEnum.灏炬暟.ObjToInt())
                 {
                     proStockInfo.ProStockAttribute = ProStockAttributeEnum.鎴愬搧.ObjToInt();
                     proStockInfo.WarehouseId = locationInfo.WarehouseId;
@@ -702,7 +702,7 @@
                 }
 
                 task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
-                
+                FeedBackWCSTaskCompleted(taskNum);
                 _unitOfWorkManage.BeginTran();
 
                 if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.OutQuality.ObjToInt() || task.TaskType == TaskTypeEnum.OutAllocate.ObjToInt() || task.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt() || task.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt())
@@ -771,14 +771,14 @@
                 _unitOfWorkManage.CommitTran();
 
                 //PP鍑哄簱浠诲姟瀹屾垚鍒ゆ柇銆傘�傘�傘�傘�傘�傘�傘�傘�傘�傘�傘�傘�傘�傘�傘�傘��
-                if (warehouse.WarehouseCode == WarehouseEnum.HA58.ToString() && task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
-                {
-                    _outboundService.MesPPOutboundOrderService.Repository.UpdateData(mesPPOutboundOrders);
-                    MesMaterialLotaAceptModel model = GetMesMaterialLotaAceptModel(stockInfo, stockInfo.Details.FirstOrDefault(), mesPPOutboundOrders.FirstOrDefault().TaskNo, warehouse.WarehouseCode, stockInfo.Details.Where(x => x.MaterielCode == mesPPOutboundOrders.FirstOrDefault().MaterialCode).Sum(x => x.StockQuantity));
-                    UploadMesMaterialLotaAcept(model);
-                    _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
-                    _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
-                }
+                //if (warehouse.WarehouseCode == WarehouseEnum.HA58.ToString() && task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
+                //{
+                //    _outboundService.MesPPOutboundOrderService.Repository.UpdateData(mesPPOutboundOrders);
+                //    MesMaterialLotaAceptModel model = GetMesMaterialLotaAceptModel(stockInfo, stockInfo.Details.FirstOrDefault(), mesPPOutboundOrders.FirstOrDefault().TaskNo, warehouse.WarehouseCode, stockInfo.Details.Where(x => x.MaterielCode == mesPPOutboundOrders.FirstOrDefault().MaterialCode).Sum(x => x.StockQuantity));
+                //    UploadMesMaterialLotaAcept(model);
+                //    _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
+                //    _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
+                //}
                 if (warehouse.WarehouseCode != WarehouseEnum.HA64.ToString() && task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
                 {
                     _outboundService.OutboundOrderService.TestOutUpload(outboundOrderDetails.FirstOrDefault().OrderId, outStockLockInfos);
@@ -788,7 +788,7 @@
                     MesMaterialLotaAceptModel model = GetMesMaterialLotaAceptModel(stockInfo, stockInfo.Details.FirstOrDefault(), mesOutboundOrders.FirstOrDefault().TaskNo, warehouse.WarehouseCode, stockInfo.Details.Where(x => x.MaterielCode == mesOutboundOrders.FirstOrDefault().MaterialCode).Sum(x => x.StockQuantity));
                     UploadMesMaterialLotaAcept(model);
                 }
-                FeedBackWCSTaskCompleted(taskNum);
+                
                 return WebResponseContent.Instance.OK();
             }
             catch (Exception ex)
@@ -1012,6 +1012,7 @@
             }
             return content;
         }
+        //鎶ュ簾鍑哄簱瀹屾垚
         public WebResponseContent OutProScrapCompleted(Dt_Task task)
         {
             WebResponseContent content = new WebResponseContent();
@@ -1030,7 +1031,6 @@
                     return content.Error("鏈壘鍒版垚鍝佸嚭搴撹鎯�");
                 }
                 //鑾峰彇鎴愬搧鎶ュ簾鍗�
-
                 Dt_ErpProScrapSheet erpProScrapSheet = _outboundRepository.ErpProScrapSheetRepository.Db.Queryable<Dt_ErpProScrapSheet>().Where(x => x.ProScrapSheetOrderNo == outProStockInfo.OrderNo).Includes(x=>x.Details).First();
                 if (erpProScrapSheet == null)
                 {
@@ -1045,13 +1045,22 @@
                 {
                     return content.Error($"鎴愬搧鎶ュ簾鍗曟槑缁嗚{erpProScrapSheetDetail.Id}宸插畬鎴�");
                 }
-                erpProScrapSheetDetail.ScrapProDetailStatus = OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt();
+                
                 //鑾峰彇褰撳墠搴撳瓨
                 Dt_ProStockInfo proStockInfo = _stockRepository.ProStockInfoRepository.Db.Queryable<Dt_ProStockInfo>().Where(x => x.PalletCode == task.PalletCode).Includes(x => x.proStockInfoDetails).First();
                 if (proStockInfo == null)
                 {
                     return content.Error($"鏈壘鍒皗task.PalletCode}搴撳瓨淇℃伅");
                 }
+                if (((int)outProStockInfo.AssignQuantity+erpProScrapSheetDetail.OverScrapPcsQty) == erpProScrapSheetDetail.ScrapPcsQty)
+                {
+                    erpProScrapSheetDetail.OverScrapPcsQty += (int)outProStockInfo.AssignQuantity;
+                    erpProScrapSheetDetail.ScrapProDetailStatus = OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt();
+                }
+                else
+                {
+                    erpProScrapSheetDetail.OverScrapPcsQty += (int)outProStockInfo.AssignQuantity;
+                }
                 List<Dt_ProStockInfoDetail> proStockInfoDetails = proStockInfo.proStockInfoDetails;
                 if (proStockInfoDetails.Count <= 0)
                 {
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
index 0b2db53..e568966 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
@@ -185,7 +185,7 @@
         /// <param name="ProOutNo">鍑哄簱璁㈠崟鍙�</param>
         /// <param name="StationCode">绔欏彴鍦板潃</param>
         /// <returns></returns>
-        public async Task<WebResponseContent> OutProductTask(int[] keys, string StationCode, int Grade)
+        public async Task<WebResponseContent> OutProductTask(int[] keys, string StationCode, int Grade,bool isFineWorks=false)
         {
             WebResponseContent content = new WebResponseContent();
             try
@@ -207,7 +207,7 @@
                 List<Dt_OutProStockInfo> outProStockInfos = new List<Dt_OutProStockInfo>();
                 List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>();
                 (List<Dt_Task>, List<Dt_ProStockInfo>?, List<Dt_ProOutOrderDetail>?, List<Dt_OutProStockInfo>?, List<Dt_LocationInfo>?) result =
-                OutProductTaskDataHandle(_ProOutOrderDetails);
+                OutProductTaskDataHandle(_ProOutOrderDetails, isFineWorks);
                 if (result.Item2 != null && result.Item2.Count > 0)
                 {
                     proStockInfos.AddRange(result.Item2);
@@ -632,7 +632,7 @@
         /// 澶勭悊鎴愬搧鍑哄簱鏁版嵁
         /// </summary>
         /// <returns></returns>
-        public (List<Dt_Task>, List<Dt_ProStockInfo>?, List<Dt_ProOutOrderDetail>?, List<Dt_OutProStockInfo>?, List<Dt_LocationInfo>?) OutProductTaskDataHandle(List<Dt_ProOutOrderDetail> proOutOrderDetails)
+        public (List<Dt_Task>, List<Dt_ProStockInfo>?, List<Dt_ProOutOrderDetail>?, List<Dt_OutProStockInfo>?, List<Dt_LocationInfo>?) OutProductTaskDataHandle(List<Dt_ProOutOrderDetail> proOutOrderDetails, bool isFineWorks = false)
         {
             List<Dt_Task> tasks = new List<Dt_Task>();
             List<Dt_ProStockInfo> proStockInfos = new List<Dt_ProStockInfo>();
@@ -640,7 +640,7 @@
             List<Dt_OutProStockInfo> outProStockInfos=new List<Dt_OutProStockInfo>();
             List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>();
             //鍒嗛厤搴撳瓨
-            (List<Dt_ProStockInfo>, List<Dt_ProOutOrderDetail>, List<Dt_OutProStockInfo>, List<Dt_LocationInfo>) result = _outboundService.ProOutOrderDetailService.AssignProStockOut(proOutOrderDetails);
+            (List<Dt_ProStockInfo>, List<Dt_ProOutOrderDetail>, List<Dt_OutProStockInfo>, List<Dt_LocationInfo>) result = _outboundService.ProOutOrderDetailService.AssignProStockOut(proOutOrderDetails, isFineWorks);
             if (result.Item1!=null&&result.Item1.Count>0)
             {
                 //鑾峰彇鎴愬搧鍗�
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Reloaction.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Reloaction.cs"
index b58fb65..ce2efb9 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Reloaction.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Reloaction.cs"
@@ -240,7 +240,7 @@
                     return WebResponseContent.Instance.Error($"鏈壘鍒板搴旂殑缁堢偣璐т綅淇℃伅");
                 }
                 task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
-                
+                FeedBackWCSTaskCompleted(task.TaskNum);
                 _unitOfWorkManage.BeginTran();
                 stockInfo.LocationCode = locationInfoEnd.LocationCode;
                 stockInfo.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
@@ -249,7 +249,7 @@
                 _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId);
                 BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.浜哄伐瀹屾垚 : WIDESEA_Core.Enums.OperateTypeEnum.鑷姩瀹屾垚);
                 _unitOfWorkManage.CommitTran();
-                FeedBackWCSTaskCompleted(task.TaskNum);
+                
                 return WebResponseContent.Instance.OK();
             }
             catch (Exception ex)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MES/MesController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MES/MesController.cs"
index f0433ba..f6e80fc 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MES/MesController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MES/MesController.cs"
@@ -184,7 +184,7 @@
         [HttpPost, Route("BagInfoSync"), AllowAnonymous]
         public MesResponseContent BagInfoSync([FromBody] Root<MesBagInfoModel> model)
         {
-            return _taskService.BagInfoSync(model.Content);
+            return _taskService.BagInfoSync(model.Content, model.From!="PK" ? "" : model.From);
         }
         /// <summary>
         /// MES鎴愬搧澶栧寘淇℃伅鎺ユ敹
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
index 7ec2844..7654ae2 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
@@ -194,9 +194,9 @@
         /// <param name="StationCode">绔欏彴鍦板潃</param>
         /// <returns></returns>
         [HttpPost, HttpGet, Route("OutProductTask"), AllowAnonymous]
-        public async Task<WebResponseContent> OutProductTask([FromBody] int[] keys, string StationCode, int Grade)
+        public async Task<WebResponseContent> OutProductTask([FromBody] int[] keys, string StationCode, int Grade,int isFineWorks=0)
         {
-            return await Service.OutProductTask(keys, StationCode, Grade);
+            return await Service.OutProductTask(keys, StationCode, Grade,Convert.ToBoolean(isFineWorks));
         }
         /// <summary>
         /// 鎴愬搧浣欐枡閫�搴撳叆浠�

--
Gitblit v1.9.3