yanjinhui
2 天以前 0a62180f002d8a601b6b3c46af3a6b4583f9acf6
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/HKTaskMethods.cs
@@ -34,6 +34,10 @@
            try
            {
                Dt_HKLocationInfo? hKLocationInfo = null;
                if (taskType==(int)TaskTypeEnum.STURR)
                {
                    var reslut=_stationInfo.Repository.QueryFirst(x=>x.StationCode==taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点货位【{taskDTO.fromLocationCode}】");
                }
                #region ç‚¹åˆ°ç‚¹
                if (!string.IsNullOrEmpty(taskDTO.toLocationCode))
                {
@@ -44,14 +48,14 @@
                //获取货位信息
                else
                    hKLocationInfo = _hKLocationInfoService.GetFreeLocationInfo(taskDTO.toAreaCode) ?? throw new Exception($"未找到终点库区【{taskDTO.toAreaCode}】可用空货位!");
                if (taskType==(int)TaskTypeEnum.Q1TSJ4)
                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)
                        if (reslu == taskDTO.containerCode && result != null)
                        {
                            throw new Exception($"当前的料箱号为{reslu}与{taskDTO.containerCode}料箱号不匹配");
                        }
@@ -126,12 +130,20 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                //4楼库内到提升机
                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()
                //库内到现边的点到点任务,是否需要判断货位状态?
                if (taskType == (int)TaskTypeEnum.STU0003)
                {
                    var reslut = _stationInfo.Repository.QueryFirst(x => x.StationCode == taskDTO.toLocationCode) ?? throw new Exception($"未找到终点货位【{taskDTO.toLocationCode}】");
                    if (reslut.StationStatus != (int)LocationStatusEnum.Free)
                    {
                        throw new Exception($"终点站台【{taskDTO.toLocationCode}】状态不为空闲!");
                    }
                }
                    Dt_Task dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,
@@ -246,8 +258,7 @@
                hIKROBOTTaskSubmit.initPriority = task.Grade;
                hIKROBOTTaskSubmit.robotTaskCode = task.WMSTaskNum;
                hIKROBOTTaskSubmit.taskType = tasktype.ToString(); ExtraDto extraDto = new ExtraDto();
                if (task.TaskType != (int)TaskTypeEnum.MOVE &&task.TaskType != (int)TaskTypeEnum.Q3RK && task.TaskType != (int)TaskTypeEnum.Q3CK &&
                    task.TaskType != (int)TaskTypeEnum.F01)
                if (task.TaskType != (int)TaskTypeEnum.MOVE && task.TaskType != (int)TaskTypeEnum.Q3RK && task.TaskType != (int)TaskTypeEnum.Q3CK && task.TaskType != (int)TaskTypeEnum.F01)
                {
                    CarrierInfoDto carrierInfoDto = new CarrierInfoDto()
                    {
@@ -353,6 +364,26 @@
                            hIKROBOTTaskSubmit.targetRoute.Add(targetRoute);
                        }
                        break;
                    case TaskTypeEnum.STUPTBY:
                        {
                            TargetRouteDto target = new TargetRouteDto()
                            {
                                code = task.CurrentAddress,
                                operation = "DELIVERY",//取货
                                seq = 0,
                                type = "STORAGE",
                            };
                            TargetRouteDto targetRoute = new TargetRouteDto()
                            {
                                code = task.NextAddress,
                                operation = "DELIVERY",//送货
                                seq = 1,
                                type = "STORAGE",
                            };
                            hIKROBOTTaskSubmit.targetRoute.Add(target);
                            hIKROBOTTaskSubmit.targetRoute.Add(targetRoute);
                        }
                        break;
                    case TaskTypeEnum.CPMoveInventory:
                        break;
                    default: