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
d0fb315d
Commit
d0fb315d
authored
3 years ago
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
a7752df6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
146 additions
and
2 deletions
+146
-2
RB_Examination_Student.cs
Edu.Model/Entity/Exam/RB_Examination_Student.cs
+26
-1
RB_Examination_Publish_ViewModel.cs
Edu.Model/ViewModel/Exam/RB_Examination_Publish_ViewModel.cs
+4
-1
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+2
-0
PaperModule.cs
Edu.Module.Exam/PaperModule.cs
+52
-0
RB_Examination_StudentRepository.cs
Edu.Repository/Exam/RB_Examination_StudentRepository.cs
+57
-0
ExamController.cs
Edu.WebApi/Controllers/Exam/ExamController.cs
+5
-0
No files found.
Edu.Model/Entity/Exam/RB_Examination_Student.cs
View file @
d0fb315d
...
@@ -45,6 +45,31 @@ namespace Edu.Model.Entity.Exam
...
@@ -45,6 +45,31 @@ namespace Edu.Model.Entity.Exam
/// <summary>
/// <summary>
/// 课程编号
/// 课程编号
/// </summary>
/// </summary>
public
int
?
CourseId
{
get
;
set
;
}
public
int
CourseId
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 集团编号
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
/// <summary>
/// 校区编号
/// </summary>
public
int
School_Id
{
get
;
set
;
}
/// <summary>
/// 状态
/// </summary>
public
int
Status
{
get
;
set
;
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Edu.Model/ViewModel/Exam/RB_Examination_Publish_ViewModel.cs
View file @
d0fb315d
...
@@ -10,6 +10,9 @@ namespace Edu.Model.ViewModel.Exam
...
@@ -10,6 +10,9 @@ namespace Edu.Model.ViewModel.Exam
/// </summary>
/// </summary>
public
class
RB_Examination_Publish_ViewModel
:
RB_Examination_Publish
public
class
RB_Examination_Publish_ViewModel
:
RB_Examination_Publish
{
{
/// <summary>
/// 考试学员列表
/// </summary>
public
List
<
RB_Examination_Student_ViewModel
>
StudentList
{
get
;
set
;
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Edu.Module.Course/CourseModule.cs
View file @
d0fb315d
...
@@ -144,6 +144,7 @@ namespace Edu.Module.Course
...
@@ -144,6 +144,7 @@ namespace Edu.Module.Course
/// 商品规格价格
/// 商品规格价格
/// </summary>
/// </summary>
private
readonly
Repository
.
Mall
.
RB_Goods_SpecificationPriceRepository
goods_SpecificationPriceRepository
=
new
Repository
.
Mall
.
RB_Goods_SpecificationPriceRepository
();
private
readonly
Repository
.
Mall
.
RB_Goods_SpecificationPriceRepository
goods_SpecificationPriceRepository
=
new
Repository
.
Mall
.
RB_Goods_SpecificationPriceRepository
();
#
region
课程管理
#
region
课程管理
public
List
<
RB_Course_ViewModel
>
GetAllCourseChapterCountModule
(
int
groupId
,
int
courseId
)
public
List
<
RB_Course_ViewModel
>
GetAllCourseChapterCountModule
(
int
groupId
,
int
courseId
)
...
@@ -377,6 +378,7 @@ namespace Edu.Module.Course
...
@@ -377,6 +378,7 @@ namespace Edu.Module.Course
}
}
}
}
#
endregion
#
endregion
return
flag
;
return
flag
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Edu.Module.Exam/PaperModule.cs
View file @
d0fb315d
...
@@ -53,6 +53,11 @@ namespace Edu.Module.Exam
...
@@ -53,6 +53,11 @@ namespace Edu.Module.Exam
/// </summary>
/// </summary>
private
readonly
RB_Examination_PublishRepository
examination_PublishRepository
=
new
RB_Examination_PublishRepository
();
private
readonly
RB_Examination_PublishRepository
examination_PublishRepository
=
new
RB_Examination_PublishRepository
();
/// <summary>
/// 试卷考试学员仓储层对象
/// </summary>
private
readonly
RB_Examination_StudentRepository
examination_StudentRepository
=
new
RB_Examination_StudentRepository
();
/// <summary>
/// <summary>
/// 获取试卷分页列表
/// 获取试卷分页列表
/// </summary>
/// </summary>
...
@@ -726,6 +731,53 @@ namespace Edu.Module.Exam
...
@@ -726,6 +731,53 @@ namespace Edu.Module.Exam
model
.
Id
=
newId
;
model
.
Id
=
newId
;
flag
=
newId
>
0
;
flag
=
newId
>
0
;
}
}
var
oldStudentList
=
examination_StudentRepository
.
GetExaminationStudentListRepository
(
new
RB_Examination_Student_ViewModel
()
{
PublishId
=
model
.
Id
});
//以前没有学员【直接新增】
if
(
oldStudentList
==
null
||
(
oldStudentList
!=
null
&&
oldStudentList
.
Count
==
0
))
{
if
(
model
.
StudentList
!=
null
&&
model
.
StudentList
.
Count
>
0
)
{
foreach
(
var
item
in
model
.
StudentList
)
{
item
.
PublishId
=
model
.
Id
;
item
.
PaperId
=
model
.
PaperId
;
examination_StudentRepository
.
Insert
(
item
);
}
}
}
else
//以前有学员
{
//现在没有学员了【直接删除以前的学员】
if
(
model
.
StudentList
==
null
||
(
model
.
StudentList
!=
null
&&
model
.
StudentList
.
Count
==
0
))
{
examination_StudentRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Examination_Student_ViewModel
.
PublishId
),
model
.
Id
));
}
//找出差异的数据
var
deleteList
=
oldStudentList
.
Where
(
qitem
=>
!
model
.
StudentList
.
Any
(
oldItem
=>
qitem
.
Id
==
oldItem
.
Id
)).
ToList
();
foreach
(
var
dItem
in
deleteList
)
{
if
(
dItem
.
Id
>
0
)
{
examination_StudentRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Examination_Student_ViewModel
.
Id
),
dItem
.
Id
));
}
}
foreach
(
var
dItem
in
model
.
StudentList
)
{
dItem
.
PublishId
=
model
.
Id
;
dItem
.
PaperId
=
model
.
PaperId
;
dItem
.
Group_Id
=
model
.
Group_Id
;
dItem
.
School_Id
=
model
.
School_Id
;
if
(
dItem
.
Id
==
0
)
{
examination_StudentRepository
.
Insert
(
dItem
);
}
else
{
examination_StudentRepository
.
Update
(
dItem
);
}
}
}
return
flag
;
return
flag
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Edu.Repository/Exam/RB_Examination_StudentRepository.cs
View file @
d0fb315d
using
Edu.Model.Entity.Exam
;
using
Edu.Model.Entity.Exam
;
using
Edu.Model.ViewModel.Exam
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
namespace
Edu.Repository.Exam
namespace
Edu.Repository.Exam
...
@@ -10,6 +12,61 @@ namespace Edu.Repository.Exam
...
@@ -10,6 +12,61 @@ namespace Edu.Repository.Exam
/// </summary>
/// </summary>
public
class
RB_Examination_StudentRepository
:
BaseRepository
<
RB_Examination_Student
>
public
class
RB_Examination_StudentRepository
:
BaseRepository
<
RB_Examination_Student
>
{
{
/// <summary>
/// 获取考试学生分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Examination_Student_ViewModel
>
GetExaminationStudentPageRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Examination_Student_ViewModel
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM RB_Examination_Student AS A
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Examination_Student_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(
query
.
PublishId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Examination_Student_ViewModel
.
PublishId
),
query
.
PublishId
);
}
}
return
GetPage
<
RB_Examination_Student_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 获取考试学生列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Examination_Student_ViewModel
>
GetExaminationStudentListRepository
(
RB_Examination_Student_ViewModel
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM RB_Examination_Student AS A
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Examination_Student_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(
query
.
PublishId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Examination_Student_ViewModel
.
PublishId
),
query
.
PublishId
);
}
}
return
Get
<
RB_Examination_Student_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Edu.WebApi/Controllers/Exam/ExamController.cs
View file @
d0fb315d
...
@@ -403,6 +403,11 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -403,6 +403,11 @@ namespace Edu.WebApi.Controllers.Exam
FillInIsIgnore
=
base
.
ParmJObj
.
GetInt
(
"FillInIsIgnore"
),
FillInIsIgnore
=
base
.
ParmJObj
.
GetInt
(
"FillInIsIgnore"
),
IsHalfScore
=
base
.
ParmJObj
.
GetInt
(
"IsHalfScore"
),
IsHalfScore
=
base
.
ParmJObj
.
GetInt
(
"IsHalfScore"
),
};
};
var
studentStr
=
base
.
ParmJObj
.
GetStringValue
(
"StudentList"
);
if
(!
string
.
IsNullOrEmpty
(
studentStr
))
{
model
.
StudentList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
RB_Examination_Student_ViewModel
>>(
studentStr
);
}
model
.
CreateBy
=
base
.
UserInfo
.
Id
;
model
.
CreateBy
=
base
.
UserInfo
.
Id
;
model
.
CreateTime
=
DateTime
.
Now
;
model
.
CreateTime
=
DateTime
.
Now
;
model
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
model
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
...
...
This diff is collapsed.
Click to expand it.
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