| | |
| | | return BaseDal.QueryFirst(x => x.Roadway == DeviceCode && x.TaskState == (int)TaskOutStatusEnum.RGV_OutZicheFinish && x.RGVTaskType == (int)RGVTaskTypeEnum.Placing, TaskOrderBy); |
| | | } |
| | | |
| | | public Dt_Task ChacheGetFinhuoTask(string DeviceCode) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.Roadway == DeviceCode && x.TaskState == (int)TaskOutStatusEnum.RGV_OutPickupExecuting, TaskOrderBy); |
| | | } |
| | | |
| | | public Dt_Task GetOutkouFinhuoTask(string DeviceCode, string curraderr) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.Roadway == DeviceCode && x.TaskState == (int)TaskOutStatusEnum.RGV_OutPickupFinish && x.RGVTaskType == (int)RGVTaskTypeEnum.Placing && x.NextAddress != "", TaskOrderBy); |
| | |
| | | /// <param name="type">1ï¼æ¥æ¾éè¦åè´§çä»»å¡ 2ï¼æ¥æ¾éè¦æ¾è´§çä»»å¡</param> |
| | | public Dt_Task GetInkouFinhuoTask(string DeviceCode) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.Roadway == DeviceCode && x.NextAddress != "" && x.TaskState == (int)TaskInStatusEnum.RGV_InPickupFinish && x.RGVTaskType == (int)RGVTaskTypeEnum.Placing, TaskOrderBy); |
| | | return BaseDal.QueryFirst(x => x.Roadway == DeviceCode && x.NextAddress != "" && (x.TaskState == (int)TaskInStatusEnum.RGV_InPickupFinish || x.TaskState == (int)TaskInStatusEnum.InexceptionalSelection) && x.RGVTaskType == (int)RGVTaskTypeEnum.Placing, TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | public Dt_Task MothermachinemovementTask2(string DeviceCode) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.Roadway == DeviceCode && (x.TaskState == (int)TaskInStatusEnum.RGV_InZicheReleaseFinish || x.TaskState == (int)TaskInStatusEnum.RGV_InMothercarExecuting && x.RGVTaskType == (int)RGVTaskTypeEnum.TravelingOnly), TaskOrderBy); |
| | | return BaseDal.QueryFirst(x => x.Roadway == DeviceCode && (x.TaskState == (int)TaskInStatusEnum.RGV_InZicheReleaseFinish || x.TaskState == (int)TaskInStatusEnum.RGV_InMothercarExecuting || x.TaskState == (int)TaskInStatusEnum.RGV_InMothercarFinish || x.TaskState == (int)TaskInStatusEnum.SC_InExecuting || x.TaskState == (int)TaskInStatusEnum.InFinish), TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public Dt_Task MothermacTask(string DeviceCode) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.Roadway == DeviceCode && (x.TaskState == (int)TaskInStatusEnum.RGV_InZicheReleaseFinish || x.TaskState == (int)TaskInStatusEnum.RGV_InMothercarExecuting || x.TaskState == (int)TaskInStatusEnum.RGV_InMothercarFinish || x.TaskState == (int)TaskInStatusEnum.SC_InExecuting || x.TaskState == (int)TaskInStatusEnum.InFinish && x.RGVTaskType == (int)RGVTaskTypeEnum.TravelingOnly), TaskOrderBy); |
| | | return BaseDal.QueryFirst(x => x.Roadway == DeviceCode && (x.TaskState == (int)TaskInStatusEnum.RGV_InZicheReleaseFinish || x.TaskState == (int)TaskInStatusEnum.RGV_InMothercarExecuting || x.TaskState == (int)TaskInStatusEnum.RGV_InMothercarFinish || x.TaskState == (int)TaskInStatusEnum.SC_InExecuting || x.TaskState == (int)TaskInStatusEnum.InFinish ), TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="DeviceCode"></param> |
| | | public Dt_Task ViceChariotPickupTask2(string DeviceCode) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.Roadway == DeviceCode && (x.TaskState == (int)TaskInStatusEnum.RGV_InReleaseFinish || x.TaskState == (int)TaskInStatusEnum.RGV_InZicheExecuting || x.TaskState == (int)TaskInStatusEnum.RGV_InZicheFinish || x.TaskState == (int)TaskInStatusEnum.RGV_InZicheReleaseExecuting || x.TaskState == (int)TaskInStatusEnum.RGV_InZicheReleaseFinish) && x.RGVTaskType == (int)RGVTaskTypeEnum.PickingUp, TaskOrderBy); |
| | | return BaseDal.QueryFirst(x => x.Roadway == DeviceCode && (x.TaskState == (int)TaskInStatusEnum.RGV_InReleaseFinish || x.TaskState == (int)TaskInStatusEnum.RGV_InZicheExecuting || x.TaskState == (int)TaskInStatusEnum.RGV_InZicheFinish || x.TaskState == (int)TaskInStatusEnum.RGV_InZicheReleaseExecuting || x.TaskState == (int)TaskInStatusEnum.RGV_InZicheReleaseFinish), TaskOrderBy); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | dt_Task = BaseDal.QueryFirst(x => x.TaskType == (int)TaskInboundTypeEnum.Inbound && x.TaskState== (int)TaskInStatusEnum.InexceptionalSelection); |
| | | |
| | | if (dt_Task == null) return webResponse.Error("æªæ¾å°éè¦ä¿®æ¹çä»»å¡ï¼æ éä¿®æ¹"); |
| | | dt_Task.NextAddress = NextAddress; |
| | | BaseDal.UpdateData(dt_Task); |
| | | return webResponse.OK("任塿¾è´§å°åä¿®æ¹æå"); |
| | | } |
| | | else |
| | | { |
| | | dt_Task = BaseDal.QueryFirst(x => x.TaskType == (int)TaskOutboundTypeEnum.Outbound && x.NextAddress == ""); |
| | | if (dt_Task == null) return webResponse.Error("æªæ¾å°éè¦ä¿®æ¹çä»»å¡ï¼æ éä¿®æ¹"); |
| | | dt_Task.NextAddress = NextAddress; |
| | | BaseDal.UpdateData(dt_Task); |
| | | return webResponse.OK("任塿¾è´§å°åä¿®æ¹æå"); |
| | | } |
| | | if (dt_Task == null) return webResponse.Error("æªæ¾å°éè¦ä¿®æ¹çä»»å¡ï¼æ éä¿®æ¹"); |
| | | dt_Task.NextAddress = NextAddress; |
| | | BaseDal.UpdateData(dt_Task); |
| | | return webResponse.OK("任塿¾è´§å°åä¿®æ¹æå"); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | try |
| | | { |
| | | int oldState = task.TaskState; |
| | | if (task.TaskType == (int)TaskInboundTypeEnum.Inbound) |
| | | if (task.TaskType == (int)TaskInboundTypeEnum.Inbound && task.TaskState != (int)TaskInStatusEnum.InexceptionalSelection) |
| | | { |
| | | if (task.TaskState >= (int)TaskInStatusEnum.InFinish) |
| | | { |
| | |
| | | int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>(); |
| | | |
| | | task.TaskState = nextStatus; |
| | | /*if (task.TaskState == (int)TaskInStatusEnum.RGV_InPickupExecuting) //å½ä¸åå
¥åºå£åè´§ä¸ï¼åè°åå
°åæ¥å£ |
| | | { |
| | | TaskResultIn(task.TaskNum.ToString(),"",1,""); |
| | | }*/ |
| | | |
| | | } |
| | | else if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | { |
| | |
| | | } |
| | | |
| | | int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskOutStatusEnum>(); |
| | | |
| | | task.TaskState = nextStatus; |
| | | } |
| | | else if (task.TaskType == (int)TaskInboundTypeEnum.Inbound && task.TaskState== (int)TaskInStatusEnum.InexceptionalSelection) |
| | | { |
| | | int nextStatus = (int)TaskInStatusEnum.Inexcepjxz; |
| | | |
| | | task.TaskState = nextStatus; |
| | | } |
| | |
| | | |
| | | try |
| | | { |
| | | if (task.TaskType == (int)TaskInboundTypeEnum.Inbound) //æ£å¸¸æµç¨ |
| | | if (task.TaskType == (int)TaskInboundTypeEnum.Inbound ) //æ£å¸¸æµç¨ |
| | | { |
| | | HandleInboundTask(task); |
| | | } |
| | | else if (task.TaskType == (int)TaskInboundTypeEnum.Inbound && (task.NextAddress == "1001" || task.NextAddress == "1002")) |
| | | { |
| | | task.TaskState = (int)TaskInStatusEnum.RGV_InMothercarFinish; |
| | | if(task.NextAddress == "1001" || task.NextAddress == "1002") |
| | | { |
| | | task.TaskState = (int)TaskInStatusEnum.InFinish_exceptionalSelection; |
| | | } |
| | | else |
| | | { |
| | | HandleInboundTask(task); |
| | | } |
| | | |
| | | } |
| | | else if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | { |
| | |
| | | : $"ç³»ç»èªå¨æµç¨ï¼ä»»å¡ç¶æä»ã{oldstaterem}ã转å°ã{afterstaterem}ã"); |
| | | |
| | | |
| | | if (task.TaskState == (int)TaskInStatusEnum.RGV_InMothercarFinish || task.TaskState == (int)TaskOutStatusEnum.OutFinish) //å
¥åºä»»å¡å®æ |
| | | if (task.TaskState == (int)TaskInStatusEnum.RGV_InMothercarFinish || task.TaskState == (int)TaskOutStatusEnum.OutFinish || task.TaskState == (int)TaskInStatusEnum.InFinish_exceptionalSelection) //å
¥åºä»»å¡å®æ |
| | | { |
| | | |
| | | if (task.NextAddress == "1001" || task.NextAddress == "1002") |
| | | { |
| | | //å¼å¸¸æé¤ä»»å¡æ¶ï¼å¼å¸¸ä¸æ¥ |
| | | TaskResultIn(task.TaskNum.ToString(), task.NextAddress, 3, ""); |
| | | AutomaticTaskCompleted(task); //ä»»å¡å®æ |
| | | BaseDal.DeleteData(task); |
| | | } |
| | | else |
| | | { |
| | | //æ£å¸¸ä»»å¡ï¼æ£å¸¸ä¸æ¥ |
| | | TaskResultIn(task.TaskNum.ToString(), "", 2, ""); |
| | | |
| | | /*AutomaticTaskCompleted(task); //ä»»å¡å®æ |
| | | BaseDal.DeleteData(task);*/ |
| | | if(task.TaskType == (int)TaskInboundTypeEnum.Inbound && task.NextAddress != "1001" && task.NextAddress != "1002") |
| | | { |
| | | TaskResultIn(task.TaskNum.ToString(), "", 2, ""); |
| | | } |
| | | else if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | { |
| | | TaskResultOut(task.TaskNum.ToString(), task.NextAddress, 2, ""); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | return WebResponseContent.Instance.Error($"{Remark}失败ï¼"); |
| | | } |
| | | |
| | | if (dt_task.NextAddress == "1001" || dt_task.NextAddress == "1002") |
| | | { |
| | | //å¼å¸¸æé¤ä»»å¡æ¶ï¼å¼å¸¸ä¸æ¥ |
| | | TaskResultIn(dt_task.TaskNum.ToString(), dt_task.NextAddress, 3, "æå¨å®æ"); |
| | | } |
| | | else |
| | | { |
| | | |
| | | if (dt_task.TaskType == (int)TaskInboundTypeEnum.Inbound && dt_task.NextAddress != "1001" && dt_task.NextAddress != "1002") |
| | | { |
| | | TaskResultIn(dt_task.TaskNum.ToString(), "", 2, "æå¨å®æ"); |
| | | } |
| | | else if(dt_task.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | { |
| | | TaskResultOut(dt_task.TaskNum.ToString(), dt_task.NextAddress, 2, "æå¨å®æ"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | var deletetask = BaseDal.DeleteData(dt_task); |
| | | if (deletetask == false) |
| | | { |
| | |
| | | db.Ado.RollbackTran(); |
| | | return WebResponseContent.Instance.Error("åæ¶ä»»å¡å¤±è´¥ï¼"); |
| | | } |
| | | /*int oldState = dt_task.TaskState; |
| | | _taskExecuteDetailService.AddTaskExecuteDetail( |
| | | dt_task.TaskId, |
| | | $"èªå¨ä»»å¡ç¶æä»ã{oldState}ãè¿å
¥å°ã{dt_Task_Hty.TaskState}ã" |
| | | );*/ |
| | | |
| | | if (dt_task.NextAddress == "1001" || dt_task.NextAddress == "1002") |
| | | { |
| | | //å¼å¸¸æé¤ä»»å¡æ¶ï¼å¼å¸¸ä¸æ¥ |
| | | TaskResultIn(dt_task.TaskNum.ToString(), dt_task.NextAddress, 3, "ä»»å¡åæ¶"); |
| | | } |
| | | else |
| | | { |
| | | |
| | | if (dt_task.TaskType == (int)TaskInboundTypeEnum.Inbound) |
| | | { |
| | | TaskResultIn(dt_task.TaskNum.ToString(), "", 3, "ä»»å¡åæ¶"); |
| | | } |
| | | else |
| | | { |
| | | TaskResultOut(dt_task.TaskNum.ToString(), dt_task.NextAddress, 3, "ä»»å¡åæ¶"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | bool deletetask = BaseDal.DeleteData(dt_task); |
| | | if (!deletetask) |