| | |
| | | public static void UpdateOutTaskPriority() |
| | | { |
| | | var db = new SqlHelper<object>().GetInstance(); |
| | | var st = Settings.outMinutePriority; |
| | | //var st = Settings.outMinutePriority; |
| | | |
| | | var st = TaskHelper.GetOutMinutePriority(); |
| | | |
| | | if (st==null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var list = TaskHelper.GetWcsTaskListByState("执行", "agv", "出库"); |
| | | |
| | | foreach (var item in list) |
| | | { |
| | | var action = db.Queryable<WmsTaskAction>().Where(p => p.S_TASK_CODE==item.S_CODE && p.N_ACTION_CODE == 1).First(); |
| | | if (action != null) |
| | | { |
| | | var action3 = db.Queryable<WmsTaskAction>().Where(p => p.S_TASK_CODE == item.S_CODE && p.N_ACTION_CODE == 3).First(); |
| | | if (action3 == null) |
| | | var wcsTask = TaskHelper.GetTaskByState("完成", "wcs", item.S_OP_CODE, "出库"); |
| | | if (wcsTask != null) { |
| | | var action = db.Queryable<WmsTaskAction>().Where(p => p.S_TASK_CODE == item.S_CODE && p.N_ACTION_CODE == 1).First(); |
| | | if (action != null) |
| | | { |
| | | if (DateTime.Now.Subtract(action.T_CREATE).TotalMinutes > st.Minute) |
| | | var action3 = db.Queryable<WmsTaskAction>().Where(p => p.S_TASK_CODE == item.S_CODE && p.N_ACTION_CODE == 3).First(); |
| | | if (action3 == null) |
| | | { |
| | | item.N_PRIORITY += st.Priority; |
| | | db.Updateable(item).UpdateColumns(it => new { it.N_PRIORITY }).ExecuteCommand(); |
| | | NDCApi.ChangeOrderPri(item.S_CODE, item.N_PRIORITY); |
| | | if (DateTime.Now.Subtract(action.T_CREATE).TotalMinutes > st.Minute) |
| | | { |
| | | item.N_PRIORITY += st.Priority; |
| | | db.Updateable(item).UpdateColumns(it => new { it.N_PRIORITY }).ExecuteCommand(); |
| | | NDCApi.ChangeOrderPri(item.S_CODE, item.N_PRIORITY); |
| | | } |
| | | } |
| | | } |
| | | } |