1
huangxiaoqiang
2025-12-18 9753fb2756f6b4e30ff79d901a7bb86145517c8b
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs
@@ -88,31 +88,33 @@
                    _unitOfWorkManage.CommitTran();
                    TaskModel esstask = new TaskModel()
                    {
                        taskType = "carry",
                        taskGroupCode = "",
                        groupPriority = 0,
                        tasks = new List<TasksType>
                        {
                                new()
                                {
                                    taskCode=task.TaskNum.ToString(),
                                    taskPriority=0,
                                    taskDescribe=new TaskDescribeType{
                                    containerCode=stockInfo.PalletCode,
                                    containerType= "CT_KUBOT_STANDARD",
                                    fromLocationCode=stockInfo.LocationCode??"",
                                    toStationCode="",
                                    toLocationCode="1-2",
                                    deadline=0,storageTag=""
                                    }
                                }
                        }
                    };
                    var result = await _eSSApiService.CreateTaskAsync(esstask);
                    //TaskModel esstask = new TaskModel()
                    //{
                    //    taskType = "carry",
                    //    taskGroupCode = "",
                    //    groupPriority = 0,
                    //    tasks = new List<TasksType>
                    //    {
                    //            new()
                    //            {
                    //                taskCode=task.TaskNum.ToString(),
                    //                taskPriority=0,
                    //                taskDescribe=new TaskDescribeType
                    //                {
                    //                    containerCode=stockInfo.PalletCode,
                    //                    containerType= "CT_KUBOT_STANDARD",
                    //                    fromLocationCode=stockInfo.LocationCode??"",
                    //                    toStationCode="",
                    //                    toLocationCode="1-2",
                    //                    deadline=0,
                    //                    storageTag=""
                    //                }
                    //            }
                    //    }
                    //};
                    //var result = await _eSSApiService.CreateTaskAsync(esstask);
                    _logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖:  " + result);
                    //_logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖:  " + result);
                }
                return content.OK("绌烘墭鍑哄簱鎴愬姛!");
            }
@@ -314,45 +316,46 @@
                    _outboundOrderDetailService.Repository.UpdateData(outboundOrderDetails);
                }
                _unitOfWorkManage.CommitTran();
                TaskModel esstask = new TaskModel()
                {
                    taskType = "carry",
                    taskGroupCode = "",
                    groupPriority = 0,
                    tasks = new List<TasksType>()
                };
                return WebResponseContent.Instance.OK();
                //TaskModel esstask = new TaskModel()
                //{
                //    taskType = "carry",
                //    taskGroupCode = "",
                //    groupPriority = 0,
                //    tasks = new List<TasksType>()
                //};
                foreach (var task in tasks)
                {
                    esstask.
                       tasks.Add(new TasksType
                       {
                           taskCode = task.TaskNum.ToString(),
                           taskPriority = 0,
                           taskDescribe = new TaskDescribeType
                           {
                               containerCode = task.PalletCode,
                               containerType = "CT_KUBOT_STANDARD",
                               fromLocationCode = task.SourceAddress ?? "",
                               toStationCode = "",
                               toLocationCode = task.TargetAddress,
                               deadline = 0,
                               storageTag = ""
                           }
                       }
                   );
                }
                var result = await _eSSApiService.CreateTaskAsync(esstask);
                //foreach (var task in tasks)
                //{
                //    esstask.
                //       tasks.Add(new TasksType
                //       {
                //           taskCode = task.TaskNum.ToString(),
                //           taskPriority = 0,
                //           taskDescribe = new TaskDescribeType
                //           {
                //               containerCode = task.PalletCode,
                //               containerType = "CT_KUBOT_STANDARD",
                //               fromLocationCode = task.SourceAddress ?? "",
                //               toStationCode = "",
                //               toLocationCode = task.TargetAddress,
                //               deadline = 0,
                //               storageTag = ""
                //           }
                //       }
                //   );
                //}
                //var result = await _eSSApiService.CreateTaskAsync(esstask);
                _logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖:  " + result);
                if (result)
                {
                    return WebResponseContent.Instance.OK();
                }
                else
                {
                    return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
                }
                //_logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖:  " + result);
                //if (result)
                //{
                //    return WebResponseContent.Instance.OK();
                //}
                //else
                //{
                //    return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
                //}
            }
            catch (Exception ex)
            {
@@ -776,46 +779,47 @@
                    _outboundOrderDetailService.Repository.UpdateData(outboundOrderDetails);
                }
                _unitOfWorkManage.CommitTran();
                return WebResponseContent.Instance.OK();
                //PushTasksToWCS(tasks);
                TaskModel esstask = new TaskModel()
                {
                    taskType = "carry",
                    taskGroupCode = "",
                    groupPriority = 0,
                    tasks = new List<TasksType>()
                };
                //TaskModel esstask = new TaskModel()
                //{
                //    taskType = "carry",
                //    taskGroupCode = "",
                //    groupPriority = 0,
                //    tasks = new List<TasksType>()
                //};
                foreach (var task in tasks)
                {
                    esstask.
                       tasks.Add(new TasksType
                       {
                           taskCode = task.TaskNum.ToString(),
                           taskPriority = 0,
                           taskDescribe = new TaskDescribeType
                           {
                               containerCode = task.PalletCode,
                               containerType = "CT_KUBOT_STANDARD",
                               fromLocationCode = task.SourceAddress ?? "",
                               toStationCode = "",
                               toLocationCode = task.TargetAddress,
                               deadline = 0,
                               storageTag = ""
                           }
                       }
                   );
                }
                var result = await _eSSApiService.CreateTaskAsync(esstask);
                //foreach (var task in tasks)
                //{
                //    esstask.
                //       tasks.Add(new TasksType
                //       {
                //           taskCode = task.TaskNum.ToString(),
                //           taskPriority = 0,
                //           taskDescribe = new TaskDescribeType
                //           {
                //               containerCode = task.PalletCode,
                //               containerType = "CT_KUBOT_STANDARD",
                //               fromLocationCode = task.SourceAddress ?? "",
                //               toStationCode = "",
                //               toLocationCode = task.TargetAddress,
                //               deadline = 0,
                //               storageTag = ""
                //           }
                //       }
                //   );
                //}
                //var result = await _eSSApiService.CreateTaskAsync(esstask);
                _logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖:  " + result);
                if (result)
                {
                    return WebResponseContent.Instance.OK();
                }
                else
                {
                    return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
                }
                //_logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖:  " + result);
                //if (result)
                //{
                //    return WebResponseContent.Instance.OK();
                //}
                //else
                //{
                //    return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
                //}
            }
            catch (Exception ex)
