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
857a9ee6
Commit
857a9ee6
authored
Sep 10, 2024
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上课记录调整
parent
ef186369
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
29 deletions
+65
-29
RB_Course_Chapter_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Course_Chapter_ViewModel.cs
+5
-0
ScrollClassModule.cs
Edu.Module.Course/ScrollClassModule.cs
+52
-28
RB_Course_ChapterRepository.cs
Edu.Repository/Course/RB_Course_ChapterRepository.cs
+4
-0
ScrollController.cs
Edu.WebApi/Controllers/Course/ScrollController.cs
+4
-1
No files found.
Edu.Model/ViewModel/Course/RB_Course_Chapter_ViewModel.cs
View file @
857a9ee6
...
@@ -49,6 +49,11 @@ namespace Edu.Model.ViewModel.Course
...
@@ -49,6 +49,11 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
/// </summary>
public
int
IsQRoot
{
get
;
set
;
}
public
int
IsQRoot
{
get
;
set
;
}
/// <summary>
/// 课程等级倒序,章节升序
/// </summary>
public
int
QOrderBy
{
get
;
set
;
}
}
}
[
Serializable
]
[
Serializable
]
...
...
Edu.Module.Course/ScrollClassModule.cs
View file @
857a9ee6
...
@@ -122,6 +122,12 @@ namespace Edu.Module.Course
...
@@ -122,6 +122,12 @@ namespace Edu.Module.Course
/// </summary>
/// </summary>
private
readonly
RB_Student_StudyRepository
studentStudyRepository
=
new
RB_Student_StudyRepository
();
private
readonly
RB_Student_StudyRepository
studentStudyRepository
=
new
RB_Student_StudyRepository
();
/// <summary>
/// 订单课程仓储层
/// </summary>
private
readonly
RB_Order_CourseRepository
order_CourseRepository
=
new
RB_Order_CourseRepository
();
#
region
班次
#
region
班次
...
@@ -3691,6 +3697,8 @@ namespace Edu.Module.Course
...
@@ -3691,6 +3697,8 @@ namespace Edu.Module.Course
//获取所有的订单信息
//获取所有的订单信息
string
orderIds
=
string
.
Join
(
","
,
ogList
.
Select
(
x
=>
x
.
OrderId
));
string
orderIds
=
string
.
Join
(
","
,
ogList
.
Select
(
x
=>
x
.
OrderId
));
var
orderList
=
orderRepository
.
GetOrderListRepository
(
new
RB_Order_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
QOrderIds
=
orderIds
});
var
orderList
=
orderRepository
.
GetOrderListRepository
(
new
RB_Order_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
QOrderIds
=
orderIds
});
//订单课程关联表
List
<
RB_Order_Course_ViewModel
>
orderCourseList
=
order_CourseRepository
.
GetOrderCourseListRepository
(
new
RB_Order_Course_ViewModel
()
{
QOrderIds
=
orderIds
});
//查询订单Guest
//查询订单Guest
string
orderGuestIds
=
string
.
Join
(
","
,
ogList
.
Select
(
x
=>
x
.
OrderId
));
string
orderGuestIds
=
string
.
Join
(
","
,
ogList
.
Select
(
x
=>
x
.
OrderId
));
var
orderGuestList
=
order_GuestRepository
.
GetSingleListRepository
(
new
RB_Order_Guest_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
OrderGuestIds
=
orderGuestIds
});
var
orderGuestList
=
order_GuestRepository
.
GetSingleListRepository
(
new
RB_Order_Guest_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
OrderGuestIds
=
orderGuestIds
});
...
@@ -3701,28 +3709,32 @@ namespace Edu.Module.Course
...
@@ -3701,28 +3709,32 @@ namespace Edu.Module.Course
foreach
(
var
item
in
orderList
)
foreach
(
var
item
in
orderList
)
{
{
int
TotalChapterNo
=
0
;
//总课次
int
CourseChapterNo
=
0
;
//已上课次
List
<
object
>
ChapterList
=
new
List
<
object
>();
List
<
object
>
ChapterList
=
new
List
<
object
>();
var
ogModel
=
ogList
.
Where
(
x
=>
x
.
OrderId
==
item
.
OrderId
).
FirstOrDefault
();
var
ogModel
=
ogList
.
Where
(
x
=>
x
.
OrderId
==
item
.
OrderId
).
FirstOrDefault
();
var
oguestModel
=
orderGuestList
.
Where
(
x
=>
x
.
Id
==
ogModel
.
GuestId
).
FirstOrDefault
();
var
oguestModel
=
orderGuestList
.
Where
(
x
=>
x
.
Id
==
ogModel
.
GuestId
).
FirstOrDefault
();
//根据课程Id 查询 上课课程
//根据课程Id 查询 上课课程
var
cList
=
course_ChapterRepository
.
GetChapterListRepository
(
new
RB_Course_Chapter_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
CourseId
=
item
.
CourseId
});
List
<
int
>
courseIdList
=
new
List
<
int
>();
courseIdList
.
Add
(
item
.
CourseId
);
var
tempCourseList
=
orderCourseList
?.
Where
(
qitem
=>
qitem
.
OrderId
==
item
.
OrderId
)?.
Select
(
qitem
=>
qitem
.
CourseId
)?.
ToList
()?.
Distinct
();
if
(
tempCourseList
!=
null
&&
tempCourseList
.
Count
()
>
0
)
{
courseIdList
.
AddRange
(
tempCourseList
);
}
var
cList
=
course_ChapterRepository
.
GetChapterListRepository
(
new
RB_Course_Chapter_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
CourseIds
=
string
.
Join
(
","
,
courseIdList
.
Distinct
()),
QOrderBy
=
1
})?.
ToList
();
if
(
item
.
ClassScrollType
==
2
)
if
(
item
.
ClassScrollType
==
2
)
{
{
var
achildList
=
AppointList
.
Where
(
x
=>
x
.
GuestId
==
ogModel
.
GuestId
).
ToList
();
//当前课程的
var
achildList
=
AppointList
.
Where
(
x
=>
x
.
GuestId
==
ogModel
.
GuestId
).
ToList
();
//当前课程的
//预约课
int
CourseChapterNo
=
achildList
.
Any
()
?
achildList
.
Max
(
x
=>
x
.
ChapterNo
)
:
0
;
foreach
(
var
sItem
in
cList
)
int
CourseChapterNo2
=
SkipList
.
Any
()
?
SkipList
.
Max
(
x
=>
x
.
ChapterNo
)
:
0
;
CourseChapterNo
=
CourseChapterNo
<
CourseChapterNo2
?
CourseChapterNo2
:
CourseChapterNo
;
cList
.
ForEach
(
x
=>
{
{
x
.
SortNum
=
Convert
.
ToDouble
(
x
.
ChapterNo
);
var
AppointModel
=
achildList
.
Where
(
y
=>
y
.
CourseGradeId
==
sItem
.
CourseRate
&&
y
.
CourseGradeNo
==
sItem
.
ChapterGradeNo
).
FirstOrDefault
();
});
//var SkipModel = SkipList.Where(y => y.ChapterNo == x.SortNum && y.CourseId == item.CourseId).FirstOrDefault();
cList
.
Where
(
x
=>
x
.
SortNum
<=
CourseChapterNo
).
OrderByDescending
(
x
=>
x
.
SortNum
).
ToList
().
ForEach
(
x
=>
int
AgainNum
=
achildList
.
Where
(
y
=>
y
.
CourseGradeId
==
sItem
.
CourseRate
&&
y
.
CourseGradeNo
==
sItem
.
ChapterGradeNo
&&
y
.
AppointType
==
3
).
Count
();
{
int
State
=
0
;
var
AppointModel
=
achildList
.
Where
(
y
=>
y
.
ChapterNo
==
x
.
SortNum
&&
y
.
AppointType
!=
3
&&
y
.
LearnCourseId
==
item
.
CourseId
).
FirstOrDefault
();
var
SkipModel
=
SkipList
.
Where
(
y
=>
y
.
ChapterNo
==
x
.
SortNum
&&
y
.
CourseId
==
item
.
CourseId
).
FirstOrDefault
();
int
AgainNum
=
achildList
.
Where
(
y
=>
y
.
ChapterNo
==
x
.
SortNum
&&
y
.
AppointType
==
3
&&
y
.
LearnCourseId
==
item
.
CourseId
).
Count
();
int
State
=
3
;
int
AppointState
=
0
;
int
AppointState
=
0
;
string
ClassDate
=
""
;
string
ClassDate
=
""
;
if
(
AppointModel
!=
null
)
if
(
AppointModel
!=
null
)
...
@@ -3732,6 +3744,7 @@ namespace Edu.Module.Course
...
@@ -3732,6 +3744,7 @@ namespace Edu.Module.Course
if
(
AppointModel
.
AppointType
==
1
)
if
(
AppointModel
.
AppointType
==
1
)
{
{
State
=
1
;
//正常上课
State
=
1
;
//正常上课
CourseChapterNo
++;
}
}
else
if
(
AppointModel
.
AppointType
==
2
)
else
if
(
AppointModel
.
AppointType
==
2
)
{
{
...
@@ -3739,30 +3752,31 @@ namespace Edu.Module.Course
...
@@ -3739,30 +3752,31 @@ namespace Edu.Module.Course
}
}
AppointState
=
(
int
)
AppointModel
.
State
;
AppointState
=
(
int
)
AppointModel
.
State
;
}
}
if
(
SkipModel
!=
null
&&
SkipModel
.
State
==
1
)
//if (SkipModel != null && SkipModel.State == 1)
{
//{
State
=
3
;
//跳课
// State = 3;//跳课
}
//}
ChapterList
.
Add
(
new
ChapterList
.
Add
(
new
{
{
x
.
ChapterNo
,
sItem
.
ChapterNo
,
x
.
ChapterName
,
sItem
.
ChapterName
,
x
.
CourseRate
,
sItem
.
CourseRate
,
CourseRateName
=
x
.
CourseRate
.
ToName
(),
CourseRateName
=
sItem
.
CourseRate
.
ToName
(),
x
.
ChapterGradeNo
,
sItem
.
ChapterGradeNo
,
State
,
State
,
AppointState
,
AppointState
,
AgainNum
,
AgainNum
,
ClassDate
ClassDate
});
});
}
);
}
}
}
else
else
{
{
//跟班
//跟班
int
CourseChapterNo
=
oguestModel
?.
CourseChapterNo
??
0
;
int
temp
CourseChapterNo
=
oguestModel
?.
CourseChapterNo
??
0
;
cList
.
ForEach
(
x
=>
{
x
.
SortNum
=
Convert
.
ToDouble
(
x
.
ChapterNo
);
});
cList
.
ForEach
(
x
=>
{
x
.
SortNum
=
Convert
.
ToDouble
(
x
.
ChapterNo
);
});
ChapterList
.
AddRange
(
cList
.
Where
(
x
=>
x
.
SortNum
<=
CourseChapterNo
).
OrderByDescending
(
x
=>
x
.
SortNum
).
Select
(
x
=>
new
ChapterList
.
AddRange
(
cList
.
Where
(
x
=>
x
.
SortNum
<=
temp
CourseChapterNo
).
OrderByDescending
(
x
=>
x
.
SortNum
).
Select
(
x
=>
new
{
{
x
.
ChapterNo
,
x
.
ChapterNo
,
x
.
ChapterName
,
x
.
ChapterName
,
...
@@ -3775,14 +3789,24 @@ namespace Edu.Module.Course
...
@@ -3775,14 +3789,24 @@ namespace Edu.Module.Course
ClassDate
=
""
ClassDate
=
""
}));
}));
}
}
if
(
item
.
ClassScrollType
==
1
)
{
TotalChapterNo
=
oguestModel
?.
TotalChapterNo
??
0
;
CourseChapterNo
=
oguestModel
?.
CourseChapterNo
??
0
;
}
else
{
TotalChapterNo
=
cList
?.
Count
()
??
0
;
}
Rlist
.
Add
(
new
Rlist
.
Add
(
new
{
{
item
.
OrderId
,
item
.
OrderId
,
item
.
CourseId
,
item
.
CourseId
,
item
.
CourseName
,
item
.
CourseName
,
item
.
ClassScrollType
,
item
.
ClassScrollType
,
CourseChapterNo
=
oguestModel
?.
CourseChapterNo
??
0
,
CourseChapterNo
,
TotalChapterNo
=
oguestModel
?.
TotalChapterNo
??
0
,
TotalChapterNo
,
ChapterList
ChapterList
});
});
}
}
...
...
Edu.Repository/Course/RB_Course_ChapterRepository.cs
View file @
857a9ee6
...
@@ -61,6 +61,10 @@ namespace Edu.Repository.Course
...
@@ -61,6 +61,10 @@ namespace Edu.Repository.Course
builder
.
AppendFormat
(
" AND {0}=0 "
,
nameof
(
RB_Course_Chapter_ViewModel
.
ParentId
));
builder
.
AppendFormat
(
" AND {0}=0 "
,
nameof
(
RB_Course_Chapter_ViewModel
.
ParentId
));
}
}
}
}
if
(
query
.
QOrderBy
==
1
)
{
builder
.
AppendFormat
(
" ORDER BY CourseRate ASC,ChapterGradeNo ASC "
);
}
return
Get
<
RB_Course_Chapter_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
return
Get
<
RB_Course_Chapter_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
}
...
...
Edu.WebApi/Controllers/Course/ScrollController.cs
View file @
857a9ee6
...
@@ -1279,7 +1279,10 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -1279,7 +1279,10 @@ namespace Edu.WebApi.Controllers.Course
public
ApiResult
GetStuLearnChapterList
()
public
ApiResult
GetStuLearnChapterList
()
{
{
var
userInfo
=
base
.
UserInfo
;
var
userInfo
=
base
.
UserInfo
;
RB_Scroll_Appointment_ViewModel
demodel
=
JsonHelper
.
DeserializeObject
<
RB_Scroll_Appointment_ViewModel
>(
base
.
RequestParm
.
Msg
.
ToString
());
RB_Scroll_Appointment_ViewModel
demodel
=
new
RB_Scroll_Appointment_ViewModel
()
{
StuId
=
base
.
ParmJObj
.
GetInt
(
"StuId"
),
};
demodel
.
Group_Id
=
userInfo
.
Group_Id
;
demodel
.
Group_Id
=
userInfo
.
Group_Id
;
var
list
=
scrollClassModule
.
GetStuLearnChapterList
(
demodel
);
var
list
=
scrollClassModule
.
GetStuLearnChapterList
(
demodel
);
return
ApiResult
.
Success
(
""
,
list
);
return
ApiResult
.
Success
(
""
,
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