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
733c02d8
Commit
733c02d8
authored
Jan 07, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
bbdd75b8
b5e9eae8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
6 deletions
+78
-6
RB_Course_Words_Extend.cs
Edu.Model/ViewModel/Course/RB_Course_Words_Extend.cs
+5
-0
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+2
-1
VisitorReserveModule.cs
Edu.Module.Duty/VisitorReserveModule.cs
+5
-5
CourseExamModule.cs
Edu.Module.Exam/CourseExamModule.cs
+58
-0
RB_Course_WordsRepository.cs
Edu.Repository/Course/RB_Course_WordsRepository.cs
+8
-0
No files found.
Edu.Model/ViewModel/Course/RB_Course_Words_Extend.cs
View file @
733c02d8
...
@@ -14,5 +14,10 @@ namespace Edu.Model.ViewModel.Course
...
@@ -14,5 +14,10 @@ namespace Edu.Model.ViewModel.Course
/// 课程编号
/// 课程编号
/// </summary>
/// </summary>
public
string
QCourseIds
{
get
;
set
;
}
public
string
QCourseIds
{
get
;
set
;
}
/// <summary>
/// 章节编号
/// </summary>
public
string
QChapterIds
{
get
;
set
;
}
}
}
}
}
Edu.Module.Course/ClassModule.cs
View file @
733c02d8
...
@@ -4155,9 +4155,10 @@ namespace Edu.Module.Course
...
@@ -4155,9 +4155,10 @@ namespace Edu.Module.Course
foreach
(
var
subItem
in
tempList
)
foreach
(
var
subItem
in
tempList
)
{
{
var
tempTimeList
=
timeList
?.
Where
(
qitem
=>
qitem
.
ClassPlanId
==
subItem
.
ClassPlanId
)?.
ToList
()?.
OrderBy
(
qitem
=>
qitem
.
StartTime
);
var
tempTimeList
=
timeList
?.
Where
(
qitem
=>
qitem
.
ClassPlanId
==
subItem
.
ClassPlanId
)?.
ToList
()?.
OrderBy
(
qitem
=>
qitem
.
StartTime
);
var
currentDate
=
Common
.
ConvertHelper
.
FormatDate
(
ClassDate
)
+
" "
+
(
tempTimeList
?.
FirstOrDefault
()?.
StartTime
??
""
);
foreach
(
var
item
in
tempTimeList
)
foreach
(
var
item
in
tempTimeList
)
{
{
var
currentDate
=
Common
.
ConvertHelper
.
FormatDate
(
ClassDate
)
+
" "
+
(
item
?.
StartTime
??
""
);
var
tempTimeGuestList
=
new
List
<
RB_Order_Guest_ViewModel
>();
var
tempTimeGuestList
=
new
List
<
RB_Order_Guest_ViewModel
>();
tempTimeGuestList
.
AddRange
(
guestList
.
Where
(
qitem
=>
qitem
.
ClassId
==
subItem
.
ClassId
&&
(
qitem
.
GuestState
==
GuestStateEnum
.
Normal
||
qitem
.
GuestState
==
GuestStateEnum
.
StopClassesApplyIng
||
((
qitem
.
GuestState
==
GuestStateEnum
.
StopClasses
||
qitem
.
GuestState
==
GuestStateEnum
.
Graduate
)
&&
qitem
.
ChangeEffectTime
.
HasValue
&&
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
qitem
.
ChangeEffectTime
))
>=
subItem
.
ClassDate
))));
tempTimeGuestList
.
AddRange
(
guestList
.
Where
(
qitem
=>
qitem
.
ClassId
==
subItem
.
ClassId
&&
(
qitem
.
GuestState
==
GuestStateEnum
.
Normal
||
qitem
.
GuestState
==
GuestStateEnum
.
StopClassesApplyIng
||
((
qitem
.
GuestState
==
GuestStateEnum
.
StopClasses
||
qitem
.
GuestState
==
GuestStateEnum
.
Graduate
)
&&
qitem
.
ChangeEffectTime
.
HasValue
&&
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
qitem
.
ChangeEffectTime
))
>=
subItem
.
ClassDate
))));
tempTimeGuestList
.
AddRange
(
tempGuestList
.
Where
(
qitem
=>
qitem
.
ClassId
==
subItem
.
ClassId
&&
item
.
ClassTimeId
==
qitem
.
ClassTimeId
&&
(
qitem
.
GuestState
==
GuestStateEnum
.
Normal
||
qitem
.
GuestState
==
GuestStateEnum
.
StopClassesApplyIng
||
((
qitem
.
GuestState
==
GuestStateEnum
.
StopClasses
||
qitem
.
GuestState
==
GuestStateEnum
.
Graduate
)
&&
qitem
.
ChangeEffectTime
.
HasValue
&&
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
qitem
.
ChangeEffectTime
))
>=
subItem
.
ClassDate
))));
tempTimeGuestList
.
AddRange
(
tempGuestList
.
Where
(
qitem
=>
qitem
.
ClassId
==
subItem
.
ClassId
&&
item
.
ClassTimeId
==
qitem
.
ClassTimeId
&&
(
qitem
.
GuestState
==
GuestStateEnum
.
Normal
||
qitem
.
GuestState
==
GuestStateEnum
.
StopClassesApplyIng
||
((
qitem
.
GuestState
==
GuestStateEnum
.
StopClasses
||
qitem
.
GuestState
==
GuestStateEnum
.
Graduate
)
&&
qitem
.
ChangeEffectTime
.
HasValue
&&
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
qitem
.
ChangeEffectTime
))
>=
subItem
.
ClassDate
))));
...
...
Edu.Module.Duty/VisitorReserveModule.cs
View file @
733c02d8
...
@@ -333,7 +333,7 @@ namespace Edu.Module.Duty
...
@@ -333,7 +333,7 @@ namespace Edu.Module.Duty
#
endregion
#
endregion
#
region
验证教室
#
region
验证教室
if
(
CheckClassRoomModule
(
chooseDateTime
,
chooseEndTime
,
model
,
out
string
roomMessage
))
if
(
CheckClassRoomModule
(
chooseDateTime
,
chooseEndTime
,
model
,
out
string
roomMessage
))
{
{
message
=
roomMessage
;
message
=
roomMessage
;
return
false
;
return
false
;
...
@@ -455,7 +455,7 @@ namespace Edu.Module.Duty
...
@@ -455,7 +455,7 @@ namespace Edu.Module.Duty
var
endTime
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
item
.
ClassDate
)
+
" "
+
item
.
EndTime
);
var
endTime
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
item
.
ClassDate
)
+
" "
+
item
.
EndTime
);
if
(
chooseDateTime
<
endTime
&&
chooseEndTime
>
startTime
)
if
(
chooseDateTime
<
endTime
&&
chooseEndTime
>
startTime
)
{
{
message
=
string
.
Format
(
"此教师已有
{0}的正常上课计划!请重新选择时间"
,
Common
.
ConvertHelper
.
FormatDate
(
chooseDateTime
)
);
message
=
string
.
Format
(
"此教师已有
{0} {1}-{2}【{3}】正常上课计划!请重新选择时间"
,
Common
.
ConvertHelper
.
FormatDate
(
model
.
ClassDate
),
item
.
StartTime
,
item
.
EndTime
,
item
.
ClassName
);
return
true
;
return
true
;
}
}
}
}
...
@@ -470,7 +470,7 @@ namespace Edu.Module.Duty
...
@@ -470,7 +470,7 @@ namespace Edu.Module.Duty
};
};
if
(
CheckReserveClassExistsModule
(
checkModel
))
if
(
CheckReserveClassExistsModule
(
checkModel
))
{
{
message
=
string
.
Format
(
"此教师已有
{0}的试听课计划!请重新选择时间"
,
Common
.
ConvertHelper
.
FormatDate
(
chooseDateTime
)
);
message
=
string
.
Format
(
"此教师已有
{0} {1}-{2} 试听课计划!请重新选择时间"
,
Common
.
ConvertHelper
.
FormatDate
(
model
.
ClassDate
),
model
.
ClassTime
,
model
.
EndTime
);
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
@@ -502,7 +502,7 @@ namespace Edu.Module.Duty
...
@@ -502,7 +502,7 @@ namespace Edu.Module.Duty
var
endTime
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
item
.
ClassDate
)
+
" "
+
item
.
EndTime
);
var
endTime
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
item
.
ClassDate
)
+
" "
+
item
.
EndTime
);
if
(
chooseDateTime
<
endTime
&&
chooseEndTime
>
startTime
)
if
(
chooseDateTime
<
endTime
&&
chooseEndTime
>
startTime
)
{
{
RoomMessage
=
string
.
Format
(
"此教室已有
{0}的正常上课计划!请重新选择时间"
,
Common
.
ConvertHelper
.
FormatDate
(
chooseDateTime
)
);
RoomMessage
=
string
.
Format
(
"此教室已有
{0} {1}-{2}【{3}】正常上课计划!请重新选择时间"
,
Common
.
ConvertHelper
.
FormatDate
(
model
.
ClassDate
),
item
.
StartTime
,
item
.
EndTime
,
item
.
ClassName
);
return
true
;
return
true
;
}
}
}
}
...
@@ -517,7 +517,7 @@ namespace Edu.Module.Duty
...
@@ -517,7 +517,7 @@ namespace Edu.Module.Duty
};
};
if
(
CheckReserveClassExistsModule
(
checkModel
))
if
(
CheckReserveClassExistsModule
(
checkModel
))
{
{
RoomMessage
=
string
.
Format
(
"此教室已有
{0}的试听课计划!请重新选择时间"
,
Common
.
ConvertHelper
.
FormatDate
(
chooseDateTime
)
);
RoomMessage
=
string
.
Format
(
"此教室已有
{0} {1}-{2} 试听课计划!请重新选择时间"
,
Common
.
ConvertHelper
.
FormatDate
(
model
.
ClassDate
),
model
.
ClassTime
,
model
.
EndTime
);
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
Edu.Module.Exam/CourseExamModule.cs
0 → 100644
View file @
733c02d8
using
Edu.Model.ViewModel.Course
;
using
Edu.Repository.Course
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Linq
;
namespace
Edu.Module.Exam
{
/// <summary>
/// 课程预习测试处理类
/// </summary>
public
class
CourseExamModule
{
/// <summary>
/// 课程章节单词处理类对象
/// </summary>
private
readonly
RB_Course_WordsRepository
course_WordsRepository
=
new
RB_Course_WordsRepository
();
/// <summary>
/// 生成课程复习和预习单词
/// </summary>
/// <param name="CourseId"></param>
/// <param name="ChapterId"></param>
/// <param name="NextChapterId"></param>
/// <returns></returns>
public
object
CreateCourseExam
(
int
CourseId
,
int
ChapterId
,
int
NextChapterId
)
{
object
result
=
new
object
();
var
list
=
course_WordsRepository
.
GetCourseWordsListRepository
(
new
RB_Course_Words_Extend
()
{
CourseId
=
CourseId
,
QChapterIds
=
ChapterId
+
","
+
NextChapterId
});
var
reviewList
=
list
?.
Where
(
qitem
=>
qitem
.
ChapterId
==
ChapterId
)?.
OrderBy
(
qitem
=>
Guid
.
NewGuid
())?.
ToList
();
var
prepList
=
list
?.
Where
(
qitem
=>
qitem
.
ChapterId
==
NextChapterId
)?.
OrderBy
(
qitem
=>
Guid
.
NewGuid
())?.
ToList
();
if
(
reviewList
!=
null
&&
reviewList
.
Count
>
0
)
{
for
(
var
i
=
0
;
i
<
reviewList
.
Count
;
i
++)
{
//选择题
if
(
i
%
2
==
0
)
{
}
}
}
if
(
prepList
!=
null
&&
prepList
.
Count
>
0
)
{
}
return
result
;
}
}
}
Edu.Repository/Course/RB_Course_WordsRepository.cs
View file @
733c02d8
...
@@ -78,6 +78,14 @@ WHERE 1=1
...
@@ -78,6 +78,14 @@ WHERE 1=1
{
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Course_Words_Extend
.
CourseId
),
query
.
QCourseIds
);
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Course_Words_Extend
.
CourseId
),
query
.
QCourseIds
);
}
}
if
(
query
.
ChapterId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_Words_Extend
.
ChapterId
),
query
.
ChapterId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QChapterIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Course_Words_Extend
.
ChapterId
),
query
.
QChapterIds
);
}
}
}
return
Get
<
RB_Course_Words_Extend
>(
builder
.
ToString
()).
ToList
();
return
Get
<
RB_Course_Words_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
...
...
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