@@ -1173,46 +1177,47 @@
                BaseDal.AddData(tasks);
                _locationInfoService.UpdateData(locationInfos);
                _unitOfWorkManage.CommitTran();
                TaskModel esstask = new TaskModel()
                {
                    taskType = "carry",
                    taskGroupCode = "",
                    groupPriority = 0,
                    tasks = new List<TasksType>()
                };
                foreach (var task in tasks)
                {
                    esstask.
                       tasks.Add(new TasksType
                       {
                           taskCode = task.TaskNum.ToString(),
                           taskPriority = 0,
                           taskDescribe = new TaskDescribeType
                           {
                               containerCode = task.PalletCode,
                               containerType = "CT_KUBOT_STANDARD",
                               fromLocationCode = task.SourceAddress ?? "",
                               toStationCode = "",
                               toLocationCode = task.TargetAddress,
                               deadline = 0,
                               storageTag = ""
                           }
                       }
                   );
                }
                var result = await _eSSApiService.CreateTaskAsync(esstask);
                _logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖:  " + result);
                if (result)
                {
                    return WebResponseContent.Instance.OK();
                }
                else
                {
                    return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
                }
                content.OK();
                //TaskModel esstask = new TaskModel()
                //{
                //    taskType = "carry",
                //    taskGroupCode = "",
                //    groupPriority = 0,
                //    tasks = new List<TasksType>()
                //};
                //foreach (var task in tasks)
                //{
                //    esstask.
                //       tasks.Add(new TasksType
                //       {
                //           taskCode = task.TaskNum.ToString(),
                //           taskPriority = 0,
                //           taskDescribe = new TaskDescribeType
                //           {
                //               containerCode = task.PalletCode,
                //               containerType = "CT_KUBOT_STANDARD",
                //               fromLocationCode = task.SourceAddress ?? "",
                //               toStationCode = "",
                //               toLocationCode = task.TargetAddress,
                //               deadline = 0,
                //               storageTag = ""
                //           }
                //       }
                //   );
                //}
                //var result = await _eSSApiService.CreateTaskAsync(esstask);
                //_logger.LogInformation("鍒涘缓浠诲姟PalletOutboundTask 杩斿洖:  " + result);
                //if (result)
                //{
                //    return WebResponseContent.Instance.OK();
                //}
                //else
                //{
                //    return WebResponseContent.Instance.Error("涓嬪彂鏈哄櫒浜轰换鍔″け璐ワ紒");
                //}
                //content.OK();
            }
            catch (Exception ex)
            {