Esempio n. 1
0
        /// <summary>
        /// 获取NC钢坯库存信息
        /// </summary>
        public DataSet Get_NC_Slab_KCList()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append(" select T.STORCODE AS NC_CK,decode(substr(T.批次号, 1, 1), '4', t.连铸炉号, t.批次号) as NC_STOVE,nvl(decode(substr(T.批次号, 1, 1), '4', t.批次号, ''),' ') as NC_BATCH_NO,T.INVTYPE AS NC_PH,replace(substr(T.INVSPEC, 1, instr(T.INVSPEC, '×', -1) - 1), 'mm', '') as NC_SLAB_SIZE,replace(substr(T.INVSPEC, instr(T.INVSPEC, '×', -1) + 1), 'm', '') * 1000 AS NC_LEN,T.ccheckstatename AS NC_SX,T.数量 AS NC_WGT,T.辅数量 AS NC_COU,T.INVCODE AS NC_WLH,T.INVNAME AS NC_WLMC,T.VFREE1 AS NC_ZYX1,T.VFREE2 AS NC_ZYX2,T.VFREE3 AS NC_ZYX3,T.生产入库日期 as 生产时间  from XGERP50.V_ONHAND t where t.批次号 not like '7%' ");
            return(DbHelperNC.Query(strSql.ToString()));
        }
Esempio n. 2
0
        /// <summary>
        /// 获取NC线材库存信息
        /// </summary>
        public DataSet Get_NC_KCList()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append(" select T.STORCODE AS NC_CK,T.批次号 AS NC_PCH,T.INVTYPE AS NC_PH,T.INVSPEC AS NC_GG,T.ccheckstatename AS NC_SX,T.数量 AS NC_WGT,T.辅数量 AS NC_COU,T.INVCODE AS NC_WLH,T.INVNAME AS NC_WLMC,T.VFREE1 AS NC_ZYX1,T.VFREE2 AS NC_ZYX2,T.VFREE3 AS NC_ZYX3 from XGERP50.V_ONHAND_XC t where T.批次号 like '3%' and T.STORCODE not like '7%' and T.STORCODE not like '680%' and T.STORCODE not like '671%' ");
            return(DbHelperNC.Query(strSql.ToString()));
        }
Esempio n. 3
0
        /// <summary>
        /// 根据工位,班组获得NC班组
        /// </summary>
        /// <param name="gzzxid">工作中心ID</param>
        /// <param name="bz">班组</param>
        /// <returns></returns>
        public DataSet GetNCBZList(string gzzxid, string bz)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append(@"SELECT PK_PGAID,
       CASE
         WHEN INSTR(BZMC, '甲') > 0 THEN
          '甲'
         WHEN INSTR(BZMC, '乙') > 0 THEN
          '乙'
         WHEN INSTR(BZMC, '丙') > 0 THEN
          '丙'
         ELSE
          '丁'
       END BZMC
  FROM XGERP50.PD_PGA WHERE 1=1");
            if (gzzxid.Trim() != "")
            {
                strSql.Append(" AND   GZZXID = '" + gzzxid + "'");
            }
            if (bz.Trim() != "")
            {
                strSql.Append(" AND  BZMC LIKE '%" + bz + "%'");
            }
            return(DbHelperNC.Query(strSql.ToString()));
        }
Esempio n. 4
0
        /// <summary>
        /// 查询NC批次信息
        /// </summary>
        /// <returns></returns>
        public int Get_NC_Batch_Count(string strSql)
        {
            object obj = DbHelperNC.GetSingle(strSql);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 根据工序,班次获得NC班次
        /// </summary>
        /// <param name="stacode">工位代码</param>
        /// <param name="bc">班次</param>
        /// <returns></returns>
        public DataSet GetNCBCList(string stacode, string bc)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("SELECT BD_WT.BCNAME, BD_WT.PK_WTID FROM  XGERP50.BD_WT, XGERP50.BD_RLH, XGERP50.PD_WK WHERE BD_WT.PK_BCLBID = BD_RLH.PK_BCLBID AND BD_RLH.PK_RLHID = PD_WK.RLHID ");
            if (stacode.Trim() != "")
            {
                strSql.Append(" AND PD_WK.GZZXBM = '" + stacode + "'");
            }
            if (bc.Trim() != "")
            {
                strSql.Append(" AND BD_WT.BCNAME ='" + bc + "'");
            }
            return(DbHelperNC.Query(strSql.ToString()));
        }
Esempio n. 6
0
        /// <summary>
        /// 获取记录总数
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(1) FROM TRC_ROLL_TIME ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            object obj = DbHelperNC.GetSingle(strSql.ToString());

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Esempio n. 7
0
        /// <summary>
        /// 查询NC仓库信息
        /// </summary>
        /// <returns></returns>
        public DataSet Get_NC_CK_INFO(string storcode)
        {
            string strSql = " select PK_STORDOC,STORCODE,STORNAME from xgerp50.bd_stordoc where pk_corp='1001' and dr=0 and storcode='" + storcode + "' ";

            return(DbHelperNC.Query(strSql.ToString()));
        }