Admin
2 天以前 679893ee68e2f7d422431bb22b665e9217f23410
ÏîÄ¿´úÂë/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("任务不处于新建状态,禁止删除!");
            }
@@ -943,49 +943,87 @@
            //判断任务类型
            // æ ¹æ®ä»»åŠ¡ç±»åž‹è°ƒç”¨ç›¸åº”çš„å®Œæˆä»»åŠ¡æ–¹æ³•
            //调取删除wcs任务
            var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
            var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue;
            var ReceiveByWMSTask = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.DelteWCSTask)?.ConfigValue;
            if (ReceiveByWMSTask == null || ipAddress == null)
            {
                throw new Exception("WMS IP æœªé…ç½®");
            }
            var wmsIpAddrss = ipAddress + ReceiveByWMSTask;
            var respon = HttpHelper.Post(wmsIpAddrss, JsonConvert.SerializeObject(task.TaskNum));
            if (respon == null) return content.Error("WCS处理失败");
            WebResponseContent respone = JsonConvert.DeserializeObject<WebResponseContent>(respon.ToString());
            if (!respone.Status) return content.Error($"删除wcs任务失败,原因=》{content.Message}");
            // éªŒè¯åº“存是否存在
            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);