/// <summary>
 /// 往入场记录队列中添加数据
 /// </summary>
 /// <param name="record"></param>
 public void AddInRecord(INRECORDALL record)
 {
     lock (InRedodeQue)
         InRedodeQue.Enqueue(record);
 }
 /// <summary>
 ///  处理入场队列中的数据
 /// </summary>
 public void AcceptInRecord(object state)
 {
     while (true)
     {
         try
         {
             InRedodeEvent.WaitOne(100);
             while (InRedodeQue.Count > 0)
             {
                 InRedodeEvent.WaitOne(100);
                 INRECORDALL recordAll = null;
                 lock (AcceptInRecordDataQueLock)
                 {
                     if (InRedodeQue.Count > 0)
                     {
                         recordAll = InRedodeQue.First();
                     }
                 }
                 try
                 {
                     if (null != recordAll)
                     {
                         string     url          = ConfigurationManager.AppSettings["serverUrl"].ToString();
                         string     authCode     = CommHelper.Str(6);
                         string     token        = CommHelper.Md5(CommHelper.StringToHexString(authCode)).ToUpper();
                         string     imgData      = "imgContent=" + recordAll.imgContent + "&imgUrl=" + recordAll.imgUrl + "&authCode=" + authCode + "&token=" + token + "";;
                         string     imgResult    = CommHelper.Post(url + "/inOutImg.eif", imgData);
                         returnData returnResult = CommHelper.FromJsonTo <returnData>(imgResult);
                         LogHelper.Log.Info("车牌号:" + recordAll.inreord.vehicleNo + ";返回状态:" + returnResult.resStatus + ";返回信息:" + returnResult.resRemark);
                         if (null != returnResult)
                         {
                             if (returnResult.resStatus == 1)
                             {
                                 LogHelper.Log.Info("通道:" + recordAll.inreord.inChannelCode + "入场图片上传成功");
                                 string data = Common.CommHelper.ToJSON(recordAll.inreord).Replace("\\", "");
                                 data = "inRecord=" + data.Remove((data.IndexOf('[') - 1), 1);
                                 data = data.Remove((data.IndexOf(']') + 1), 1) + "&authCode=" + authCode + "&token=" + token;
                                 string     inResult       = CommHelper.Post(url + "/inRecord.eif", data);
                                 returnData returnInrecord = CommHelper.FromJsonTo <returnData>(inResult);
                                 if (returnInrecord.resStatus == 1)
                                 {
                                     LogHelper.Log.Info("通道:" + recordAll.inreord.inChannelCode + "入场记录上传成功");
                                     InRedodeQue.Dequeue();
                                 }
                                 else
                                 {
                                     LogHelper.Log.Info("通道:" + recordAll.inreord.inChannelCode + "入场记录上传失败");
                                 }
                             }
                             else
                             {
                                 LogHelper.Log.Info("通道:" + recordAll.inreord.inChannelCode + "入场图片上传失败");
                             }
                         }
                         else
                         {
                             LogHelper.Log.Error(returnResult.resRemark);
                         }
                     }
                 }
                 catch (Exception ex)
                 {
                     LogHelper.Log.Error(ex.Message);
                     AcceptDataEvent.Reset();
                 }
             }
             AcceptDataEvent.Reset();
         }
         catch (Exception ex)
         {
             LogHelper.Log.Error(ex.Message);
             AcceptDataEvent.Reset();
         }
     }
 }