肖洋
2024-11-29 663d9d2e658ab99a0c3598becd23b00b34b3e3d9
高常温逻辑
已修改25个文件
660 ■■■■ 文件已修改
Code Management/WCS/WIDESEAWCS_Client/src/api/http.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/HostedService/SeedDataHostedService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManager.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/CustomProfile.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs 97 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs 73 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/api/http.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/HostedService/SeedDataHostedService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/HttpContextUser/AspNetUser.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/WIDESEA_Core.csproj 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtBoxingInfo.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfo.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Client/src/api/http.js
@@ -12,8 +12,8 @@
let loadingInstance;
let loadingStatus = false;
if (process.env.NODE_ENV == 'development') {
    // axios.defaults.baseURL = 'http://127.0.0.1:9291/';
    axios.defaults.baseURL = 'http://192.168.20.251:9291/';
    axios.defaults.baseURL = 'http://127.0.0.1:9291/';
    // axios.defaults.baseURL = 'http://192.168.20.251:9291/';
}
else if (process.env.NODE_ENV == 'debug') {
    axios.defaults.baseURL = 'http://127.0.0.1:8098/';
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/HostedService/SeedDataHostedService.cs
@@ -49,7 +49,7 @@
                {
                    // 使用 myScopedService 执行任务
                    await DBSeed.SeedAsync(_dbContext, _webRootPath);
                    //await DBSeed.SeedAsync(_dbContext, _webRootPath);
                    //多租户 同步
                    //await DBSeed.TenantSeedAsync(_dbContext);
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -65,6 +65,13 @@
        WebResponseContent ReceiveByWMSTask([NotNull] WMSTaskDTO taskDTOs);
        /// <summary>
        /// 接收WMS任务信息
        /// </summary>
        /// <param name="taskDTOs">WMS任务对象集合</param>
        /// <returns>返回处理结果</returns>
        WebResponseContent ReceiveByWMSGWTask([NotNull] WMSTaskDTO taskDTO);
        /// <summary>
        /// 根据托盘号、起始地址向WMS请求任务
        /// </summary>
        /// <param name="palletCode">托盘号</param>
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManager.cs
@@ -33,7 +33,7 @@
        public int stationID { get; set; }
        /// <summary>
        /// 站台类型  1-入库站台 2-出库站台 3-异常排出站台 4-NG工站放料 5-NG工站取料 6-空框入库 7-空框出库
        /// 站台类型  1-入库站台 2-出库站台 3-异常排出站台 4-NG工站放料 5-NG工站取料 6-空框入库 7-空框出库,8-入库线体扫码确认,9-入库站台确认
        /// </summary>
        [ImporterHeader(Name = "站台类型")]
        [ExporterHeader(DisplayName = "站台类型")]
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs
@@ -31,6 +31,12 @@
            return Service.ReceiveByWMSTask(taskDTOs);
        }
        [HttpPost, Route("ReceiveByWMSGWTask"), AllowAnonymous]
        public WebResponseContent ReceiveByWMSGWTask([FromBody] WMSTaskDTO taskDTOs)
        {
            return Service.ReceiveByWMSGWTask(taskDTOs);
        }
        [HttpPost, HttpGet, Route("UpdateTaskExceptionMessage")]
        public WebResponseContent UpdateTaskExceptionMessage(int taskNum, string message)
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/CustomProfile.cs
@@ -17,12 +17,18 @@
        /// <summary>
        /// 配置构造函数,用来创建关系映射
        /// </summary>
        public CustomProfile()
        public CustomProfile()
        {
            CreateMap<Dt_DeviceInfo,DeviceInfoDTO>();
            CreateMap<Dt_DeviceInfo, DeviceInfoDTO>();
            CreateMap<WMSTaskDTO, Dt_Task>().ForMember(a => a.WMSId, b => b.MapFrom(b => b.Id));
            CreateMap<Dt_Task, ConveyorLineTaskCommand>().ForMember(a => a.TargetAddress, b => b.MapFrom(b => b.NextAddress)).ForMember(a => a.Barcode, b => b.MapFrom(b => b.PalletCode)).ForMember(a => a.TaskNum, b => b.MapFrom(b => b.TaskNum));
            CreateMap<Dt_Task,ConveyorLineTaskCommand_After>().ForMember(a => a.ConveyorLineBarcode, b => b.MapFrom(b => b.PalletCode)).ForMember(a => a.ConveyorLineTaskNum, b => b.MapFrom(b => b.TaskNum));
            CreateMap<Dt_Task, ConveyorLineTaskCommand>()
                .ForMember(a => a.TargetAddress, b => b.MapFrom(b => b.NextAddress))
                .ForMember(a => a.Barcode, b => b.MapFrom(b => b.PalletCode))
                .ForMember(a => a.TaskNum, b => b.MapFrom(b => b.TaskNum));
            CreateMap<Dt_Task, ConveyorLineTaskCommand_After>()
                .ForMember(a => a.ConveyorLineBarcode, b => b.MapFrom(b => b.PalletCode))
                .ForMember(a => a.ConveyorLineTaskNum, b => b.MapFrom(b => b.TaskNum))
                .ForMember(a => a.ConveyorLineTargetAddress, b => b.MapFrom(b => b.NextAddress));
        }
    }
}
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs
@@ -107,7 +107,7 @@
app.ConfigureApplication();//配置文件
app.UseApplicationSetup();//启动配置
app.UseSession();
if (app.Environment.IsDevelopment())
//if (app.Environment.IsDevelopment())
{
    //todo
    //app.UseSwaggerAuthorized();
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
@@ -159,6 +159,44 @@
            return content;
        }
        /// <summary>
        /// 高温出库
        /// </summary>
        /// <param name="taskDTO"></param>
        /// <returns></returns>
        public WebResponseContent ReceiveByWMSGWTask([NotNull] WMSTaskDTO taskDTO)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                if (BaseDal.QueryFirst(x => x.TaskNum == taskDTO.TaskNum || x.PalletCode == taskDTO.PalletCode) != null)
                {
                    return content.OK();
                }
                Dt_Task task = _mapper.Map<Dt_Task>(taskDTO);
                task.Creater = "WMS";
                if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                {
                    task.TaskState = (int)TaskOutStatusEnum.OutNew;
                    task.CurrentAddress = taskDTO.RoadWay;
                    task.NextAddress = "002-000-002";
                    task.SourceAddress = taskDTO.SourceAddress;
                    task.TargetAddress = taskDTO.TargetAddress;
                }
                BaseDal.AddData(task);
                _taskExecuteDetailService.AddTaskExecuteDetail(task.WMSId, "接收WMS任务");
                content = WebResponseContent.Instance.OK("成功");
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error($"任务接收错误,错误信息:{ex.Message}");
            }
            return content;
        }
        /// <summary>
        /// 接收WMS任务信息
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -530,18 +530,28 @@
                if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting)
                {
                    var routers = _routerService.QueryNextRoutes(task.NextAddress, task.TargetAddress);
                    if (!routers.Any()) return WebResponseContent.Instance.Error($"未找到设备路由信息");
                    if (!task.Roadway.Contains("GW"))
                    {
                        var routers = _routerService.QueryNextRoutes(task.NextAddress, task.TargetAddress);
                        if (!routers.Any()) return WebResponseContent.Instance.Error($"未找到设备路由信息");
                    int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskOutStatusEnum>();
                    task.TaskState = nextStatus;
                    task.CurrentAddress = task.NextAddress;
                    task.NextAddress = routers.FirstOrDefault().ChildPosi;
                    task.ModifyDate = DateTime.Now;
                    task.Modifier = "System";
                    BaseDal.UpdateData(task);
                        int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskOutStatusEnum>();
                        task.TaskState = nextStatus;
                        task.CurrentAddress = task.NextAddress;
                        task.NextAddress = routers.FirstOrDefault().ChildPosi;
                        task.ModifyDate = DateTime.Now;
                        task.Modifier = "System";
                        BaseDal.UpdateData(task);
                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"堆垛机出库完成");
                        _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"堆垛机出库完成");
                    }
                    else
                    {
                        task.TaskState = (int)TaskOutStatusEnum.OutFinish;
                        BaseDal.UpdateData(task);
                        _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"堆垛机出库完成");
                    }
                    //暂不考虑多个出库口
