Ejemplo n.º 1
0
        public static Result <TicketResult> Ticket_SubmitWalkPast(SubmitWalkPast_Object submitWalkPastObject)
        {
            var data   = JsonSerializeHelper.ToJson(submitWalkPastObject);
            var result = HttpHelper.Post(url + "Ticket_SubmitWalkPast", data, 60);

            return(JsonSerializeHelper.ToObject <Result <TicketResult> >(result));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 提交过闸结果
 /// </summary>
 /// <param name="obj">过闸结果</param>
 /// <returns></returns>
 public Result <TicketResult> Ticket_SubmitWalkPast(SubmitWalkPast_Object obj)
 {
     _log.Info("进入【提交过闸结果】事件: Ticket_SubmitWalkPast");
     _log.Info("得到数据: " + JsonHelper.ObjectToJsonStr(obj));
     try
     {
         _log.Info("本次过闸人数 Count: " + obj.Count);
         _log.Info("可用人数 CapacitySize: " + obj.Ticket.CapacitySize);
         _log.Info("已用人数 UsageCount: " + obj.Ticket.UsageCount);
         if (obj.Count <= 0)
         {
             _log.Info("通行超时,验票结束");
             return(TicketDataResult.TaskTerminationResult("通行超时,验票结束", "通行超时,验票结束"));
         }
         ////掌静脉
         //if (obj.Ticket != null && obj.Ticket.TicketType == SourceType.PalmVein.ToString())
         //{
         //    return TicketDataResult.TaskTerminationResult("验证通过,感谢您的光临", "验证通过,感谢您的光临");
         //}
         //条形码和二维码和身份证,将验票结果写入数据库
         if (obj.Ticket != null && (obj.Ticket.TicketType == SourceType.BarCode.ToString() || obj.Ticket.TicketType == SourceType.QRcode.ToString() || obj.Ticket.TicketType == SourceType.IdCard.ToString()))
         {
             _log.Info("条形码和二维码,更新状态");
             var ticket = _otaFacadeService.UpdateTicket(obj.Ticket.UR_Text1, obj.Count, obj.Device.DeviceName);
             if (ticket == null)
             {
                 _log.Info("ticket等于null---------------------------------------");
             }
             else
             {
                 obj.Ticket.UsageCount   = ticket.UsedQuantity;
                 obj.Ticket.CapacitySize = ticket.Quantity;
             }
         }
         //一票多人
         if (obj.Ticket != null && obj.Ticket.UsageCount < obj.Ticket.CapacitySize)
         {
             var session = obj.Session;
             session.IDCard_Pass      = false;
             session.Fingerprint_Pass = false;
             session.AdminConfirm     = false;
             return(Schedule_Ticket(obj.Ticket, session));
         }
         //年卡
         //if (obj.Ticket != null && obj.Ticket.TicketType == SourceType.YearTicket.ToString())
         //{
         //    //添加入园记录
         //    _otaFacadeService.AddYearTicketAdmissionRecord(obj.Ticket.Number);
         //}
         _log.Info("验证通过,感谢您的光临");
         _log.Info("结束【提交过闸结果】事件: Ticket_SubmitWalkPast");
         return(TicketDataResult.TaskTerminationResult("验证通过,感谢您的光临", "验证通过,感谢您的光临"));
     }
     catch (Exception ex)
     {
         _log.Error(ex);
         return(TicketDataResult.FailResult("系统异常,请联系管理员!"));
     }
 }