Beispiel #1
0
        static void Main1(string[] args)
        {
            try
            {
                // string key = "设备1";
                // Dictionary<string, string> CoorDic = new Dictionary<string, string>();
                //List<String> list= RedisList.Get ("robotCoordinate");
                // WriteListToTextFile(list, "111.txt");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            //AutoTaskServer  at= new AutoTaskServer();
            //// Console.WriteLine(r.DeviceErrDailyRpt("2018-06-25", "1, 2" ,null));
            //at.TaskExec("2018-12-31");


            Console.ReadKey();

            ReportServer r = new ReportServer();

            // Console.WriteLine(r.DeviceErrDailyRpt("2018-06-25", "1, 2" ,null));
            // Console.WriteLine(r.DeviceErrDailyRpt("2018-06-25", "1, 2", "HNC-808A",0));
            //Console.WriteLine(r.DeviceErrPhaseRpt("2018-06-25", "2018-06-26","1, 2", "HNC-808A", 0));
            Console.WriteLine(r.DeviceErrYearRpt("2018", "1, 2", "HNC-808A", 0));
            Console.WriteLine(r.DeviceErrYearRpt("2018", "1, 2", "HNC-808A", 1));

            Console.ReadKey();

            ReportServer       ats = new ReportServer();
            WorkSataionsServer ws  = new WorkSataionsServer();

            Console.WriteLine(ats.DeviceDailyRpt("2018-06-25", "1,2", "HNC-808A"));
            Console.WriteLine(ats.DevicePhaseRpt("2018-06-25", "2018-06-25", "1,2", "HNC-808A"));
            Console.WriteLine(ats.DeviceMonthRpt("2018-06", "1,2", "HNC-808A"));
            Console.WriteLine(ats.DeviceYearRpt("2018", "1,2", "HNC-808A"));


            DevicesServer ds = new DevicesServer();

            Console.WriteLine(ds.DeviceModelList());
            Console.ReadKey();



            string connstr = @"Host=47.96.172.122;UserName=huabao;Password=huabao2025;Database=huabao;Port=3306;CharSet=utf8;Allow Zero Datetime=true";

            using (MySqlConnection connection = new MySqlConnection(connstr))
            {
                if (connection.State != ConnectionState.Open)
                {
                    connection.Open();
                }
                string       sql = "update getpics set getpicstime=@getpicstime where id=260";
                MySqlCommand cmd = new MySqlCommand(sql, connection);

                cmd.Parameters.AddWithValue("@getpicstime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                cmd.ExecuteNonQuery();
            }
        }
        public string GetLocationList(int lineid = 1)
        {
            WorkSataionsServer wServer = new WorkSataionsServer();

            return(wServer.GetLocationList(lineid));
        }
        //test:  /WorkStations/GetWorkStationList?orderid=99-1-18-1&lineid=1

        public string GetWorkStationList(string orderid, int lineid = 1)
        {
            WorkSataionsServer wServer = new WorkSataionsServer();

            return(wServer.GetWorkStationList(orderid, lineid));
        }
        //test: /WorkStations/GetArtificialInfo?artificialid=24
        public string GetArtificialInfo(int artificialid)
        {
            WorkSataionsServer wServer = new WorkSataionsServer();

            return(wServer.GetArtificialInfo(artificialid));
        }
        /// <summary>
        /// 工位读取接口
        /// </summary>
        /// <returns></returns>
        /// 测试数据  WorkStations/GetWorkSataionsInfo
        public string GetWorkSataionsInfo()
        {
            WorkSataionsServer wServer = new WorkSataionsServer();

            return(JsonConvert.SerializeObject(wServer.GetWorkStationInfo()));
        }