1
Huangxiaoqiang-03
2024-11-01 6e9f630e4e12738d98241b684e6227e02010b6c5
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
@@ -9,11 +9,15 @@
using WIDESEA_Model.Models;
using WIDESEA_Core.Helper;
using Microsoft.Extensions.Logging;
using System.Net.Http.Headers;
using System.Security.Policy;
using Newtonsoft.Json;
namespace WIDESEA_TaskInfoService
{
    public partial class TaskService
    {
        public string url = AppSettings.Configuration["WCS"];
        /// <summary>
        /// PDA申请入库--堆垛机立库入库
        /// </summary>
@@ -100,6 +104,7 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                _unitOfWorkManage.BeginTran();
                Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(stationCode, taskType);
                //Dt_LocationInfo dt_LocationInfo = null;
                if (locationInfo != null)
@@ -107,7 +112,7 @@
                    Dt_Task task = new()
                    {
                        CurrentAddress = stationCode,
                        Grade = 0,
                        Grade = 2,
                        PalletCode = palletCode,
                        NextAddress = locationInfo.LocationCode,
                        Roadway = locationInfo.RoadwayNo,
@@ -144,14 +149,22 @@
                        _basicService.LocationInfoService.UpdateLocationLock(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false);
                    }
                    _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
                    List<Dt_Task> tasks = new List<Dt_Task>();
                    tasks.Add(task);
                    _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum);
                    var response = HttpHelper.Post<WebResponseContent>(url + "ReceiveTask/", tasks, "入库任务下发");
                    if (!response.Status)
                    {
                        return content = WebResponseContent.Instance.Error("任务下发异常");
                    }
                    _unitOfWorkManage.CommitTran();
                    return content = WebResponseContent.Instance.OK();
                }
                return content = WebResponseContent.Instance.Error("未找到可分配货位");
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            return content;