Commit 95c7072d authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education into master

parents 0a7adb10 9185416c
......@@ -13,4 +13,25 @@
<PackageReference Include="NPOI" Version="2.5.1" />
</ItemGroup>
<ItemGroup>
<Reference Include="Aspose.Pdf">
<HintPath>..\lib\Aspose.Pdf.dll</HintPath>
</Reference>
<Reference Include="Aspose.Words">
<HintPath>..\lib\Aspose.Words.dll</HintPath>
</Reference>
<Reference Include="Spire.License">
<HintPath>..\lib\Spire.License.dll</HintPath>
</Reference>
<Reference Include="Spire.Pdf">
<HintPath>..\lib\Spire.Pdf.dll</HintPath>
</Reference>
<Reference Include="Spire.Presentation">
<HintPath>..\lib\Spire.Presentation.dll</HintPath>
</Reference>
<Reference Include="Spire.XLS">
<HintPath>..\lib\Spire.XLS.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
......@@ -35,7 +35,7 @@ namespace Edu.Common
}
/// <summary>
/// 格式化时间【yyyy-MM-dd HH:mm:ss
/// 格式化时间【yyyy-MM-dd】
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
......
......@@ -13,7 +13,13 @@
"Microsoft.Extensions.Configuration": "3.1.8",
"Microsoft.Extensions.Configuration.Json": "3.1.8",
"NPOI": "2.5.1",
"Newtonsoft.Json": "12.0.3"
"Newtonsoft.Json": "12.0.3",
"Aspose.Pdf": "8.6.0.0",
"Aspose.Words": "17.7.0.0",
"Spire.License": "1.3.6.40",
"Spire.Pdf": "3.9.130.14040",
"Spire.Presentation": "2.8.13.14040",
"Spire.XLS": "7.12.23.14040"
},
"runtime": {
"Edu.Common.dll": {}
......@@ -874,7 +880,55 @@
"System.Runtime": "4.1.0"
}
},
"System.Threading.Tasks.Extensions/4.5.4": {}
"System.Threading.Tasks.Extensions/4.5.4": {},
"Aspose.Pdf/8.6.0.0": {
"runtime": {
"Aspose.Pdf.dll": {
"assemblyVersion": "8.6.0.0",
"fileVersion": "8.6.0.0"
}
}
},
"Aspose.Words/17.7.0.0": {
"runtime": {
"Aspose.Words.dll": {
"assemblyVersion": "17.7.0.0",
"fileVersion": "17.7.0.0"
}
}
},
"Spire.License/1.3.6.40": {
"runtime": {
"Spire.License.dll": {
"assemblyVersion": "1.3.6.40",
"fileVersion": "1.3.6.40"
}
}
},
"Spire.Pdf/3.9.130.14040": {
"runtime": {
"Spire.Pdf.dll": {
"assemblyVersion": "3.9.130.14040",
"fileVersion": "3.9.130.14040"
}
}
},
"Spire.Presentation/2.8.13.14040": {
"runtime": {
"Spire.Presentation.dll": {
"assemblyVersion": "2.8.13.14040",
"fileVersion": "2.8.13.14040"
}
}
},
"Spire.XLS/7.12.23.14040": {
"runtime": {
"Spire.XLS.dll": {
"assemblyVersion": "7.12.23.14040",
"fileVersion": "7.12.23.14040"
}
}
}
}
},
"libraries": {
......@@ -1477,6 +1531,36 @@
"sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==",
"path": "system.threading.tasks.extensions/4.5.4",
"hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512"
},
"Aspose.Pdf/8.6.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"Aspose.Words/17.7.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"Spire.License/1.3.6.40": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"Spire.Pdf/3.9.130.14040": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"Spire.Presentation/2.8.13.14040": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"Spire.XLS/7.12.23.14040": {
"type": "reference",
"serviceable": false,
"sha512": ""
}
}
}
\ No newline at end of file
......@@ -95,5 +95,10 @@ namespace Edu.Model.Entity.Course
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 排序
/// </summary>
public int SortNum { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Course
{
public class ChapterTree_ViewModel
{
/// <summary>
/// 主键(章节编号)
/// </summary>
public int ChapterId { get; set; }
/// <summary>
/// 课程Id
/// </summary>
public int CourseId { get; set; }
/// <summary>
/// 章节编号
/// </summary>
public string ChapterNo { get; set; }
/// <summary>
/// 章节名称
/// </summary>
public string ChapterName { get; set; }
/// <summary>
/// 章节内容
/// </summary>
public string ChapterContent { get; set; }
/// <summary>
/// 父节点编号
/// </summary>
public int ParentId { get; set; }
/// <summary>
/// 下级列表
/// </summary>
public List<ChapterTree_ViewModel> ChildList { get; set; }
}
}
......@@ -9,6 +9,24 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public class RB_Course_Discuss_ViewModel:Model.Entity.Course.RB_Course_Discuss
{
/// <summary>
/// 创建人
/// </summary>
public string CreateByName { get; set; }
/// <summary>
/// 修改人
/// </summary>
public string UpdateByName { get; set; }
/// <summary>
/// 创建时间字符串
/// </summary>
public string CreateTimeStr { get { return Common.ConvertHelper.FormatTime(this.CreateTime); } }
/// <summary>
/// 修改时间字符串
/// </summary>
public string UpdateTimeStr { get { return Common.ConvertHelper.FormatTime(this.UpdateTime); } }
}
}
\ No newline at end of file
......@@ -12,5 +12,25 @@ namespace Edu.Model.ViewModel.Course
/// 课程编号【逗号分隔】
/// </summary>
public string CourseIds { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string CreateByName { get; set; }
/// <summary>
/// 更新人
/// </summary>
public string UpdateByName { get; set; }
/// <summary>
/// 创建时间字符串
/// </summary>
public string CreateTimeStr { get { return Common.ConvertHelper.FormatTime(this.CreateTime); } }
/// <summary>
/// 更新时间
/// </summary>
public string UpdateTimeStr { get { return Common.ConvertHelper.FormatTime(this.UpdateTime); } }
}
}
\ No newline at end of file
......@@ -9,5 +9,24 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public class RB_Course_Source_ViewModel : Model.Entity.Course.RB_Course_Source
{
/// <summary>
/// 创建人
/// </summary>
public string CreateByName { get; set; }
/// <summary>
/// 更新人
/// </summary>
public string UpdateByName { get; set; }
/// <summary>
/// 创建时间字符串
/// </summary>
public string CreateTimeStr { get { return Common.ConvertHelper.FormatTime(this.CreateTime); } }
/// <summary>
/// 修改时间字符串
/// </summary>
public string UpdateTimeStr { get { return Common.ConvertHelper.FormatTime(this.UpdateTime); } }
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@
using Edu.Model.ViewModel.Course;
using Edu.Repository.Course;
using System.Collections.Generic;
using System.Linq;
using VT.FW.DB;
namespace Edu.Module.Course
......@@ -236,7 +237,7 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool AddNoticeRevice(RB_Course_NoticeRevice_ViewModel model)
public bool AddNoticeReviceModule(RB_Course_NoticeRevice_ViewModel model)
{
var newId = noticeReviceRepository.Insert(model);
model.ReviceId = newId;
......@@ -247,6 +248,7 @@ namespace Edu.Module.Course
#region 课程章节管理
/// <summary>
/// 获取课程章节列表
/// </summary>
......@@ -257,6 +259,51 @@ namespace Edu.Module.Course
return chapterRepository.GetChapterListRepository(query);
}
/// <summary>
/// 获取课程章节树形列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<ChapterTree_ViewModel> GetChapterTreeListModule(RB_Course_Chapter_ViewModel query)
{
var list = GetChapterListModule(query);
List<ChapterTree_ViewModel> treeList = GetChapterChild(list, 0);
return treeList;
}
/// <summary>
/// 递归遍历所有章节
/// </summary>
/// <param name="sourceList">源数据</param>
/// <param name="parentId">父节点编号</param>
/// <returns></returns>
public List<ChapterTree_ViewModel> GetChapterChild(List<RB_Course_Chapter_ViewModel> sourceList,int parentId)
{
List<ChapterTree_ViewModel> resultList = new List<ChapterTree_ViewModel>();
//获取下级节点
var subList = sourceList?.Where(qItem => qItem.ParentId==parentId).OrderBy(qitem=>qitem.SortNum).ToList();
//如果存在下级节点
if (subList != null&& subList.Count>0)
{
foreach (var childItem in subList)
{
var childModel = new ChapterTree_ViewModel()
{
ChapterId = childItem.ChapterId,
ParentId = childItem.ParentId,
ChapterContent = childItem.ChapterContent,
ChapterName = childItem.ChapterName,
ChapterNo = childItem.ChapterNo,
CourseId = childItem.CourseId,
ChildList = new List<ChapterTree_ViewModel>()
};
childModel.ChildList.AddRange(GetChapterChild(sourceList, childItem.ChapterId));
resultList.Add(childModel);
}
}
return resultList;
}
/// <summary>
/// 新增修改课程章节
/// </summary>
......
......@@ -26,6 +26,8 @@ SELECT *
FROM rb_course_chapter
WHERE 1=1
");
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Course_Chapter_ViewModel.Group_Id), query.Group_Id);
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Course_Chapter_ViewModel.School_Id), query.School_Id);
if (query != null)
{
if (query.CourseId > 0)
......
......@@ -73,7 +73,6 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.Success(data: list);
}
/// <summary>
/// 添加修改问题
/// </summary>
......@@ -113,6 +112,98 @@ namespace Edu.WebApi.Controllers.Course
var flag = questionModule.RemoveQuestionModule(QuestionId);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 更新问题排序
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult UpdateQuestionSort()
{
var curQId = base.ParmJObj.GetInt("curQId", 0);
var targetQId = base.ParmJObj.GetInt("targetQId", 0);
var flag = questionModule.UpdateQuestionSortModule(curQId, targetQId);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 获取课程问题知识点列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetPointList()
{
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Question_Point_ViewModel>(RequestParm.Msg.ToString());
var list = questionModule.GetPointListModule(query);
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取知识点分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetPointPageList()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Question_Point_ViewModel>(RequestParm.Msg.ToString());
var list = questionModule.GetPointPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
if (item.CreateBy > 0)
{
item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
if (item.UpdateBy > 0)
{
item.UpdateByName = UserReidsCache.GetUserLoginInfo(item.UpdateBy)?.AccountName ?? "";
}
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 获取课程问题知识点
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetQuestionPoint()
{
var PointId = base.ParmJObj.GetInt("PointId", 0);
var extModel = questionModule.GetQuestionPointModule(PointId);
return ApiResult.Success(data: extModel);
}
/// <summary>
/// 添加修改问题知识点
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetQuestionPoint()
{
var extModel = Common.Plugin.JsonHelper.DeserializeObject<RB_Question_Point_ViewModel>(RequestParm.Msg.ToString());
extModel.CreateTime = DateTime.Now;
extModel.CreateBy = base.UserInfo.Id;
extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
bool flag = questionModule.SetQuestionPointModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 删除课程问题知识点
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveQuestionPoint()
{
var PointId = base.ParmJObj.GetInt("PointId", 0);
var flag = questionModule.RemoveQuestionPointModule(PointId);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<License>
<Data>
<LicensedTo>Aspose Scotland Team</LicensedTo>
<EmailTo>billy.lundie@aspose.com</EmailTo>
<LicenseType>Developer OEM</LicenseType>
<LicenseNote>Limited to 1 developer, unlimited physical locations</LicenseNote>
<OrderID>140408052324</OrderID>
<UserID>94236</UserID>
<OEM>This is a redistributable license</OEM>
<Products>
<Product>Aspose.Total for .NET</Product>
</Products>
<EditionType>Enterprise</EditionType>
<SerialNumber>9a59547c-41f0-428b-ba72-7c4368f151d7</SerialNumber>
<SubscriptionExpiry>20151231</SubscriptionExpiry>
<LicenseVersion>3.0</LicenseVersion>
<LicenseInstructions>http://www.aspose.com/corporate/purchase/license-instructions.aspx</LicenseInstructions>
</Data>
<Signature>FO3PHsblgDt8F59sMT1l1amyi9qk2V6E8dQkIP7LdTJSxDibNEFu1zOinQbqFfKv/ruttvcxoROkc1tUe0DtO6cP1Zf6J0VemgSY8i/LZECTGszRqJVQRZ0MoVnBhuPAJk5eli7fhVcF8hWd3E4XQ3LzfmJCuaj2NEteRi5Hrfg=</Signature>
</License>
\ No newline at end of file
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