/// <summary> /// 检查比对任务目的 /// </summary> /// <param name="id"></param> /// <param name="wcs_no"></param> /// <param name="loc"></param> /// <returns></returns> public void CheckTask(String wcs_no, String loc) { try { // 获取对应清单 String sql = String.Format(@"select TASK_TYPE,FRT,TASK_UID_1,LOC_TO_1,TASK_UID_2,LOC_TO_2 from wcs_command_v where STEP <>'4' and WCS_NO = '{0}'", wcs_no); DataTable dt = mySQL.SelectAll(sql); if (tools.IsNoData(dt)) { return; } String tasktype = dt.Rows[0]["TASK_TYPE"].ToString(); String frt = dt.Rows[0]["FRT"].ToString(); String taskid1 = dt.Rows[0]["TASK_UID_1"].ToString(); String loc1 = dt.Rows[0]["LOC_TO_1"].ToString(); String taskid2 = dt.Rows[0]["TASK_UID_2"].ToString(); String loc2 = dt.Rows[0]["LOC_TO_2"].ToString(); // 判断目的位置是否一致 // 更新Task状态(Command于数据库TRIGGER 'update_command_T' 触发更新) switch (tasktype) { case TaskType.入库: if (loc == task.GetABCStockLoc(loc1)) { task.UpdateTask(taskid1, TaskSite.完成); } if (loc == task.GetABCStockLoc(loc2)) { task.UpdateTask(taskid2, TaskSite.完成); } break; case TaskType.出库: if (loc == frt) { task.UpdateTask(taskid1, TaskSite.完成); task.UpdateTask(taskid2, TaskSite.完成); } break; default: break; } } catch (Exception ex) { throw ex; } }