Beispiel #1
0
 public static void Ticket(int sessionId, string gameName)
 {
     LogManager.WriteLog("购买数据开始处理");
     try
     {
         string    sql       = "SELECT * FROM white_names where session_id = '" + sessionId + "' and isupload = 0 ";
         DataTable dataTable = MySqlDBHelper.ExecuteDataTable(PoliceDataFactory.entranceCon, sql);
         bool      flag      = dataTable.Rows.Count > 0;
         if (flag)
         {
             LogManager.WriteLog("本次上次购买数据数量为" + dataTable.Rows.Count + "条");
             Ticket ticket = new Ticket
             {
                 verification = verification,
                 dataVoList   = new List <TicketInfo>()
             };
             foreach (object obj in dataTable.Rows)
             {
                 DataRow item = (DataRow)obj;
                 ticket.dataVoList.Add(new TicketInfo
                 {
                     activityId        = gameName,
                     purchaserName     = item["buy_name"].ToString(),
                     purchaserIdCardNo = item["id_no"].ToString(),
                     purchaserTel      = item["purchaser_tel"].ToString(),
                     purchaserSeatNo   = string.Concat(new string[]
                     {
                         item["area"].ToString(),
                         item["row"].ToString(),
                         "排",
                         item["seat"].ToString(),
                         "号"
                     }),
                     ticketNo = item["ticket_no"].ToString()
                 });
             }
             string url        = URL + "/api/ticket";
             string ticketdata = JsonConvert.SerializeObject(ticket);
             LogManager.WriteLog("购买上传数据:" + ticketdata);
             string msg = PoliceDataFactory.HttpPost(url, ticketdata, null);
             LogManager.WriteLog("购买数据上传完成");
             LogManager.WriteLog("购买数据上传返回结果:" + msg);
             LogManager.WriteLog("更新上传数据状态");
             string updatesql = "update white_names set isupload=1 where session_id = '" + sessionId + "'";
             MySqlDBHelper.ExecuteNonQuery(PoliceDataFactory.entranceCon, CommandType.Text, updatesql);
         }
         else
         {
             LogManager.WriteLog("无购买数据上传");
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteLog("购买数据上传异常" + ex.Message);
     }
 }
Beispiel #2
0
        /// <summary>
        /// 检票数据上传
        /// </summary>
        public static void Entrance(int sessionId, string gameName)
        {
            LogManager.WriteLog("检票数据开始上传");
            try
            {
                string    sql       = "SELECT DISTINCT s.session_id,s.tel_no,s.tel_area,s.ticket_no,s.id_no, s.buy_name,s.create_date from in_sessions s where session_id = '" + sessionId + "' and isupload = 0";
                DataTable dataTable = MySqlDBHelper.ExecuteDataTable(entranceCon, sql);

                Entrance entrance = new Entrance()
                {
                    verification = verification, dataVoList = new List <EntranceInfo>()
                };

                foreach (DataRow item in dataTable.Rows)
                {
                    entrance.dataVoList.Add(new EntranceInfo()
                    {
                        activityId           = serverGameName,
                        entranceCode         = item["tel_no"].ToString(),
                        entranceName         = item["tel_area"].ToString(),
                        ticketNumber         = 1,
                        certificationNumber  = 0,
                        ticketNo             = item["ticket_no"].ToString(),
                        ticketHolderIdCardNo = item["id_no"].ToString(),
                        ticketHolderName     = item["buy_name"].ToString(),
                        entranceFacePic      = "",
                        abnormalNumber       = 0,
                        entranceTime         = Convert.ToDateTime(item["create_date"].ToString())
                    });
                }

                string url = URL + "/api/entrance";

                string ticketdata = Newtonsoft.Json.JsonConvert.SerializeObject(entrance);

                LogManager.WriteLog("检票上传数据:" + ticketdata);
                string msg = PoliceDataFactory.HttpPost(url, ticketdata, null);
                LogManager.WriteLog("检票数据上传完成");
                LogManager.WriteLog("检票数据上传返回结果:" + msg);
                LogManager.WriteLog("更新上传数据状态");
                string updatesql = "update in_sessions set isupload=1 where session_id = '" + sessionId + "'";
                MySqlDBHelper.ExecuteNonQuery(PoliceDataFactory.entranceCon, CommandType.Text, updatesql);
            }
            catch (Exception ex)
            {
                LogManager.WriteLog("检票数据上传异常" + ex.Message);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 告警数据上传
        /// </summary>
        public static void InspectTicket(int sessionId, string gameName)
        {
            LogManager.WriteLog("告警数据开始上传");
            try
            {
                string sql = "SELECT id,session_id,buy_name,id_no,id_card_photo,year_ticket_photo,address,status,remark from black_names where session_id = '" + sessionId + "' and isupload = 0";

                DataTable dataTable = MySqlDBHelper.ExecuteDataTable(entranceCon, sql);

                InspectTicket inspectTicket = new InspectTicket()
                {
                    verification = verification, dataVoList = new List <InspectTicketInfo>()
                };

                foreach (DataRow item in dataTable.Rows)
                {
                    inspectTicket.dataVoList.Add(new InspectTicketInfo()
                    {
                        taskId               = serverGameName,
                        warningTime          = DateTime.Now,
                        warningPosition      = IrAdvanced.ReadString("TelArea"),
                        ticketWarningType    = 1,
                        ticketNo             = item["id"].ToString(),
                        ticketHolderIdCardNo = item["id_no"].ToString(),
                        ticketHolderName     = item["buy_name"].ToString(),
                        entranceFacePic      = item["remark"].ToString()
                    });
                }

                string url  = URL + "/api/inspectTicket";
                string data = JsonConvert.SerializeObject(inspectTicket);
                LogManager.WriteLog("告警上传数据:" + data);
                string msg = PoliceDataFactory.HttpPost(url, data, null);
                LogManager.WriteLog("告警数据上传完成");
                LogManager.WriteLog("告警数据上传返回结果:" + msg);
                LogManager.WriteLog("更新上传数据状态");
                string updatesql = "update black_names set isupload=1 where session_id = '" + sessionId + "'";
                MySqlDBHelper.ExecuteNonQuery(PoliceDataFactory.entranceCon, CommandType.Text, updatesql);
            }
            catch (Exception ex)
            {
                LogManager.WriteLog("检票数据上传异常" + ex.Message);
            }
        }