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
b642eb08
Commit
b642eb08
authored
Feb 18, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
95479c92
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
4 deletions
+29
-4
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+19
-4
RB_Course_ChapterRepository.cs
Edu.Repository/Course/RB_Course_ChapterRepository.cs
+10
-0
No files found.
Edu.Module.Course/CourseModule.cs
View file @
b642eb08
...
...
@@ -1093,14 +1093,19 @@ namespace Edu.Module.Course
/// </summary>
public
void
RunCourseChapterModule
()
{
var
courseList
=
c
ourseRepository
.
GetCourseListRepository
(
new
RB_Course_ViewModel
()
{
QCourseIds
=
"97"
}
);
var
courseList
=
c
hapterRepository
.
GetCourseChapterListExtRepository
(
);
if
(
courseList
!=
null
&&
courseList
.
Count
>
0
)
{
foreach
(
var
item
in
courseList
)
{
//if (item.CourseId != 97)
//{
// continue;
//}
List
<
RB_Course_Chapter_ViewModel
>
result
=
new
List
<
RB_Course_Chapter_ViewModel
>();
var
sourceList
=
GetChapterListModule
(
new
RB_Course_Chapter_ViewModel
()
{
CourseId
=
item
.
CourseId
});
var
treeList
=
GetChapterTreeListModule
(
new
RB_Course_Chapter_ViewModel
()
{
CourseId
=
item
.
CourseId
});
var
chapterQuery
=
new
RB_Course_Chapter_ViewModel
()
{
CourseId
=
item
.
CourseId
};
var
sourceList
=
GetChapterListModule
(
chapterQuery
);
var
treeList
=
GetChapterTreeListModule
(
chapterQuery
);
if
(
treeList
!=
null
&&
treeList
.
Count
>
0
)
{
foreach
(
var
tItem
in
treeList
)
...
...
@@ -1140,7 +1145,12 @@ namespace Edu.Module.Course
int
index
=
1
;
foreach
(
var
sItem
in
result
)
{
sItem
.
SortNum
=
index
;
sItem
.
ChapterNo
=
index
.
ToString
();
string
pattern
=
@"第[一二三四五六七八九十]次课"
;
string
newStr
=
Regex
.
Replace
(
sItem
.
ChapterName
,
pattern
,
""
);
string
newTitle
=
string
.
Format
(
"第{0}次课"
,
new
WordToNumHelper
().
NumToChinese
(
index
.
ToString
()))
+
" "
+
newStr
.
Trim
();
sItem
.
ChapterName
=
newTitle
;
index
++;
}
chapterRepository
.
DeleteByCourseIdRepository
(
item
.
CourseId
);
...
...
@@ -1169,7 +1179,12 @@ namespace Edu.Module.Course
var
tempModel
=
sourceList
?.
Where
(
qitem
=>
qitem
.
ChapterId
==
subItem
.
ChapterId
)?.
FirstOrDefault
();
if
(
tempModel
!=
null
)
{
tempModel
.
ChapterName
=
item
.
ChapterName
+
" "
+
tempModel
.
ChapterName
;
string
newName
=
item
.
ChapterName
+
" "
+
tempModel
.
ChapterName
;
string
pattern
=
@"第[一二三四五六七八九十]*次课"
;
newName
=
Regex
.
Replace
(
newName
,
pattern
,
""
);
string
pattern2
=
@"第[一二三四五六七八九十]*课"
;
newName
=
Regex
.
Replace
(
newName
,
pattern2
,
""
);
tempModel
.
ChapterName
=
newName
;
tempModel
.
StudyHours
=
2
;
tempModel
.
StudyMinutes
=
90
;
tempModel
.
ParentId
=
0
;
...
...
Edu.Repository/Course/RB_Course_ChapterRepository.cs
View file @
b642eb08
...
...
@@ -46,6 +46,16 @@ namespace Edu.Repository.Course
return
Get
<
RB_Course_Chapter_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
/// <summary>
/// 获取有章节的课程编号
/// </summary>
/// <returns></returns>
public
List
<
RB_Course_Chapter_ViewModel
>
GetCourseChapterListExtRepository
()
{
string
sql
=
" SELECT DISTINCT CourseId FROM rb_course_chapter WHERE Status=0 ORDER BY CourseId "
;
return
Get
<
RB_Course_Chapter_ViewModel
>(
sql
).
ToList
();
}
/// <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