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
822f5a7a
Commit
822f5a7a
authored
Aug 24, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
fefc272a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
162 additions
and
20 deletions
+162
-20
RB_Examination_Publish.cs
Edu.Model/Entity/Exam/RB_Examination_Publish.cs
+8
-2
RB_Examination_Publish_ViewModel.cs
Edu.Model/ViewModel/Exam/RB_Examination_Publish_ViewModel.cs
+21
-0
PaperModule.cs
Edu.Module.Exam/PaperModule.cs
+77
-13
RB_Examination_PublishRepository.cs
Edu.Repository/Exam/RB_Examination_PublishRepository.cs
+8
-1
ExamController.cs
Edu.WebApi/Controllers/Exam/ExamController.cs
+16
-4
TimerJobj.cs
Edu.WebApi/Timers/TimerJobj.cs
+32
-0
No files found.
Edu.Model/Entity/Exam/RB_Examination_Publish.cs
View file @
822f5a7a
using
System
;
using
Edu.Common.Enum
;
using
System
;
using
VT.FW.DB
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Exam
namespace
Edu.Model.Entity.Exam
...
@@ -73,7 +74,7 @@ namespace Edu.Model.Entity.Exam
...
@@ -73,7 +74,7 @@ namespace Edu.Model.Entity.Exam
/// <summary>
/// <summary>
/// 删除状态
/// 删除状态
/// </summary>
/// </summary>
public
int
Status
{
get
;
set
;
}
public
DateStateEnum
Status
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 题目乱序(1-是)
/// 题目乱序(1-是)
...
@@ -154,5 +155,10 @@ namespace Edu.Model.Entity.Exam
...
@@ -154,5 +155,10 @@ namespace Edu.Model.Entity.Exam
/// 封面图片
/// 封面图片
/// </summary>
/// </summary>
public
string
PublishPic
{
get
;
set
;
}
public
string
PublishPic
{
get
;
set
;
}
/// <summary>
/// 审核备注
/// </summary>
public
string
PublishRemark
{
get
;
set
;
}
}
}
}
}
Edu.Model/ViewModel/Exam/RB_Examination_Publish_ViewModel.cs
View file @
822f5a7a
...
@@ -30,6 +30,11 @@ namespace Edu.Model.ViewModel.Exam
...
@@ -30,6 +30,11 @@ namespace Edu.Model.ViewModel.Exam
/// </summary>
/// </summary>
public
string
QPublishIds
{
get
;
set
;
}
public
string
QPublishIds
{
get
;
set
;
}
/// <summary>
/// 查询不正常的数据
/// </summary>
public
int
IsQNotNormal
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 学生id
/// 学生id
/// </summary>
/// </summary>
...
@@ -44,5 +49,21 @@ namespace Edu.Model.ViewModel.Exam
...
@@ -44,5 +49,21 @@ namespace Edu.Model.ViewModel.Exam
/// 考试状态
/// 考试状态
/// </summary>
/// </summary>
public
string
ExamStatusStr
{
get
;
set
;
}
public
string
ExamStatusStr
{
get
;
set
;
}
/// <summary>
/// 图片列表
/// </summary>
public
List
<
string
>
PicList
{
get
{
List
<
string
>
list
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
this
.
PublishPic
))
{
list
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
string
>>(
this
.
PublishPic
);
}
return
list
;
}
}
}
}
}
}
Edu.Module.Exam/PaperModule.cs
View file @
822f5a7a
...
@@ -12,6 +12,8 @@ using Edu.Repository.Question;
...
@@ -12,6 +12,8 @@ using Edu.Repository.Question;
using
Edu.Model.ViewModel.Question
;
using
Edu.Model.ViewModel.Question
;
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
using
Edu.Model.CacheModel
;
using
Edu.Model.CacheModel
;
using
Edu.Common.Enum
;
using
Edu.Common.Enum.EduTask
;
namespace
Edu.Module.Exam
namespace
Edu.Module.Exam
{
{
...
@@ -916,6 +918,23 @@ namespace Edu.Module.Exam
...
@@ -916,6 +918,23 @@ namespace Edu.Module.Exam
}
}
/// <summary>
/// 批量更新试卷是否开放
/// </summary>
/// <param name="paperIds"></param>
/// <param name="IsOpen"></param>
/// <returns></returns>
public
bool
BatchSetIsOpenModule
(
List
<
int
>
paperIds
,
int
IsOpen
)
{
var
list
=
examination_PaperRepository
.
GetExaminationPaperParentRepository
(
string
.
Join
(
","
,
paperIds
));
foreach
(
var
item
in
paperIds
)
{
}
return
examination_PaperRepository
.
BatchSetIsOpenRepository
(
paperIds
,
IsOpen
)
>
0
;
}
/// <summary>
/// <summary>
/// 获取发布试卷分页列表
/// 获取发布试卷分页列表
/// </summary>
/// </summary>
...
@@ -1065,7 +1084,7 @@ namespace Edu.Module.Exam
...
@@ -1065,7 +1084,7 @@ namespace Edu.Module.Exam
/// </summary>
/// </summary>
/// <param name="Id"></param>
/// <param name="Id"></param>
/// <returns></returns>
/// <returns></returns>
public
bool
SumitExamApplyModule
(
int
Id
)
public
bool
Su
b
mitExamApplyModule
(
int
Id
)
{
{
bool
flag
=
false
;
bool
flag
=
false
;
var
model
=
GetExaminationPublishModule
(
Id
);
var
model
=
GetExaminationPublishModule
(
Id
);
...
@@ -1073,7 +1092,10 @@ namespace Edu.Module.Exam
...
@@ -1073,7 +1092,10 @@ namespace Edu.Module.Exam
{
{
Group_Id
=
model
.
Group_Id
,
Group_Id
=
model
.
Group_Id
,
});
});
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>();
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Examination_Publish_ViewModel
.
PublishRemark
),
""
}
};
if
(
obj
.
IsOpenExamApply
==
0
)
if
(
obj
.
IsOpenExamApply
==
0
)
{
{
...
@@ -1088,7 +1110,6 @@ namespace Edu.Module.Exam
...
@@ -1088,7 +1110,6 @@ namespace Edu.Module.Exam
flag
=
examination_PublishRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Examination_Publish_ViewModel
.
Id
),
model
.
Id
));
flag
=
examination_PublishRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Examination_Publish_ViewModel
.
Id
),
model
.
Id
));
if
(
flag
&&
obj
.
IsOpenExamApply
==
1
)
if
(
flag
&&
obj
.
IsOpenExamApply
==
1
)
{
{
var
educationReceipt
=
new
Model
.
Entity
.
EduTask
.
RB_Education_Receipt
()
var
educationReceipt
=
new
Model
.
Entity
.
EduTask
.
RB_Education_Receipt
()
{
{
Id
=
0
,
Id
=
0
,
...
@@ -1184,19 +1205,19 @@ namespace Edu.Module.Exam
...
@@ -1184,19 +1205,19 @@ namespace Edu.Module.Exam
}
}
/// <summary>
/// <summary>
///
批量更新是否开放
///
删除考试
/// </summary>
/// </summary>
/// <param name="paperIds"></param>
/// <param name="Id"></param>
/// <param name="IsOpen"></param>
/// <returns></returns>
/// <returns></returns>
public
bool
BatchSetIsOpenModule
(
List
<
int
>
paperIds
,
int
IsOpen
)
public
bool
RemoveExamPublishModule
(
int
Id
)
{
{
var
list
=
examination_PaperRepository
.
GetExaminationPaperParentRepository
(
string
.
Join
(
","
,
paperIds
));
bool
flag
=
false
;
foreach
(
var
item
in
paperIds
)
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
{
nameof
(
RB_Examination_Publish_ViewModel
.
Status
),(
int
)
DateStateEnum
.
Delete
}
}
};
return
examination_PaperRepository
.
BatchSetIsOpenRepository
(
paperIds
,
IsOpen
)>
0
;
flag
=
examination_PublishRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Examination_Publish_ViewModel
.
Id
),
Id
));
return
flag
;
}
}
#
region
学生管理
#
region
学生管理
...
@@ -1257,5 +1278,48 @@ namespace Edu.Module.Exam
...
@@ -1257,5 +1278,48 @@ namespace Edu.Module.Exam
#
endregion
#
endregion
/// <summary>
/// 获取状态字符串
/// </summary>
/// <param name="status"></param>
/// <returns></returns>
public
string
GetExamineStatusStr
(
EduTaskRrocessStatus
status
)
{
string
str
=
"草稿"
;
switch
(
status
)
{
case
EduTaskRrocessStatus
.
NotAudit
:
str
=
"草稿"
;
break
;
case
EduTaskRrocessStatus
.
AuditIng
:
str
=
"审核中"
;
break
;
case
EduTaskRrocessStatus
.
AuditThrough
:
str
=
"正常"
;
break
;
case
EduTaskRrocessStatus
.
AuditNotThrough
:
str
=
"驳回"
;
break
;
case
EduTaskRrocessStatus
.
Rejected
:
str
=
"驳回"
;
break
;
case
EduTaskRrocessStatus
.
OtherHaveAudit
:
str
=
"正常"
;
break
;
case
EduTaskRrocessStatus
.
Invalid
:
str
=
"作废"
;
break
;
}
return
str
;
}
/// <summary>
/// 定时处理考卷过期数据
/// </summary>
public
void
DealExamPublish
()
{
var
list
=
examination_PublishRepository
.
GetExaminationPublishListRepository
(
new
RB_Examination_Publish_ViewModel
()
{
IsQNotNormal
=
1
});
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
foreach
(
var
item
in
list
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Examination_Publish_ViewModel
.
ExamineStatus
),
(
int
)
EduTaskRrocessStatus
.
Invalid
}
};
examination_PublishRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Examination_Publish_ViewModel
.
Id
),
item
.
Id
));
}
}
}
}
}
}
}
Edu.Repository/Exam/RB_Examination_PublishRepository.cs
View file @
822f5a7a
using
Edu.Model.Entity.Exam
;
using
Edu.Common.Enum
;
using
Edu.Model.Entity.Exam
;
using
Edu.Model.ViewModel.Exam
;
using
Edu.Model.ViewModel.Exam
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -30,6 +31,7 @@ SELECT A.*,IFNULL(B.PaperName,'') AS PaperName
...
@@ -30,6 +31,7 @@ SELECT A.*,IFNULL(B.PaperName,'') AS PaperName
FROM RB_Examination_Publish AS A LEFT JOIN rb_examination_paper AS B ON A.PaperId=B.PaperId
FROM RB_Examination_Publish AS A LEFT JOIN rb_examination_paper AS B ON A.PaperId=B.PaperId
WHERE 1=1
WHERE 1=1
"
);
"
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Examination_Publish_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
if
(
query
!=
null
)
{
{
if
(
query
.
Group_Id
>
0
)
if
(
query
.
Group_Id
>
0
)
...
@@ -60,6 +62,7 @@ SELECT A.*,IFNULL(B.PaperName,'') AS PaperName
...
@@ -60,6 +62,7 @@ SELECT A.*,IFNULL(B.PaperName,'') AS PaperName
FROM RB_Examination_Publish AS A LEFT JOIN rb_examination_paper AS B ON A.PaperId=B.PaperId
FROM RB_Examination_Publish AS A LEFT JOIN rb_examination_paper AS B ON A.PaperId=B.PaperId
WHERE 1=1
WHERE 1=1
"
);
"
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Examination_Publish_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
if
(
query
!=
null
)
{
{
if
(
query
.
Group_Id
>
0
)
if
(
query
.
Group_Id
>
0
)
...
@@ -75,6 +78,10 @@ WHERE 1=1
...
@@ -75,6 +78,10 @@ WHERE 1=1
{
{
builder
.
AppendFormat
(
" AND A.{0} in ({1}) "
,
nameof
(
RB_Examination_Publish_ViewModel
.
Id
),
query
.
QPublishIds
);
builder
.
AppendFormat
(
" AND A.{0} in ({1}) "
,
nameof
(
RB_Examination_Publish_ViewModel
.
Id
),
query
.
QPublishIds
);
}
}
if
(
query
.
IsQNotNormal
==
1
)
{
builder
.
AppendFormat
(
" AND A.ExamineStatus NOT IN(2,5,6) AND A.ExamEndTime<'{0}' "
,
Common
.
ConvertHelper
.
FormatTime
(
DateTime
.
Now
));
}
}
}
return
Get
<
RB_Examination_Publish_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
return
Get
<
RB_Examination_Publish_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
}
...
...
Edu.WebApi/Controllers/Exam/ExamController.cs
View file @
822f5a7a
...
@@ -467,7 +467,6 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -467,7 +467,6 @@ namespace Edu.WebApi.Controllers.Exam
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
/// <summary>
/// <summary>
/// 发布考试
/// 发布考试
/// </summary>
/// </summary>
...
@@ -556,7 +555,8 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -556,7 +555,8 @@ namespace Edu.WebApi.Controllers.Exam
item
.
StudentCount
,
item
.
StudentCount
,
ReviewerName
=
item
.
Reviewer
>
0
?
(
UserReidsCache
.
GetUserLoginInfo
(
item
.
Reviewer
)?.
AccountName
??
""
)
:
""
,
ReviewerName
=
item
.
Reviewer
>
0
?
(
UserReidsCache
.
GetUserLoginInfo
(
item
.
Reviewer
)?.
AccountName
??
""
)
:
""
,
item
.
Reviewer
,
item
.
Reviewer
,
ExamineStatusStr
=
EnumHelper
.
ToName
(
item
.
ExamineStatus
)
item
.
ExamineStatus
,
ExamineStatusStr
=
paperModule
.
GetExamineStatusStr
(
item
.
ExamineStatus
)
};
};
result
.
Add
(
obj
);
result
.
Add
(
obj
);
}
}
...
@@ -570,10 +570,22 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -570,10 +570,22 @@ namespace Edu.WebApi.Controllers.Exam
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
SumitExamApply
()
public
ApiResult
SubmitExamApply
()
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
);
var
flag
=
paperModule
.
SubmitExamApplyModule
(
Id
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 删除考试
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
RemovePublishExam
()
{
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
);
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
);
var
flag
=
paperModule
.
SumitExamApply
Module
(
Id
);
var
flag
=
paperModule
.
RemoveExamPublish
Module
(
Id
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
...
...
Edu.WebApi/Timers/TimerJobj.cs
View file @
822f5a7a
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
using
Edu.Module.Course
;
using
Edu.Module.Course
;
using
Edu.Module.Duty
;
using
Edu.Module.Duty
;
using
Edu.Module.EduTask
;
using
Edu.Module.EduTask
;
using
Edu.Module.Exam
;
using
System
;
using
System
;
using
System.IO
;
using
System.IO
;
using
System.Threading
;
using
System.Threading
;
...
@@ -33,6 +34,11 @@ namespace Edu.WebApi.Timers
...
@@ -33,6 +34,11 @@ namespace Edu.WebApi.Timers
/// </summary>
/// </summary>
private
static
readonly
OrderChangeModule
orderChangeModule
=
new
OrderChangeModule
();
private
static
readonly
OrderChangeModule
orderChangeModule
=
new
OrderChangeModule
();
/// <summary>
/// 考试试卷处理类对象
/// </summary>
private
static
readonly
PaperModule
paperModule
=
new
PaperModule
();
static
System
.
Timers
.
Timer
timer1
;
//计时器
static
System
.
Timers
.
Timer
timer1
;
//计时器
static
System
.
Timers
.
Timer
timer2
;
//定期处理未值班数据
static
System
.
Timers
.
Timer
timer2
;
//定期处理未值班数据
...
@@ -43,6 +49,8 @@ namespace Edu.WebApi.Timers
...
@@ -43,6 +49,8 @@ namespace Edu.WebApi.Timers
static
System
.
Timers
.
Timer
changeOrder
;
//批量处理转班订单
static
System
.
Timers
.
Timer
changeOrder
;
//批量处理转班订单
static
System
.
Timers
.
Timer
examTimer
;
//考卷定时处理
public
static
void
RunTimer
()
public
static
void
RunTimer
()
{
{
timer1
=
new
System
.
Timers
.
Timer
timer1
=
new
System
.
Timers
.
Timer
...
@@ -80,6 +88,13 @@ namespace Edu.WebApi.Timers
...
@@ -80,6 +88,13 @@ namespace Edu.WebApi.Timers
};
};
changeOrder
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
BatchDealChangeOrder
);
changeOrder
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
BatchDealChangeOrder
);
changeOrder
.
Enabled
=
true
;
changeOrder
.
Enabled
=
true
;
examTimer
=
new
System
.
Timers
.
Timer
()
{
Interval
=
(
1000
*
60
)
*
(
1
*
5
)
//5分钟执行一次
};
examTimer
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
DealExamPublich
);
examTimer
.
Enabled
=
true
;
}
}
public
static
void
RunStop
()
public
static
void
RunStop
()
...
@@ -89,6 +104,7 @@ namespace Edu.WebApi.Timers
...
@@ -89,6 +104,7 @@ namespace Edu.WebApi.Timers
timer3
.
Enabled
=
false
;
timer3
.
Enabled
=
false
;
timer4
.
Enabled
=
false
;
timer4
.
Enabled
=
false
;
changeOrder
.
Enabled
=
false
;
changeOrder
.
Enabled
=
false
;
examTimer
.
Enabled
=
false
;
}
}
/// <summary>
/// <summary>
...
@@ -99,6 +115,22 @@ namespace Edu.WebApi.Timers
...
@@ -99,6 +115,22 @@ namespace Edu.WebApi.Timers
private
static
int
inTimer3
=
0
;
private
static
int
inTimer3
=
0
;
private
static
int
inTimer4
=
0
;
private
static
int
inTimer4
=
0
;
private
static
int
changeOrder_Timer
=
0
;
private
static
int
changeOrder_Timer
=
0
;
private
static
int
examPublish_Timer
=
0
;
/// <summary>
/// 处理值班数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public
static
void
DealExamPublich
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
if
(
Interlocked
.
Exchange
(
ref
examPublish_Timer
,
1
)
==
0
)
{
paperModule
.
DealExamPublish
();
Interlocked
.
Exchange
(
ref
examPublish_Timer
,
0
);
}
}
/// <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