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
bfc76adb
Commit
bfc76adb
authored
Jan 08, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
af229737
e3aa76a3
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
204 additions
and
34 deletions
+204
-34
SaleplatEnum.cs
Edu.Common/Enum/Course/SaleplatEnum.cs
+29
-0
RB_Course_StepPrice.cs
Edu.Model/Entity/Course/RB_Course_StepPrice.cs
+33
-23
RB_Course_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_ViewModel.cs
+31
-1
RB_Question_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_ViewModel.cs
+6
-0
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+52
-7
RB_QuestionRepository.cs
Edu.Repository/Question/RB_QuestionRepository.cs
+14
-1
CourseController.cs
Edu.WebApi/Controllers/Course/CourseController.cs
+12
-0
QuestionController.cs
Edu.WebApi/Controllers/Course/QuestionController.cs
+27
-2
No files found.
Edu.Common/Enum/Course/SaleplatEnum.cs
0 → 100644
View file @
bfc76adb
using
Edu.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Common.Enum.Course
{
/// <summary>
/// 销售端口
/// </summary>
public
enum
SaleplatEnum
{
/// <summary>
/// 内部销售
/// </summary>
[
EnumField
(
"内部销售"
)]
InternalSales
=
1
,
/// <summary>
/// 学员App
/// </summary>
[
EnumField
(
"学员App"
)]
StudentApp
=
2
,
/// <summary>
/// 网课端
/// </summary>
[
EnumField
(
"网课端"
)]
OnlineClass
=
3
,
}
}
Edu.Model/Entity/Course/RB_Course_StepPrice.cs
View file @
bfc76adb
...
...
@@ -3,31 +3,41 @@ using VT.FW.DB;
namespace
Edu.Model.Entity.Course
{
/// <summary>
/// 课程阶梯价格实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Course_StepPrice
/// <summary>
/// 课程阶梯价格实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Course_StepPrice
{
/// <summary>
/// 主键
/// </summary>
public
int
CoursePriceId
{
get
;
set
;
}
/// <summary>
/// 主键
/// </summary>
public
int
CoursePriceId
{
get
;
set
;
}
/// <summary>
/// 课程编号
/// </summary>
public
int
CourseId
{
get
;
set
;
}
/// <summary>
/// 课程编号
/// </summary>
public
int
CourseId
{
get
;
set
;
}
/// <summary>
/// 人数
/// </summary>
public
int
PersionNum
{
get
;
set
;
}
/// <summary>
/// 人数
/// </summary>
public
int
PersionNum
{
get
;
set
;
}
/// <summary>
/// 售价
/// </summary>
public
decimal
SellPrice
{
get
;
set
;
}
}
/// <summary>
/// 售价
/// </summary>
public
decimal
PersionPrice
{
get
;
set
;
}
/// <summary>
/// 集团编号
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
/// <summary>
/// 学校编号
/// </summary>
public
int
School_Id
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Course/RB_Course_ViewModel.cs
View file @
bfc76adb
...
...
@@ -23,7 +23,7 @@ namespace Edu.Model.ViewModel.Course
/// <summary>
/// 创建时间字符串
/// </summary>
public
string
CreateTimeStr
{
get
{
return
this
.
CreateTime
.
FormatTime
();}
}
public
string
CreateTimeStr
{
get
{
return
this
.
CreateTime
.
FormatTime
();
}
}
/// <summary>
/// 更新时间
...
...
@@ -44,5 +44,35 @@ namespace Edu.Model.ViewModel.Course
/// 课程阶梯价格列表
/// </summary>
public
List
<
RB_Course_StepPrice_ViewModel
>
StepPriceList
{
get
;
set
;
}
/// <summary>
/// 教师团队
/// </summary>
public
List
<
int
>
TeacherIdList
{
get
{
if
(!
string
.
IsNullOrEmpty
(
this
.
Teacher_Ids
))
{
return
Common
.
ConvertHelper
.
StringToList
(
this
.
Teacher_Ids
);
}
return
new
List
<
int
>();
}
}
/// <summary>
/// 销售平台
/// </summary>
public
List
<
int
>
SalePlatList
{
get
{
if
(!
string
.
IsNullOrEmpty
(
this
.
Saleplat
))
{
return
Common
.
ConvertHelper
.
StringToList
(
this
.
Saleplat
);
}
return
new
List
<
int
>();
}
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Question/RB_Question_ViewModel.cs
View file @
bfc76adb
...
...
@@ -43,6 +43,7 @@ namespace Edu.Model.ViewModel.Question
/// </summary>
public
string
QQuestionTypeStr
{
get
;
set
;
}
/// <summary>
/// 知识点【查询使用,多选】
/// </summary>
...
...
@@ -58,5 +59,10 @@ namespace Edu.Model.ViewModel.Question
/// </summary>
public
object
AnswerObj
{
get
;
set
;
}
/// <summary>
/// 知识点名称
/// </summary>
public
string
PointName
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.Course/CourseModule.cs
View file @
bfc76adb
...
...
@@ -161,19 +161,64 @@ namespace Edu.Module.Course
model
.
CourseId
=
newId
;
flag
=
newId
>
0
;
}
//没有设置阶梯价格,删除原来的价格
course_StepPriceRepository
.
DeleteStepPriceRepository
(
model
.
CourseId
);
if
(
model
.
IsOpenStepPrice
==
1
)
#
region
阶梯报价
//未开启阶梯价格
if
(
model
.
IsOpenStepPrice
==
0
)
{
course_StepPriceRepository
.
DeleteStepPriceRepository
(
model
.
CourseId
);
}
else
//开启阶梯价格
{
if
(
model
.
StepPriceList
!=
null
&&
model
.
StepPriceList
.
Count
>
0
)
var
oldStepPriceList
=
course_StepPriceRepository
.
GetCourseStepPriceListRepository
(
new
RB_Course_StepPrice_ViewModel
()
{
CourseId
=
model
.
CourseId
});
//以前没有阶梯报价信息【直接新增】
if
(
oldStepPriceList
==
null
||
(
oldStepPriceList
!=
null
&&
oldStepPriceList
.
Count
==
0
))
{
foreach
(
var
item
in
model
.
StepPriceList
)
if
(
model
.
StepPriceList
!=
null
&&
model
.
StepPriceList
.
Count
>
0
)
{
foreach
(
var
item
in
model
.
StepPriceList
)
{
item
.
CoursePriceId
=
0
;
item
.
CourseId
=
model
.
CourseId
;
item
.
Group_Id
=
model
.
Group_Id
;
item
.
School_Id
=
model
.
School_Id
;
course_StepPriceRepository
.
Insert
(
item
);
}
}
}
else
//以前有阶梯报价
{
//现在没有阶梯报价了【直接删除以前的阶梯报价】
if
(
model
.
StepPriceList
==
null
||
(
model
.
StepPriceList
!=
null
&&
model
.
StepPriceList
.
Count
==
0
))
{
course_StepPriceRepository
.
DeleteStepPriceRepository
(
model
.
CourseId
);
}
//找出差异的数据
var
deleteList
=
oldStepPriceList
.
Where
(
qitem
=>
!
model
.
StepPriceList
.
Any
(
oldItem
=>
qitem
.
CoursePriceId
==
oldItem
.
CoursePriceId
)).
ToList
();
foreach
(
var
dItem
in
deleteList
)
{
if
(
dItem
.
CoursePriceId
>
0
)
{
course_StepPriceRepository
.
Delete
(
dItem
.
CoursePriceId
);
}
}
foreach
(
var
priceItem
in
model
.
StepPriceList
)
{
item
.
CourseId
=
model
.
CourseId
;
course_StepPriceRepository
.
Insert
(
item
);
priceItem
.
CourseId
=
model
.
CourseId
;
priceItem
.
Group_Id
=
model
.
Group_Id
;
priceItem
.
School_Id
=
model
.
School_Id
;
if
(
priceItem
.
CoursePriceId
==
0
)
{
course_StepPriceRepository
.
Insert
(
priceItem
);
}
else
{
course_StepPriceRepository
.
Update
(
priceItem
);
}
}
}
}
#
endregion
return
flag
;
}
...
...
Edu.Repository/Question/RB_QuestionRepository.cs
View file @
bfc76adb
...
...
@@ -54,7 +54,7 @@ WHERE 1=1
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*,IFNULL(B.`Name` ,'') AS QuestionTypeName
FROM RB_Question AS A LEFT JOIN RB_Question_Type B ON A.QuestionTypeId=B.QId
FROM RB_Question AS A LEFT JOIN RB_Question_Type B ON A.QuestionTypeId=B.QId
WHERE 1=1 "
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Question_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
==
null
)
...
...
@@ -72,6 +72,19 @@ WHERE 1=1 ");
builder
.
AppendFormat
(
" AND A.{0} LIKE @Title "
,
nameof
(
RB_Question_ViewModel
.
Title
));
parameters
.
Add
(
"Title"
,
"%"
+
query
.
Title
.
Trim
()
+
"%"
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
PointName
))
{
builder
.
Append
(
@" AND A.Knowledge<>'' AND EXISTS (SELECT 1 FROM rb_question_point WHERE PointId IN(A.Knowledge) AND A.CourseId=CourseId AND PointName LIKE @PointName ) "
);
parameters
.
Add
(
"PointName"
,
"%"
+
query
.
PointName
.
Trim
()
+
"%"
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QQuestionTypeStr
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Question_ViewModel
.
QuestionTypeId
),
query
.
QQuestionTypeStr
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QDifficultyType
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Question_ViewModel
.
DifficultyType
),
query
.
QDifficultyType
);
}
builder
.
AppendFormat
(
" ORDER BY A.{0} DESC "
,
nameof
(
RB_Question_ViewModel
.
QuestionId
));
return
GetPage
<
RB_Question_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
...
...
Edu.WebApi/Controllers/Course/CourseController.cs
View file @
bfc76adb
using
System
;
using
Edu.Cache.User
;
using
Edu.Common.API
;
using
Edu.Common.Enum.Course
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Module.Course
;
...
...
@@ -216,6 +217,17 @@ namespace Edu.WebApi.Controllers.Course
return
ApiResult
.
Success
(
data
:
extModel
);
}
/// <summary>
/// 获取销售端口
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetSaleplatList
()
{
var
list
=
Common
.
Plugin
.
EnumHelper
.
EnumToList
(
typeof
(
SaleplatEnum
));
return
ApiResult
.
Success
(
data
:
list
);
}
/// <summary>
/// 删除课程
/// </summary>
...
...
Edu.WebApi/Controllers/Course/QuestionController.cs
View file @
bfc76adb
...
...
@@ -48,9 +48,34 @@ namespace Edu.WebApi.Controllers.Course
var
query
=
new
RB_Question_ViewModel
()
{
CourseId
=
base
.
ParmJObj
.
GetInt
(
"CourseId"
),
Title
=
base
.
ParmJObj
.
GetStringValue
(
"Title"
),
CourseId
=
base
.
ParmJObj
.
GetInt
(
"CourseId"
),
Title
=
base
.
ParmJObj
.
GetStringValue
(
"Title"
),
PointName
=
base
.
ParmJObj
.
GetStringValue
(
"PointName"
),
};
try
{
var
DifficultyTypeList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
int
>>(
base
.
ParmJObj
.
GetStringValue
(
"DifficultyType"
));
if
(
DifficultyTypeList
!=
null
&&
DifficultyTypeList
.
Count
>
0
&&
!
DifficultyTypeList
.
Contains
(
0
))
{
query
.
QDifficultyType
=
string
.
Join
(
","
,
DifficultyTypeList
);
}
}
catch
{
}
try
{
var
QuestionTypeIdList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
int
>>(
base
.
ParmJObj
.
GetStringValue
(
"QuestionTypeId"
));
if
(
QuestionTypeIdList
!=
null
&&
QuestionTypeIdList
.
Count
>
0
)
{
query
.
QQuestionTypeStr
=
string
.
Join
(
","
,
QuestionTypeIdList
);
}
}
catch
{
}
var
list
=
questionModule
.
GetQuestionPageListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
List
<
object
>
resultList
=
new
List
<
object
>();
foreach
(
var
item
in
list
)
...
...
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