Example #1
0
 /// <summary>
 /// 根据类型返回任务号
 /// </summary>
 /// <param name="Module"></param>
 /// <returns></returns>
 public string GetTaskNo(string Module)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         SysStationDao dao = new SysStationDao();
         return dao.GetTaskNo(Module);
     }
 }
Example #2
0
 /// <summary>
 /// 堆垛机流水号报错,重置0;
 /// </summary>
 public void ResetSQueNo()
 {
     using (PersistentManager pm = new PersistentManager())
     {
         SysStationDao dao = new SysStationDao();
         dao.ResetSQueNo();
     }
 }
Example #3
0
 /// <summary>
 ///根据货位信息,任务类别, 获取站台信息
 /// </summary>
 /// <param name="CellCode"></param>
 /// <param name="TaskType"></param>
 /// <returns></returns>
 public DataTable GetSationInfo(string CellCode, string TaskType,string Item)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         SysStationDao dao = new SysStationDao();
         return dao.GetSationInfo(CellCode, TaskType,Item);
     }
 }
Example #4
0
        private string GetTaskDetailNo(string TaskID)
        {
            string strValue = "";
            string strSQL   = string.Format("SELECT TASK_ID,TASK.BILL_NO,BILL.BTYPE_CODE,BTYPE.BILL_TYPE||BTYPE.TARGET_CODE AS TASKNOTYPE " +
                                            "FROM WCS_TASK TASK " +
                                            "LEFT JOIN VBILLMASTER BILL ON BILL.BILL_NO=TASK.BILL_NO " +
                                            "LEFT JOIN CMD_BILL_TYPE BTYPE ON BTYPE.BTYPE_CODE=BILL.BTYPE_CODE " +
                                            "WHERE TASK_ID='{0}'", TaskID);
            DataTable dt   = ExecuteQuery(strSQL).Tables[0];
            string    mode = "";

            if (dt.Rows.Count > 0)
            {
                string BType = dt.Rows[0]["TASKNOTYPE"].ToString();
                switch (BType)
                {
                case "2195":    //紧急补料单  9000-9299
                    mode = "F";
                    break;

                case "3195":    //抽检        9300-9499
                    mode = "R";
                    break;

                case "2122":    //倒库        9500-9799
                    mode = "B";
                    break;

                case "4195":     //盘点单     9800--9998
                    mode = "C";
                    break;

                default:
                    mode = "M";
                    break;
                }
            }
            SysStationDao SysDao = new SysStationDao();

            strValue = SysDao.GetTaskNo(mode);

            return(strValue);
        }
Example #5
0
        private string GetTaskDetailNo(string TaskID)
        {
            string strValue = "";
            string strSQL = string.Format("SELECT TASK_ID,TASK.BILL_NO,BILL.BTYPE_CODE,BTYPE.BILL_TYPE||BTYPE.TARGET_CODE AS TASKNOTYPE " +
                                          "FROM WCS_TASK TASK " +
                                          "LEFT JOIN VBILLMASTER BILL ON BILL.BILL_NO=TASK.BILL_NO " +
                                          "LEFT JOIN CMD_BILL_TYPE BTYPE ON BTYPE.BTYPE_CODE=BILL.BTYPE_CODE " +
                                          "WHERE TASK_ID='{0}'", TaskID);
            DataTable dt = ExecuteQuery(strSQL).Tables[0];
            string mode = "";
            if (dt.Rows.Count > 0)
            {
                string BType = dt.Rows[0]["TASKNOTYPE"].ToString();
                switch (BType)
                {
                    case "2195"://紧急补料单  9000-9299
                        mode = "F";
                        break;
                    case "3195"://抽检        9300-9499
                        mode = "R";
                        break;
                    case "2122"://倒库        9500-9799
                        mode = "B";
                        break;
                    case "4195": //盘点单     9800--9998
                        mode = "C";
                        break;
                    default:
                        mode = "M";
                        break;

                }
            }
            SysStationDao SysDao = new SysStationDao();
            strValue = SysDao.GetTaskNo(mode);

            return strValue;
        }
