yanjinhui
6 天以前 c71c0e3e641f54f8c1deec44bb570b4f1b2ee07e
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/KLSTaskMethods.cs
@@ -212,8 +212,14 @@
                Dt_StationManger? stationInfo = null;
                Dt_Task dt_Task = null;
                //入库 åˆ°ä¸€æ¥¼ä¸‰ä¸ªç«™å°çš„位置
                if (taskType == (int)TaskTypeEnum.Q3RK)
                if (taskType == (int)TaskTypeEnum.Q3RK)//6-1楼
                {
                    var  ionInfo = _stationMangerService.Repository.QueryFirst(x => x.StationCode == taskDTO.toLocationCode) ?? throw new Exception($"未找到终点站台【{taskDTO.toLocationCode}】!");
                    var StationInfo = _stationInfo.Repository.QueryFirst(x => x.StationCode == taskDTO.fromLocationCode ) ?? throw new Exception($"未找到{taskDTO.fromLocationCode}起点货位");
                    if (StationInfo.PalletCode != taskDTO.containerCode) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】绑定料箱号【{StationInfo.PalletCode}】与任务料箱号【{taskDTO.containerCode}】不匹配!");
                    if (StationInfo.StationStatus != (int)LocationStatusEnum.InStock) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前状态不可以出库");
                    if (StationInfo.FloorNumber != "FF") throw new Exception($"【{taskDTO.fromLocationCode}】的楼层和任务类型楼层不匹配");
                    dt_Task = new Dt_Task()
                    {
                        TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
@@ -231,10 +237,15 @@
                    };
                }
                //出库
                if (taskType == (int)TaskTypeEnum.Q3CK)
                if (taskType == (int)TaskTypeEnum.Q3CK)//1-6楼
                {
                    //stationInfo = _stationMangerService.Repository.QueryFirst(x => x.StationCode == taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                    //if (stationInfo.IsOccupied != (int)LocationStatusEnum.InStock) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不可出库!");
                    var StationInfo = _stationInfo.Repository.QueryFirst(x => x.StationCode == taskDTO.toLocationCode) ?? throw new Exception($"未{taskDTO.toLocationCode}终点货位");
                    if (StationInfo.StationStatus != (int)LocationStatusEnum.Free) throw new Exception($"终点库位【{taskDTO.toLocationCode}】当前状态不可以放货");
                    if (StationInfo.FloorNumber != "FF") throw new Exception($"终点库位【{taskDTO.toLocationCode}】的楼层与任务类型楼层不匹配");
                    var ionInfo = _stationMangerService.Repository.QueryFirst(x => x.StationCode == taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点站台【{taskDTO.fromLocationCode}】!");
                    if (ionInfo.Remark != taskDTO.containerCode) throw new Exception($"起点站台【{taskDTO.fromLocationCode}】绑定料箱号【{ionInfo.Remark}】与任务料箱号【{taskDTO.containerCode}】不匹配!");
                    dt_Task = new Dt_Task()
                    {
                        TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
@@ -285,19 +296,27 @@
            Dt_StationInfo? stationInfo = null;
            try
            {
                //#region æ˜¯å¦éœ€è¦åˆ¤æ–­å¹³åº“库位状态
                //if (taskType!= (int)TaskTypeEnum.CK3F)
                //{
                //    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
                //{
                //    stationInfo = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.toLocationCode) ?? throw new Exception($"未找到终点库位【{taskDTO.toLocationCode}】!");
                //    if (stationInfo.StationName != LocationStatusEnum.InStock.ToString()) throw new Exception($"起点库位【{taskDTO.toLocationCode}】当前库位状态不可出库!");
                //}
                //#endregion
                #region æ˜¯å¦éœ€è¦åˆ¤æ–­å¹³åº“库位状态
                if (taskType == (int)TaskTypeEnum.CK3F|| taskType == (int)TaskTypeEnum.F03)
                {
                    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}】不匹配!");
                }
                #endregion
                Dt_Task dt_Task = new Dt_Task()
                {
@@ -337,6 +356,13 @@
            try
            {
                var stationInfo = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.fromLocationCode) ?? throw new Exception($"未找到起点库位【{taskDTO.fromLocationCode}】!");
                if (stationInfo.StationStatus != (int)LocationStatusEnum.InStock) throw new Exception($"起点库位【{taskDTO.fromLocationCode}】当前库位状态不是有货!");
                if (stationInfo.PalletCode != taskDTO.containerCode) throw new Exception($"当前库位【{taskDTO.fromLocationCode}】绑定料箱号【{stationInfo.PalletCode}】与任务的料箱号【{taskDTO.containerCode}】不匹配");
                var stationInfo2 = _stationInfo.Repository.QueryFirst(x => x.StationName == taskDTO.toLocationCode) ?? throw new Exception($"未找到终点库位【{taskDTO.toLocationCode}】!");
                if (stationInfo2.StationStatus != (int)LocationStatusEnum.Free) throw new Exception($"终点库位【{taskDTO.toLocationCode}】当前库位状态不是空闲!");
                var dt_Task = new Dt_Task()
                {
                    TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),