huanghongfeng
3 天以前 5ffc36a1db18d3112a9b50a9cf3953d7fcf21bae
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/genAgvSchedulingTask.cs
@@ -26,16 +26,36 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                if (input.RequestType == "999")
                {
                    int CZInfotli = _task_CZInfoRepository.QueryData(x => x.CurrentStatue == "3").Count();
                    if (CZInfotli == 0)
                    {
                        return content.Error($"没有自动取轴任务,无自动任务");
                    }
                }
                if (string.IsNullOrEmpty(input.Position)) { return content.Error($"agv任务下发申请目标地址为空!!!请检查"); }
                //查找当前在车轴线末端需要agv搬运的车轴
                List<Dt_CZInfo_mes> CZInfotlist = _task_CZInfoRepository.QueryData(x => x.CurrentStatue == "3" || x.CurrentStatue == "4" || x.CurrentStatue == "5" || x.CurrentStatue == "13");
                List<Dt_CZInfo_mes> CZInfotlist = _task_CZInfoRepository.QueryData(x => x.CurrentStatue == "4" || x.CurrentStatue == "5" );
                if (CZInfotlist.Count >= 2) { return content.Error($"已有agv任务正在进行中,下发失败!!!"); }
                Dt_CZInfo_mes CZInfot = CZInfotlist.FirstOrDefault(x => x.CurrentStatue == "3" || x.CurrentStatue == "13");
                if (CZInfot == null) { return content.Error($"未找到现有输送线完成的车轴信息"); }
                Dt_CZInfo_mes CZInfot = null;
                if (input.RequestType == "888")
                {
                    CZInfot = _task_CZInfoRepository.QueryFirst(x =>x.CZTM==input.PalletCode && (x.CurrentStatue == "11" || x.CurrentStatue == "12" || x.CurrentStatue == "13"));
                    if (CZInfot == null) { return content.Error($"未找到现有输送线完成的车轴信息"); }
                }
                else
                {
                    CZInfot = _task_CZInfoRepository.QueryFirst(x => x.CurrentStatue == "3");
                    if (CZInfot == null) { return content.Error($"未找到现有输送线完成的车轴信息"); }
                }
                CZInfot.CurrentStatue = "4";
               
@@ -59,7 +79,7 @@
                //agv参数调取
                genAgvSchedulingTask schedulingTask = new genAgvSchedulingTask
                {
                    reqCode = Guid.NewGuid().ToString().Replace("-", ""),
                    reqCode = $"{DateTime.Now:yyyyMMddHHmmss}",
                    clientCode = "WMS",
                    taskTyp = "BY",
                    ctnrTyp = "1",
@@ -108,7 +128,7 @@
            catch (Exception ex)
            {
                LogFactory.GetLog("下发AGV任务").Error(true, ex.Message);
                return content.Error($"请求异常:{ex.Message}");
                return content.Error($"下发任务接口异常:{ex.Message}");
            }
        }
    }