public void AddAppMessage(SendAppMessageModel sendAppMessageModel) { //判断当前接受人是否是差旅客户 CustomerInfoEntity customerInfoEntity = _customerDal.Find <CustomerInfoEntity>(sendAppMessageModel.Cid); if (string.IsNullOrEmpty(customerInfoEntity.CorpID)) { return; } CorporationEntity corporationEntity = _corporationDal.Query <CorporationEntity>(n => n.CorpId == customerInfoEntity.CorpID) .FirstOrDefault(); if (corporationEntity == null || corporationEntity.IsAmplitudeCorp != "T") { return; } SendAppMessageEntity sendAppMessageEntity = Mapper.Map <SendAppMessageModel, SendAppMessageEntity>(sendAppMessageModel); sendAppMessageEntity.CreateTime = DateTime.Now; _sendAppMessageDal.Insert(sendAppMessageEntity); }