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
b80aede3
Commit
b80aede3
authored
Jun 30, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
c0f10775
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
132 additions
and
0 deletions
+132
-0
RB_Plan_Appointment_Details_ViewModel.cs
...ViewModel/Scroll/RB_Plan_Appointment_Details_ViewModel.cs
+30
-0
PlanAppoimentModule.cs
Edu.Module.Course/PlanAppoimentModule.cs
+48
-0
RB_Plan_Appointment_DetailsRepository.cs
...epository/Scroll/RB_Plan_Appointment_DetailsRepository.cs
+34
-0
PlanAppoimentController.cs
Edu.WebApi/Controllers/Course/PlanAppoimentController.cs
+20
-0
No files found.
Edu.Model/ViewModel/Scroll/RB_Plan_Appointment_Details_ViewModel.cs
View file @
b80aede3
...
...
@@ -19,5 +19,35 @@ namespace Edu.Model.ViewModel.Scroll
/// rb_student表编号【查询使用】
/// </summary>
public
string
QStuIds
{
get
;
set
;
}
/// <summary>
/// 预约日期
/// </summary>
public
DateTime
Date
{
get
;
set
;
}
/// <summary>
/// 预约时段开始时间
/// </summary>
public
string
StartTime
{
get
;
set
;
}
/// <summary>
/// 预约时段结束时间
/// </summary>
public
string
EndTime
{
get
;
set
;
}
/// <summary>
/// 查询开始日期
/// </summary>
public
string
QStartDate
{
get
;
set
;
}
/// <summary>
/// 查询结束日期
/// </summary>
public
string
QEndDate
{
get
;
set
;
}
/// <summary>
/// 集团编号
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
}
}
Edu.Module.Course/PlanAppoimentModule.cs
View file @
b80aede3
...
...
@@ -148,6 +148,7 @@ namespace Edu.Module.Course
{
var
oldDetailModel
=
oldList
?.
Where
(
qitem
=>
qitem
.
Status
==
0
&&
qitem
.
StuId
==
item
.
StuId
)?.
FirstOrDefault
();
item
.
DetailsId
=
oldDetailModel
?.
DetailsId
??
0
;
item
.
PlanAppointmentId
=
model
.
Id
;
if
(
item
.
DetailsId
>
0
)
{
plan_Appointment_DetailsRepository
.
Update
(
item
);
...
...
@@ -175,5 +176,52 @@ namespace Edu.Module.Course
bool
flag
=
plan_Appointment_DetailsRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Plan_Appointment_Details_ViewModel
.
DetailsId
),
DetailsId
));
return
flag
;
}
/// <summary>
/// 获取学员预约统计
/// </summary>
/// <param name="startDate"></param>
/// <param name="endDate"></param>
/// <param name="Group_Id"></param>
/// <returns></returns>
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
()
{
QStartDate
=
startDate
,
QEndDate
=
endDate
,
Group_Id
=
Group_Id
});
for
(
var
i
=
0
;
i
<=
days
;
i
++)
{
DateTime
newDate
=
start
.
AddDays
(
i
);
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
();
subTimeList
.
Add
(
new
{
item
.
StartTime
,
item
.
EndTime
,
StuAppointNum
=
tempDataList
?.
Count
()
??
0
,
SubDate
=
Common
.
ConvertHelper
.
FormatDate
(
newDate
),
PlanAppointmentId
=
tempDataList
?.
FirstOrDefault
()?.
PlanAppointmentId
??
0
});
}
var
obj
=
new
{
DateStr
=
Common
.
ConvertHelper
.
FormatDate
(
newDate
),
TimeList
=
subTimeList
};
list
.
Add
(
obj
);
}
return
list
;
}
}
}
Edu.Repository/Scroll/RB_Plan_Appointment_DetailsRepository.cs
View file @
b80aede3
...
...
@@ -46,5 +46,39 @@ WHERE 1=1
}
return
Get
<
RB_Plan_Appointment_Details_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 获取学员预约列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Plan_Appointment_Details_ViewModel
>
GetPlanAppointmentStaticRepository
(
RB_Plan_Appointment_Details_ViewModel
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*,B.Date,B.StartTime,B.EndTime
FROM RB_Plan_Appointment_Details AS A INNER JOIN RB_Plan_Appointment AS B ON A.PlanAppointmentId=B.Id
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
" AND B.{0}={1} "
,
nameof
(
RB_Plan_Appointment_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QStartDate
))
{
builder
.
AppendFormat
(
" AND B.Date>='{0}' "
,
query
.
QStartDate
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QEndDate
))
{
builder
.
AppendFormat
(
" AND B.Date<='{0} 23:59:59' "
,
query
.
QEndDate
);
}
}
var
list
=
Get
<
RB_Plan_Appointment_Details_ViewModel
>(
builder
.
ToString
()).
ToList
();
return
list
;
}
}
}
Edu.WebApi/Controllers/Course/PlanAppoimentController.cs
View file @
b80aede3
...
...
@@ -68,6 +68,26 @@ namespace Edu.WebApi.Controllers.Course
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 学员预约统计
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetPlanAppointmentStatic
()
{
string
startDate
=
base
.
ParmJObj
.
GetStringValue
(
"StartTime"
);
string
endDate
=
base
.
ParmJObj
.
GetStringValue
(
"EndTime"
);
if
(
string
.
IsNullOrEmpty
(
startDate
))
{
startDate
=
Common
.
ConvertHelper
.
FormatDate
(
DateTime
.
Now
);
}
if
(
string
.
IsNullOrEmpty
(
endDate
))
{
endDate
=
Common
.
ConvertHelper
.
FormatDate
(
Convert
.
ToDateTime
(
startDate
).
AddMonths
(
1
));
}
var
data
=
planAppoiment
.
GetPlanAppointmentStaticModule
(
startDate
,
endDate
,
base
.
UserInfo
.
Group_Id
);
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