yanjinhui
6 天以前 e3694f8b831fdd89562b8ae83e9708aed518be1f
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs
@@ -297,28 +297,14 @@
            try
            {
                #region æ˜¯å¦éœ€è¦åˆ¤æ–­å¹³åº“库位状态
                if (taskType == (int)TaskTypeEnum.CK3F|| taskType == (int)TaskTypeEnum.F03)
               var reslut= ValidateLocationForTask(taskType,taskDTO);
                if (!reslut.Status)
                {
                    stationInfo = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.toLocationCode) ?? throw new Exception($"未找到终点库位【{taskDTO.toLocationCode}】!");
                    if (stationInfo.StationName != LocationStatusEnum.Free.ToString()) throw new Exception($"终点库位【{taskDTO.toLocationCode}】库位状态不可入库!");
                }
                else if (taskType == (int)TaskTypeEnum.RK3F || taskType == (int)TaskTypeEnum.F04)
                {
                    stationInfo = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                    if (stationInfo.StationName != LocationStatusEnum.InStock.ToString()) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不可出库!");
                    if (stationInfo.PalletCode != taskDTO.containerCode) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】绑定料箱号【{stationInfo.PalletCode}】与任务料箱号【{taskDTO.containerCode}】不匹配!");
                }
                else if(taskType==(int)TaskTypeEnum.F02)
                {
                    stationInfo = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.toLocationCode) ?? throw new Exception($"未找到终点库位【{taskDTO.toLocationCode}】!");
                    if (stationInfo.StationName != LocationStatusEnum.Free.ToString()) throw new Exception($"终点库位【{taskDTO.toLocationCode}】库位状态不可入库!");
                    stationInfo = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                    if (stationInfo.StationName != LocationStatusEnum.InStock.ToString()) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不可出库!");
                    if (stationInfo.PalletCode != taskDTO.containerCode) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】绑定料箱号【{stationInfo.PalletCode}】与任务料箱号【{taskDTO.containerCode}】不匹配!");
                    throw new Exception(reslut.Message);
                }
                #endregion
                Dt_Task dt_Task = new Dt_Task()
                 Dt_Task dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    WMSTaskNum = taskDTO.taskCode,