Commit f0a4c534 authored by liudong1993's avatar liudong1993

Merge branch 'sdzq' of http://gitlab.oytour.com/Kui2/mall.oytour.com into sdzq-ld

parents 8bf1b121 07cd2b23
......@@ -447,7 +447,7 @@ namespace Mall.Module.Education
Type = Common.Enum.MiAi.MessageTypeEnum.CircleReply,
UserId = article.CreateBy ?? 0,
SourceId = comment.ArticleId,
Content = Common.Plugin.StringHelper.FromUnicodeString( comment.Content),
Content = Common.Plugin.StringHelper.FromUnicodeString(comment.Content),
Status = 0,
TenantId = comment.TenantId,
MallBaseId = comment.MallBaseId,
......@@ -549,22 +549,41 @@ namespace Mall.Module.Education
public List<Rb_Education_Dynamic_Extend> GetMiAiAllDynamicList(Rb_Education_Dynamic_Extend model)
{
List<Rb_Education_Dynamic_Extend> articleList = new List<Rb_Education_Dynamic_Extend>();
articleList = articleRepository.GetMiAiAllDynamicList( model);
articleList = articleRepository.GetMiAiAllDynamicList(model);
DecoratorDynameicArticle(articleList);
return articleList;
}
/// <summary>
/// 动态详情
/// </summary>
/// <param name="empId">员工id</param>
/// <param name="articleId">动态id</param>
/// <returns></returns>
public Rb_Education_Dynamic_Extend GetMiAiDynamicDetial(Rb_Education_Dynamic_Extend model)
/// <summary>
/// 动态详情
/// </summary>
/// <param name="empId">员工id</param>
/// <param name="articleId">动态id</param>
/// <returns></returns>
public Rb_Education_Dynamic_Extend GetMiAiDynamicDetial(Rb_Education_Dynamic_Extend model)
{
return articleRepository.GetMiAiDynamicDetial(model);
Rb_Education_Dynamic_Extend article = articleRepository.GetMiAiDynamicDetial(model);
if (article == null)
{
return article;
}
article.LikeList = likeRepository.GetDynamicLikeList(new Rb_Education_DynamicLike_Extend { ArticleId = article.Id });
article.CommentList = commentRepository.GetDynamicCommentList(new Rb_Education_DynamicComment_Extend { ArticleId = article.Id });
foreach (var common in article.CommentList)
{
if (common.CommentId != null && common.CommentId > 0)
{
Rb_Education_DynamicComment_Extend byReplayCommon = article.CommentList.Where(t => t.Id == common.CommentId.Value).FirstOrDefault();
if (byReplayCommon != null)
{
common.ByReplyEmName = byReplayCommon.UserName;
common.ByReplyEmpId = byReplayCommon.UserId;
}
}
}
return article;
}
......
......@@ -15,6 +15,7 @@ using Newtonsoft.Json.Linq;
using Mall.Common.Plugin;
using Google.Protobuf.WellKnownTypes;
using Mall.Model.Entity.Education;
using Microsoft.AspNetCore.Authorization;
namespace Mall.WebApi.Controllers.Education
{
......@@ -634,6 +635,7 @@ namespace Mall.WebApi.Controllers.Education
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[AllowAnonymous]
[HttpPost]
public ApiResult GetMiAiDynamicList(object requestMsg)
{
......
......@@ -874,7 +874,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
[AllowAnonymous]
[HttpPost]
public ApiResult GetMiAiBaseIfo()
{
......@@ -887,53 +887,57 @@ namespace Mall.WebApi.Controllers.MallBase
int MyFollowId = 0;
int OtherFollowId = 0;
var oldList = miaiModule.GetFollowMemberList(new RB_MiAi_FollowMember_Extend { Status = 0, UserId = userId, CreateBy = userInfo.UserId, MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId });
var oldOtherList = miaiModule.GetFollowMemberList(new RB_MiAi_FollowMember_Extend { Status = 0, UserId = userInfo.UserId, CreateBy = userId, MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId });
var oldUserInfo = miaiModule.GetMemberUserInfo(userId);
var oldBaseInfo = miaiModule.GetBaseInfoList(new RB_MiAi_BaseInfo_Extend { UserId = userId, TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId }).FirstOrDefault();
if (userId != userInfo.UserId)
if (userInfo!=null)
{
if (oldList != null && oldList.Any() && oldOtherList != null && oldOtherList.Any())
{
isFollow = 3;
MyFollowId = oldList.FirstOrDefault()?.ID ?? 0;
OtherFollowId = oldOtherList.FirstOrDefault()?.ID ?? 0;
}
else if (oldList != null && oldList.Any())
{
isFollow = 1;
MyFollowId = oldList.FirstOrDefault()?.ID ?? 0;
}
else if (oldOtherList != null && oldOtherList.Any())
{
isFollow = 2;
OtherFollowId = oldOtherList.FirstOrDefault()?.ID ?? 0;
}
else
{
isFollow = 0;
}
var oldList = miaiModule.GetFollowMemberList(new RB_MiAi_FollowMember_Extend { Status = 0, UserId = userId, CreateBy = userInfo.UserId, MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId });
var oldOtherList = miaiModule.GetFollowMemberList(new RB_MiAi_FollowMember_Extend { Status = 0, UserId = userInfo.UserId, CreateBy = userId, MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId });
//设置消息推送
miaiCommonModule.SetMessage(new RB_Miai_Message_Extend()
if (userId != userInfo.UserId)
{
Id = 0,
Type = Common.Enum.MiAi.MessageTypeEnum.Look,
UserId = userId,
SourceId = userId,
Content = "用户访问了您的自画像",
Status = 0,
TenantId = oldUserInfo.TenantId,
MallBaseId = oldUserInfo.MallBaseId,
CreateBy = userInfo.UserId,
CreateDate = DateTime.Now,
UpdateDate = DateTime.Now
});
if (oldList != null && oldList.Any() && oldOtherList != null && oldOtherList.Any())
{
isFollow = 3;
MyFollowId = oldList.FirstOrDefault()?.ID ?? 0;
OtherFollowId = oldOtherList.FirstOrDefault()?.ID ?? 0;
}
else if (oldList != null && oldList.Any())
{
isFollow = 1;
MyFollowId = oldList.FirstOrDefault()?.ID ?? 0;
}
else if (oldOtherList != null && oldOtherList.Any())
{
isFollow = 2;
OtherFollowId = oldOtherList.FirstOrDefault()?.ID ?? 0;
}
else
{
isFollow = 0;
}
}
//设置消息推送
miaiCommonModule.SetMessage(new RB_Miai_Message_Extend()
{
Id = 0,
Type = Common.Enum.MiAi.MessageTypeEnum.Look,
UserId = userId,
SourceId = userId,
Content = "用户访问了您的自画像",
Status = 0,
TenantId = RequestParm.TenantId,
MallBaseId = RequestParm.MallBaseId,
CreateBy = userInfo.UserId,
CreateDate = DateTime.Now,
UpdateDate = DateTime.Now
});
}
}
var oldUserInfo = miaiModule.GetMemberUserInfo(userId);
var oldBaseInfo = miaiModule.GetBaseInfoList(new RB_MiAi_BaseInfo_Extend { UserId = userId, TenantId = RequestParm.TenantId, MallBaseId = RequestParm.MallBaseId }).FirstOrDefault();
if (oldUserInfo != null && oldUserInfo.Id > 0)
{
......@@ -1304,7 +1308,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
return ApiResult.Failed("动态id不为空");
}
Rb_Education_Dynamic_Extend articele = dynamicModule.GetDynamicDetial(new Rb_Education_Dynamic_Extend { UserId = userInfo.UserId, Id = articleId });
Rb_Education_Dynamic_Extend articele = dynamicModule.GetMiAiDynamicDetial(new Rb_Education_Dynamic_Extend { UserId = userInfo.UserId, Id = articleId });
if (articele != null)
{
var data = DecoratorDynameicResult(articele);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment