dengjunjie
7 天以前 3b7569285434bb38736627821f7d7eb34fabca28
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs
@@ -14,6 +14,7 @@
using WIDESEAWCS_DTO.AGV.HIKROBOT;
using System.Diagnostics.CodeAnalysis;
using System.Reflection.PortableExecutable;
using WIDESEAWCS_QuartzJob;
namespace WIDESEAWCS_TaskInfoService
{
@@ -43,6 +44,23 @@
                //获取货位信息
                else
                    hKLocationInfo = _hKLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode) ?? throw new Exception($"未找到终点库区【{taskDTO.toAreaCode}】可用空货位!");
                if (taskType == (int)TaskTypeEnum.Q1TSJ4)
                {
                    var device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "TSJ") as OtherDevice;
                    if (device.IsConnected)
                    {
                        var reslu = device.GetValue<HoistEnum, string>(HoistEnum.Emptycontainernumber);
                        var result = reslu?.TrimEnd('\0')?.Substring(2);
                        if (reslu == taskDTO.containerCode && result != null)
                        {
                            throw new Exception($"当前的料箱号为{reslu}与{taskDTO.containerCode}料箱号不匹配");
                        }
                    }
                    else
                    {
                        throw new Exception("提升机信息设备连接失败");
                    }
                }
                Dt_Task dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
@@ -111,6 +129,8 @@
                Dt_HKLocationInfo? hKLocationInfo = _hKLocationInfoService.Repository.QueryFirst(x => x.LocationCode == taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                if (hKLocationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不可出库!");
                if (hKLocationInfo.PalletCode != taskDTO.containerCode) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】绑定料箱号【{hKLocationInfo.PalletCode}】与任务料箱号【{taskDTO.containerCode}】不匹配!");
                //库内到库外的点到点任务,是否需要判断货位状态?
                Dt_Task dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
@@ -226,21 +246,22 @@
                hIKROBOTTaskSubmit.initPriority = task.Grade;
                hIKROBOTTaskSubmit.robotTaskCode = task.WMSTaskNum;
                hIKROBOTTaskSubmit.taskType = tasktype.ToString(); ExtraDto extraDto = new ExtraDto();
                CarrierInfoDto carrierInfoDto = new CarrierInfoDto()
                if (task.TaskType != (int)TaskTypeEnum.MOVE && task.TaskType != (int)TaskTypeEnum.Q3RK && task.TaskType != (int)TaskTypeEnum.Q3CK && task.TaskType != (int)TaskTypeEnum.F01)
                {
                    carrierCode = task.PalletCode,
                    carrierType = task.PalletCode.Contains("LXM") ? "DX" : "SX"
                };
                extraDto.carrierInfo.Add(carrierInfoDto);
                hIKROBOTTaskSubmit.extra = extraDto;
                    CarrierInfoDto carrierInfoDto = new CarrierInfoDto()
                    {
                        carrierCode = task.PalletCode,
                        carrierType = task.PalletCode.Contains("LXM") ? "DX" : "SX"
                    };
                    extraDto.carrierInfo.Add(carrierInfoDto);
                    hIKROBOTTaskSubmit.extra = extraDto;
                }
                switch (tasktype)
                {
                    case TaskTypeEnum.CPInbound:
                    case TaskTypeEnum.CPOutbound:
                    case TaskTypeEnum.MLInbound:
                    case TaskTypeEnum.MLOutbound:
                        break;
                    case TaskTypeEnum.F01:
                        break;
                    case TaskTypeEnum.RK3F:
                    case TaskTypeEnum.CK3F:
@@ -310,7 +331,8 @@
                        break;
                    case TaskTypeEnum.Q3RK:
                    case TaskTypeEnum.Q3CK:
                    case TaskTypeEnum.Move:
                    case TaskTypeEnum.MOVE:
                    case TaskTypeEnum.F01:
                        {
                            TargetRouteDto target = new TargetRouteDto()
                            {