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
f15ac8eb
Commit
f15ac8eb
authored
Aug 23, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
bb8e1068
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
32 deletions
+72
-32
PaperModule.cs
Edu.Module.Exam/PaperModule.cs
+28
-29
RB_Examination_PaperRepository.cs
Edu.Repository/Exam/RB_Examination_PaperRepository.cs
+13
-0
ExamController.cs
Edu.WebApi/Controllers/Exam/ExamController.cs
+31
-3
No files found.
Edu.Module.Exam/PaperModule.cs
View file @
f15ac8eb
...
@@ -771,34 +771,37 @@ namespace Edu.Module.Exam
...
@@ -771,34 +771,37 @@ namespace Edu.Module.Exam
/// <summary>
/// <summary>
/// 根据试卷编号删除试卷
/// 根据试卷编号删除试卷
/// </summary>
/// </summary>
/// <param name="PaperId"></param>
/// <param name="PaperId
s
"></param>
/// <returns></returns>
/// <returns></returns>
[
TransactionCallHandler
]
[
TransactionCallHandler
]
public
bool
RemoveExamnationPaperModule
(
int
PaperId
)
public
bool
RemoveExamnationPaperModule
(
List
<
int
>
PaperIds
)
{
{
var
flag
=
true
;
var
flag
=
true
;
var
model
=
GetExaminationPaperModule
(
PaperId
);
foreach
(
var
PaperId
in
PaperIds
)
var
childList
=
examination_PaperRepository
.
GetExaminationPaperChildRepository
(
PaperId
.
ToString
());
if
(
PaperId
>
0
)
{
flag
=
examination_PaperRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Examination_Paper_ViewModel
.
PaperId
),
PaperId
));
}
if
(
flag
&&
model
.
GroupList
!=
null
&&
model
.
GroupList
.
Count
>
0
)
{
flag
=
examination_GroupRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Examination_Group_ViewModel
.
PaperId
),
PaperId
));
}
if
(
flag
&&
model
.
GroupList
!=
null
&&
model
.
GroupList
.
Count
>
0
&&
model
.
GroupList
[
0
].
DetailsList
!=
null
&&
model
.
GroupList
[
0
].
DetailsList
.
Count
>
0
)
{
flag
=
examination_DetailsRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Examination_Details_ViewModel
.
PaperId
),
PaperId
));
}
//删除所有的自己点信息
if
(
childList
!=
null
&&
childList
.
Count
>
0
)
{
{
foreach
(
var
item
in
childList
)
var
model
=
GetExaminationPaperModule
(
PaperId
);
var
childList
=
examination_PaperRepository
.
GetExaminationPaperChildRepository
(
PaperId
.
ToString
());
if
(
PaperId
>
0
)
{
flag
=
examination_PaperRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Examination_Paper_ViewModel
.
PaperId
),
PaperId
));
}
if
(
flag
&&
model
.
GroupList
!=
null
&&
model
.
GroupList
.
Count
>
0
)
{
{
examination_PaperRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Examination_Paper_ViewModel
.
PaperId
),
item
.
PaperId
));
flag
=
examination_GroupRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Examination_Group_ViewModel
.
PaperId
),
PaperId
));
examination_GroupRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Examination_Group_ViewModel
.
PaperId
),
item
.
PaperId
));
}
examination_DetailsRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Examination_Details_ViewModel
.
PaperId
),
item
.
PaperId
));
if
(
flag
&&
model
.
GroupList
!=
null
&&
model
.
GroupList
.
Count
>
0
&&
model
.
GroupList
[
0
].
DetailsList
!=
null
&&
model
.
GroupList
[
0
].
DetailsList
.
Count
>
0
)
{
flag
=
examination_DetailsRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Examination_Details_ViewModel
.
PaperId
),
PaperId
));
}
//删除所有的子节点信息
if
(
childList
!=
null
&&
childList
.
Count
>
0
)
{
foreach
(
var
item
in
childList
)
{
examination_PaperRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Examination_Paper_ViewModel
.
PaperId
),
item
.
PaperId
));
examination_GroupRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Examination_Group_ViewModel
.
PaperId
),
item
.
PaperId
));
examination_DetailsRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Examination_Details_ViewModel
.
PaperId
),
item
.
PaperId
));
}
}
}
}
}
return
flag
;
return
flag
;
...
@@ -864,17 +867,13 @@ namespace Edu.Module.Exam
...
@@ -864,17 +867,13 @@ namespace Edu.Module.Exam
/// <summary>
/// <summary>
/// 移动试卷
/// 移动试卷
/// </summary>
/// </summary>
/// <param name="PaperId">试卷编号</param>
/// <param name="ParentId">父节点编号</param>
/// <param name="ParentId">父节点编号</param>
/// <param name="PaperIds">试卷编号</param>
/// <returns></returns>
/// <returns></returns>
public
bool
MoveExamnationPaperModule
(
int
Pa
perId
,
int
ParentId
)
public
bool
MoveExamnationPaperModule
(
int
Pa
rentId
,
List
<
int
>
PaperIds
)
{
{
var
flag
=
true
;
var
flag
=
true
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
flag
=
examination_PaperRepository
.
BatchMovePaperRepository
(
ParentId
,
PaperIds
)
>
0
;
{
{
nameof
(
RB_Examination_Paper_ViewModel
.
ParentId
),
ParentId
}
};
flag
=
examination_PaperRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Examination_Paper_ViewModel
.
PaperId
),
PaperId
));
return
flag
;
return
flag
;
}
}
...
...
Edu.Repository/Exam/RB_Examination_PaperRepository.cs
View file @
f15ac8eb
...
@@ -168,5 +168,18 @@ WHERE 1=1
...
@@ -168,5 +168,18 @@ WHERE 1=1
builder
.
AppendFormat
(
" UPDATE RB_Examination_Paper SET IsOpen={0} WHERE PaperId IN({1}) "
,
IsOpen
,
string
.
Join
(
","
,
paperIds
));
builder
.
AppendFormat
(
" UPDATE RB_Examination_Paper SET IsOpen={0} WHERE PaperId IN({1}) "
,
IsOpen
,
string
.
Join
(
","
,
paperIds
));
return
base
.
Execute
(
builder
.
ToString
());
return
base
.
Execute
(
builder
.
ToString
());
}
}
/// <summary>
/// 批量移动文件夹
/// </summary>
/// <param name="ParentId"></param>
/// <param name="paperIds"></param>
/// <returns></returns>
public
int
BatchMovePaperRepository
(
int
ParentId
,
List
<
int
>
paperIds
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
" UPDATE RB_Examination_Paper SET ParentId={0} WHERE PaperId IN({1}) "
,
ParentId
,
string
.
Join
(
","
,
paperIds
));
return
base
.
Execute
(
builder
.
ToString
());
}
}
}
}
}
Edu.WebApi/Controllers/Exam/ExamController.cs
View file @
f15ac8eb
...
@@ -7,6 +7,7 @@ using Edu.Common.Plugin;
...
@@ -7,6 +7,7 @@ using Edu.Common.Plugin;
using
Edu.Model.ViewModel.Exam
;
using
Edu.Model.ViewModel.Exam
;
using
Edu.Model.ViewModel.Flow
;
using
Edu.Model.ViewModel.Flow
;
using
Edu.Module.Exam
;
using
Edu.Module.Exam
;
using
Edu.Module.Question
;
using
Edu.Module.System
;
using
Edu.Module.System
;
using
Edu.WebApi.Filter
;
using
Edu.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Cors
;
...
@@ -37,6 +38,11 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -37,6 +38,11 @@ namespace Edu.WebApi.Controllers.Exam
/// </summary>
/// </summary>
private
readonly
BasicFlowModule
basicFlowModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
BasicFlowModule
>();
private
readonly
BasicFlowModule
basicFlowModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
BasicFlowModule
>();
/// <summary>
/// 问题验证处理类
/// </summary>
private
readonly
AnalysisQuestionTypeModule
analysisQuestion
=
new
AnalysisQuestionTypeModule
();
/// <summary>
/// <summary>
/// 获取试卷分页列表
/// 获取试卷分页列表
/// </summary>
/// </summary>
...
@@ -177,6 +183,18 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -177,6 +183,18 @@ namespace Edu.WebApi.Controllers.Exam
Score
=
sObj
.
GetDecimal
(
"Score"
),
Score
=
sObj
.
GetDecimal
(
"Score"
),
};
};
dSortNum
++;
dSortNum
++;
string
msg
=
analysisQuestion
.
CheckQuestion
(
detailModel
.
QuestionTypeKey
,
detailModel
.
QuestionContent
,
detailModel
.
Answer
,
out
string
newAnswer
);
if
(!
string
.
IsNullOrEmpty
(
msg
))
{
return
ApiResult
.
Failed
(
message
:
msg
);
}
else
{
if
(!
string
.
IsNullOrEmpty
(
newAnswer
))
{
detailModel
.
Answer
=
newAnswer
;
}
}
gModel
.
DetailsList
.
Add
(
detailModel
);
gModel
.
DetailsList
.
Add
(
detailModel
);
}
}
}
}
...
@@ -392,7 +410,17 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -392,7 +410,17 @@ namespace Edu.WebApi.Controllers.Exam
public
ApiResult
DeletePaper
()
public
ApiResult
DeletePaper
()
{
{
var
PaperId
=
base
.
ParmJObj
.
GetInt
(
"PaperId"
);
var
PaperId
=
base
.
ParmJObj
.
GetInt
(
"PaperId"
);
var
flag
=
paperModule
.
RemoveExamnationPaperModule
(
PaperId
);
List
<
int
>
PaperIds
=
new
List
<
int
>();
if
(
PaperId
>
0
)
{
PaperIds
.
Add
(
PaperId
);
}
var
tempList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
int
>>(
base
.
ParmJObj
.
GetStringValue
(
"PaperIds"
));
if
(
tempList
!=
null
&&
tempList
.
Count
>
0
)
{
PaperIds
.
AddRange
(
tempList
);
}
var
flag
=
paperModule
.
RemoveExamnationPaperModule
(
PaperIds
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
...
@@ -415,9 +443,9 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -415,9 +443,9 @@ namespace Edu.WebApi.Controllers.Exam
[
HttpPost
]
[
HttpPost
]
public
ApiResult
MovePaper
()
public
ApiResult
MovePaper
()
{
{
var
PaperId
=
base
.
ParmJObj
.
GetInt
(
"PaperId"
);
var
PaperId
s
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
int
>>(
base
.
ParmJObj
.
GetStringValue
(
"PaperIds"
)
);
var
ParentId
=
base
.
ParmJObj
.
GetInt
(
"ParentId"
);
var
ParentId
=
base
.
ParmJObj
.
GetInt
(
"ParentId"
);
var
flag
=
paperModule
.
MoveExamnationPaperModule
(
Pa
perId
,
ParentId
);
var
flag
=
paperModule
.
MoveExamnationPaperModule
(
Pa
rentId
,
PaperIds
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
...
...
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