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
abdc31b7
Commit
abdc31b7
authored
May 06, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
67213dd1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
32 deletions
+34
-32
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+16
-22
RB_Course_ChapterRepository.cs
Edu.Repository/Course/RB_Course_ChapterRepository.cs
+17
-8
CourseController.cs
Edu.WebApi/Controllers/Course/CourseController.cs
+0
-1
TimerJobj.cs
Edu.WebApi/Timers/TimerJobj.cs
+1
-1
No files found.
Edu.Module.Course/CourseModule.cs
View file @
abdc31b7
...
...
@@ -881,8 +881,10 @@ namespace Edu.Module.Course
oldCourseRate
=
chapterRepository
.
GetEntity
(
model
.
ChapterId
)?.
CourseRate
??
Common
.
Enum
.
Course
.
CourseRateEnum
.
OTHER
;
}
flag
=
chapterRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_Chapter_ViewModel
.
ChapterId
),
model
.
ChapterId
));
if
(
flag
&&
model
.
ParentId
==
0
)
{
if
(
oldCourseRate
!=
model
.
CourseRate
)
{
if
(
flag
&&
model
.
ParentId
==
0
)
{
if
(
oldCourseRate
!=
model
.
CourseRate
)
{
//修改了等级了 重新初始化
System
.
Threading
.
Tasks
.
Task
.
Run
(()
=>
{
...
...
@@ -893,7 +895,8 @@ namespace Edu.Module.Course
}
else
{
if
(
model
.
ParentId
==
0
)
{
if
(
model
.
ParentId
==
0
)
{
//查询当前等级对应的NO
int
CourseGradeId
=
chapterRepository
.
GetMaxChapterGradeNo
(
model
.
CourseId
,
model
.
ChapterNo
,
model
.
CourseRate
,
model
.
Group_Id
);
model
.
ChapterGradeNo
=
CourseGradeId
+
1
;
...
...
@@ -1073,18 +1076,9 @@ namespace Edu.Module.Course
var
courseList
=
chapterRepository
.
GetCourseChapterListExtRepository
();
if
(
courseList
!=
null
&&
courseList
.
Count
>
0
)
{
foreach
(
var
item
in
courseList
)
var
tempCourseList
=
courseList
.
Where
(
qitem
=>
qitem
.
CourseId
==
58
||
qitem
.
CourseId
==
10
);
foreach
(
var
item
in
tempCourseList
)
{
//if (item.CourseId == 285 || item.CourseId == 215 )
//{
// continue;
//}
//else
//{
//}
List
<
RB_Course_Chapter_ViewModel
>
result
=
new
List
<
RB_Course_Chapter_ViewModel
>();
var
chapterQuery
=
new
RB_Course_Chapter_ViewModel
()
{
CourseId
=
item
.
CourseId
};
var
sourceList
=
GetChapterListModule
(
chapterQuery
,
isQueryWords
:
true
);
...
...
@@ -1147,14 +1141,14 @@ namespace Edu.Module.Course
}
index
++;
}
chapterRepository
.
DeleteByCourseIdRepository
(
item
.
CourseId
);
course_WordsRepository
.
DeleteWordsByCourseIdRepository
(
item
.
CourseId
);
chapterRepository
.
SetBatchInsertCourseChapterRepository
(
result
);
if
(
wordsList
!=
null
&&
wordsList
.
Count
>
0
)
{
course_WordsRepository
.
BatchInsertCourseWordsRepository
(
wordsList
);
}
//
chapterRepository.DeleteByCourseIdRepository(item.CourseId);
//
course_WordsRepository.DeleteWordsByCourseIdRepository(item.CourseId);
//
chapterRepository.SetBatchInsertCourseChapterRepository(result);
//
if (wordsList != null && wordsList.Count > 0)
//
{
//
course_WordsRepository.BatchInsertCourseWordsRepository(wordsList);
//
}
}
string
str
=
Common
.
Plugin
.
JsonHelper
.
Serialize
(
result
);
}
...
...
Edu.Repository/Course/RB_Course_ChapterRepository.cs
View file @
abdc31b7
...
...
@@ -128,15 +128,24 @@ namespace Edu.Repository.Course
/// <returns></returns>
public
bool
SetBatchCurrentHoursRepository
(
List
<
RB_Course_Chapter_ViewModel
>
param
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
"INSERT INTO rb_course_chapter (ChapterId, CurrentHours) VALUES"
);
param
.
ForEach
(
x
=>
bool
flag
=
false
;
try
{
builder
.
Append
(
$"(
{
x
.
ChapterId
}
,'
{
x
.
CurrentHours
}
'),"
);
});
builder
=
builder
.
Remove
(
builder
.
Length
-
1
,
1
);
builder
.
Append
(
"ON DUPLICATE KEY UPDATE CurrentHours=VALUES(CurrentHours);"
);
return
Execute
(
builder
.
ToString
())
>
0
;
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
"INSERT INTO rb_course_chapter (ChapterId, CurrentHours) VALUES"
);
param
.
ForEach
(
x
=>
{
builder
.
Append
(
$"(
{
x
.
ChapterId
}
,'
{
x
.
CurrentHours
}
'),"
);
});
builder
=
builder
.
Remove
(
builder
.
Length
-
1
,
1
);
builder
.
Append
(
"ON DUPLICATE KEY UPDATE CurrentHours=VALUES(CurrentHours);"
);
flag
=
Execute
(
builder
.
ToString
())
>
0
;
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"SetBatchCurrentHoursRepository"
);
}
return
flag
;
}
/// <summary>
...
...
Edu.WebApi/Controllers/Course/CourseController.cs
View file @
abdc31b7
...
...
@@ -671,7 +671,6 @@ namespace Edu.WebApi.Controllers.Course
Objectives
=
base
.
ParmJObj
.
GetStringValue
(
"Objectives"
),
Requirement
=
base
.
ParmJObj
.
GetStringValue
(
"Requirement"
),
CourseRate
=
(
CourseRateEnum
)
base
.
ParmJObj
.
GetInt
(
"CourseRate"
),
//CurrentHours=base.ParmJObj.GetInt("CurrentHours"),
};
extModel
.
Status
=
DateStateEnum
.
Normal
;
...
...
Edu.WebApi/Timers/TimerJobj.cs
View file @
abdc31b7
...
...
@@ -147,7 +147,7 @@ namespace Edu.WebApi.Timers
marketTimer
=
new
System
.
Timers
.
Timer
()
{
Interval
=
(
1000
*
60
)
*
(
60
*
1
)
//5
分钟执行一次
Interval
=
(
1000
*
60
)
*
(
20
)
//20
分钟执行一次
};
marketTimer
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
DealMarketConsultantData
);
marketTimer
.
Enabled
=
true
;
...
...
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