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
32901033
Commit
32901033
authored
Jun 30, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1111
parent
b80aede3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
133 additions
and
17 deletions
+133
-17
PlanAppoimentModule.cs
Edu.Module.Course/PlanAppoimentModule.cs
+96
-8
RB_Plan_Appointment_DetailsRepository.cs
...epository/Scroll/RB_Plan_Appointment_DetailsRepository.cs
+4
-1
LeaveStudentController.cs
Edu.WebApi/Controllers/Applet/LeaveStudentController.cs
+33
-8
No files found.
Edu.Module.Course/PlanAppoimentModule.cs
View file @
32901033
...
...
@@ -41,18 +41,58 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="group_Id"></param>
/// <returns></returns>
public
List
<
RB_Scroll_CourseTime_View
Model
>
GetScrollCourseTimeList
(
int
group_Id
)
public
List
<
CourseTime
Model
>
GetScrollCourseTimeList
(
int
group_Id
)
{
List
<
CourseTimeModel
>
timeList
=
new
List
<
CourseTimeModel
>();
var
list
=
scroll_CourseTimeRepository
.
GetList
(
new
RB_Scroll_CourseTime_ViewModel
()
{
Group_Id
=
group_Id
});
foreach
(
var
item
in
list
)
foreach
(
var
item
in
list
.
Where
(
qitem
=>
qitem
.
Id
==
1
)
)
{
item
.
TimeList
=
new
List
<
CourseTimeModel
>();
if
(!
string
.
IsNullOrEmpty
(
item
.
Content
))
{
item
.
T
imeList
=
JsonHelper
.
DeserializeObject
<
List
<
CourseTimeModel
>>(
item
.
Content
);
t
imeList
=
JsonHelper
.
DeserializeObject
<
List
<
CourseTimeModel
>>(
item
.
Content
);
}
}
return
list
;
if
(
timeList
==
null
||
(
timeList
!=
null
&&
timeList
.
Count
<=
0
))
{
timeList
.
Add
(
new
CourseTimeModel
()
{
StartTime
=
"09:30"
,
EndTime
=
"11:00"
,
Sort
=
1
});
timeList
.
Add
(
new
CourseTimeModel
()
{
StartTime
=
"11:10"
,
EndTime
=
"12:40"
,
Sort
=
2
});
timeList
.
Add
(
new
CourseTimeModel
()
{
StartTime
=
"13:30"
,
EndTime
=
"15:00"
,
Sort
=
3
});
timeList
.
Add
(
new
CourseTimeModel
()
{
StartTime
=
"15:10"
,
EndTime
=
"16:40"
,
Sort
=
4
});
timeList
.
Add
(
new
CourseTimeModel
()
{
StartTime
=
"16:50"
,
EndTime
=
"18:20"
,
Sort
=
5
});
timeList
.
Add
(
new
CourseTimeModel
()
{
StartTime
=
"19:00"
,
EndTime
=
"20:30"
,
Sort
=
6
});
}
return
timeList
;
}
/// <summary>
...
...
@@ -177,6 +217,53 @@ namespace Edu.Module.Course
return
flag
;
}
/// <summary>
/// 获取学员预约列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Plan_Appointment_Details_ViewModel
>
GetPlanAppointmentStatic
(
RB_Plan_Appointment_Details_ViewModel
query
)
{
return
plan_Appointment_DetailsRepository
.
GetPlanAppointmentStaticRepository
(
query
);
}
/// <summary>
/// 小程序学员预约记录统计
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
object
>
GetStuPlanAppointListModule
(
RB_Plan_Appointment_Details_ViewModel
query
)
{
List
<
object
>
list
=
new
List
<
object
>();
var
timeList
=
GetScrollCourseTimeList
(
query
.
Group_Id
);
var
dataList
=
GetPlanAppointmentStatic
(
query
);
if
(
dataList
!=
null
&&
dataList
.
Count
>
0
)
{
var
dayList
=
dataList
.
GroupBy
(
qitem
=>
new
{
qitem
.
Date
}).
Select
(
qitem
=>
new
{
qitem
.
Key
.
Date
});
foreach
(
var
item
in
dayList
)
{
var
tempDataList
=
dataList
?.
Where
(
qitem
=>
Common
.
ConvertHelper
.
FormatDate
(
qitem
.
Date
)
==
Common
.
ConvertHelper
.
FormatDate
(
item
.
Date
)
&&
qitem
.
Status
==
0
)?.
ToList
();
List
<
object
>
subList
=
new
List
<
object
>();
foreach
(
var
subItem
in
tempDataList
)
{
var
timeModel
=
timeList
.
FirstOrDefault
(
qitem
=>
qitem
.
StartTime
==
subItem
.
StartTime
);
subList
.
Add
(
new
{
subItem
.
StartTime
,
subItem
.
EndTime
,
Sort
=
timeModel
.
Sort
,
});
}
list
.
Add
(
new
{
DateStr
=
Common
.
ConvertHelper
.
FormatDate
(
item
.
Date
),
SubList
=
subList
});
}
}
return
list
;
}
/// <summary>
/// 获取学员预约统计
/// </summary>
...
...
@@ -184,14 +271,14 @@ namespace Edu.Module.Course
/// <param name="endDate"></param>
/// <param name="Group_Id"></param>
/// <returns></returns>
public
List
<
object
>
GetPlanAppointmentStaticModule
(
string
startDate
,
string
endDate
,
int
Group_Id
)
public
List
<
object
>
GetPlanAppointmentStaticModule
(
string
startDate
,
string
endDate
,
int
Group_Id
)
{
List
<
object
>
list
=
new
List
<
object
>();
DateTime
start
=
Convert
.
ToDateTime
(
startDate
);
DateTime
end
=
Convert
.
ToDateTime
(
endDate
);
int
days
=
(
end
-
start
).
Days
;
var
timeList
=
GetScrollCourseTimeList
(
Group_Id
)?.
FirstOrDefault
()?.
TimeList
??
new
List
<
CourseTimeModel
>(
);
var
dataList
=
plan_Appointment_DetailsRepository
.
GetPlanAppointmentStaticRepository
(
new
RB_Plan_Appointment_Details_ViewModel
()
var
timeList
=
GetScrollCourseTimeList
(
Group_Id
);
var
dataList
=
GetPlanAppointmentStatic
(
new
RB_Plan_Appointment_Details_ViewModel
()
{
QStartDate
=
startDate
,
QEndDate
=
endDate
,
...
...
@@ -203,11 +290,12 @@ namespace Edu.Module.Course
List
<
object
>
subTimeList
=
new
List
<
object
>();
foreach
(
var
item
in
timeList
)
{
var
tempDataList
=
dataList
?.
Where
(
qitem
=>
qitem
.
Date
==
newDate
&&
qitem
.
Status
==
0
&&
qitem
.
StartTime
==
item
.
StartTime
&&
qitem
.
EndTime
==
item
.
EndTime
)?.
ToList
();
var
tempDataList
=
dataList
?.
Where
(
qitem
=>
Common
.
ConvertHelper
.
FormatDate
(
qitem
.
Date
)
==
Common
.
ConvertHelper
.
FormatDate
(
newDate
)
&&
qitem
.
Status
==
0
&&
qitem
.
StartTime
==
item
.
StartTime
&&
qitem
.
EndTime
==
item
.
EndTime
)?.
ToList
();
subTimeList
.
Add
(
new
{
item
.
StartTime
,
item
.
EndTime
,
item
.
Sort
,
StuAppointNum
=
tempDataList
?.
Count
()
??
0
,
SubDate
=
Common
.
ConvertHelper
.
FormatDate
(
newDate
),
PlanAppointmentId
=
tempDataList
?.
FirstOrDefault
()?.
PlanAppointmentId
??
0
...
...
Edu.Repository/Scroll/RB_Plan_Appointment_DetailsRepository.cs
View file @
32901033
...
...
@@ -75,7 +75,10 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND B.Date<='{0} 23:59:59' "
,
query
.
QEndDate
);
}
if
(
query
.
Account_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Plan_Appointment_Details_ViewModel
.
Account_Id
),
query
.
Account_Id
);
}
}
var
list
=
Get
<
RB_Plan_Appointment_Details_ViewModel
>(
builder
.
ToString
()).
ToList
();
return
list
;
...
...
Edu.WebApi/Controllers/Applet/LeaveStudentController.cs
View file @
32901033
...
...
@@ -106,7 +106,6 @@ namespace Edu.WebApi.Controllers.Applet
[
HttpPost
]
public
ApiResult
GetPlanTime
()
{
List
<
object
>
result
=
new
List
<
object
>();
var
model
=
planAppoiment
.
GetPlanAppointmentConfigModule
(
new
RB_Dictvalue_Extend
()
{
RB_Group_id
=
base
.
AppletUserInfo
.
Group_Id
,
...
...
@@ -114,7 +113,6 @@ namespace Edu.WebApi.Controllers.Applet
});
var
today
=
DateTime
.
Now
;
Int32
.
TryParse
((
model
?.
Code
??
""
),
out
int
WeekStr
);
WeekStr
=
1
;
DateTime
startTime
=
DateTime
.
Now
;
int
NowWeek
=
(
int
)
today
.
DayOfWeek
;
DateTime
endTime
=
DateTime
.
Now
;
...
...
@@ -131,15 +129,35 @@ namespace Edu.WebApi.Controllers.Applet
endTime
=
today
.
AddDays
(
6
-
Convert
.
ToInt16
(
today
.
DayOfWeek
)
+
14
+
1
);
}
int
days
=
(
endTime
-
startTime
).
Days
;
var
timeModel
=
planAppoiment
.
GetScrollCourseTimeList
(
base
.
AppletUserInfo
.
Group_Id
).
FirstOrDefault
();
var
TimeList
=
planAppoiment
.
GetScrollCourseTimeList
(
base
.
AppletUserInfo
.
Group_Id
);
var
dataList
=
planAppoiment
.
GetPlanAppointmentStatic
(
new
RB_Plan_Appointment_Details_ViewModel
()
{
QStartDate
=
Common
.
ConvertHelper
.
FormatDate
(
startTime
),
QEndDate
=
Common
.
ConvertHelper
.
FormatDate
(
endTime
),
Account_Id
=
base
.
AppletUserInfo
.
Id
});
List
<
object
>
result
=
new
List
<
object
>();
for
(
var
i
=
0
;
i
<=
days
;
i
++)
{
var
newDate
=
startTime
.
AddDays
(
i
);
List
<
object
>
subTimeList
=
new
List
<
object
>();
foreach
(
var
item
in
TimeList
)
{
var
tempData
=
dataList
?.
FirstOrDefault
(
qitem
=>
Common
.
ConvertHelper
.
FormatDate
(
qitem
.
Date
)
==
Common
.
ConvertHelper
.
FormatDate
(
newDate
)
&&
qitem
.
Status
==
0
&&
qitem
.
StartTime
==
item
.
StartTime
&&
qitem
.
EndTime
==
item
.
EndTime
);
subTimeList
.
Add
(
new
{
item
.
StartTime
,
item
.
EndTime
,
item
.
Sort
,
SubDate
=
Common
.
ConvertHelper
.
FormatDate
(
newDate
),
DetailsId
=
tempData
?.
DetailsId
??
0
});
}
result
.
Add
(
new
{
DateStr
=
Common
.
ConvertHelper
.
FormatDate
(
newDate
),
TimeList
=
timeModel
?.
TimeList
?.
Select
(
qitem
=>
new
{
qitem
.
StartTime
,
qitem
.
EndTime
})
});
TimeList
=
subTimeList
});
}
return
ApiResult
.
Success
(
data
:
result
);
}
...
...
@@ -191,10 +209,17 @@ namespace Edu.WebApi.Controllers.Applet
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetPlanAppointment
()
public
ApiResult
Get
Stu
PlanAppointment
()
{
return
ApiResult
.
Failed
();
var
query
=
new
RB_Plan_Appointment_Details_ViewModel
()
{
Account_Id
=
base
.
AppletUserInfo
.
Id
,
Group_Id
=
base
.
AppletUserInfo
.
Group_Id
,
QStartDate
=
base
.
ParmJObj
.
GetStringValue
(
"StartDate"
),
QEndDate
=
base
.
ParmJObj
.
GetStringValue
(
"EndDate"
)
};
var
data
=
planAppoiment
.
GetStuPlanAppointListModule
(
query
);
return
ApiResult
.
Success
(
data
:
data
);
}
}
}
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