public int GetUnReadMessageCount(int cid)
        {
            int type = (int)SendAppMessageTypeEnum.SendRunPrintFltTicketEmail;
            IQueryable <SendAppMessageEntity> iQueryable =
                _sendAppMessageDal.Query <SendAppMessageEntity>(
                    n =>
                    n.Cid == cid && n.SendStatus == 1 && (n.IsRead ?? 0) == 0 &&
                    !string.IsNullOrEmpty(n.SendContent) && n.SendType != type);

            iQueryable = iQueryable.Take(99);

            return(iQueryable.Count());
        }
Beispiel #2
0
        /// <summary>
        /// 获取待推送信息
        /// </summary>
        /// <param name="sendAppMessageType"></param>
        /// <returns></returns>
        public List <SendAppMessageModel> GetSendAppMessage(SendAppMessageTypeEnum sendAppMessageType)
        {
            List <SendAppMessageEntity> waitSendList = null;

            if (sendAppMessageType == SendAppMessageTypeEnum.AuditUrgeNotice)
            {
                waitSendList = _sendAppMessageDal.GetAuditUrgeMessage <SendAppMessageEntity>();
            }
            else if (sendAppMessageType == SendAppMessageTypeEnum.SendPrintFltTicketEmail)
            {
                waitSendList =
                    _sendAppMessageDal.Query <SendAppMessageEntity>(
                        n =>
                        n.SendStatus == 0 &&
                        n.SendType == (int)SendAppMessageTypeEnum.PrintTicketNotice &&
                        n.OrderType.ToUpper() == "FLT", true)
                    .ToList();
            }
            else
            {
                waitSendList =
                    _sendAppMessageDal.Query <SendAppMessageEntity>(
                        n =>
                        (n.SendStatus == 0 || n.SendStatus == -1) &&
                        n.SendType == (int)sendAppMessageType, true)
                    .ToList();     //待推送信息
            }

            if (waitSendList == null || waitSendList.Count == 0)
            {
                return(new List <SendAppMessageModel>());
            }

            List <SendAppMessageModel> sendAppMessageModels =
                Mapper.Map <List <SendAppMessageEntity>, List <SendAppMessageModel> >(waitSendList);

            return(sendAppMessageModels);
        }