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
9a384fa5
Commit
9a384fa5
authored
Sep 29, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
7fc1c5e6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
2 deletions
+57
-2
RB_Course_Category_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_Category_ViewModel.cs
+2
-0
CourseCategoryModule.cs
Edu.Module.Course/CourseCategoryModule.cs
+26
-2
RB_Course_CategoryRepository.cs
Edu.Repository/Course/RB_Course_CategoryRepository.cs
+15
-0
CourseController.cs
Edu.WebApi/Controllers/Course/CourseController.cs
+14
-0
No files found.
Edu.Model/ViewModel/Course/RB_Course_Category_ViewModel.cs
View file @
9a384fa5
using
Edu.Common
;
using
System
;
using
VT.FW.DB
;
namespace
Edu.Model.ViewModel.Course
{
...
...
@@ -7,6 +8,7 @@ namespace Edu.Model.ViewModel.Course
/// 课程分类视图实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Course_Category_ViewModel
:
Model
.
Entity
.
Course
.
RB_Course_Category
{
/// <summary>
...
...
Edu.Module.Course/CourseCategoryModule.cs
View file @
9a384fa5
...
...
@@ -27,8 +27,6 @@ namespace Edu.Module.Course
return
categoryRepository
.
GetCourseCategoryListRepository
(
query
);
}
/// <summary>
/// 获取课程分类分页列表
/// </summary>
...
...
@@ -42,6 +40,32 @@ namespace Edu.Module.Course
return
categoryRepository
.
GetCourseCategoryPageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
}
/// <summary>
/// 获取当前和当前所有下级分类列表
/// </summary>
/// <param name="cateIds">事例(1,5)</param>
/// <returns></returns>
public
List
<
RB_Course_Category_ViewModel
>
GetChildCategoryListModule
(
string
cateIds
)
{
return
categoryRepository
.
GetChildCategoryListRepository
(
cateIds
);
}
/// <summary>
/// 获取当前和当前所有下级分类编号
/// </summary>
/// <param name="cateIds">事例(1,5)</param>
/// <returns></returns>
public
string
GetChildCategoryStringModule
(
string
cateIds
)
{
string
result
=
""
;
var
list
=
GetChildCategoryListModule
(
cateIds
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
result
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
CateId
));
}
return
result
;
}
/// <summary>
/// 根据分类编号获取课程分类实体
/// </summary>
...
...
Edu.Repository/Course/RB_Course_CategoryRepository.cs
View file @
9a384fa5
...
...
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
using
System.Data
;
namespace
Edu.Repository.Course
{
...
...
@@ -98,5 +99,19 @@ WHERE 1=1
}
return
GetPage
<
RB_Course_Category_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
/// <summary>
/// 获取所有子级分类
/// </summary>
/// <param name="cateIds">事例(1,5)</param>
/// <returns></returns>
public
List
<
RB_Course_Category_ViewModel
>
GetChildCategoryListRepository
(
string
cateIds
)
{
StringBuilder
builder
=
new
StringBuilder
();
var
parameters
=
new
DynamicParameters
();
string
procName
=
"proc_getchildcategory"
;
parameters
.
Add
(
"QId"
,
cateIds
,
direction
:
ParameterDirection
.
Input
);
return
Get
<
RB_Course_Category_ViewModel
>(
procName
,
parameters
,
commandType
:
CommandType
.
StoredProcedure
).
ToList
();
}
}
}
\ No newline at end of file
Edu.WebApi/Controllers/Course/CourseController.cs
View file @
9a384fa5
...
...
@@ -69,6 +69,20 @@ namespace Edu.WebApi.Controllers.Course
return
ApiResult
.
Success
(
data
:
list
);
}
/// <summary>
/// 获取课程分类树形列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetChildCategoryList
()
{
var
query
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Course_Category_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
var
list
=
categoryModule
.
GetChildCategoryStringModule
(
"1,5"
);
return
ApiResult
.
Success
(
data
:
list
);
}
/// <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