Admin
22 小时以前 fd7fa01f87026b9db4cc6d44c0f93987b9bc27f2
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -929,7 +929,7 @@
                return content.Error("未找到任务信息!");
            }
            if (task.TaskState != (int)TaskInStatusEnum.InNew && task.TaskState != (int)TaskOutStatusEnum.OutNew && task.TaskState != (int)TaskStatus.Created)
            if (task.TaskState != (int)TaskInStatusEnum.InNew && task.TaskState != (int)TaskOutStatusEnum.OutNew && task.TaskState != (int)TaskStatus.Created && task.TaskState != (int)TaskInStatusEnum.InAbnormalCompletion && task.TaskState != (int)TaskOutStatusEnum.OutAbnormalCompletion)
            {
                return content.Error("任务不处于新建状态,禁止删除!");
            }
@@ -944,48 +944,69 @@
            // æ ¹æ®ä»»åŠ¡ç±»åž‹è°ƒç”¨ç›¸åº”çš„å®Œæˆä»»åŠ¡æ–¹æ³•
            // éªŒè¯åº“存是否存在
            var stock = _WheelsStockRepository.QueryFirstNavAsync(x => x.Wheels_Num.Contains(task.PalletCode) && x.Wheels_Location == task.SourceAddress);
            var ZdpStock = _ZdpStockRepository.QueryFirstNavAsync(x => x.Zdp_code == task.PalletCode && x.Zdp_Location == task.SourceAddress);
            bool res = false;
            switch (task.TaskType)
            if(task.TaskState== (int)TaskInStatusEnum.InAbnormalCompletion || task.TaskState == (int)TaskOutStatusEnum.OutAbnormalCompletion)
            {
                case (int)TaskInboundTypeEnum.Inbound:
                case (int)TaskInboundTypeEnum.InWheels:
                case (int)TaskInboundTypeEnum.InBrake:
                    LogFactory.GetLog("任务完成").InfoFormat(true, "入库任务", "");
                        res = SellectLocationInfo(task,1);
                    break;
                var taskHtyNG2 = CreateHistoricalTask(task, true);
                case (int)TaskOutboundTypeEnum.Outbound:
                case (int)TaskOutboundTypeEnum.OutWheels:
                    LogFactory.GetLog("任务完成").InfoFormat(true, "出库任务", "");
                        res = SellectLocationInfo(task,2);
                    break;
                //if (task.TaskState == (int)TaskInStatusEnum.InNew || task.TaskState == (int)TaskOutStatusEnum.OutNew)
                //{
                //    //if(task.TaskType ==  )
                //}
                case (int)TaskOutboundTypeEnum.OutBrake:
                    LogFactory.GetLog("任务完成").InfoFormat(true, "制动盘出库任务", "");
                        res = SellectLocationInfo(task,3);
                    break;
                // æ·»åŠ åŽ†å²ä»»åŠ¡
                var isTaskHtyAdd2 = _task_HtyRepository.AddData(taskHtyNG2) > 0;
                case (int)TaskRelocationTypeEnum.Relocation:
                    if (stock != null)
                    {
                        res = SellectLocationInfo(task,4);
                    }
                    else
                    {
                        res = SellectLocationInfo(task,5);
                    }
                    break;
                // åˆ é™¤ä»»åŠ¡æ•°æ®
                var isTaskDelete2 = BaseDal.Delete(task.TaskId);
                default:
                    return content.Error("任务类型不存在");
                return content.OK("删除成功!");
            }
            if (!res)
            else
            {
                return content.Error("在执行任务分类的时候出现错误!");
                var stock = _WheelsStockRepository.QueryFirstNavAsync(x => x.Wheels_Num.Contains(task.PalletCode) && x.Wheels_Location == task.SourceAddress);
                var ZdpStock = _ZdpStockRepository.QueryFirstNavAsync(x => x.Zdp_code == task.PalletCode && x.Zdp_Location == task.SourceAddress);
                bool res = false;
                switch (task.TaskType)
                {
                    case (int)TaskInboundTypeEnum.Inbound:
                    case (int)TaskInboundTypeEnum.InWheels:
                    case (int)TaskInboundTypeEnum.InBrake:
                        LogFactory.GetLog("任务完成").InfoFormat(true, "入库任务", "");
                        res = SellectLocationInfo(task, 1);
                        break;
                    case (int)TaskOutboundTypeEnum.Outbound:
                    case (int)TaskOutboundTypeEnum.OutWheels:
                        LogFactory.GetLog("任务完成").InfoFormat(true, "出库任务", "");
                        res = SellectLocationInfo(task, 2);
                        break;
                    case (int)TaskOutboundTypeEnum.OutBrake:
                        LogFactory.GetLog("任务完成").InfoFormat(true, "制动盘出库任务", "");
                        res = SellectLocationInfo(task, 3);
                        break;
                    case (int)TaskRelocationTypeEnum.Relocation:
                        if (stock != null)
                        {
                            res = SellectLocationInfo(task, 4);
                        }
                        else
                        {
                            res = SellectLocationInfo(task, 5);
                        }
                        break;
                    default:
                        return content.Error("任务类型不存在");
                }
                if (!res)
                {
                    return content.Error("在执行任务分类的时候出现错误!");
                }
            }
            var taskHtyNG = CreateHistoricalTask(task, true);