public int GetNextPositionID(int taskID) { //改写下个位置获取方法; var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format(@"select top 1 id from ( select b.id, b.position_name ,0 as path_node_order from wcs_task a left join wcs_position b on a.origin_position_id = b.id where a.id = {0} union select c.id, c.position_name ,b.path_node_order from wcs_task a left join wcs_path_node b on a.path_id = b.path_id left join wcs_position c on b.position_id = c.id where a.id= {0} union select b.id,b.position_name ,10000 as path_node_order from wcs_task a left join wcs_position b on a.target_position_id = b.id where a.id = {0} ) t where t.path_node_order > (select isnull(b.path_node_order,0) from wcs_task a left join wcs_path_node b on a.path_id = b.path_id and a.current_position_id = b.position_id where a.id= {0}) order by path_node_order", taskID); var r = ra.DoScalar(sql); return(Convert.ToInt32(DBNullUtil.Convert(r))); }
public int GetOperateQuantityByTagAddress(string address) { var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format("select current_operate_quantity from wcs_position where tag_address = '{0}'", address); var r = ra.DoScalar(sql); return(Convert.ToInt32(DBNullUtil.Convert(r))); }
public bool Exist(string barcode) { var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format("select count(*) from wms_product where piece_barcode = '{0}'", barcode); var r = ra.DoScalar(sql); return(Convert.ToInt32(DBNullUtil.Convert(r)) != 0); }
public int GetPositionIDByPositionName(string positionName) { var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format("select id from wcs_position where position_name = '{0}'", positionName); var r = ra.DoScalar(sql); return(Convert.ToInt32(DBNullUtil.Convert(r))); }
public string GetPositionNameByPositionID(int positionID) { var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format("select position_name from wcs_position where id = '{0}'", positionID); var r = ra.DoScalar(sql); return(Convert.ToString(DBNullUtil.Convert(r))); }
public string GetStockOutQuantity(int taskID) { var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format(@"select task_quantity from wcs_task where id = {0} ", taskID); var r = ra.DoScalar(sql); return(Convert.ToString(DBNullUtil.Convert(r))); }
public string GetOriginStorageCode(int taskID) { var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format(@"select origin_storage_code from wcs_task where id = {0} ", taskID); var r = ra.DoScalar(sql); return(Convert.ToString(DBNullUtil.Convert(r))); }
public int GetAllotID(int taskID) { var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format(@"select allot_id from wcs_task where id = {0} ", taskID); var r = ra.DoScalar(sql); return(Convert.ToInt32(DBNullUtil.Convert(r))); }
public bool CheckTaskComplete(int taskID) { var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format(@"select id from wcs_task where id = {0} and task_quantity = operate_quantity", taskID); var r = ra.DoScalar(sql); return(Convert.ToInt32(DBNullUtil.Convert(r)) == taskID); }
//判断是否存在未分拣数据 public bool FindUnsortCount() { //01未完成 02已完成 var ra = TransactionScopeManager[Global.yzServiceName].NewRelationAccesser(); string sql = string.Format(@"SELECT COUNT(*) FROM sms_sort_order_allot_master WHERE STATUS='01'"); var r = ra.DoScalar(sql); return(Convert.ToInt32(DBNullUtil.Convert(r)) > 0); }
public string GetStockOutCellName(int taskID) { var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format(@"select b.cell_name from wcs_task a left join wms_cell b on a.origin_cell_code = b.cell_code where id = {0} ", taskID); var r = ra.DoScalar(sql); return(Convert.ToString(DBNullUtil.Convert(r))); }
public bool HasEmptyAutomaticDemolitionPlatePosition() { var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format(@"select count(*) from wcs_position where position_type = '02' and has_goods = 0" ); var r = ra.DoScalar(sql); return(Convert.ToInt32(DBNullUtil.Convert(r)) > 0); }
public int GetStorageQuantity(int positionID) { var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format(@"select sum(c.quantity) from wcs_cell_position a left join wms_cell b on a.cell_code = b.cell_code left join wms_storage c on a.cell_code = c.cell_code where a.stock_in_position_id = '{0}' and b.is_single = 1", positionID); var r = ra.DoScalar(sql); return(Convert.ToInt32(DBNullUtil.Convert(r))); }
public int GetProductNo(string barcode) { var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format(@"select product_no from wms_product a left join wcs_product_size b on a.product_code = b.product_code where a.piece_barcode = '{0}'", barcode); var r = ra.DoScalar(sql); return(Convert.ToInt32(DBNullUtil.Convert(r))); }
public int GetTask(int productID, int quantity) { var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format(@"select a.id from wcs_task a left join wcs_product_size b on a.product_code = b.product_code where a.order_type = '01' and a.state ='01' and a.current_position_id = a.origin_position_id and a.current_position_id = {0} and a.current_position_state = '01' and b.product_no = '{1}' and a.task_quantity = {2} order by a.target_position_id" , Global.STOCK_IN_POSITION_ID, productID, quantity); var r = ra.DoScalar(sql); return(Convert.ToInt32(DBNullUtil.Convert(r))); }
public bool CheckPositionTask(int positionID) { var ra = TransactionScopeManager[Global.THOK_WCS_DB_NAME].NewRelationAccesser(); string sql = string.Format(@"select count(*) from wcs_task a where a.current_position_id = {0} and a.current_position_state = '02' and (a.state = '01' or a.state = '02') and (a.storage_sequence = (select isNull(min(storage_sequence),0) from wms_storage where quantity > 0 and cell_code = a.origin_cell_code) or a.order_type = '00' or a.order_type = '01' or a.order_type = '05' or a.order_type = '06' or a.order_type = '07' or a.order_type = '08' or a.order_type = '09') " , positionID); var r = ra.DoScalar(sql); return(Convert.ToInt32(DBNullUtil.Convert(r)) == 1); }