|
@@ -7,7 +7,6 @@ using GxPress.Request.App.Middle;
|
|
using GxPress.Request.Notice;
|
|
using GxPress.Request.Notice;
|
|
using GxPress.EnumConst;
|
|
using GxPress.EnumConst;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
-using System.Transactions;
|
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using Datory;
|
|
using Datory;
|
|
|
|
|
|
@@ -28,15 +27,15 @@ namespace GxPress.Service.Implement.Notice
|
|
var userEntity = await _userRepository.GetAsync(request.UserId);
|
|
var userEntity = await _userRepository.GetAsync(request.UserId);
|
|
if (userEntity == null)
|
|
if (userEntity == null)
|
|
throw new BusinessException("用户不存在");
|
|
throw new BusinessException("用户不存在");
|
|
|
|
+ //获取简单标题
|
|
|
|
+ request.SimplenessTitle = _contentJsonService.GetTitile(request.Title, request.Content);
|
|
var noticeId = 0;
|
|
var noticeId = 0;
|
|
var middleId = 0;
|
|
var middleId = 0;
|
|
var addresseeUsers = new List<User>();
|
|
var addresseeUsers = new List<User>();
|
|
var ccUsers = new List<User>();
|
|
var ccUsers = new List<User>();
|
|
- request.Title = _contentJsonService.GetTitile(request.Title, request.Content);
|
|
|
|
//添加通知
|
|
//添加通知
|
|
if (request.Id == 0)
|
|
if (request.Id == 0)
|
|
{
|
|
{
|
|
-
|
|
|
|
noticeId = await _noticeRepository.InsertAsync(request);
|
|
noticeId = await _noticeRepository.InsertAsync(request);
|
|
if (noticeId == 0) return false;
|
|
if (noticeId == 0) return false;
|
|
var middleInsertTypes = new MiddleInsertTypeRequest
|
|
var middleInsertTypes = new MiddleInsertTypeRequest
|
|
@@ -62,6 +61,7 @@ namespace GxPress.Service.Implement.Notice
|
|
notice.Title = request.Title;
|
|
notice.Title = request.Title;
|
|
notice.HtmlContent = request.HtmlContent;
|
|
notice.HtmlContent = request.HtmlContent;
|
|
notice.SourceId = request.SoureId;
|
|
notice.SourceId = request.SoureId;
|
|
|
|
+ notice.SimplenessTtile = request.SimplenessTitle;
|
|
await _noticeRepository.UpdateNoticeAsync(notice);
|
|
await _noticeRepository.UpdateNoticeAsync(notice);
|
|
//删除middle
|
|
//删除middle
|
|
await _middleRepository.DeleteAsync(Q.Where(nameof(Entity.Middle.Middle.MiddleId), noticeId).Where(nameof(Entity.Middle.Middle.FolderType), AllTypeConst.Inbox.GetHashCode()).Where(nameof(Entity.Middle.Middle.IsAdmin), false));
|
|
await _middleRepository.DeleteAsync(Q.Where(nameof(Entity.Middle.Middle.MiddleId), noticeId).Where(nameof(Entity.Middle.Middle.FolderType), AllTypeConst.Inbox.GetHashCode()).Where(nameof(Entity.Middle.Middle.IsAdmin), false));
|