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
76e01cac
Commit
76e01cac
authored
Mar 11, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增实体类
parent
7d45527f
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
223 additions
and
12 deletions
+223
-12
RB_Course_JobDetails.cs
Edu.Model/Entity/Course/RB_Course_JobDetails.cs
+40
-0
RB_Course_Offer.cs
Edu.Model/Entity/Course/RB_Course_Offer.cs
+5
-0
RB_Course_JobDetails_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_JobDetails_ViewModel.cs
+76
-0
RB_Course_Job_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_Job_ViewModel.cs
+6
-0
RB_Question_Answer_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_Answer_ViewModel.cs
+0
-5
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+14
-1
CourseOfferModule.cs
Edu.Module.Course/CourseOfferModule.cs
+1
-1
RB_CourseRepository.cs
Edu.Repository/Course/RB_CourseRepository.cs
+0
-1
RB_Course_JobDetailsRepository.cs
Edu.Repository/Course/RB_Course_JobDetailsRepository.cs
+43
-0
CourseController.cs
Edu.WebApi/Controllers/Course/CourseController.cs
+33
-2
CourseOfferController.cs
Edu.WebApi/Controllers/Course/CourseOfferController.cs
+5
-2
No files found.
Edu.Model/Entity/Course/RB_Course_JobDetails.cs
0 → 100644
View file @
76e01cac
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Course
{
/// <summary>
/// 课程作业详情实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Course_JobDetails
{
/// <summary>
/// 作业详情编号
/// </summary>
public
int
DetailsId
{
get
;
set
;
}
/// <summary>
/// 作业编号
/// </summary>
public
int
JobId
{
get
;
set
;
}
/// <summary>
/// 问题编号
/// </summary>
public
int
QuestionId
{
get
;
set
;
}
/// <summary>
/// 作业分数
/// </summary>
public
decimal
Score
{
get
;
set
;
}
/// <summary>
/// 排序
/// </summary>
public
int
SortNum
{
get
;
set
;
}
}
}
Edu.Model/Entity/Course/RB_Course_Offer.cs
View file @
76e01cac
...
...
@@ -116,5 +116,10 @@ namespace Edu.Model.Entity.Course
/// 客户电话
/// </summary>
public
string
CustomerTel
{
get
;
set
;
}
/// <summary>
/// 客户人数
/// </summary>
public
int
JoinNum
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Course/RB_Course_JobDetails_ViewModel.cs
0 → 100644
View file @
76e01cac
using
Edu.Common.Enum.Course
;
using
Edu.Common.Enum.Question
;
using
Edu.Model.Entity.Course
;
using
Edu.Model.ViewModel.Question
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.Course
{
/// <summary>
/// 课程作业详情视图实体类
/// </summary>
public
class
RB_Course_JobDetails_ViewModel
:
RB_Course_JobDetails
{
/// <summary>
/// 问题名称
/// </summary>
public
string
Title
{
get
;
set
;
}
/// <summary>
/// 问题内容
/// </summary>
public
string
QuestionContent
{
get
;
set
;
}
/// <summary>
/// 难易程度(1-易,2-中,3-难)
/// </summary>
public
DifficultyTypeEnum
DifficultyType
{
get
;
set
;
}
/// <summary>
/// 答案解析
/// </summary>
public
string
AnswerParse
{
get
;
set
;
}
/// <summary>
/// 问题类型编号
/// </summary>
public
int
QuestionTypeId
{
get
;
set
;
}
/// <summary>
/// 问题类型Key
/// </summary>
public
string
QuestionTypeKey
{
get
;
set
;
}
/// <summary>
/// 知识点
/// </summary>
public
string
Knowledge
{
get
;
set
;
}
/// <summary>
/// 是否同步修改引用此题目的作业和考试(1-是)
/// </summary>
public
int
IsUpdateJobExam
{
get
;
set
;
}
/// <summary>
/// 问题答案【JSON字符串】
/// </summary>
public
string
Answer
{
get
;
set
;
}
/// <summary>
/// 填空题(答案顺序打乱也判正确)
/// </summary>
public
int
IsMutex
{
get
;
set
;
}
/// <summary>
/// 题目所属大类
/// </summary>
public
QuestionCategoryEnum
?
Category
{
get
;
set
;
}
/// <summary>
/// 考级程度
/// </summary>
public
LevelTypeEnum
?
LevelType
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Course/RB_Course_Job_ViewModel.cs
View file @
76e01cac
using
System
;
using
System.Collections.Generic
;
namespace
Edu.Model.ViewModel.Course
{
...
...
@@ -17,5 +18,10 @@ namespace Edu.Model.ViewModel.Course
/// 创建时间字符串
/// </summary>
public
string
CreateTimeStr
{
get
{
return
Common
.
ConvertHelper
.
FormatTime
(
this
.
CreateTime
);
}
}
/// <summary>
/// 作业详情列表
/// </summary>
public
List
<
RB_Course_JobDetails_ViewModel
>
JobDetailsList
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Question/RB_Question_Answer_ViewModel.cs
deleted
100644 → 0
View file @
7d45527f
namespace
Edu.Model.ViewModel.Question
{
}
\ No newline at end of file
Edu.Module.Course/CourseModule.cs
View file @
76e01cac
...
...
@@ -89,7 +89,20 @@ namespace Edu.Module.Course
/// <returns></returns>
public
List
<
RB_Course_ViewModel
>
GetCourseListModule
(
RB_Course_ViewModel
query
)
{
return
courseRepository
.
GetCourseListRepository
(
query
);
var
list
=
courseRepository
.
GetCourseListRepository
(
query
);
if
(
query
.
IsQPrice
==
1
&&
list
!=
null
&&
list
.
Count
>
0
)
{
var
ids
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
CourseId
));
var
preferentialList
=
course_PreferentialRepository
.
GetCoursePreferentialListRepostory
(
new
RB_Course_Preferential_Extend
()
{
QCourseIds
=
ids
});
foreach
(
var
item
in
list
)
{
item
.
PreferentialList
=
preferentialList
?.
Where
(
qitem
=>
qitem
.
CourseId
==
item
.
CourseId
)?.
OrderBy
(
qitem
=>
qitem
.
PriceDiscountType
)?.
ToList
()
??
new
List
<
RB_Course_Preferential_Extend
>();
}
}
return
list
;
}
/// <summary>
...
...
Edu.Module.Course/CourseOfferModule.cs
View file @
76e01cac
...
...
@@ -78,7 +78,6 @@ namespace Edu.Module.Course
public
virtual
bool
SetCourseOfferModule
(
RB_Course_Offer_ViewModel
model
)
{
bool
flag
=
false
;
if
(
model
.
Id
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
...
...
@@ -96,6 +95,7 @@ namespace Edu.Module.Course
{
nameof
(
RB_Course_Offer_ViewModel
.
UpdateTime
),
model
.
UpdateTime
},
{
nameof
(
RB_Course_Offer_ViewModel
.
CustomerName
),
model
.
CustomerName
},
{
nameof
(
RB_Course_Offer_ViewModel
.
CustomerTel
),
model
.
CustomerTel
},
{
nameof
(
RB_Course_Offer_ViewModel
.
JoinNum
),
model
.
JoinNum
},
};
flag
=
course_OfferRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Course_Offer_ViewModel
.
Id
),
model
.
Id
));
}
...
...
Edu.Repository/Course/RB_CourseRepository.cs
View file @
76e01cac
...
...
@@ -27,7 +27,6 @@ FROM RB_Course AS A LEFT JOIN rb_course_category AS B ON A.CateId=B.CateId
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_ViewModel
.
Group_Id
),
query
.
Group_Id
);
//builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Course_ViewModel.School_Id), query.School_Id);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
{
...
...
Edu.Repository/Course/RB_Course_JobDetailsRepository.cs
0 → 100644
View file @
76e01cac
using
Edu.Model.Entity.Course
;
using
Edu.Model.ViewModel.Course
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Edu.Repository.Course
{
/// <summary>
/// 课程作业仓储层
/// </summary>
public
class
RB_Course_JobDetailsRepository
:
BaseRepository
<
RB_Course_JobDetails
>
{
/// <summary>
/// 获取课程作业题目列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course_JobDetails_ViewModel
>
GetCourseJobDetailsListRepository
(
RB_Course_JobDetails_ViewModel
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*,B.Title,B.QuestionContent,B.DifficultyType,B.AnswerParse,B.QuestionTypeId,B.QuestionTypeKey,B.Knowledge,B.IsUpdateJobExam
,B.Answer,B.IsMutex,B.Category,B.LevelType
FROM RB_Course_JobDetails AS A INNER JOIN rb_question AS B ON A.QuestionId=B.QuestionId
WHERE 1=1
"
);
if
(
query
==
null
)
{
return
new
List
<
RB_Course_JobDetails_ViewModel
>();
}
else
{
if
(
query
.
JobId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_JobDetails_ViewModel
.
JobId
),
query
.
JobId
);
}
}
return
Get
<
RB_Course_JobDetails_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
}
}
Edu.WebApi/Controllers/Course/CourseController.cs
View file @
76e01cac
...
...
@@ -200,11 +200,42 @@ namespace Edu.WebApi.Controllers.Course
[
HttpPost
]
public
ApiResult
GetCourseList
()
{
var
query
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Course_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Course_ViewModel
()
{
IsQPrice
=
base
.
ParmJObj
.
GetInt
(
"IsQPrice"
,
0
),
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
var
list
=
courseModule
.
GetCourseListModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
return
ApiResult
.
Success
(
data
:
list
.
Select
(
qitem
=>
new
{
qitem
.
CourseId
,
qitem
.
CourseName
,
qitem
.
CateId
,
qitem
.
CateName
,
qitem
.
CoverImg
,
qitem
.
TeacherIdList
,
qitem
.
OriginalPrice
,
qitem
.
SellPrice
,
qitem
.
SalePlatList
,
qitem
.
SalePlatArr
,
qitem
.
ClassHours
,
PreferentialList
=
qitem
?.
PreferentialList
?.
Select
(
sItem
=>
new
{
sItem
.
Id
,
sItem
.
PriceDiscountType
,
sItem
.
PriceDiscountTypeStr
,
sItem
.
CourseId
,
sItem
.
SaleCommissionType
,
sItem
.
SaleCommissionMoney
,
sItem
.
B2BCommissionType
,
sItem
.
B2BCommissionMoney
,
sItem
.
BuyNum
,
sItem
.
SendNum
,
sItem
.
PriceType
,
sItem
.
PriceMoney
})
}));
}
...
...
Edu.WebApi/Controllers/Course/CourseOfferController.cs
View file @
76e01cac
...
...
@@ -92,6 +92,7 @@ namespace Edu.WebApi.Controllers.Course
qitem
.
OfferDetails
,
qitem
.
CustomerName
,
qitem
.
CustomerTel
,
qitem
.
JoinNum
,
});
return
ApiResult
.
Success
(
data
:
pageModel
);
}
...
...
@@ -133,7 +134,8 @@ namespace Edu.WebApi.Controllers.Course
TotalDiscountPrice
=
base
.
ParmJObj
.
GetDecimal
(
"TotalDiscountPrice"
),
CustomerInfo
=
base
.
ParmJObj
.
GetStringValue
(
"CustomerInfo"
),
CustomerName
=
base
.
ParmJObj
.
GetStringValue
(
"CustomerName"
),
CustomerTel
=
base
.
ParmJObj
.
GetStringValue
(
"CustomerTel"
)
CustomerTel
=
base
.
ParmJObj
.
GetStringValue
(
"CustomerTel"
),
JoinNum
=
base
.
ParmJObj
.
GetInt
(
"JoinNum"
)
};
try
{
...
...
@@ -180,7 +182,8 @@ namespace Edu.WebApi.Controllers.Course
extModel
?.
CreateBy
,
extModel
?.
CustomerTel
,
extModel
?.
CustomerName
,
CreateByName
=
extModel
.
CreateBy
>
0
?
UserReidsCache
.
GetUserLoginInfo
(
extModel
.
CreateBy
)?.
AccountName
??
""
:
""
,
extModel
?.
JoinNum
,
CreateByName
=
extModel
.
CreateBy
>
0
?
UserReidsCache
.
GetUserLoginInfo
(
extModel
.
CreateBy
)?.
AccountName
??
""
:
""
,
extModel
?.
SerialNum
,
OfferDetails
=
extModel
?.
OfferDetails
??
new
List
<
RB_Course_OfferDetails_ViewModel
>()
};
...
...
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