예제 #1
0
파일: BillDao.cs 프로젝트: radtek/HNXC_WCS
        /// <summary>
        /// 更新单号完成标志。
        /// </summary>
        /// <param name="BillNo"></param>
        public void UpdateInBillMasterFinished(string BillNo, string isBill)
        {
            StoredProcParameter parameters = new StoredProcParameter();

            parameters.AddParameter("VBILLNO", BillNo);
            parameters.AddParameter("VISBILL", isBill);
            ExecuteNonQuery("CONFIRMBILLFINSHED", parameters);
        }
예제 #2
0
        /// <summary>
        /// 分配货位,返回 0:TaskID,1:货位
        /// </summary>
        /// <param name="strWhere"></param>
        public string[] AssignCell(string strWhere, string ApplyStation)
        {
            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() == "")
            {
                StoredProcParameter parameters = new StoredProcParameter();
                parameters.AddParameter("VBILLNO", billNo);
                parameters.AddParameter("VPRODUCTCODE", ProductCode);
                parameters.AddParameter("VCELL", "00000000", DbType.String, ParameterDirection.Output);
                if (ApplyStation == "131")
                {
                    ExecuteNonQuery("APPLYPALLETCELL", parameters);
                }
                else
                {
                    ExecuteNonQuery("APPLYCELL", parameters);
                }
                VCell = parameters["VCELL"].ToString();
            }
            else
            {
                VCell = dt.Rows[0]["CELL_CODE"].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);

            string[] strValue = new string[2];
            strValue[0] = TaskID;
            strValue[1] = VCell;


            return(strValue);
        }
예제 #3
0
 public void ExecBalance(string wh_code, DateTime settleDate, string type)
 {
     using (PersistentManager persistentManager = new PersistentManager())
     {
         BalanceDao          dao  = new BalanceDao();
         StoredProcParameter para = new StoredProcParameter();
         para.AddParameter("wh_code", wh_code, DbType.String);
         para.AddParameter("day", settleDate, DbType.Date);
         para.AddParameter("type", type, DbType.String);
         dao.ExecProc("cp_DailyBalance", para);
     }
 }
예제 #4
0
파일: BillDao.cs 프로젝트: radtek/HNXC_WCS
        /// <summary>
        /// 更新单号完成标志。
        /// </summary>
        /// <param name="BillNo"></param>
        public void UpdateOutBillMasterFinished(string BillNo)
        {
            StoredProcParameter parameters = new StoredProcParameter();

            parameters.AddParameter("VBILLNO", BillNo);
            ExecuteNonQuery("CONFIRMOUTBILLFINSHED", parameters);
        }
 private void InitParam()
 {
     param.AddParameter("pageIndex", pageIndex.ToString(), DbType.Int32);
     param.AddParameter("pageSize", pageSize.ToString(), DbType.Int32);
     param.AddParameter("filter", filter, DbType.String);
     param.AddParameter("orderBy", ReturnField, DbType.String);
     param.AddParameter("PrimaryKey", PrimaryKey, DbType.String);
     param.AddParameter("TableViewName", TableView, DbType.String);
     param.AddParameter("QueryFields", queryFields, DbType.String);
 }
예제 #6
0
        /// <summary>
        /// 空托盘组出库单
        /// </summary>
        /// <param name="TARGET_CODE"></param>
        /// <returns></returns>
        public string CreatePalletOutBillTask(string TARGET_CODE)
        {
            string strSQL = string.Format("SELECT * FROM WCS_TASK WHERE PRODUCT_CODE='0000' AND STATE IN (0,1) AND TASK_TYPE='12' AND TARGET_CODE='{0}'", TARGET_CODE);

            DataTable dt = ExecuteQuery(strSQL).Tables[0];

            if (dt.Rows.Count == 0)
            {
                StoredProcParameter parameters = new StoredProcParameter();
                parameters.AddParameter("VCELL", "00000000", DbType.String, ParameterDirection.Output);
                ExecuteNonQuery("APPLYPALLETOUTCELL", parameters);
                string VCell = parameters["VCELL"].ToString();
                //VCell=-1表示找不到可以出库的空托盘组
                if (VCell != "-1")
                {
                    string strBillNo = GetBillNo("POS");

                    strSQL = string.Format("INSERT INTO WMS_PALLET_MASTER (BILL_NO,BILL_DATE,BTYPE_CODE,WAREHOUSE_CODE,STATUS,STATE,OPERATER,OPERATE_DATE,TASKER,TASK_DATE)" +
                                           "values ('{0}',SYSDATE,'012','001','1','3','000001',SYSDATE,'000001',SYSDATE)", strBillNo);
                    ExecuteNonQuery(strSQL);

                    strSQL = string.Format("INSERT INTO WMS_PALLET_DETAIL(BILL_NO,ITEM_NO,PRODUCT_CODE,QUANTITY,PACKAGES)" +
                                           " VALUES('{0}',1,'0000',6,1)", strBillNo);
                    ExecuteNonQuery(strSQL);
                    strSQL = string.Format("INSERT INTO WMS_PRODUCT_STATE(BILL_NO,ITEM_NO,PRODUCT_CODE,WEIGHT,REAL_WEIGHT,PACKAGE_COUNT,IS_MIX,CELL_CODE)" + "VALUES('{0}',1,'0000',0,0,1,0,'{1}')", strBillNo, VCell);
                    ExecuteNonQuery(strSQL);
                    strSQL = string.Format("INSERT INTO WCS_TASK(TASK_ID,TASK_TYPE,TASK_LEVEL,BILL_NO,PRODUCT_CODE,REAL_WEIGHT,PRODUCT_BARCODE,PALLET_CODE,STATE,TASK_DATE,TASKER,PRODUCT_TYPE,IS_MIX,CELL_CODE,TARGET_CODE)" +
                                           "SELECT STATE.BILL_NO||LPAD(ITEM_NO, 2, '0'),BTYPE.TASK_TYPE ,BTYPE.TASK_LEVEL,STATE.BILL_NO,PRODUCT_CODE,REAL_WEIGHT,PRODUCT_BARCODE,PALLET_CODE,'0',TASK_DATE,TASKER,2,IS_MIX,CELL_CODE,'{1}' FROM  WMS_PRODUCT_STATE STATE " +
                                           "LEFT JOIN WMS_PALLET_MASTER BILL ON STATE.BILL_NO=BILL.BILL_NO " +
                                           "LEFT JOIN CMD_BILL_TYPE BTYPE ON BILL.BTYPE_CODE=BTYPE.BTYPE_CODE WHERE  STATE.BILL_NO='{0}'", strBillNo, TARGET_CODE);
                    ExecuteNonQuery(strSQL);
                    return(strBillNo + "01");
                }
                else
                {
                    throw new Exception("没有找到可以出库的托盘货位。");
                }
            }
            else
            {
                return(dt.Rows[0]["TASK_ID"].ToString());
            }
        }
예제 #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);
        }