Example #6
0
        /// <summary>
        /// 分配货位,返回 0:TaskID,1:任务号,2:货物到达入库站台的目的地址--平面号,3:堆垛机入库站台,4:货位,5:堆垛机编号
        /// </summary>
        /// <param name="strWhere"></param>
        public string[] AssignNewCell(string strWhere, string CraneNo)
        {
            string[] strValue = new string[6];
            string where = "1=1";
            if (!string.IsNullOrEmpty(strWhere))
                where = strWhere;
            string strSQL = "SELECT * FROM WCS_TASK WHERE " + where;
            DataTable dt = ExecuteQuery(strSQL).Tables[0];
            if (dt.Rows.Count == 0)
            {
                throw new Exception("找不到相关的入库单号。");
            }
            string TaskID = dt.Rows[0]["TASK_ID"].ToString();

            string billNo = dt.Rows[0]["BILL_NO"].ToString();
            string ProductCode = dt.Rows[0]["PRODUCT_CODE"].ToString();
            string VCell = "";
            if (dt.Rows[0]["CELL_CODE"].ToString() != "")
            {
                VCell = dt.Rows[0]["CELL_CODE"].ToString();
                CellDao cdao = new CellDao();
                DataTable dtCell = cdao.GetCellInfo(VCell);
                if (dtCell.Rows[0]["ERROR_FLAG"].ToString() == "1")
                {
                    VCell = "";
                }

            }
            if (VCell == "")
            {
                StoredProcParameter parameters = new StoredProcParameter();
                parameters.AddParameter("VPRODUCTCODE",ProductCode);
                parameters.AddParameter("VCRANENO", CraneNo);
                parameters.AddParameter("VCELL", "00000000", DbType.String, ParameterDirection.Output);

                ExecuteNonQuery("APPLYNEWCELL", parameters);
                VCell = parameters["VCELL"].ToString();

            }
            if (VCell == "")
            {
                throw new Exception("没有可分配的货位!");
            }
            strSQL = string.Format("UPDATE CMD_CELL SET IS_LOCK='1',BILL_NO='{1}' WHERE CELL_CODE='{0}'", VCell, billNo);
            ExecuteNonQuery(strSQL);

            strSQL = string.Format("UPDATE WCS_TASK SET CELL_CODE='{0}' WHERE {1}", VCell, where);
            ExecuteNonQuery(strSQL);

            SysStationDao sysdao = new SysStationDao();

            dt = sysdao.GetSationInfo(VCell, "11","3");
            string TaskNo = InsertTaskDetail(TaskID);

            strValue[0] = TaskID;
            strValue[1] = TaskNo;
            strValue[2] = dt.Rows[0]["STATION_NO"].ToString();
            strValue[3] = dt.Rows[0]["CRANE_POSITION"].ToString();
            strValue[4] = VCell;
            strValue[5] = dt.Rows[0]["CRANE_NO"].ToString();

            return strValue;
        }
Example #7
0
        /// <summary>
        /// 分配货位,返回 0:TaskID,1:任务号,2:货物到达入库站台的目的地址--平面号,3:堆垛机入库站台,4:货位,5:堆垛机编号
        /// </summary>
        /// <param name="strWhere"></param>
        public string[] AssignNewCell(string strWhere, string CraneNo)
        {
            string[] strValue = new string[6];
            string where = "1=1";
            if (!string.IsNullOrEmpty(strWhere))
            {
                where = strWhere;
            }
            string    strSQL = "SELECT * FROM WCS_TASK WHERE " + where;
            DataTable dt     = ExecuteQuery(strSQL).Tables[0];

            if (dt.Rows.Count == 0)
            {
                throw new Exception("找不到相关的入库单号。");
            }
            string TaskID = dt.Rows[0]["TASK_ID"].ToString();

            string billNo      = dt.Rows[0]["BILL_NO"].ToString();
            string ProductCode = dt.Rows[0]["PRODUCT_CODE"].ToString();
            string VCell       = "";

            if (dt.Rows[0]["CELL_CODE"].ToString() != "")
            {
                VCell = dt.Rows[0]["CELL_CODE"].ToString();
                CellDao   cdao   = new CellDao();
                DataTable dtCell = cdao.GetCellInfo(VCell);
                if (dtCell.Rows[0]["ERROR_FLAG"].ToString() == "1")
                {
                    VCell = "";
                }
            }
            if (VCell == "")
            {
                StoredProcParameter parameters = new StoredProcParameter();
                parameters.AddParameter("VPRODUCTCODE", ProductCode);
                parameters.AddParameter("VCRANENO", CraneNo);
                parameters.AddParameter("VCELL", "00000000", DbType.String, ParameterDirection.Output);

                ExecuteNonQuery("APPLYNEWCELL", parameters);
                VCell = parameters["VCELL"].ToString();
            }
            if (VCell == "")
            {
                throw new Exception("没有可分配的货位!");
            }
            strSQL = string.Format("UPDATE CMD_CELL SET IS_LOCK='1',BILL_NO='{1}' WHERE CELL_CODE='{0}'", VCell, billNo);
            ExecuteNonQuery(strSQL);

            strSQL = string.Format("UPDATE WCS_TASK SET CELL_CODE='{0}' WHERE {1}", VCell, where);
            ExecuteNonQuery(strSQL);


            SysStationDao sysdao = new SysStationDao();

            dt = sysdao.GetSationInfo(VCell, "11", "3");
            string TaskNo = InsertTaskDetail(TaskID);

            strValue[0] = TaskID;
            strValue[1] = TaskNo;
            strValue[2] = dt.Rows[0]["STATION_NO"].ToString();
            strValue[3] = dt.Rows[0]["CRANE_POSITION"].ToString();
            strValue[4] = VCell;
            strValue[5] = dt.Rows[0]["CRANE_NO"].ToString();


            return(strValue);
        }