Exemplo n.º 1
0
        /// <summary>
        ///外部調用時請賦值public屬性
        /// </summary>
        private void CallRFC()
        {
            try
            {
                ZRFC_GET_PRO_HEADER8.SetValue("PLANT", this.Plant);
                ZRFC_GET_PRO_HEADER8.SetValue("COUNT", COUNT);
                ZRFC_GET_PRO_HEADER8.SetValue("CUST", CUST);
                ZRFC_GET_PRO_HEADER8.SetValue("IN_CNF", "");
                if (downLoadDate != "")
                {
                    ZRFC_GET_PRO_HEADER8.SetValue("SCHEDULED_DATE", downLoadDate);
                    ZRFC_GET_PRO_HEADER8.SetValue("RLDATE", downLoadDate);
                    autoDownLoad = false;
                }
                else
                {
                    ZRFC_GET_PRO_HEADER8.SetValue("SCHEDULED_DATE", DateTime.Now.ToString("yyyy-MM-dd"));
                    ZRFC_GET_PRO_HEADER8.SetValue("RLDATE", DateTime.Now.ToString("yyyy-MM-dd"));
                }
                ZRFC_GET_PRO_HEADER8.CallRFC();
                dtITAB     = ZRFC_GET_PRO_HEADER8.GetTableValue("ITAB");
                dtWOHeader = ZRFC_GET_PRO_HEADER8.GetTableValue("WO_HEADER");
                dtWOItem   = ZRFC_GET_PRO_HEADER8.GetTableValue("WO_ITEM");
                dtWOText   = ZRFC_GET_PRO_HEADER8.GetTableValue("WO_TEXT");

                Output.Tables.Add(dtITAB);
                Output.Tables.Add(dtWOHeader);
                Output.Tables.Add(dtWOItem);
                Output.Tables.Add(dtWOText);
                if (dtITAB.Rows.Count > 0)
                {
                    throw new Exception(dtITAB.Rows[0][1].ToString());
                }
                SaveWOHeader();
                ConvertWO();
                downLoadDate = "";
            }
            catch (Exception ex)
            {
                //write log
                WriteLog.WriteIntoMESLog(SFCDB, BU, "MESInterface", "MESInterface.HWD.DownLoadWO", "CallRFC", ip + ";" + ex.Message.ToString(), "", "interface");
            }
        }
Exemplo n.º 2
0
        public override void init()
        {
            try
            {
                BU             = ConfigGet("BU");
                Plant          = ConfigGet("PLANT");
                DB             = ConfigGet("DB");
                CUST           = ConfigGet("CUST");
                COUNT          = ConfigGet("COUNT");
                arrayConvertWO = ConfigGet("CONVERTWO").Split(',');
                _downloadWO    = ConfigGet("DOWNLOADWO");
                List <System.Net.IPAddress> temp = HWDNNSFCBase.HostInfo.IP.Where(ipv4 => ipv4.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).ToList();
                ip                   = temp[0].ToString();
                Output.UI            = new DownloadWO_UI(this);
                SFCDB                = new OleExec(DB, false);
                synLock              = new T_R_SYNC_LOCK(SFCDB, DB_TYPE_ENUM.Oracle);
                C_TAB_COLUMN_MAP     = new T_C_TAB_COLUMN_MAP(SFCDB, DB_TYPE_ENUM.Oracle);
                C_SKU                = new T_C_SKU(SFCDB, DB_TYPE_ENUM.Oracle);
                R_WO_HEADER          = new T_R_WO_HEADER(SFCDB, DB_TYPE_ENUM.Oracle);
                R_WO_ITEM            = new T_R_WO_ITEM(SFCDB, DB_TYPE_ENUM.Oracle);
                R_WO_TEXT            = new T_R_WO_TEXT(SFCDB, DB_TYPE_ENUM.Oracle);
                RouteDetail          = new T_C_ROUTE_DETAIL(SFCDB, DB_TYPE_ENUM.Oracle);
                WOType               = new T_R_WO_TYPE(SFCDB, DB_TYPE_ENUM.Oracle);
                Keypart              = new T_C_KEYPART(SFCDB, DB_TYPE_ENUM.Oracle);
                C_ROUTE              = new T_C_ROUTE(SFCDB, DB_TYPE_ENUM.Oracle);
                R_WO_BASE            = new T_R_WO_BASE(SFCDB, DB_TYPE_ENUM.Oracle);
                T_Series             = new T_C_SERIES(SFCDB, DB_TYPE_ENUM.Oracle);
                t_c_kp_list          = new T_C_KP_LIST(SFCDB, DB_TYPE_ENUM.Oracle);
                ZRFC_GET_PRO_HEADER8 = new ZRFC_GET_PRO_HEADER8(BU);
            }
            catch (Exception e)
            {
                throw new Exception("Init DownLoadWO Fail" + e.Message);
            }

            Output.Tables.Add(ZRFC_GET_PRO_HEADER8.GetTableValue("PO"));
            // Output.Tables.Add(ZRFC_GET_PRO_HEADER8.GetTableValue("POD"));
        }
