Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
ed25431a
Commit
ed25431a
authored
Sep 09, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
971ee6f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
22 deletions
+104
-22
CourseChapterHelper.cs
Edu.Common/Data/CourseChapterHelper.cs
+4
-0
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+22
-22
LoginController.cs
Edu.WebApi/Controllers/User/LoginController.cs
+78
-0
No files found.
Edu.Common/Data/CourseChapterHelper.cs
View file @
ed25431a
...
@@ -52,6 +52,10 @@ namespace Edu.Common.Data
...
@@ -52,6 +52,10 @@ namespace Edu.Common.Data
{
{
model
.
ChapterContent
=
dr
[
"内容"
].
ToString
();
model
.
ChapterContent
=
dr
[
"内容"
].
ToString
();
}
}
if
(
dr
.
Table
.
Columns
.
Contains
(
"章节标题"
)
&&
!
string
.
IsNullOrEmpty
(
dr
[
"章节标题"
].
ToString
()))
{
model
.
ChapterContent
=
dr
[
"章节标题"
].
ToString
();
}
if
(
dr
.
Table
.
Columns
.
Contains
(
"时长"
)
&&
!
string
.
IsNullOrEmpty
(
dr
[
"时长"
].
ToString
()))
if
(
dr
.
Table
.
Columns
.
Contains
(
"时长"
)
&&
!
string
.
IsNullOrEmpty
(
dr
[
"时长"
].
ToString
()))
{
{
model
.
StudyHours
=
2
;
model
.
StudyHours
=
2
;
...
...
Edu.Module.Course/CourseModule.cs
View file @
ed25431a
...
@@ -1076,28 +1076,28 @@ namespace Edu.Module.Course
...
@@ -1076,28 +1076,28 @@ namespace Edu.Module.Course
public
void
RunWordsUrlModule
(
List
<
RB_Course_Chapter_ViewModel
>
n5CourseList
,
List
<
RB_Course_Chapter_ViewModel
>
n4CourseList
,
List
<
RB_Course_Chapter_ViewModel
>
n3CourseList
)
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
wordsList
=
course_WordsRepository
.
GetCourseWordsListRepository
(
new
RB_Course_Words_Extend
()
{
CourseId
=
1
});
var
n5WordsList
=
wordsList
.
Where
(
qitem
=>
qitem
.
ChapterId
<
43
).
ToList
();
//
var n5WordsList = wordsList.Where(qitem => qitem.ChapterId < 43).ToList();
int
n5ChapterId
=
6
;
//
int n5ChapterId = 6;
var
tempN5Words
=
n5WordsList
.
GroupBy
(
qitem
=>
new
{
qitem
.
ChapterId
}).
OrderBy
(
qitem
=>
qitem
.
Key
.
ChapterId
).
Select
(
qitem
=>
new
{
qitem
.
Key
.
ChapterId
});
//
var tempN5Words = n5WordsList.GroupBy(qitem => new { qitem.ChapterId }).OrderBy(qitem=>qitem.Key.ChapterId).Select(qitem => new { qitem.Key.ChapterId });
foreach
(
var
item
in
tempN5Words
)
//
foreach (var item in tempN5Words)
{
//
{
var
tempList
=
n5WordsList
.
Where
(
qitem
=>
qitem
.
ChapterId
==
item
.
ChapterId
).
ToList
();
//
var tempList = n5WordsList.Where(qitem => qitem.ChapterId == item.ChapterId).ToList();
foreach
(
var
subItem
in
tempList
)
//
foreach (var subItem in tempList)
{
//
{
subItem
.
CourseId
=
n5CourseList
.
FirstOrDefault
().
CourseId
;
//
subItem.CourseId = n5CourseList.FirstOrDefault().CourseId;
subItem
.
ChapterId
=
n5ChapterId
;
//
subItem.ChapterId = n5ChapterId;
}
//
}
n5ChapterId
++;
//
n5ChapterId++;
}
//
}
if
(
n5CourseList
!=
null
&&
n5CourseList
.
Count
>
0
)
//
if (n5CourseList != null && n5CourseList.Count > 0)
{
//
{
chapterRepository
.
SetBatchInsertCourseChapterRepository
(
n5CourseList
);
//
chapterRepository.SetBatchInsertCourseChapterRepository(n5CourseList);
}
//
}
if
(
n5WordsList
!=
null
&&
n5WordsList
.
Count
>
0
)
//
if (n5WordsList != null && n5WordsList.Count > 0)
{
//
{
course_WordsRepository
.
BatchInsertCourseWordsRepository
(
n5WordsList
);
//
course_WordsRepository.BatchInsertCourseWordsRepository(n5WordsList);
}
//
}
var
n4WordsList
=
wordsList
.
Where
(
qitem
=>
qitem
.
ChapterId
>=
43
&&
qitem
.
ChapterId
<
79
).
ToList
();
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
});
var
tempN4Words
=
n4WordsList
.
GroupBy
(
qitem
=>
new
{
qitem
.
ChapterId
}).
OrderBy
(
qitem
=>
qitem
.
Key
.
ChapterId
).
Select
(
qitem
=>
new
{
qitem
.
Key
.
ChapterId
});
...
...
Edu.WebApi/Controllers/User/LoginController.cs
View file @
ed25431a
...
@@ -4,6 +4,7 @@ using Edu.Common.API;
...
@@ -4,6 +4,7 @@ using Edu.Common.API;
using
Edu.Common.Enum.User
;
using
Edu.Common.Enum.User
;
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
using
Edu.Model.CacheModel
;
using
Edu.Model.CacheModel
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.System
;
using
Edu.Model.ViewModel.System
;
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.User
;
using
Edu.Module.Course
;
using
Edu.Module.Course
;
...
@@ -53,6 +54,8 @@ namespace Edu.WebApi.Controllers.User
...
@@ -53,6 +54,8 @@ namespace Edu.WebApi.Controllers.User
/// 部门处理类对象
/// 部门处理类对象
/// </summary>
/// </summary>
private
readonly
DepartmentModule
departmentModule
=
new
DepartmentModule
();
private
readonly
DepartmentModule
departmentModule
=
new
DepartmentModule
();
private
readonly
CourseModule
courseModule
=
new
CourseModule
();
[
HttpGet
]
[
HttpGet
]
...
@@ -60,9 +63,84 @@ namespace Edu.WebApi.Controllers.User
...
@@ -60,9 +63,84 @@ namespace Edu.WebApi.Controllers.User
[
AllowAnonymous
]
[
AllowAnonymous
]
public
ApiResult
Test
()
public
ApiResult
Test
()
{
{
TestMethod
();
return
ApiResult
.
Success
();
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>
/// 用户登录
/// 用户登录
/// </summary>
/// </summary>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment