Exemplo n.º 1
0
        /// <summary>
        /// 检查电芯状态
        /// </summary>
        /// <param name="sfc">电芯号</param>
        /// <returns></returns>
        public static miCheckSFCstatusResponse ElectricCoreState(string sfc)
        {
            miCheckSFCstatusResponse miCheckSFCstatusResponseAddress = new miCheckSFCstatusResponse();

            try
            {
                MiCheckSFCStatusServiceService ElectricCoreStateAddress = new MiCheckSFCStatusServiceService();
                ElectricCoreStateAddress.Url             = "http://172.26.11.3:50000/atlmeswebservice/MiCheckSFCStatusServiceService?wsdl";
                ElectricCoreStateAddress.Timeout         = 300000;
                ElectricCoreStateAddress.Credentials     = new System.Net.NetworkCredential("SUP_TEST01", "test12345", null); //Baiduhai7     //验证信息
                ElectricCoreStateAddress.PreAuthenticate = true;
                miCheckSFCstatus       ms = new miCheckSFCstatus();
                changeSFCStatusRequest ct = new changeSFCStatusRequest();
                ct.site              = "2001";
                ct.operation         = "HSTDY1";
                ct.operationRevision = "#";
                ct.sfc = "PL0205005";

                ms.ChangeSFCStatusRequest       = ct;
                miCheckSFCstatusResponseAddress = ElectricCoreStateAddress.miCheckSFCstatus(ms);
            }
            catch
            {
                ////写CSV文件
                //ConfigureHelp.SaveInfoToCSVFileAtLog(beginTime.ToString("yyyy-MM-dd hh:mm:ss"), endTime.ToString("yyyy-MM-dd hh:mm:ss"), timeS.TotalMilliseconds.ToString(),
                //string.Format("开始时间代码Error [BeginTime]({0}、{1})", BarCode1.Text, resource),
            }
            return(miCheckSFCstatusResponseAddress);
        }
Exemplo n.º 2
0
        public MESClass()
        {
            miCheckSFCStatusService = new MiCheckSFCStatusServiceService();
            miCheckSFCsta           = new miCheckSFCstatus();
            changeStatusRequest     = new changeSFCStatusRequest();
            miCheckSFCstatusRes     = new miCheckSFCstatusResponse();
            miCommon = new miCommonResponse();

            machineIntegrationService = new MachineIntegrationServiceService();
            dataCollect           = new dataCollectForSfcEx();
            sfcDataCollectRequest = new sfcDcExRequest();
            sfcRes = new sfcDcExResponse();
            dataCollectForSfcExRes = new dataCollectForSfcExResponse();
        }
Exemplo n.º 3
0
        public static void WriteMiCheckSfcStatusLog(miCheckSFCstatus data, MESRes mesRes, string strStartTime, string strEndTime, int iTime)
        {
            lock (_objG08FileOperationLock1)
            {
                try
                {
                    string strFilename = DateTime.Now.ToString("yyyy-MM-dd") + ".xlsx";
                    if (!Directory.Exists(strG08MesLogFilePath1))
                    {
                        Directory.CreateDirectory(strG08MesLogFilePath1);
                    }
                    if (!File.Exists(strG08MesLogFilePath1 + strFilename))
                    {
                        CreateMiCheckSfcStatusLogFile(strFilename);
                    }

                    Workbook wb = new Workbook();
                    wb.LoadFromFile(strG08MesLogFilePath1 + strFilename);
                    Worksheet sheet1 = wb.Worksheets[0];

                    int rowIndex = sheet1.Range.RowCount;
                    if (rowIndex > 1)
                    {
                        rowIndex++;
                        sheet1.Range["A" + rowIndex.ToString()].Text = " ";
                        sheet1.Range["B" + rowIndex.ToString()].Text = " ";
                        rowIndex++;
                    }

                    string strParam = "{";
                    strParam += "\"site\":" + "\"" + data.ChangeSFCStatusRequest.site + "\"" + ",";
                    strParam += "\"sfc\":" + "\"" + data.ChangeSFCStatusRequest.sfc + "\"" + ",";
                    strParam += "\"operation\":" + "\"" + data.ChangeSFCStatusRequest.operation + "\"" + ",";
                    strParam += "\"operationRevision\":" + "\"" + data.ChangeSFCStatusRequest.operationRevision + "\"}";

                    sheet1.Range["A" + rowIndex.ToString()].Text = "SFC";
                    sheet1.Range["B" + rowIndex.ToString()].Text = data.ChangeSFCStatusRequest.sfc;

                    rowIndex++;
                    sheet1.Range["A" + rowIndex.ToString()].Text = "接口调用开始时间";
                    sheet1.Range["B" + rowIndex.ToString()].Text = strStartTime;

                    rowIndex++;
                    sheet1.Range["A" + rowIndex.ToString()].Text = "接口调用传参";
                    sheet1.Range["B" + rowIndex.ToString()].Text = strParam;

                    rowIndex++;
                    sheet1.Range["A" + rowIndex.ToString()].Text = "接口调用返回时间";
                    sheet1.Range["B" + rowIndex.ToString()].Text = strEndTime;

                    rowIndex++;
                    sheet1.Range["A" + rowIndex.ToString()].Text = "耗时(ms)";
                    sheet1.Range["B" + rowIndex.ToString()].Text = iTime.ToString();

                    rowIndex++;
                    sheet1.Range["A" + rowIndex.ToString()].Text = "返回代码";
                    sheet1.Range["B" + rowIndex.ToString()].Text = [email protected]();

                    rowIndex++;
                    sheet1.Range["A" + rowIndex.ToString()].Text = "返回信息";
                    sheet1.Range["B" + rowIndex.ToString()].Text = [email protected](",", ", ").Replace("\r\n", " ");

                    wb.SaveToFile(strG08MesLogFilePath1 + strFilename);
                }
                catch (Exception)
                {
                }
            }
        }