Exemplo n.º 3
0
        public void Download(string StrWo, string Plant)
        {
            OleExec   sfcdb;
            DataTable RFC_Table = new DataTable();

            T_R_WO_HEADER_TJ R_WO_HEADER;


            Dictionary <string, string> DicPara = new Dictionary <string, string>();

            sfcdb = this.DBPools["SFCDB"].Borrow();


            ZRFC_GET_PRO_HEADER8 zrfc_GET_PRO_HEADER8 = new ZRFC_GET_PRO_HEADER8();

            zrfc_GET_PRO_HEADER8.SetValues(StrWo, Plant);//NHGZ,WDN1//WDN1,WSL3
            zrfc_GET_PRO_HEADER8.CallRFC();

            DataTable woheader = zrfc_GET_PRO_HEADER8.GetTableValue("PO");

            R_WO_HEADER = new T_R_WO_HEADER_TJ(sfcdb, DB_TYPE_ENUM.Oracle);

            Row_R_WO_HEADER_TJ rowRWOHeader = (Row_R_WO_HEADER_TJ)R_WO_HEADER.NewRow();

            if (woheader.Rows.Count > 0)
            {
                rowRWOHeader.ID        = R_WO_HEADER.GetNewID(BU, sfcdb);
                rowRWOHeader.AUFNR     = woheader.Rows[0]["AUFNR"].ToString();
                rowRWOHeader.WERKS     = woheader.Rows[0]["WERKS"].ToString();
                rowRWOHeader.AUART     = woheader.Rows[0]["AUART"].ToString();
                rowRWOHeader.MATNR     = woheader.Rows[0]["MATNR"].ToString();
                rowRWOHeader.REVLV     = woheader.Rows[0]["REVLV"].ToString();
                rowRWOHeader.KDAUF     = woheader.Rows[0]["KDAUF"].ToString();
                rowRWOHeader.GSTRS     = woheader.Rows[0]["GSTRS"].ToString();
                rowRWOHeader.DISPO     = woheader.Rows[0]["DISPO"].ToString();
                rowRWOHeader.GAMNG     = woheader.Rows[0]["GAMNG"].ToString();
                rowRWOHeader.VERID     = woheader.Rows[0]["VERID"].ToString();
                rowRWOHeader.ARBPL     = woheader.Rows[0]["ARBPL"].ToString();
                rowRWOHeader.KUNNR     = woheader.Rows[0]["KUNNR"].ToString();
                rowRWOHeader.KDMAT     = woheader.Rows[0]["KDMAT"].ToString();
                rowRWOHeader.AEDAT     = woheader.Rows[0]["AEDAT"].ToString();
                rowRWOHeader.AENAM     = woheader.Rows[0]["AENAM"].ToString();
                rowRWOHeader.MATKL     = woheader.Rows[0]["MATKL"].ToString();
                rowRWOHeader.MAKTX     = woheader.Rows[0]["MAKTX"].ToString();
                rowRWOHeader.GMEIN     = woheader.Rows[0]["GMEIN"].ToString();
                rowRWOHeader.STATUS    = woheader.Rows[0]["STATUS"].ToString();
                rowRWOHeader.ERDAT     = woheader.Rows[0]["ERDAT"].ToString();
                rowRWOHeader.ERFZEIT   = woheader.Rows[0]["ERFZEIT"].ToString();
                rowRWOHeader.AEZEIT    = woheader.Rows[0]["AEZEIT"].ToString();
                rowRWOHeader.GSUZS     = woheader.Rows[0]["GSUZS"].ToString();
                rowRWOHeader.RSNUM     = woheader.Rows[0]["RSNUM"].ToString();
                rowRWOHeader.KBEASOLL  = woheader.Rows[0]["KBEASOLL"].ToString();
                rowRWOHeader.TASKGROUP = woheader.Rows[0]["TASKGROUP"].ToString();
                rowRWOHeader.CY_SEQNR  = woheader.Rows[0]["CY_SEQNR"].ToString();
                rowRWOHeader.ZAPLFL    = woheader.Rows[0]["ZAPLFL"].ToString();
                rowRWOHeader.ZVORNR    = woheader.Rows[0]["ZVORNR"].ToString();
                rowRWOHeader.ZTDLINE   = woheader.Rows[0]["ZTDLINE"].ToString();
                rowRWOHeader.KDPOS     = woheader.Rows[0]["KDPOS"].ToString();
                rowRWOHeader.BSTKD     = woheader.Rows[0]["BSTKD"].ToString();
                rowRWOHeader.POSEX_E   = woheader.Rows[0]["POSEX_E"].ToString();
                rowRWOHeader.TKNUM     = woheader.Rows[0]["TKNUM"].ToString();
                rowRWOHeader.APRIO     = woheader.Rows[0]["APRIO"].ToString();
                rowRWOHeader.MAUFNR    = woheader.Rows[0]["MAUFNR"].ToString();
                rowRWOHeader.OBJNR     = woheader.Rows[0]["OBJNR"].ToString();
                rowRWOHeader.FEVOR     = woheader.Rows[0]["FEVOR"].ToString();
                rowRWOHeader.WEMNG     = woheader.Rows[0]["WEMNG"].ToString();
                rowRWOHeader.ERNAM     = woheader.Rows[0]["ERNAM"].ToString();
                rowRWOHeader.IDAT2     = woheader.Rows[0]["IDAT2"].ToString();
                rowRWOHeader.PHAS2     = woheader.Rows[0]["PHAS2"].ToString();
                rowRWOHeader.STLAL     = woheader.Rows[0]["STLAL"].ToString();
                rowRWOHeader.STLAN     = woheader.Rows[0]["STLAN"].ToString();
                rowRWOHeader.VDATU     = woheader.Rows[0]["VDATU"].ToString();
                rowRWOHeader.VGW03     = woheader.Rows[0]["VGW03"].ToString();
                String WO  = rowRWOHeader.AUFNR;
                string sql = $@"DELETE FROM R_WO_HEADER_TJ WHERE AUFNR = '{WO}'";
                sfcdb.ExecSQL(sql);
                sql = rowRWOHeader.GetInsertString(DB_TYPE_ENUM.Oracle);
                sfcdb.ExecSQL(sql);
            }
        }