Commit 5eae33fe authored by 黄奎's avatar 黄奎

页面修改

parent d6ad33c8
......@@ -1070,83 +1070,6 @@ namespace Edu.Module.Course
}
/// <summary>
/// 重新更新课程单词URL
/// </summary>
public void RunWordsUrlModule(List<RB_Course_Chapter_ViewModel> n5CourseList, List<RB_Course_Chapter_ViewModel> n4CourseList, List<RB_Course_Chapter_ViewModel> n3CourseList)
{
var wordsList = course_WordsRepository.GetCourseWordsListRepository(new RB_Course_Words_Extend() {CourseId=1 });
//var n5WordsList = wordsList.Where(qitem => qitem.ChapterId < 43).ToList();
//int n5ChapterId = 6;
//var tempN5Words = n5WordsList.GroupBy(qitem => new { qitem.ChapterId }).OrderBy(qitem=>qitem.Key.ChapterId).Select(qitem => new { qitem.Key.ChapterId });
//foreach (var item in tempN5Words)
//{
// var tempList = n5WordsList.Where(qitem => qitem.ChapterId == item.ChapterId).ToList();
// foreach (var subItem in tempList)
// {
// subItem.CourseId = n5CourseList.FirstOrDefault().CourseId;
// subItem.ChapterId = n5ChapterId;
// }
// n5ChapterId++;
//}
//if (n5CourseList != null && n5CourseList.Count > 0)
//{
// chapterRepository.SetBatchInsertCourseChapterRepository(n5CourseList);
//}
//if (n5WordsList != null && n5WordsList.Count > 0)
//{
// course_WordsRepository.BatchInsertCourseWordsRepository(n5WordsList);
//}
var n4WordsList = wordsList.Where(qitem => qitem.ChapterId >= 43 && qitem.ChapterId<79).ToList();
var tempN4Words = n4WordsList.GroupBy(qitem => new { qitem.ChapterId }).OrderBy(qitem => qitem.Key.ChapterId).Select(qitem => new { qitem.Key.ChapterId });
int n4ChapterId = 1;
foreach (var item in tempN4Words)
{
var tempList = n4WordsList.Where(qitem => qitem.ChapterId == item.ChapterId).ToList();
foreach (var subItem in tempList)
{
subItem.CourseId = n4CourseList.FirstOrDefault().CourseId;
subItem.ChapterId = n4ChapterId;
}
n4ChapterId++;
}
if (n4CourseList != null && n4CourseList.Count > 0)
{
chapterRepository.SetBatchInsertCourseChapterRepository(n4CourseList);
}
if (n4WordsList != null && n4WordsList.Count > 0)
{
course_WordsRepository.BatchInsertCourseWordsRepository(n4WordsList);
}
var n3WordsList = wordsList.Where(qitem => qitem.ChapterId >= 79).ToList();
var tempN3Words = n3WordsList.GroupBy(qitem => new { qitem.ChapterId }).OrderBy(qitem => qitem.Key.ChapterId).Select(qitem => new { qitem.Key.ChapterId });
int n3ChapterId = 1;
foreach (var item in tempN3Words)
{
var tempList = n3WordsList.Where(qitem => qitem.ChapterId == item.ChapterId).ToList();
foreach (var subItem in tempList)
{
subItem.CourseId = n3CourseList.FirstOrDefault().CourseId;
subItem.ChapterId = n3ChapterId;
}
n3ChapterId++;
}
if (n3CourseList != null && n3CourseList.Count > 0)
{
chapterRepository.SetBatchInsertCourseChapterRepository(n3CourseList);
}
if (n3WordsList != null && n3WordsList.Count > 0)
{
course_WordsRepository.BatchInsertCourseWordsRepository(n3WordsList);
}
string str = "";
}
/// <summary>
/// 获取课程章节列表
/// </summary>
......
......@@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>
<ItemGroup>
......
......@@ -1255,6 +1255,7 @@ namespace Edu.WebApi.Controllers.Course
/// <returns></returns>
[HttpPost]
[Obsolete]
public FileContentResult DownLoadStuLearnChapterStatic()
{
var userInfo = base.UserInfo;
......
......@@ -54,10 +54,7 @@ namespace Edu.WebApi.Controllers.User
/// 部门处理类对象
/// </summary>
private readonly DepartmentModule departmentModule = new DepartmentModule();
private readonly CourseModule courseModule = new CourseModule();
[HttpGet]
[HttpPost]
[AllowAnonymous]
......@@ -66,81 +63,7 @@ namespace Edu.WebApi.Controllers.User
new OrderModule().GetClassNameList("1337");
return ApiResult.Success();
}
private void TestMethod()
{
var n4File = @"G:/HKFile/n4.xlsx";
var n3File = @"G:/HKFile/n3.xlsx";
List<RB_Course_Chapter_ViewModel> n4ChapterList = new List<RB_Course_Chapter_ViewModel>();
List<RB_Course_Chapter_ViewModel> n3ChapterList = new List<RB_Course_Chapter_ViewModel>();
var n4List = Common.Data.CourseChapterHelper.GetXlsCourseChapterData(n4File);
int n4ChapterNo = 1;
foreach (var item in n4List)
{
n4ChapterList.Add(new RB_Course_Chapter_ViewModel()
{
ChapterId=0,
CourseId=332,
ChapterNo= n4ChapterNo.ToString(),
ChapterName=item.ChapterName,
ChapterContent=System.Web.HttpUtility.UrlEncode(item.ChapterContent),
ParentId=0,
OpenStatus=1,
CreateBy=1,
CreateTime=DateTime.Now,
UpdateBy=1,
UpdateTime=DateTime.Now,
Progress=0,
Status=0,
Group_Id=100000,
SortNum= n4ChapterNo,
StudyHours=item.StudyHours,
StudyMinutes=item.StudyMinutes,
Objectives="",
Requirement="",
CourseRate= Common.Enum.Course.CourseRateEnum.N4,
CurrentHours=(n4ChapterNo-1)*2,
ChapterGradeNo= n4ChapterNo,
});
n4ChapterNo++;
}
var n3List = Common.Data.CourseChapterHelper.GetXlsCourseChapterData(n3File);
int n3ChapterNo = 1;
foreach (var item in n3List)
{
n3ChapterList.Add(new RB_Course_Chapter_ViewModel()
{
ChapterId = 0,
CourseId = 333,
ChapterNo = n3ChapterNo.ToString(),
ChapterName = item.ChapterName,
ChapterContent = System.Web.HttpUtility.UrlEncode(item.ChapterContent),
ParentId = 0,
OpenStatus = 1,
CreateBy = 1,
CreateTime = DateTime.Now,
UpdateBy = 1,
UpdateTime = DateTime.Now,
Progress = 0,
Status = 0,
Group_Id = 100000,
SortNum = n3ChapterNo,
StudyHours = item.StudyHours,
StudyMinutes = item.StudyMinutes,
Objectives = "",
Requirement = "",
CourseRate = Common.Enum.Course.CourseRateEnum.N3,
CurrentHours = (n3ChapterNo - 1) * 2,
ChapterGradeNo = n3ChapterNo,
});
n3ChapterNo++;
}
courseModule.RunWordsUrlModule(new List<Model.ViewModel.Course.RB_Course_Chapter_ViewModel>(), n4ChapterList, n3ChapterList);
}
/// <summary>
/// 用户登录
/// </summary>
......
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