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
4f4a93ab
Commit
4f4a93ab
authored
Mar 22, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
b9d06bf8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
28 deletions
+77
-28
RB_Course_Vip.cs
Edu.Model/Entity/Course/RB_Course_Vip.cs
+6
-1
CourseVipModule.cs
Edu.Module.EduTask/CourseVipModule.cs
+64
-26
StopStudentClassController.cs
Edu.WebApi/Controllers/EduTask/StopStudentClassController.cs
+7
-1
No files found.
Edu.Model/Entity/Course/RB_Course_Vip.cs
View file @
4f4a93ab
...
...
@@ -25,10 +25,15 @@ namespace Edu.Model.Entity.Course
/// </summary>
public
string
CourseName
{
get
;
set
;
}
/// <summary>
/// 课时类型(1-课时,2-小时)
/// </summary>
public
int
HourType
{
get
;
set
;
}
/// <summary>
/// 总课时
/// </summary>
public
int
TotalHour
{
get
;
set
;
}
public
decimal
TotalHour
{
get
;
set
;
}
/// <summary>
/// 上课时段
...
...
Edu.Module.EduTask/CourseVipModule.cs
View file @
4f4a93ab
...
...
@@ -11,6 +11,7 @@ using Edu.Model.ViewModel.Scroll;
using
Edu.Model.ViewModel.Sell
;
using
Edu.Module.Course
;
using
Edu.Repository.Course
;
using
Edu.Repository.Customer
;
using
Edu.Repository.EduTask
;
using
Edu.Repository.Grade
;
using
Edu.Repository.Scroll
;
...
...
@@ -51,6 +52,11 @@ namespace Edu.Module.EduTask
/// </summary>
private
readonly
RB_Scroll_CourseTimeRepository
scroll_CourseTimeRepository
=
new
RB_Scroll_CourseTimeRepository
();
/// <summary>
/// 学员协助人员仓储层对象
/// </summary>
private
readonly
RB_Student_AssistRepository
student_AssistRepository
=
new
RB_Student_AssistRepository
();
/// <summary>
/// 班级处理类对象
/// </summary>
...
...
@@ -110,6 +116,53 @@ namespace Edu.Module.EduTask
return
flag
;
}
/// <summary>
/// 计算章节次数
/// </summary>
/// <param name="CourseTimeId">上课时段编号</param>
/// <param name="HourType">课时类型(1-课时,2-小时)</param>
/// <param name="TotalHour">总时间</param>
/// <param name="message">提示信息</param>
/// <returns></returns>
public
int
CalcChapterTimesModule
(
int
CourseTimeId
,
int
HourType
,
decimal
TotalHour
,
out
decimal
StudyMinutes
,
out
decimal
StudyHours
,
out
string
message
)
{
message
=
""
;
var
timeModel
=
scroll_CourseTimeRepository
.
GetList
(
new
RB_Scroll_CourseTime_ViewModel
()
{
CourseTimeIds
=
CourseTimeId
.
ToString
()
})?.
FirstOrDefault
();
List
<
CourseTimeModel
>
timeList
=
new
List
<
CourseTimeModel
>();
decimal
totalMinutes
=
0
;
if
(
HourType
==
1
)
{
totalMinutes
=
TotalHour
*
45
;
}
else
{
totalMinutes
=
TotalHour
*
60
;
}
StudyMinutes
=
0
;
StudyHours
=
0
;
if
(
timeModel
!=
null
&&
!
string
.
IsNullOrEmpty
(
timeModel
.
Content
))
{
timeList
=
JsonHelper
.
DeserializeObject
<
List
<
CourseTimeModel
>>(
timeModel
.
Content
);
StudyMinutes
=
timeList
?.
FirstOrDefault
()?.
Minutes
??
60
;
StudyHours
=
timeList
?.
FirstOrDefault
()?.
ClassHours
??
2
;
}
int
times
=
0
;
if
(
Convert
.
ToInt32
(
totalMinutes
)
%
Convert
.
ToInt32
(
StudyMinutes
)
==
0
)
{
times
=
Convert
.
ToInt32
(
totalMinutes
)
/
Convert
.
ToInt32
(
StudyMinutes
);
}
else
{
times
=
Convert
.
ToInt32
(
totalMinutes
)
/
Convert
.
ToInt32
(
StudyMinutes
)
+
1
;
message
=
"总课时和上课时段存在冲突,请调整课时或小时!"
;
}
return
times
;
}
/// <summary>
/// Vip课程申请转订单
...
...
@@ -199,29 +252,7 @@ namespace Edu.Module.EduTask
//添加课程章节
if
(
flag
)
{
var
timeModel
=
scroll_CourseTimeRepository
.
GetList
(
new
RB_Scroll_CourseTime_ViewModel
()
{
CourseTimeIds
=
model
.
CourseTimeId
.
ToString
()
})?.
FirstOrDefault
();
List
<
CourseTimeModel
>
timeList
=
new
List
<
CourseTimeModel
>();
decimal
ClassHours
=
0
;
decimal
StudyMinutes
=
0
;
if
(
timeModel
!=
null
&&
!
string
.
IsNullOrEmpty
(
timeModel
.
Content
))
{
timeList
=
JsonHelper
.
DeserializeObject
<
List
<
CourseTimeModel
>>(
timeModel
.
Content
);
ClassHours
=
timeList
?.
FirstOrDefault
()?.
ClassHours
??
2
;
StudyMinutes
=
timeList
?.
FirstOrDefault
()?.
Minutes
??
90
;
}
decimal
times
=
0
;
if
(
Convert
.
ToDecimal
(
model
.
TotalHour
)
%
ClassHours
==
0
)
{
times
=
Convert
.
ToDecimal
(
model
.
TotalHour
)
%
ClassHours
;
}
else
{
times
=
Convert
.
ToDecimal
(
model
.
TotalHour
)
%
ClassHours
+
1
;
}
int
times
=
CalcChapterTimesModule
(
model
.
CourseTimeId
,
model
.
HourType
,
model
.
TotalHour
,
out
decimal
StudyMinutes
,
out
decimal
ClassHours
,
out
string
msg
);
var
courseChapterList
=
new
List
<
RB_Course_Chapter_ViewModel
>();
for
(
var
i
=
0
;
i
<
times
;
i
++)
{
...
...
@@ -265,7 +296,6 @@ namespace Edu.Module.EduTask
//添加班级
if
(
flag
)
{
classModel
.
CreateBy
=
userInfo
.
Id
;
classModel
.
CreateTime
=
DateTime
.
Now
;
classModel
.
UpdateBy
=
userInfo
.
Id
;
...
...
@@ -283,7 +313,7 @@ namespace Edu.Module.EduTask
classModel
.
IsOpenCommission
=
0
;
classModel
.
CommissionType
=
0
;
classModel
.
CommissionValue
=
0
;
classModel
.
ClassHours
=
model
.
TotalHour
;
classModel
.
ClassHours
=
Convert
.
ToInt32
(
model
.
TotalHour
)
;
classModel
.
ClassStyle
=
0
;
classModel
.
ClassStatus
=
ClassStatusEnum
.
StudyIng
;
classModel
.
InnerRemark
=
""
;
...
...
@@ -303,6 +333,10 @@ namespace Edu.Module.EduTask
//添加订单
if
(
flag
)
{
var
assistList
=
student_AssistRepository
.
GetStudentAssistListRepository
(
new
Model
.
ViewModel
.
Customer
.
RB_Student_Assist_Extend
()
{
StuId
=
model
.
StuId
});
var
stuModel
=
studentRepository
.
GetEntity
(
model
.
StuId
);
RB_Order_ViewModel
demodel
=
new
RB_Order_ViewModel
()
{
...
...
@@ -333,7 +367,11 @@ namespace Edu.Module.EduTask
{
demodel
.
CustomerId
=
stuModel
.
StuSourceId
;
}
if
(
assistList
!=
null
&&
assistList
.
Count
>
0
)
{
demodel
.
CourseConsultantId
=
assistList
?.
FirstOrDefault
(
qitem
=>
qitem
.
AssistType
==
Common
.
Enum
.
User
.
AssistTypeEnum
.
CourseAdviser
)?.
AssistId
??
0
;
demodel
.
HelpEnterId
=
assistList
?.
FirstOrDefault
(
qitem
=>
qitem
.
AssistType
==
Common
.
Enum
.
User
.
AssistTypeEnum
.
Teacher
)?.
AssistId
??
0
;
}
demodel
.
Group_Id
=
userInfo
.
Group_Id
;
demodel
.
School_Id
=
userInfo
.
School_Id
;
...
...
Edu.WebApi/Controllers/EduTask/StopStudentClassController.cs
View file @
4f4a93ab
...
...
@@ -106,7 +106,8 @@ namespace Edu.WebApi.Controllers.EduTask
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
),
CateId
=
base
.
ParmJObj
.
GetInt
(
"CateId"
),
CourseName
=
base
.
ParmJObj
.
GetStringValue
(
"CourseName"
),
TotalHour
=
base
.
ParmJObj
.
GetInt
(
"TotalHour"
),
HourType
=
base
.
ParmJObj
.
GetInt
(
"HourType"
),
TotalHour
=
base
.
ParmJObj
.
GetDecimal
(
"TotalHour"
),
CourseTimeId
=
base
.
ParmJObj
.
GetInt
(
"CourseTimeId"
),
CoursePrice
=
base
.
ParmJObj
.
GetDecimal
(
"CoursePrice"
),
Remarks
=
base
.
ParmJObj
.
GetStringValue
(
"Remarks"
),
...
...
@@ -119,6 +120,11 @@ namespace Edu.WebApi.Controllers.EduTask
model
.
UpdateBy
=
base
.
UserInfo
.
Id
;
model
.
UpdateTime
=
DateTime
.
Now
;
model
.
AuditStatus
=
Common
.
Enum
.
User
.
WFRrocessStatus
.
NotAudit
;
int
times
=
courseVipModule
.
CalcChapterTimesModule
(
model
.
CourseTimeId
,
model
.
HourType
,
model
.
TotalHour
,
out
_
,
out
_
,
out
string
message1
);
if
(!
string
.
IsNullOrEmpty
(
message1
))
{
return
ApiResult
.
Failed
(
message
:
message1
);
}
bool
flag
=
courseVipModule
.
SetCourseVipModule
(
model
,
out
string
message
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
(
message
:
message
);
}
...
...
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