@@ -593,11 +603,6 @@
                        task.Remark = "NG";
                        BaseDal.UpdateData(task);
                        _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"堆垛机出库完成,MOM返回NG");
                    }
                    else if (task.Roadway.Contains("GW"))
                    {
                        BaseDal.DeleteData(task);
                        _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"堆垛机出库完成,高温库数据删除");
                    }
                }
                #endregion
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -104,6 +104,7 @@
                    {
                        ConveyorLineTaskCommand_After command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(childDeviceCode);
                        if (command == null) continue;
                        if (command.ConveyorLineBarcode.Trim().Contains("\0")) command.ConveyorLineBarcode = "";
                        DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(ConveyorLineTaskCommand_After.InteractiveSignal) && x.ProtocalDetailValue == command.InteractiveSignal.ToString());
@@ -115,8 +116,48 @@
                                method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode });
                            }
                        }
                     }
                        if (childDeviceCode == "1670")
                        {
                            Platform platform = _platFormRepository.QueryFirst(x => x.PLCCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
                            if (platform != null)
                            {
                                if (command.HasPallet != 1)
                                {
                                    MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
                                    if (method != null)
                                    {
                                        int count = string.IsNullOrEmpty(platform.Location) ? 0 + 1 : platform.Location.Split(',').Count() + 1;
                                        method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
                                    }
                                }
                                else
                                {
                                    if (!string.IsNullOrEmpty(platform.Location))
                                    {
                                        var strings = platform.Location.Split(',').ToList();
                                        foreach (var ite in strings)
                                        {
                                            int index = strings.FindIndex(p => p == ite);
                                            ConveyorLineTaskCommand command1 = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(ite);
                                            if (command1.InteractiveSignal != 2)
                                            {
                                                MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
                                                if (method != null)
                                                {
                                                    int count = strings.Count - index;
                                                    method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    #endregion
                }
            }
            catch (Exception ex)
@@ -149,12 +190,44 @@
                if (task == null)
                {
                    HandleNewTask(conveyorLine, command, childDeviceCode);
                }
                else
                {
                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
                    _taskService.UpdateTaskStatusToNext(task);
                }
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine(ex.ToString());
            }
        }
        /// <summary>
        /// 输送线请求入库下一地址
        /// </summary>
        /// <param name="conveyorLine">输送线实例对象</param>
        /// <param name="command">读取的请求信息</param>
        /// <param name="childDeviceCode">子设备编号</param>
        public void RequestInNextAddress(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
        {
            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
            if (task != null)
            {
                Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
                if (newTask != null)
                {
                    //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, newTask.TaskNum, childDeviceCode);
                    //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, newTask.NextAddress, childDeviceCode);
                    //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, command.ConveyorLineBarcode, childDeviceCode);
                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
                    //taskCommand.InteractiveSignal = command.InteractiveSignal;
                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
                }
            }
        }
@@ -174,7 +247,7 @@
                WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
                if(content.Status)
                if (content.Status)
                {
                    conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
                }
@@ -190,14 +263,14 @@
        /// <param name="command">读取的请求信息</param>
        /// <param name="childDeviceCode">子设备编号</param>
        /// <param name="ProtocalDetailValue">线体当前bool读取偏移地址</param>
        public void RequestOutbound(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode, int ProtocalDetailValue)
        public void RequestOutbound(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
        {
            var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
            if (task != null)
            {
                ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(task);
                taskCommand.InteractiveSignal = command.InteractiveSignal;
                ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                conveyorLine.SendCommand(taskCommand, childDeviceCode);
                conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
                //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                _taskService.UpdateTaskStatusToNext(task);
@@ -210,17 +283,17 @@
        /// <param name="conveyorLine">输送线实例对象</param>
        /// <param name="command">读取的请求信息</param>
        /// <param name="childDeviceCode">子设备编号</param>
        public void RequestOutNextAddress(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode)
        public void RequestOutNextAddress(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
        {
            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
            if (task != null)
            {
                Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
                if (newTask != null)
                {
                    ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(newTask);
                    taskCommand.InteractiveSignal = command.InteractiveSignal;
                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
                }
            }
        }
@@ -246,10 +319,12 @@
                }
                else
                {
                    taskCommand.ConveyorLineTargetAddress = 1000;
                    Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode);
                    taskCommand.ConveyorLineTargetAddress = Convert.ToInt16( stationManager.stationLocation);
                }
                conveyorLine.SendCommand(taskCommand, childDeviceCode);
                conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
                //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                content = _taskService.UpdateTaskStatusToNext(task);
            }
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
@@ -50,27 +50,59 @@
        private void HandleNewTask(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
        {
            Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode);
            //if ((conveyorLine.DeviceCode == "1003" && childDeviceCode == "1016") || (conveyorLine.DeviceCode == "1005" && childDeviceCode == "1048"))
            //{
            //    CreateAndSendEmptyTrayTask(conveyorLine, command, childDeviceCode);
            //}
            if (stationManager.stationType == 1)
            if (stationManager.stationType == 8)
            {
                var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
                if (task != null)
                {
                    RequestInNextAddress(conveyorLine, command, childDeviceCode);
                }
            }
            else if (stationManager.stationType == 9)
            {
                var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
                if (task != null)
                {
                    ConveyorLineInFinish(conveyorLine, command, childDeviceCode);
                }
                else
                {
                    RequestWmsTask(conveyorLine, command, childDeviceCode);
                }
            }
            //else if ((conveyorLine.DeviceCode == "1001" && childDeviceCode == "1068"))
            //{
            //    ConveyorLineOutFinish(conveyorLine, command, childDeviceCode);
            //}
            else if (stationManager.stationType == 1)
            {
                if (stationManager.stationArea.Contains("GW"))
                {
                    var taskGW = _taskRepository.QueryFirst(x => x.TargetAddress == childDeviceCode && x.TaskState == (int)TaskOutStatusEnum.OutFinish);
                    if (taskGW != null)
                    {
                        command.ConveyorLineBarcode = taskGW.PalletCode;
                    }
                }
                RequestWmsTask(conveyorLine, command, childDeviceCode);
            }
            else if (stationManager.stationType == 10)
            {
                var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
                if (task != null)
                {
                    RequestOutbound(conveyorLine, command, childDeviceCode);
                }
            }
            else if (stationManager.stationType == 11)
            {
                var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
                if (task != null)
                {
                    RequestOutNextAddress(conveyorLine, command, childDeviceCode);
                }
            }
            else if (stationManager.stationType == 12)
            {
                var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
                if (task != null)
                {
                    RequestOutNextAddress(conveyorLine, command, childDeviceCode);
                }
            }
        }
        /// <summary>
@@ -181,21 +213,30 @@
        /// </summary>
        private async void RequestWmsTask(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
        {
            var taskGW = _taskRepository.QueryFirst(x => x.TargetAddress == childDeviceCode && x.TaskState == (int)TaskOutStatusEnum.OutFinish);
            if (taskGW != null)
                _taskRepository.DeleteData(taskGW);
            var content = await _taskService.RequestWMSTask(command.ConveyorLineBarcode, childDeviceCode);
            if (content.Status)
            {
                var task = _taskService.QueryBarCodeConveyorLineTask(command.ConveyorLineBarcode, childDeviceCode);
                if (task != null)
                {
                    //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, task.TaskNum, childDeviceCode);
                    //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, task.NextAddress, childDeviceCode);
                    //conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, command.ConveyorLineBarcode, childDeviceCode);
                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, task.NextAddress, childDeviceCode);
                    //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                    _taskService.UpdateTaskStatusToNext(task);
                }
            }
            else
            {
                WriteInfo(conveyorLine.DeviceName, content.Message);
                _taskRepository.AddData(taskGW);
            }
        }
    }
}
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -141,19 +141,19 @@
                {
                    return task;
                }
                else
                {
                    List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList();
                    List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes);
                    foreach (var item in tasks)
                    {
                        if (OutTaskStationIsOccupied(task) != null)
                        {
                            return task;
                        }
                    }
                    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                }
                //else
                //{
                //    List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList();
                //    List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes);
                //    foreach (var item in tasks)
                //    {
                //        if (OutTaskStationIsOccupied(task) != null)
                //        {
                //            return task;
                //        }
                //    }
                //    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                //}
            }
            else if (task == null)
            {
@@ -170,6 +170,22 @@
        /// <returns>如果未被占用,返回传入的任务信息,否则,返回null</returns>
        private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task)
        {
            if (task.Roadway.Contains("GW"))
            {
                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "1015");
                if (device != null)
                {
                    CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device;
                    if (conveyorLine.IsOccupied(task.TargetAddress))//出库站台未被占用
                    {
                        return task;
                    }
                }
                else
                {
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到出库站台【{task.TargetAddress}】对应的通讯对象,无法判断出库站台是否被占用");
                }
            }
            Dt_Router? router = _routerService.QueryNextRoutes(task.Roadway, task.NextAddress).FirstOrDefault();
            if (router != null)
            {
@@ -177,7 +193,7 @@
                if (device != null)
                {
                    CommonConveyorLine conveyorLine = (CommonConveyorLine)device;
                    //if (conveyorLine.IsOccupied(router.ChildPosi))//出库站台未被占用
                    if (conveyorLine.IsOccupied(router.ChildPosi))//出库站台未被占用
                    {
                        return task;
                    }
@@ -240,31 +256,45 @@
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
            {
                List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress);
                if (routers.Count > 0)
                if (task.Roadway.Contains("GW"))
                {
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(routers.FirstOrDefault().SrmRow);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(routers.FirstOrDefault().SrmColumn);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(routers.FirstOrDefault().SrmLayer);
                    string[] sourceCodes = task.CurrentAddress.Split("-");
                    if (sourceCodes.Length == 3)
                    {
                        stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
                        stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
                        stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
                    }
                    else
                    {
                        //数据配置错误
                        _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"出库任务起点错误,起点:【{task.CurrentAddress}】");
                        return null;
                    }
                    string[] endCodes = task.NextAddress.Split("-");
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(endCodes[0]);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(endCodes[1]);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(endCodes[2]);
                    string[] sourceCodes = task.SourceAddress.Split("-");
                    stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
                    stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
                    stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
                }
                else
                {
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法获取对应的堆垛机放货站台信息");
                    return null;
                    List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress);
                    if (routers.Count > 0)
                    {
                        stackerCraneTaskCommand.EndRow = Convert.ToInt16(routers.FirstOrDefault().SrmRow);
                        stackerCraneTaskCommand.EndColumn = Convert.ToInt16(routers.FirstOrDefault().SrmColumn);
                        stackerCraneTaskCommand.EndLayer = Convert.ToInt16(routers.FirstOrDefault().SrmLayer);
                        string[] sourceCodes = task.CurrentAddress.Split("-");
                        if (sourceCodes.Length == 3)
                        {
                            stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
                            stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
                            stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
                        }
                        else
                        {
                            //数据配置错误
                            _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"出库任务起点错误,起点:【{task.CurrentAddress}】");
                            return null;
                        }
                    }
                    else
                    {
                        _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法获取对应的堆垛机放货站台信息");
                        return null;
                    }
                }
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
Code Management/WMS/WIDESEA_WMSClient/src/api/http.js
@@ -11,8 +11,8 @@
let loadingInstance
let loadingStatus = false
if (process.env.NODE_ENV == 'development') {
  // axios.defaults.baseURL = 'http://localhost:5000/';
  axios.defaults.baseURL = 'http://192.168.20.251:5000/';
  axios.defaults.baseURL = 'http://localhost:5000/';
  // axios.defaults.baseURL = 'http://192.168.20.251:5000/';
}
else if (process.env.NODE_ENV == 'debug') {
  axios.defaults.baseURL = 'http://127.0.0.1:9991/';
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs
@@ -125,5 +125,10 @@
        /// 请求WCS任务
        /// </summary>
        public const string ReceiveByWMSTask = "ReceiveByWMSTask";
        /// <summary>
        /// 请求WCS任务
        /// </summary>
        public const string ReceiveTask = "ReceiveTask";
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs
@@ -17,8 +17,11 @@
                using HttpClient httpClient = new HttpClient();
                httpClient.Timeout = new TimeSpan(0, 0, 60);
                foreach (var header in headers)
                    httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
                if (headers != null)
                {
                    foreach (var header in headers)
                        httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
                }
                result = await httpClient.GetAsync(serviceAddress).Result.Content.ReadAsStringAsync();
                return result;
@@ -41,8 +44,11 @@
                    using HttpClient httpClient = new HttpClient();
                    httpClient.Timeout = new TimeSpan(0, 0, 60);
                    foreach (var header in headers)
                        httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
                    if (headers != null)
                    {
                        foreach (var header in headers)
                            httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
                    }
                    result = await httpClient.PostAsync(serviceAddress, httpContent).Result.Content.ReadAsStringAsync();
                }
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/HostedService/SeedDataHostedService.cs
@@ -49,7 +49,7 @@
                {
                    // 使用 myScopedService 执行任务
                    await DBSeed.SeedAsync(_dbContext, _webRootPath);
                    //await DBSeed.SeedAsync(_dbContext, _webRootPath);
                    //多租户 同步
                    //await DBSeed.TenantSeedAsync(_dbContext);
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/HttpContextUser/AspNetUser.cs
@@ -153,14 +153,18 @@
        public IEnumerable<Claim> GetClaimsIdentity()
        {
            var claims = _accessor.HttpContext.User.Claims.ToList();
            var headers = _accessor.HttpContext.Request.Headers;
            foreach (var header in headers)
            if (_accessor.HttpContext != null)
            {
                claims.Add(new Claim(header.Key, header.Value));
            }
            return claims;
                var claims = _accessor.HttpContext.User.Claims.ToList();
                var headers = _accessor.HttpContext.Request.Headers;
                foreach (var header in headers)
                {
                    claims.Add(new Claim(header.Key, header.Value));
                }
                return claims;
            }
            return ArraySegment<Claim>.Empty;
        }
        public List<string> GetClaimValueByType(string ClaimType)
@@ -186,7 +190,7 @@
        public string UserName { get; set; }
        public int UserId {  get; set; }
        public int UserId { get; set; }
        public string UserTrueName { get; set; }
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/WIDESEA_Core.csproj
@@ -27,7 +27,7 @@
    <PackageReference Include="OfficeOpenXml.Core.ExcelPackage" Version="1.0.0" />
    <PackageReference Include="SkiaSharp" Version="2.88.8" />
    <PackageReference Include="SqlSugarCore" Version="5.1.4.152" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.0" />
    <PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.5" />
    <PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="6.5.0" />
    <PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs
@@ -175,4 +175,10 @@
    /// <returns></returns>
    Task<WebResponseContent> UpdateTaskStatus(int taskNum, int taskState);
    /// <summary>
    ///
    /// </summary>
    /// <returns></returns>
    WebResponseContent StockCheckingAsync();
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtBoxingInfo.cs
@@ -35,6 +35,18 @@
        public string Remark { get; set; }
        /// <summary>
        /// 当前工序
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "当前工序")]
        public string ProcessCode { get; set; }
        /// <summary>
        /// 下一工序
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "下一工序")]
        public string NextProcessCode { get; set; }
        /// <summary>
        /// 库存明细
        /// </summary>
        [MinItemsCount(1)] // 检测集合元素最少1个
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/BasicModel/DtStockInfo.cs
@@ -87,6 +87,18 @@
        public int StockStatus { get; set; }
        /// <summary>
        /// 当前工序
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "当前工序")]
        public string ProcessCode { get; set; }
        /// <summary>
        /// 下一工序
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "下一工序")]
        public string NextProcessCode { get; set; }
        /// <summary>
        /// 库存明细
        /// </summary>
        [SugarColumn(ColumnName = "StockInfoDetails")]
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -1,7 +1,9 @@
using Mapster;

