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
72b75926
Commit
72b75926
authored
Aug 11, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
afdf6a2e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
266 additions
and
35 deletions
+266
-35
RB_Examination_Paper.cs
Edu.Model/Entity/Exam/RB_Examination_Paper.cs
+15
-0
ExaminationPaperTreeModel.cs
Edu.Model/ViewModel/Exam/ExaminationPaperTreeModel.cs
+73
-0
RB_Examination_Paper_ViewModel.cs
Edu.Model/ViewModel/Exam/RB_Examination_Paper_ViewModel.cs
+5
-0
OrderModule2.cs
Edu.Module.Course/OrderModule2.cs
+6
-10
PaperModule.cs
Edu.Module.Exam/PaperModule.cs
+115
-18
RB_Examination_PaperRepository.cs
Edu.Repository/Exam/RB_Examination_PaperRepository.cs
+15
-1
ExamController.cs
Edu.WebApi/Controllers/Exam/ExamController.cs
+37
-6
No files found.
Edu.Model/Entity/Exam/RB_Examination_Paper.cs
View file @
72b75926
...
@@ -67,5 +67,20 @@ namespace Edu.Model.Entity.Exam
...
@@ -67,5 +67,20 @@ namespace Edu.Model.Entity.Exam
/// 组卷类型(1-智能组卷,2-手动组卷,3-智能导入)
/// 组卷类型(1-智能组卷,2-手动组卷,3-智能导入)
/// </summary>
/// </summary>
public
int
GenerateType
{
get
;
set
;
}
public
int
GenerateType
{
get
;
set
;
}
/// <summary>
/// 生成试卷套数
/// </summary>
public
int
CreateNum
{
get
;
set
;
}
/// <summary>
/// 试卷类型(1-文件夹,2-试卷)
/// </summary>
public
int
PaperType
{
get
;
set
;
}
/// <summary>
/// 父节点编号
/// </summary>
public
int
ParentId
{
get
;
set
;
}
}
}
}
}
Edu.Model/ViewModel/Exam/ExaminationPaperTreeModel.cs
0 → 100644
View file @
72b75926
using
Edu.Common.Enum.Question
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.Exam
{
/// <summary>
/// 试卷树形结构实体类
/// </summary>
public
class
ExaminationPaperTreeModel
{
/// <summary>
/// 试卷编号
/// </summary>
public
int
PaperId
{
get
;
set
;
}
/// <summary>
/// 试卷名称
/// </summary>
public
string
PaperName
{
get
;
set
;
}
/// <summary>
/// 关联题库编号
/// </summary>
public
string
QuestionBandIds
{
get
;
set
;
}
/// <summary>
/// 难易程度(1-易,2-中,3-难)
/// </summary>
public
DifficultyTypeEnum
DifficultyType
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 发布次数
/// </summary>
public
int
PublishCount
{
get
;
set
;
}
/// <summary>
/// 组卷类型(1-智能组卷,2-手动组卷,3-智能导入)
/// </summary>
public
int
GenerateType
{
get
;
set
;
}
/// <summary>
/// 生成试卷套数
/// </summary>
public
int
CreateNum
{
get
;
set
;
}
/// <summary>
/// 试卷类型(1-文件夹,2-试卷)
/// </summary>
public
int
PaperType
{
get
;
set
;
}
/// <summary>
/// 父节点编号
/// </summary>
public
int
ParentId
{
get
;
set
;
}
/// <summary>
/// 下级节点
/// </summary>
public
List
<
ExaminationPaperTreeModel
>
ChildList
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Exam/RB_Examination_Paper_ViewModel.cs
View file @
72b75926
...
@@ -24,5 +24,10 @@ namespace Edu.Model.ViewModel.Exam
...
@@ -24,5 +24,10 @@ namespace Edu.Model.ViewModel.Exam
/// 试卷题目分组列表
/// 试卷题目分组列表
/// </summary>
/// </summary>
public
List
<
RB_Examination_Group_ViewModel
>
GroupList
{
get
;
set
;
}
public
List
<
RB_Examination_Group_ViewModel
>
GroupList
{
get
;
set
;
}
/// <summary>
/// 问题数量
/// </summary>
public
int
QuestionCount
{
get
;
set
;
}
}
}
}
}
Edu.Module.Course/OrderModule2.cs
View file @
72b75926
...
@@ -16,6 +16,7 @@ using Edu.Repository.Grade;
...
@@ -16,6 +16,7 @@ using Edu.Repository.Grade;
using
Edu.Repository.Contract
;
using
Edu.Repository.Contract
;
using
Edu.Model.Entity.Contract
;
using
Edu.Model.Entity.Contract
;
using
Edu.Model.Entity.Course
;
using
Edu.Model.Entity.Course
;
using
Edu.Model.ViewModel.Contract
;
namespace
Edu.Module.Course
namespace
Edu.Module.Course
{
{
...
@@ -196,17 +197,12 @@ namespace Edu.Module.Course
...
@@ -196,17 +197,12 @@ namespace Edu.Module.Course
{
{
FinaceNum
=
string
.
Join
(
","
,
flist
.
Select
(
qitem
=>
qitem
.
FrID
));
FinaceNum
=
string
.
Join
(
","
,
flist
.
Select
(
qitem
=>
qitem
.
FrID
));
}
}
var
totalBackProtocolCount
=
backClass_ProtocolRepository
.
GetBackClassProtocolNumRepository
();
var
contractModel
=
education_ContractRepository
.
GetList
(
new
RB_Education_Contract_ViewModel
()
string
BackProtocol
;
if
(
totalBackCount
<
10000
)
{
{
BackProtocol
=
String
.
Format
(
"{0:00000}"
,
totalBackProtocolCount
);
OrderId
=
OrderId
,
}
GuestId
=
GuestId
else
})?.
FirstOrDefault
();
{
string
ProtocolNum
=
(
contractModel
?.
ContractNo
??
""
)
+
"-T"
;
BackProtocol
=
totalBackProtocolCount
.
ToString
();
}
string
ProtocolNum
=
"TX"
+
BackProtocol
;
RB_BackClass_Protocol
model
=
new
RB_BackClass_Protocol
()
RB_BackClass_Protocol
model
=
new
RB_BackClass_Protocol
()
{
{
Id
=
0
,
Id
=
0
,
...
...
Edu.Module.Exam/PaperModule.cs
View file @
72b75926
...
@@ -37,11 +37,82 @@ namespace Edu.Module.Exam
...
@@ -37,11 +37,82 @@ namespace Edu.Module.Exam
/// <param name="rowsCount"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <param name="query"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Examination_Paper_View
Model
>
GetExaminationPaperPageModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Examination_Paper_ViewModel
query
)
public
List
<
ExaminationPaperTree
Model
>
GetExaminationPaperPageModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Examination_Paper_ViewModel
query
)
{
{
return
examination_PaperRepository
.
GetExaminationPaperPageRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
List
<
ExaminationPaperTreeModel
>
treeList
=
new
List
<
ExaminationPaperTreeModel
>();
var
data
=
examination_PaperRepository
.
GetExaminationPaperPageRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
if
(
data
!=
null
&&
data
.
Count
>
0
)
{
var
childList
=
new
List
<
RB_Examination_Paper_ViewModel
>();
string
ids
=
string
.
Join
(
","
,
data
.
Select
(
qitem
=>
qitem
.
PaperId
));
if
(!
string
.
IsNullOrEmpty
(
ids
))
{
childList
=
examination_PaperRepository
.
GetExaminationPaperChildRepository
(
ids
);
}
foreach
(
var
item
in
data
)
{
ExaminationPaperTreeModel
model
=
new
ExaminationPaperTreeModel
()
{
PaperId
=
item
.
PaperId
,
PaperName
=
item
.
PaperName
,
QuestionBandIds
=
item
.
QuestionBandIds
,
DifficultyType
=
item
.
DifficultyType
,
CreateTime
=
item
.
CreateTime
,
CreateBy
=
item
.
CreateBy
,
PublishCount
=
item
.
PublishCount
,
GenerateType
=
item
.
GenerateType
,
CreateNum
=
item
.
CreateNum
,
PaperType
=
item
.
PaperType
,
ParentId
=
item
.
ParentId
,
ChildList
=
new
List
<
ExaminationPaperTreeModel
>(),
};
model
.
ChildList
=
GetPaperChild
(
childList
,
item
.
PaperId
);
treeList
.
Add
(
model
);
}
}
return
treeList
;
}
/// <summary>
/// 递归遍历所有章节
/// </summary>
/// <param name="sourceList">源数据</param>
/// <param name="parentId">父节点编号</param>
/// <returns></returns>
public
List
<
ExaminationPaperTreeModel
>
GetPaperChild
(
List
<
RB_Examination_Paper_ViewModel
>
sourceList
,
int
parentId
)
{
List
<
ExaminationPaperTreeModel
>
resultList
=
new
List
<
ExaminationPaperTreeModel
>();
//获取下级节点
var
subList
=
sourceList
?.
Where
(
qItem
=>
qItem
.
ParentId
==
parentId
).
ToList
();
//如果存在下级节点
if
(
subList
!=
null
&&
subList
.
Count
>
0
)
{
foreach
(
var
childItem
in
subList
)
{
var
childModel
=
new
ExaminationPaperTreeModel
()
{
PaperId
=
childItem
.
PaperId
,
PaperName
=
childItem
.
PaperName
,
QuestionBandIds
=
childItem
.
QuestionBandIds
,
DifficultyType
=
childItem
.
DifficultyType
,
CreateTime
=
childItem
.
CreateTime
,
CreateBy
=
childItem
.
CreateBy
,
PublishCount
=
childItem
.
PublishCount
,
GenerateType
=
childItem
.
GenerateType
,
CreateNum
=
childItem
.
CreateNum
,
PaperType
=
childItem
.
PaperType
,
ParentId
=
childItem
.
ParentId
,
ChildList
=
new
List
<
ExaminationPaperTreeModel
>(),
};
childModel
.
ChildList
.
AddRange
(
GetPaperChild
(
sourceList
,
childItem
.
PaperId
));
resultList
.
Add
(
childModel
);
}
}
return
resultList
;
}
}
/// <summary>
/// <summary>
/// 获取试卷题目列表
/// 获取试卷题目列表
/// </summary>
/// </summary>
...
@@ -72,22 +143,7 @@ namespace Edu.Module.Exam
...
@@ -72,22 +143,7 @@ namespace Edu.Module.Exam
[
TransactionCallHandler
]
[
TransactionCallHandler
]
public
virtual
bool
SetExaminationPaperModule
(
RB_Examination_Paper_ViewModel
model
)
public
virtual
bool
SetExaminationPaperModule
(
RB_Examination_Paper_ViewModel
model
)
{
{
bool
flag
;
bool
flag
=
SetExaminationPaperFolderModule
(
model
);
if
(
model
.
PaperId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Examination_Paper_ViewModel
.
PaperName
),
model
.
PaperName
},
{
nameof
(
RB_Examination_Paper_ViewModel
.
DifficultyType
),
model
.
DifficultyType
},
};
flag
=
examination_PaperRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Examination_Paper_ViewModel
.
PaperId
),
model
.
PaperId
));
}
else
{
var
newPaperId
=
examination_PaperRepository
.
Insert
(
model
);
model
.
PaperId
=
newPaperId
;
flag
=
newPaperId
>
0
;
}
if
(
model
.
GroupList
!=
null
&&
model
.
GroupList
.
Count
>
0
)
if
(
model
.
GroupList
!=
null
&&
model
.
GroupList
.
Count
>
0
)
{
{
foreach
(
var
gitem
in
model
.
GroupList
)
foreach
(
var
gitem
in
model
.
GroupList
)
...
@@ -157,6 +213,47 @@ namespace Edu.Module.Exam
...
@@ -157,6 +213,47 @@ namespace Edu.Module.Exam
return
flag
;
return
flag
;
}
}
/// <summary>
/// 新增修改文件夹
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
virtual
bool
SetExaminationPaperFolderModule
(
RB_Examination_Paper_ViewModel
model
)
{
return
SetExaminationPaperCommonModule
(
model
);
}
/// <summary>
/// 新增修改试卷基础信息
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetExaminationPaperCommonModule
(
RB_Examination_Paper_ViewModel
model
)
{
bool
flag
;
if
(
model
.
PaperId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Examination_Paper_ViewModel
.
PaperName
),
model
.
PaperName
},
{
nameof
(
RB_Examination_Paper_ViewModel
.
QuestionBandIds
),
model
.
QuestionBandIds
},
{
nameof
(
RB_Examination_Paper_ViewModel
.
DifficultyType
),
model
.
DifficultyType
},
{
nameof
(
RB_Examination_Paper_ViewModel
.
GenerateType
),
model
.
GenerateType
},
{
nameof
(
RB_Examination_Paper_ViewModel
.
CreateNum
),
model
.
CreateNum
},
{
nameof
(
RB_Examination_Paper_ViewModel
.
PaperType
),
model
.
PaperType
},
{
nameof
(
RB_Examination_Paper_ViewModel
.
ParentId
),
model
.
ParentId
},
};
flag
=
examination_PaperRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Examination_Paper_ViewModel
.
PaperId
),
model
.
PaperId
));
}
else
{
var
newPaperId
=
examination_PaperRepository
.
Insert
(
model
);
model
.
PaperId
=
newPaperId
;
flag
=
newPaperId
>
0
;
}
return
flag
;
}
/// <summary>
/// <summary>
/// 根据试卷编号获取试卷实体
/// 根据试卷编号获取试卷实体
/// </summary>
/// </summary>
...
...
Edu.Repository/Exam/RB_Examination_PaperRepository.cs
View file @
72b75926
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
using
Edu.Model.ViewModel.Exam
;
using
Edu.Model.ViewModel.Exam
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
using
VT.FW.DB.Dapper
;
...
@@ -30,6 +31,7 @@ SELECT A.*
...
@@ -30,6 +31,7 @@ SELECT A.*
FROM RB_Examination_Paper AS A
FROM RB_Examination_Paper AS A
WHERE 1=1
WHERE 1=1
"
);
"
);
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Examination_Paper_ViewModel
.
ParentId
),
0
);
if
(
query
!=
null
)
if
(
query
!=
null
)
{
{
if
(
query
.
Group_Id
>
0
)
if
(
query
.
Group_Id
>
0
)
...
@@ -44,6 +46,18 @@ WHERE 1=1
...
@@ -44,6 +46,18 @@ WHERE 1=1
}
}
return
GetPage
<
RB_Examination_Paper_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
return
GetPage
<
RB_Examination_Paper_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
}
/// <summary>
/// 获取试卷所有下级列表
/// </summary>
/// <param name="QPaperIds"></param>
/// <returns></returns>
public
List
<
RB_Examination_Paper_ViewModel
>
GetExaminationPaperChildRepository
(
string
QPaperIds
)
{
var
parameters
=
new
DynamicParameters
();
string
procName
=
"proc_getchildpaper"
;
parameters
.
Add
(
"QPaperIds"
,
QPaperIds
,
direction
:
ParameterDirection
.
Input
);
return
Get
<
RB_Examination_Paper_ViewModel
>(
procName
,
parameters
,
commandType
:
CommandType
.
StoredProcedure
).
ToList
();
}
}
}
}
}
Edu.WebApi/Controllers/Exam/ExamController.cs
View file @
72b75926
...
@@ -47,16 +47,18 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -47,16 +47,18 @@ namespace Edu.WebApi.Controllers.Exam
var
list
=
paperModule
.
GetExaminationPaperPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
var
list
=
paperModule
.
GetExaminationPaperPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
foreach
(
var
item
in
list
)
{
{
if
(
item
.
CreateBy
>
0
)
{
item
.
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
;
}
result
.
Add
(
new
result
.
Add
(
new
{
{
item
.
PaperId
,
item
.
PaperId
,
item
.
PaperName
,
item
.
PaperName
,
item
.
CreateTimeStr
,
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
,
item
.
CreateByName
,
CreateTimeStr
=
Common
.
ConvertHelper
.
FormatTimeStr
(
item
.
CreateTime
),
DifficultyTypeName
=
item
.
DifficultyType
.
ToName
(),
item
.
PublishCount
,
QuestionCount
=
0
,
item
.
ParentId
,
item
.
PaperType
,
item
.
ChildList
,
});
});
}
}
pageModel
.
Count
=
rowsCount
;
pageModel
.
Count
=
rowsCount
;
...
@@ -81,6 +83,9 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -81,6 +83,9 @@ namespace Edu.WebApi.Controllers.Exam
CreateTime
=
DateTime
.
Now
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
base
.
UserInfo
.
Group_Id
,
Group_Id
=
base
.
UserInfo
.
Group_Id
,
GenerateType
=
base
.
ParmJObj
.
GetInt
(
"GenerateType"
),
GenerateType
=
base
.
ParmJObj
.
GetInt
(
"GenerateType"
),
CreateNum
=
base
.
ParmJObj
.
GetInt
(
"CreateNum"
),
PaperType
=
base
.
ParmJObj
.
GetInt
(
"PaperType"
),
ParentId
=
base
.
ParmJObj
.
GetInt
(
"ParentId"
),
};
};
extModel
.
GroupList
=
new
List
<
RB_Examination_Group_ViewModel
>();
extModel
.
GroupList
=
new
List
<
RB_Examination_Group_ViewModel
>();
string
groups
=
base
.
ParmJObj
.
GetStringValue
(
"GroupList"
);
string
groups
=
base
.
ParmJObj
.
GetStringValue
(
"GroupList"
);
...
@@ -150,6 +155,32 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -150,6 +155,32 @@ namespace Edu.WebApi.Controllers.Exam
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
}
/// <summary>
/// 新增修改文件夹
/// </summary>
/// <returns></returns>
public
ApiResult
SetPaperFolder
()
{
var
extModel
=
new
RB_Examination_Paper_ViewModel
()
{
PaperId
=
base
.
ParmJObj
.
GetInt
(
"PaperId"
),
PaperName
=
base
.
ParmJObj
.
GetStringValue
(
"PaperName"
),
QuestionBandIds
=
base
.
ParmJObj
.
GetStringValue
(
"QuestionBandIds"
),
DifficultyType
=
(
DifficultyTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"DifficultyType"
),
CreateBy
=
UserInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
base
.
UserInfo
.
Group_Id
,
GenerateType
=
base
.
ParmJObj
.
GetInt
(
"GenerateType"
),
CreateNum
=
base
.
ParmJObj
.
GetInt
(
"CreateNum"
),
PaperType
=
base
.
ParmJObj
.
GetInt
(
"PaperType"
),
ParentId
=
base
.
ParmJObj
.
GetInt
(
"ParentId"
),
};
bool
flag
=
paperModule
.
SetExaminationPaperFolderModule
(
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
/// <summary>
/// <summary>
/// 根据编号获取试卷信息
/// 根据编号获取试卷信息
/// </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