Commit 705696ea authored by 吴春's avatar 吴春

提交代码

parent 9746eb05
...@@ -13,6 +13,12 @@ namespace Mall.Model.Entity.Education ...@@ -13,6 +13,12 @@ namespace Mall.Model.Entity.Education
[DB(ConnectionName = "DefaultConnection")] [DB(ConnectionName = "DefaultConnection")]
public class Rb_Education_Dynamic public class Rb_Education_Dynamic
{ {
/// <summary>
/// 话题id
/// </summary>
public int TalkId { get; set; }
/// <summary> /// <summary>
/// 动态文章id /// 动态文章id
/// </summary> /// </summary>
......
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Mall.Model.Entity.Education
{
/// <summary>
/// 朋友圈话题
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class Rb_Education_Talk
{
/// <summary>
/// id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 文章内容
/// </summary>
public string Content
{
get;
set;
}
/// <summary>
/// 商户id
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 老师对应的用户id
/// </summary>
public int? CreateBy
{
get;
set;
}
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime
{
get;
set;
}
/// <summary>
/// 状态 0:正常,1:删除
/// </summary>
public int Status
{
get;
set;
}
/// <summary>
/// 封面图片
/// </summary>
public string CoverPhoto
{
get;
set;
}
/// <summary>
/// 是否前台显示1-是,2-否
/// </summary>
public int IsOpen { get; set; }
}
}
...@@ -13,6 +13,11 @@ namespace Mall.Model.Extend.Education ...@@ -13,6 +13,11 @@ namespace Mall.Model.Extend.Education
[DB(ConnectionName = "DefaultConnection")] [DB(ConnectionName = "DefaultConnection")]
public class Rb_Education_Dynamic_Extend : Rb_Education_Dynamic public class Rb_Education_Dynamic_Extend : Rb_Education_Dynamic
{ {
/// <summary>
/// 话题
/// </summary>
public string TalkContent { get; set; }
#region 扩展字段 #region 扩展字段
/// <summary> /// <summary>
/// 操作人 /// 操作人
......
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Education;
namespace Mall.Model.Extend.Education
{
public class Rb_Education_Talk_Extend : Rb_Education_Talk
{
}
}
...@@ -3256,7 +3256,113 @@ namespace Mall.Model.Extend.MarketingCenter ...@@ -3256,7 +3256,113 @@ namespace Mall.Model.Extend.MarketingCenter
/// 商品图片 /// 商品图片
/// </summary> /// </summary>
public string picUrl { get; set; } public string picUrl { get; set; }
}
/// <summary>
///新增相亲星球大事件-自定义列表
/// </summary>
public class MiAiActivityTypeCustomItem
{
/// <summary>
/// 列表样式[-1-列表模式,0-左右滑动,1-一行一个,2-一行两个3-一行三个]
/// </summary>
public int listStyle { get; set; }
/// <summary>
/// 背景颜色
/// </summary>
public string backgroundColor { get; set; }
/// <summary>
/// 上边距
/// </summary>
public string PaddingTop { get; set; }
/// <summary>
/// 下边距
/// </summary>
public string PaddingBottom { get; set; }
/// <summary>
/// 左边距
/// </summary>
public string PaddingLeft { get; set; }
/// <summary>
/// 右边距
/// </summary>
public string PaddingRight { get; set; }
/// <summary>
/// 搜索圆角像素
/// </summary>
public int SearchFilletPX
{
get;
set;
}
/// <summary>
/// 自定义列表
/// </summary>
public List<MiAiActivityTypeCusModel> list { get; set; }
} }
/// <summary>
/// 商品详情项
/// </summary>
public class MiAiActivityTypeCusModel
{
/// <summary>
/// 标题
/// </summary>
public string name { get; set; }
/// <summary>
/// 副标题
/// </summary>
public string lableName { get; set; }
/// <summary>
/// 副标题
/// </summary>
public List<string> lableNameList { get; set; }
/// <summary>
/// 商品图片
/// </summary>
public string picUrl { get; set; }
/// <summary>
/// 链接
/// </summary>
public string linkUrl { get; set; }
}
#endregion #endregion
} }
\ No newline at end of file
...@@ -19,7 +19,7 @@ namespace Mall.Module.Education ...@@ -19,7 +19,7 @@ namespace Mall.Module.Education
private readonly Rb_Education_DynamicLikeRepository likeRepository = new Rb_Education_DynamicLikeRepository(); private readonly Rb_Education_DynamicLikeRepository likeRepository = new Rb_Education_DynamicLikeRepository();
private readonly Rb_Education_DynamicCommentRepository commentRepository = new Rb_Education_DynamicCommentRepository(); private readonly Rb_Education_DynamicCommentRepository commentRepository = new Rb_Education_DynamicCommentRepository();
private readonly Rb_Education_DynamicMessageRepository messageRepository = new Rb_Education_DynamicMessageRepository(); private readonly Rb_Education_DynamicMessageRepository messageRepository = new Rb_Education_DynamicMessageRepository();
private readonly Rb_Education_TalkRepository education_TalkRepository = new Rb_Education_TalkRepository();
/// <summary> /// <summary>
/// 获取消息未读数 /// 获取消息未读数
...@@ -500,6 +500,168 @@ namespace Mall.Module.Education ...@@ -500,6 +500,168 @@ namespace Mall.Module.Education
/// <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);
}
#endregion
#region 朋友圈话题 主要针对相亲项目
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<Rb_Education_Talk_Extend> GetEducationTalkList(Rb_Education_Talk_Extend where)
{
return education_TalkRepository.GetEducationTalkList(where);
}
/// <summary>
/// 话题分页
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowCount"></param>
/// <param name="where"></param>
/// <returns></returns>
public List<Rb_Education_Talk_Extend> GetEducationTalkPageList(int pageIndex, int pageSize, out long rowCount, Rb_Education_Talk_Extend where)
{
return education_TalkRepository.GetEducationTalkPageList(pageIndex, pageSize, out rowCount, where);
}
/// <summary>
/// 新增/修改话题
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetEducationTalk(Rb_Education_Talk_Extend model)
{
if (model.Id == 0)
{
return education_TalkRepository.Insert(model) > 0;
}
else
{
IDictionary<string, object> fileds = new Dictionary<string, object>
{
{ nameof(Rb_Education_Talk_Extend.Content), model.Content },
{ nameof(Rb_Education_Talk_Extend.IsOpen), model.IsOpen },
{ nameof(Rb_Education_Talk_Extend.CoverPhoto), model.CoverPhoto }
};
IList<WhereHelper> auditrecordWhereHelpers = new List<WhereHelper>
{
new WhereHelper()
{
FiledName = nameof(Rb_Education_Talk_Extend.Id),
FiledValue = model.Id,
OperatorEnum = OperatorEnum.Equal
},
new WhereHelper()
{
FiledName = nameof(Rb_Education_Talk_Extend.TenantId),
FiledValue = model.TenantId,
OperatorEnum = OperatorEnum.Equal
},
new WhereHelper()
{
FiledName = nameof(Rb_Education_Talk_Extend.MallBaseId),
FiledValue = model.MallBaseId,
OperatorEnum = OperatorEnum.Equal
}
};
return education_TalkRepository.Update(fileds, auditrecordWhereHelpers);
}
}
/// <summary>
/// 修改话题显示
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool UpdateEducationTalkShow(Rb_Education_Talk_Extend model)
{
IDictionary<string, object> fileds = new Dictionary<string, object>
{
{ nameof(Rb_Education_Talk_Extend.IsOpen), model.IsOpen }
};
IList<WhereHelper> auditrecordWhereHelpers = new List<WhereHelper>
{
new WhereHelper()
{
FiledName = nameof(Rb_Education_Talk_Extend.Id),
FiledValue = model.Id,
OperatorEnum = OperatorEnum.Equal
},
new WhereHelper()
{
FiledName = nameof(Rb_Education_Talk_Extend.TenantId),
FiledValue = model.TenantId,
OperatorEnum = OperatorEnum.Equal
},
new WhereHelper()
{
FiledName = nameof(Rb_Education_Talk_Extend.MallBaseId),
FiledValue = model.MallBaseId,
OperatorEnum = OperatorEnum.Equal
}
};
return education_TalkRepository.Update(fileds, auditrecordWhereHelpers);
}
/// <summary>
/// 删除话题
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool DelEducationTalk(Rb_Education_Talk_Extend model)
{
IDictionary<string, object> fileds = new Dictionary<string, object>
{
{ nameof(Rb_Education_Talk_Extend.Status), 1 }
};
IList<WhereHelper> auditrecordWhereHelpers = new List<WhereHelper>
{
new WhereHelper()
{
FiledName = nameof(Rb_Education_Talk_Extend.Id),
FiledValue = model.Id,
OperatorEnum = OperatorEnum.Equal
},
new WhereHelper()
{
FiledName = nameof(Rb_Education_Talk_Extend.TenantId),
FiledValue = model.TenantId,
OperatorEnum = OperatorEnum.Equal
},
new WhereHelper()
{
FiledName = nameof(Rb_Education_Talk_Extend.MallBaseId),
FiledValue = model.MallBaseId,
OperatorEnum = OperatorEnum.Equal
}
};
return education_TalkRepository.Update(fileds, auditrecordWhereHelpers);
}
#endregion #endregion
} }
} }
...@@ -676,6 +676,30 @@ namespace Mall.Module.MarketingCenter ...@@ -676,6 +676,30 @@ namespace Mall.Module.MarketingCenter
} }
item.data = miAiActivityTypeItem; item.data = miAiActivityTypeItem;
break; break;
case "miaiactivityCustom":
MiAiActivityTypeCustomItem miAiActivityTypeCustomItem = new MiAiActivityTypeCustomItem();
try
{
var driveData = JsonHelper.DeserializeObject<MiAiActivityTypeCustomItem>(item.data.ToString());
if (driveData != null)
{
miAiActivityTypeCustomItem.listStyle = driveData?.listStyle ?? 1;
miAiActivityTypeCustomItem.backgroundColor = driveData?.backgroundColor ?? "";
miAiActivityTypeCustomItem.PaddingTop = driveData?.PaddingTop ?? "0";
miAiActivityTypeCustomItem.PaddingBottom = driveData?.PaddingBottom ?? "0";
miAiActivityTypeCustomItem.PaddingLeft = driveData?.PaddingLeft ?? "0";
miAiActivityTypeCustomItem.PaddingRight = driveData?.PaddingRight ?? "0";
miAiActivityTypeCustomItem.SearchFilletPX = driveData?.SearchFilletPX ?? 0;
miAiActivityTypeCustomItem.list = new List<MiAiActivityTypeCusModel>();
miAiActivityTypeCustomItem.list = driveData.list;
}
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "miaiuser");
}
item.data = miAiActivityTypeCustomItem;
break;
//导航-页面 //导航-页面
case "nav-page": item.data = JsonHelper.DeserializeObject<navPageItem>(item.data.ToString()); break; case "nav-page": item.data = JsonHelper.DeserializeObject<navPageItem>(item.data.ToString()); break;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mall.Model.Entity.Education;
using Mall.Model.Extend.Education;
namespace Mall.Repository.Education
{
public class Rb_Education_TalkRepository : BaseRepository<Rb_Education_Talk>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(Rb_Education_Talk); } }
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<Rb_Education_Talk_Extend> GetEducationTalkList(Rb_Education_Talk_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from Rb_Education_Talk where Status=0");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and MallBaseId={0}", where.MallBaseId);
}
if (where.Id > 0)
{
sb.AppendFormat(" and Id={0}", where.Id);
}
if (where.IsOpen > 0)
{
sb.AppendFormat(" and IsOpen={0}", where.IsOpen);
}
}
return Get<Rb_Education_Talk_Extend>(sb.ToString()).ToList();
}
/// <summary>
/// 话题分页
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowCount"></param>
/// <param name="where"></param>
/// <returns></returns>
public List<Rb_Education_Talk_Extend> GetEducationTalkPageList(int pageIndex, int pageSize, out long rowCount, Rb_Education_Talk_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from Rb_Education_Talk where Status=0");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and MallBaseId={0}", where.MallBaseId);
}
if (where.Id > 0)
{
sb.AppendFormat(" and Id={0}", where.Id);
}
if (where.IsOpen > 0)
{
sb.AppendFormat(" and IsOpen={0}", where.IsOpen);
}
}
return GetPage<Rb_Education_Talk_Extend>(pageIndex, pageSize, out rowCount, sb.ToString()).ToList();
}
}
}
...@@ -1363,7 +1363,7 @@ namespace Mall.WebApi.Controllers.Education ...@@ -1363,7 +1363,7 @@ namespace Mall.WebApi.Controllers.Education
{ {
fileList = JsonConvert.DeserializeObject<List<string>>(item.Files); fileList = JsonConvert.DeserializeObject<List<string>>(item.Files);
} }
var resultData = new { id = item.Id, content = StringHelper.FromUnicodeString(item.Content), coverPhoto = item.CoverPhoto, fileType = item.FileType, fileList, realtionType = item.RealtionType, commentContent = StringHelper.FromUnicodeString(item.CommentContent), createEmpId = item.CreateBy, createEmName = item.CreateByName, crearteEmPhoto = item.CrearteByPhoto, replyName = item.ReplyName ?? "", replyPhoto = item.ReplyPhoto ?? "", createTime = StringHelper.DateFormatToString(item.CreateTime.Value), commentId = item.CommentId }; var resultData = new { id = item.Id, content = StringHelper.FromUnicodeString(item.Content), coverPhoto = item.CoverPhoto,item.TalkId,item.TalkContent, fileType = item.FileType, fileList, realtionType = item.RealtionType, commentContent = StringHelper.FromUnicodeString(item.CommentContent), createEmpId = item.CreateBy, createEmName = item.CreateByName, crearteEmPhoto = item.CrearteByPhoto, replyName = item.ReplyName ?? "", replyPhoto = item.ReplyPhoto ?? "", createTime = StringHelper.DateFormatToString(item.CreateTime.Value), commentId = item.CommentId };
list.Add(resultData); list.Add(resultData);
} }
pagelist.count = Convert.ToInt32(count); pagelist.count = Convert.ToInt32(count);
...@@ -1482,7 +1482,7 @@ namespace Mall.WebApi.Controllers.Education ...@@ -1482,7 +1482,7 @@ namespace Mall.WebApi.Controllers.Education
fileList = JsonConvert.DeserializeObject<List<string>>(article.Files); fileList = JsonConvert.DeserializeObject<List<string>>(article.Files);
} }
//StringHelper.UrlEncode(StringHelper.FromUnicodeString(article.Content)) //StringHelper.UrlEncode(StringHelper.FromUnicodeString(article.Content))
var resultData = new { id = article.Id, createEmpId = article.CreateBy, createEmName = article.CreateByName, crearteEmPhoto = article.CrearteByPhoto, YearTime = article.CreateTime.HasValue ? (article.CreateTime.Value.Year == System.DateTime.Now.Year ? "" : article.CreateTime.Value.ToString("yyyy")) : "", MonthTime = article.CreateTime.HasValue ? article.CreateTime.Value.ToString("MM") : "", DayTime = article.CreateTime.HasValue ? article.CreateTime.Value.ToString("dd") : "", createTime = article.CreateTime.HasValue ? StringHelper.DateFormatToString(article.CreateTime.Value) : "", content = StringHelper.FromUnicodeString(article.Content), coverPhoto = article.CoverPhoto, fileType = article.FileType, latAndLong = article.LatAndLong, address = article.Address, files = fileList, hasLike = article.HasLike, likeList = article.LikeList.Select(t => new { empId = t.UserId, empName = t.EmName, t.Id }), commentList = article.CommentList.Select(t => new { commentId = t.Id, empId = t.UserId, empName = t.UserName, byReplayEmpId = t.ByReplyEmpId, byReplayEmpName = t.ByReplyEmName, content = StringHelper.FromUnicodeString(t.Content) }) }; var resultData = new { id = article.Id, createEmpId = article.CreateBy,article.TalkContent,article.TalkId, createEmName = article.CreateByName, crearteEmPhoto = article.CrearteByPhoto, YearTime = article.CreateTime.HasValue ? (article.CreateTime.Value.Year == System.DateTime.Now.Year ? "" : article.CreateTime.Value.ToString("yyyy")) : "", MonthTime = article.CreateTime.HasValue ? article.CreateTime.Value.ToString("MM") : "", DayTime = article.CreateTime.HasValue ? article.CreateTime.Value.ToString("dd") : "", createTime = article.CreateTime.HasValue ? StringHelper.DateFormatToString(article.CreateTime.Value) : "", content = StringHelper.FromUnicodeString(article.Content), coverPhoto = article.CoverPhoto, fileType = article.FileType, latAndLong = article.LatAndLong, address = article.Address, files = fileList, hasLike = article.HasLike, likeList = article.LikeList.Select(t => new { empId = t.UserId, empName = t.EmName, t.Id }), commentList = article.CommentList.Select(t => new { commentId = t.Id, empId = t.UserId, empName = t.UserName, byReplayEmpId = t.ByReplyEmpId, byReplayEmpName = t.ByReplyEmName, content = StringHelper.FromUnicodeString(t.Content) }) };
return resultData; return resultData;
} }
/// <summary> /// <summary>
......
...@@ -619,7 +619,7 @@ namespace Mall.WebApi.Controllers.Education ...@@ -619,7 +619,7 @@ namespace Mall.WebApi.Controllers.Education
fileList = JsonConvert.DeserializeObject<List<string>>(article.Files); fileList = JsonConvert.DeserializeObject<List<string>>(article.Files);
} }
//StringHelper.UrlEncode(StringHelper.FromUnicodeString(article.Content)) //StringHelper.UrlEncode(StringHelper.FromUnicodeString(article.Content))
var resultData = new { id = article.Id, createEmpId = article.CreateBy, createEmName = article.CreateByName, crearteEmPhoto = article.CrearteByPhoto, YearTime = article.CreateTime.HasValue ? (article.CreateTime.Value.Year == System.DateTime.Now.Year ? "" : article.CreateTime.Value.ToString("yyyy")) : "", MonthTime = article.CreateTime.HasValue ? article.CreateTime.Value.ToString("MM") : "", DayTime = article.CreateTime.HasValue ? article.CreateTime.Value.ToString("dd") : "", createTime = article.CreateTime.HasValue ? StringHelper.DateFormatToString(article.CreateTime.Value) : "", content = StringHelper.FromUnicodeString(article.Content), coverPhoto = article.CoverPhoto, fileType = article.FileType, latAndLong = article.LatAndLong, address = article.Address, files = fileList, hasLike = article.HasLike, likeList = article.LikeList.Select(t => new { empId = t.UserId, empName = t.EmName, t.Id }), commentList = article.CommentList.Select(t => new { commentId = t.Id, empId = t.UserId, empName = t.UserName, byReplayEmpId = t.ByReplyEmpId, byReplayEmpName = t.ByReplyEmName, content = StringHelper.FromUnicodeString(t.Content) }) }; var resultData = new { id = article.Id, createEmpId = article.CreateBy, article.TalkId, article.TalkContent, createEmName = article.CreateByName, crearteEmPhoto = article.CrearteByPhoto, YearTime = article.CreateTime.HasValue ? (article.CreateTime.Value.Year == System.DateTime.Now.Year ? "" : article.CreateTime.Value.ToString("yyyy")) : "", MonthTime = article.CreateTime.HasValue ? article.CreateTime.Value.ToString("MM") : "", DayTime = article.CreateTime.HasValue ? article.CreateTime.Value.ToString("dd") : "", createTime = article.CreateTime.HasValue ? StringHelper.DateFormatToString(article.CreateTime.Value) : "", content = StringHelper.FromUnicodeString(article.Content), coverPhoto = article.CoverPhoto, fileType = article.FileType, latAndLong = article.LatAndLong, address = article.Address, files = fileList, hasLike = article.HasLike, likeList = article.LikeList.Select(t => new { empId = t.UserId, empName = t.EmName, t.Id }), commentList = article.CommentList.Select(t => new { commentId = t.Id, empId = t.UserId, empName = t.UserName, byReplayEmpId = t.ByReplyEmpId, byReplayEmpName = t.ByReplyEmName, content = StringHelper.FromUnicodeString(t.Content) }) };
return resultData; return resultData;
} }
...@@ -652,6 +652,23 @@ namespace Mall.WebApi.Controllers.Education ...@@ -652,6 +652,23 @@ namespace Mall.WebApi.Controllers.Education
pagelist.pageData = list; pagelist.pageData = list;
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
} }
/// <summary>
/// 获取话题列表
/// </summary>
/// <param name="requestMsg"></param>
/// <returns></returns>
public ApiResult GetEducationTalkList(object requestMsg)
{
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
Rb_Education_Talk_Extend demodel = new Rb_Education_Talk_Extend();
demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId;
demodel.IsOpen = 1;
List<Rb_Education_Talk_Extend> talkList = dynamicModule.GetEducationTalkList(demodel);
return ApiResult.Success("", talkList.Select(x => new { x.IsOpen, x.Id, x.Content, x.CoverPhoto }));
}
#endregion #endregion
......
...@@ -27,7 +27,7 @@ namespace Mall.WebApi.Controllers.Education ...@@ -27,7 +27,7 @@ namespace Mall.WebApi.Controllers.Education
{ {
private readonly EducationModule educationModule = new EducationModule(); private readonly EducationModule educationModule = new EducationModule();
private Module.User.UserModule UserModule = new Module.User.UserModule(); private Module.User.UserModule UserModule = new Module.User.UserModule();
private readonly DynamicModule dynamicModule = new DynamicModule();
#region 课程管理 #region 课程管理
/// <summary> /// <summary>
...@@ -862,7 +862,7 @@ namespace Mall.WebApi.Controllers.Education ...@@ -862,7 +862,7 @@ namespace Mall.WebApi.Controllers.Education
{ {
return ApiResult.Failed("请输入简介"); return ApiResult.Failed("请输入简介");
} }
if (query.GoodCourseList==null||!query.GoodCourseList.Any()) if (query.GoodCourseList == null || !query.GoodCourseList.Any())
{ {
return ApiResult.Failed("请输入擅长课程"); return ApiResult.Failed("请输入擅长课程");
} }
...@@ -1759,5 +1759,145 @@ namespace Mall.WebApi.Controllers.Education ...@@ -1759,5 +1759,145 @@ namespace Mall.WebApi.Controllers.Education
} }
} }
#endregion #endregion
#region 话题
[HttpPost]
public ApiResult GetEducationTalkPageList()
{
var parms = RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
Rb_Education_Talk_Extend demodel = JsonConvert.DeserializeObject<Rb_Education_Talk_Extend>(RequestParm.msg.ToString());
demodel.TenantId = UserInfo.TenantId;
demodel.MallBaseId = parms.MallBaseId;
var list = dynamicModule.GetEducationTalkPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.Id,
x.IsOpen,
x.Content,
x.CoverPhoto
});
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 获取新闻信息详情
/// </summary>
/// <returns></returns>
public ApiResult GetSetEducationTalk()
{
var qequest = RequestParm;
JObject parms = JObject.Parse(RequestParm.msg.ToString());
Int32.TryParse(RequestParm.uid, out int Uid);
var model = new Rb_Education_Talk_Extend()
{
Id = parms.GetInt("Id", 0),
IsOpen = parms.GetInt("IsOpen", 2),
CoverPhoto = parms.GetStringValue("CoverPhoto"),
Content = parms.GetStringValue("Content")
};
if (model.Id == 0)
{
model.CreateBy = UserInfo.EmpId;
model.CreateTime = System.DateTime.Now;
model.MallBaseId = qequest.MallBaseId;
model.TenantId = UserInfo.TenantId;
model.Status = 0;
}
var extModel = dynamicModule.SetEducationTalk(model);
return ApiResult.Success(data: extModel);
}
/// <summary>
/// 获取话题详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetEducationTalkDetails()
{
var parms = RequestParm;
JObject parmsJob = JObject.Parse(RequestParm.msg.ToString());
int id = parmsJob.GetInt("Id");
if (id == 0)
{
return ApiResult.Failed("请传递参数");
}
var model = dynamicModule.GetEducationTalkList(new Rb_Education_Talk_Extend { TenantId = UserInfo.TenantId, MallBaseId = parms.MallBaseId, Id = id }).FirstOrDefault();
if (model == null)
{
return ApiResult.Failed("数据不存在");
}
else
{
return ApiResult.Success("", model);
}
}
/// <summary>
/// 隐藏/显示话题
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult UpdateEducationTalkShow()
{
var parms = RequestParm;
JObject parmsJob = JObject.Parse(RequestParm.msg.ToString());
int id = parmsJob.GetInt("Id");
int isOpen = parmsJob.GetInt("IsOpen", 0);
if (id == 0)
{
return ApiResult.Failed("请传递参数");
}
bool flag = dynamicModule.UpdateEducationTalkShow(new Rb_Education_Talk_Extend { TenantId = UserInfo.TenantId, MallBaseId = parms.MallBaseId, Id = id, IsOpen = isOpen });
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
/// <summary>
/// 删除话题
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult DelEducationTalk()
{
var parms = RequestParm;
JObject parmsJob = JObject.Parse(RequestParm.msg.ToString());
int id = parmsJob.GetInt("Id");
if (id == 0)
{
return ApiResult.Failed("请传递参数");
}
bool flag = dynamicModule.DelEducationTalk(new Rb_Education_Talk_Extend { TenantId = UserInfo.TenantId, MallBaseId = parms.MallBaseId, Id = id });
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
#endregion
} }
} }
\ No newline at end of file
...@@ -1464,6 +1464,15 @@ namespace Mall.WebApi.Controllers ...@@ -1464,6 +1464,15 @@ namespace Mall.WebApi.Controllers
data = miAiActivityTypeItemInfo data = miAiActivityTypeItemInfo
}; };
break; break;
case "miaiactivityCustom":
var miAiActivityTypeCustomItem = subItem.data as MiAiActivityTypeCustomItem;
obj = new
{
id = subItem.Id,
data = miAiActivityTypeCustomItem
};
break;
} }
return obj; return obj;
} }
......
...@@ -1015,6 +1015,54 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1015,6 +1015,54 @@ namespace Mall.WebApi.Controllers.MallBase
return ApiResult.Failed("发布失败"); return ApiResult.Failed("发布失败");
} }
} }
/// <summary>
/// 动态列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
public ApiResult GetMiAiDynamicDetial()
{
var req = RequestParm;
var userInfo = AppletUserInfo;
JObject parm = JObject.Parse(req.msg.ToString());
int articleId = parm.GetInt("articleId");
if (articleId == 0)
{
return ApiResult.Failed("动态id不为空");
}
Rb_Education_Dynamic_Extend articele = dynamicModule.GetDynamicDetial(new Rb_Education_Dynamic_Extend { UserId = userInfo.UserId, Id = articleId });
if (articele != null)
{
var data = DecoratorDynameicResult(articele);
return ApiResult.Success(data: data);
}
else
{
return ApiResult.Failed("动态不存在");
}
}
/// <summary>
/// 返回动态详情
/// </summary>
/// <param name="article">动态内容</param>
/// <returns></returns>
public object DecoratorDynameicResult(Rb_Education_Dynamic_Extend article)
{
List<string> fileList = new List<string>();
if (!string.IsNullOrEmpty(article.Files))
{
fileList = JsonConvert.DeserializeObject<List<string>>(article.Files);
}
//StringHelper.UrlEncode(StringHelper.FromUnicodeString(article.Content))
var resultData = new { id = article.Id, createEmpId = article.CreateBy, article.TalkContent, article.TalkId, createEmName = article.CreateByName, crearteEmPhoto = article.CrearteByPhoto, YearTime = article.CreateTime.HasValue ? (article.CreateTime.Value.Year == System.DateTime.Now.Year ? "" : article.CreateTime.Value.ToString("yyyy")) : "", MonthTime = article.CreateTime.HasValue ? article.CreateTime.Value.ToString("MM") : "", DayTime = article.CreateTime.HasValue ? article.CreateTime.Value.ToString("dd") : "", createTime = article.CreateTime.HasValue ? StringHelper.DateFormatToString(article.CreateTime.Value) : "", content = StringHelper.FromUnicodeString(article.Content), coverPhoto = article.CoverPhoto, fileType = article.FileType, latAndLong = article.LatAndLong, address = article.Address, files = fileList, hasLike = article.HasLike, likeList = article.LikeList.Select(t => new { empId = t.UserId, empName = t.EmName, t.Id }), commentList = article.CommentList.Select(t => new { commentId = t.Id, empId = t.UserId, empName = t.UserName, byReplayEmpId = t.ByReplyEmpId, byReplayEmpName = t.ByReplyEmName, content = StringHelper.FromUnicodeString(t.Content) }) };
return resultData;
}
#endregion #endregion
......
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