using Mapster;
using Masuit.Tools;
using WIDESEA_DTO.MOM;
using WIDESEA_DTO.WMS;
using WIDESEA_IServices;
using WIDESEA_IStoragIntegrationServices;
using WIDESEA_StorageBasicRepository;
using WIDESEAWCS_BasicInfoRepository;
@@ -12,17 +14,11 @@
{
    private readonly LogFactory LogFactory = new LogFactory();
    private readonly IUnitOfWorkManage _unitOfWorkManage;
    private readonly IDt_OutOrderRepository _outOrderRepository;
    private readonly IStockInfoRepository _stockInfoRepository;
    private readonly IStockInfoDetailRepository _stockInfoDetailRepository;
    private readonly IDt_Task_HtyRepository _task_HtyRepository;
    private readonly IDt_OutOrderAndStockRepository _outOrderAndStockRepository;
    private readonly IDt_OutOrderAndStock_HtyRepository _outOrderAndStock_HtyRepository;
    private readonly IMapper _mapper;
    private readonly IDt_MaterielInfoRepository _materielInfoRepository;
    private readonly ILocationInfoRepository _locationRepository;
    private readonly IDt_WareAreaInfoRepository _wareAreaInfoRepository;
    private readonly IPointStackerRelationRepository _pointStackerRelationRepository;
    private readonly ITaskExecuteDetailRepository _taskExecuteDetailRepository;
    private readonly ILocationStatusChangeRecordRepository _locationStatusChangeRecordRepository;
    private readonly IBoxingInfoRepository _boxingInfoRepository; //组盘
@@ -30,21 +26,16 @@
    private readonly IProcessApplyService _processApplyService; //工艺路线
    private readonly IDt_AreaInfoRepository _areaInfoRepository; //区域
    private readonly IAgingInOrOutInputService _agingInOrOutInputService; //静置\陈化
    private readonly IProductionRepository _productionRepository; //生产
    private readonly IDt_StationManagerRepository _stationManagerRepository;
    private readonly ISys_ConfigService _configService;
    public Dt_TaskService(IDt_TaskRepository BaseDal,
                                IUnitOfWorkManage unitOfWorkManage,
                                IDt_OutOrderRepository outOrderRepository,
                                IStockInfoRepository stockInfoRepository,
                                IDt_OutOrderAndStockRepository dt_OutOrderAndStockRepository,
                                IDt_OutOrderAndStock_HtyRepository dt_OutOrderAndStock_HtyRepository,
                                IDt_Task_HtyRepository task_HtyRepository,
                                IMapper mapper,
                                IDt_MaterielInfoRepository materielInfoRepository,
                                ILocationInfoRepository locationRepository,
                                IDt_WareAreaInfoRepository wareAreaInfoRepository,
                                IPointStackerRelationRepository pointStackerRelationRepository,
                                ITaskExecuteDetailRepository taskExecuteDetailRepository,
                                ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository,
                                IBoxingInfoRepository boxingInfoRepository,
@@ -53,20 +44,14 @@
                                IDt_AreaInfoRepository areaInfoRepository,
                                IAgingInOrOutInputService agingInOrOutInputService,
                                IStockInfoDetailRepository stockInfoDetailRepository,
                                IProductionRepository productionRepository,
                                IDt_StationManagerRepository stationManagerRepository) : base(BaseDal)
                                IDt_StationManagerRepository stationManagerRepository,
                                ISys_ConfigService configService) : base(BaseDal)
    {
        _unitOfWorkManage = unitOfWorkManage;
        _outOrderRepository = outOrderRepository;
        _stockInfoRepository = stockInfoRepository;
        _outOrderAndStockRepository = dt_OutOrderAndStockRepository;
        _outOrderAndStock_HtyRepository = dt_OutOrderAndStock_HtyRepository;
        _task_HtyRepository = task_HtyRepository;
        _mapper = mapper;
        _materielInfoRepository = materielInfoRepository;
        _locationRepository = locationRepository;
        _wareAreaInfoRepository = wareAreaInfoRepository;
        _pointStackerRelationRepository = pointStackerRelationRepository;
        _taskExecuteDetailRepository = taskExecuteDetailRepository;
        _locationStatusChangeRecordRepository = locationStatusChangeRecordRepository;
        _boxingInfoRepository = boxingInfoRepository;
@@ -75,8 +60,8 @@
        _areaInfoRepository = areaInfoRepository;
        _agingInOrOutInputService = agingInOrOutInputService;
        _stockInfoDetailRepository = stockInfoDetailRepository;
        _productionRepository = productionRepository;
        _stationManagerRepository = stationManagerRepository;
        _configService = configService;
    }
    #region 外部接口方法
@@ -141,8 +126,19 @@
        var parameterInfo = JsonConvert.DeserializeObject<List<ParameterInfo>>(stock.ParameterInfos).FirstOrDefault(y => y.Description.Contains("时间"));
        if (parameterInfo == null) throw new Exception("");
        var outHours = (DateTime.Now - stock.OutboundTime.Value).TotalHours;
        var outHours = (DateTime.Now - (stock.LinedProcessFeedbackTime == null ? stock.CreateDate : stock.LinedProcessFeedbackTime.ToDateTime())).TotalHours;
        //if (stock.LinedProcessFeedbackTime == null)
        //{
        //    outHours = (DateTime.Now - stock.CreateDate).TotalHours;
        //}
        //else
        //{
        //    outHours = (DateTime.Now - stock.LinedProcessFeedbackTime.ToDateTime()).TotalHours;
        //}
        var isNG = outHours > parameterInfo.LowerSpecificationsLimit.ToDouble() && outHours < parameterInfo.UpperSpecificationsLimit.ToDouble();
        var defectCode = string.Empty;
        if (!isNG) defectCode = "TQCK";
        return new AgingOutputDto
@@ -617,11 +613,18 @@
            // 如果状态为false,则返回null
            if (!content.Status) return content.Error("工艺申请失败");
            var resultProcessApply = JsonConvert.DeserializeObject<ResultProcessApply>(content.Data.ToString());
            if ((resultProcessApply.Success)) return content.Error("工艺申请失败");
            //// 调用GetProcessResponseAsync方法,获取工艺响应
            var par = resultProcessApply.ProcessInfo.Where(x => x.ProcessCode == boxing.ProcessCode).FirstOrDefault().Number.ToInt32();
            // 调用GetProcessResponseAsync方法,获取工艺响应
            //var processResponse = await GetProcessResponseAsync(process, input.Position);
            //List<string> strings = input.Position == "1088" ? new List<string>() { "CHSC01" } : new List<string>() { "JZSC01" };
            ////List<string> strings = input.Position == "1088" ? new List<string>() { "CHSC01" } : new List<string>() { "JZSC01" };
            Console.WriteLine(area.AreaCode+"-----------------------");
            Console.WriteLine(input.Position + "-----------------------");
            var stationManagers = _stationManagerRepository.QueryData(x => x.stationType == 1 && x.stationChildCode == input.Position && x.stationArea == area.AreaCode).ToList();
            if (stationManagers.Count <= 0)
            {
@@ -734,6 +737,7 @@
        {
            PalletCode = palletCode,
            IsFull = true,
            ProcessCode = result.ProcessCode,
            BoxingInfoDetails = result.SerialNos.Select(serialNoObj => new DtBoxingInfoDetail
            {
                SerialNumber = serialNoObj.SerialNo,
@@ -791,7 +795,7 @@
            if (hasTask != null)
            {
                WMSTaskDTO taskDTO1 = CreateTaskDTO(hasTask);
                return content.OK("已存在空盘出库任务", data: taskDTO1);
                return content.OK("已存在出库任务", data: taskDTO1);
            }
            // 创建新任务实例
@@ -885,7 +889,9 @@
            TaskState = (int)TaskOutStatusEnum.OutNew,
            TaskType = tag == (int)TaskOutboundTypeEnum.Outbound ? (int)TaskOutboundTypeEnum.Outbound : (int)TaskOutboundTypeEnum.OutTray,
            TaskNum = BaseDal.GetTaskNo().Result,
            Creater = "System" // 修正拼写错误
            Creater = "System", // 修正拼写错误
            CreateDate = DateTime.Now,
            TaskId = 0,
        };
    }
@@ -1134,39 +1140,6 @@
    #endregion 内部调用方法
    #region private 内部方法
    /// <summary>
    /// 更新出库订单和库存信息
    /// </summary>
    /// <param name="stock">库存实例</param>
    /// <param name="barCode">条码</param>
    /// <returns>更新后的订单和库存信息</returns>
    private async Task<Dt_OutOrderAndStock> UpdateOrderAndStockAsync(DtStockInfo stock, string barCode)
    {
        //根据PalletCode获取订单和库存信息
        var orderStock = await _outOrderAndStockRepository.GetOrderAndStock(palletCode: barCode);
        //完成数量增加
        orderStock.CompletedQuantity += stock.StockInfoDetails.Sum(x => x.StockQuantity);
        //订单详情完成数量增加
        orderStock.OrderList.OrderDetailList.CompletedQuantity += stock.StockInfoDetails.Sum(x => x.StockQuantity);
        //返回更新后的订单和库存信息
        return orderStock;
    }
    /// <summary>
    /// 判断订单是否完成
    /// </summary>
    /// <param name="orderStock">订单和库存信息</param>
    /// <returns>是否完成</returns>
    // 判断订单是否完成
    private bool IsOrderComplete(Dt_OutOrderAndStock orderStock)
    {
        // 如果出库数量等于完成出库数量,则订单完成
        return orderStock.CompletedQuantity == orderStock.OutboundQuantity;
    }
    /// <summary>
    /// 创建历史任务记录
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -1,8 +1,12 @@
using log4net.Core;

using log4net.Core;
using Mapster;
using Masuit.Tools;
using Masuit.Tools.Models;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
using SixLabors.Fonts.Tables.AdvancedTypographic;
using System.Diagnostics;
using WIDESEA_Core.Const;
using WIDESEA_DTO;
using WIDESEA_DTO.MOM;
using WIDESEA_DTO.WMS;
@@ -387,13 +391,13 @@
            }
            //创建一个TrayCellsStatusDto对象,并赋值
           TrayCellsStatusDto trayCells = new TrayCellsStatusDto()
           {
               Software = "WMS",
               TrayBarcode = input.PalletCode,
               //EquipmentCode = "EQ_CWJZ01"
               EquipmentCode = input.EquiCodeMOM
           };
            TrayCellsStatusDto trayCells = new TrayCellsStatusDto()
            {
                Software = "WMS",
                TrayBarcode = input.PalletCode,
                //EquipmentCode = "EQ_CWJZ01"
                EquipmentCode = input.EquiCodeMOM
            };
            // 调用GetTrayCellStatusAsync方法,获取整盘电芯
            content = await GetTrayCellStatusAsync(trayCells);
@@ -413,7 +417,7 @@
            ////    return content.Error("料框属性不存在");
            //// 调用CreateBoxingInfo方法,创建组盘信息
            var boxing =  CreateBoxingInfo(result, input.PalletCode);
            var boxing = CreateBoxingInfo(result, input.PalletCode);
            if (boxing == null) return content.Error("组盘失败");
            //// 调用GetProcessApplyAsync方法,获取工艺路线
@@ -779,4 +783,83 @@
    }
    #endregion
    #region 检测高温库是否有可出库库存
    public WebResponseContent StockCheckingAsync()
    {
        WebResponseContent webResponseContent = new WebResponseContent();
        try
        {
            Task.Run(async () =>
            {
                while (true)
                {
                    Thread.Sleep(10000);
                    var area = await _areaInfoRepository.QueryFirstAsync(x => x.AreaCode == "GWSC1");
                    var stockInfo = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
                         .Includes(x => x.LocationInfo) // 预加载LocationInfo
                         .Includes(x => x.StockInfoDetails) // 预加载StockInfoDetails
                         .Where(x => x.AreaCode == area.AreaCode && x.OutboundTime < DateTime.Now && x.IsFull == true) // 过滤条件
                         .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID) // 过滤条件
                         .OrderBy(x => x.OutboundTime) // 排序
                         .ToListAsync(); // 获取第一个元素
                    if (stockInfo.Count <= 0) continue;
                    foreach (var item in stockInfo)
                    {
                        var hasTask = BaseDal.QueryFirst(x => x.PalletCode == item.PalletCode);
                        if (hasTask != null)
                        {
                            Console.WriteLine("已存在出库任务");
                            continue;
                        }
                        string position = string.Empty;
                        if (item.LocationInfo.RoadwayNo == "GWSC1")
                            position = "1059";
                        else
                            position = "1065";
                        var task = CreateTask(item, position, (int)TaskOutboundTypeEnum.Outbound);
                        task.NextAddress = "002-000-002";
                        // 创建任务DTO
                        WMSTaskDTO taskDTO = CreateTaskDTO(task);
                        var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
                        var wmsBase = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue;
                        var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.ReceiveTask)?.ConfigValue;
                        if (wmsBase == null || ipAddress == null)
                        {
                            throw new InvalidOperationException("WMS IP 未配置");
                        }
                        var wmsIpAddress = wmsBase + ipAddress;
                        var result = HttpHelper.PostAsync(wmsIpAddress, taskDTO.ToJsonString()).Result;
                        var content = JsonConvert.DeserializeObject<WebResponseContent>(result);
                        if (content.Status)
                        {
                            await BaseDal.AddDataAsync(task);
                            // 更新库存位置状态为不可用
                            item.LocationInfo.LocationStatus = (int)LocationEnum.InStockDisable;
                            await _locationRepository.UpdateDataAsync(item.LocationInfo);
                        }
                    }
                }
            });
            return webResponseContent.OK();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message.ToString());
            return webResponseContent.Error(ex.Message);
        }
    }
    #endregion
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs
@@ -122,4 +122,14 @@
        return await Service.UpdateTaskStatus(input.TaskNum, input.TaskState);
    }
    /// <summary>
    /// 获取高温可出库库存
    /// </summary>
    /// <param name="input">请求数据</param>
    /// <returns></returns>
    [HttpGet, AllowAnonymous, Route("StockCheckingAsync")]
    public WebResponseContent StockCheckingAsync()
    {
        return Service.StockCheckingAsync();
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
@@ -146,7 +146,6 @@
app.UseAuthorization();
app.MapControllers();
app.Run();