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
1c707e3b
Commit
1c707e3b
authored
Jun 29, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
21
parent
9fd29b56
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
135 additions
and
2 deletions
+135
-2
PlanAppoimentModule.cs
Edu.Module.Course/PlanAppoimentModule.cs
+25
-1
LeaveStudentController.cs
Edu.WebApi/Controllers/Applet/LeaveStudentController.cs
+37
-1
PlanAppoimentController.cs
Edu.WebApi/Controllers/Course/PlanAppoimentController.cs
+73
-0
No files found.
Edu.Module.Course/PlanAppoimentModule.cs
View file @
1c707e3b
using
Edu.Model.ViewModel.Scroll
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.Scroll
;
using
Edu.Model.ViewModel.User
;
using
Edu.Repository.Scroll
;
using
Edu.Repository.User
;
...
...
@@ -30,6 +31,29 @@ namespace Edu.Module.Course
/// </summary>
private
readonly
Rb_dictvalueRepository
dictvalueRepository
=
new
Rb_dictvalueRepository
();
/// <summary>
/// 上课时段
/// </summary>
private
readonly
RB_Scroll_CourseTimeRepository
scroll_CourseTimeRepository
=
new
RB_Scroll_CourseTimeRepository
();
/// <summary>
/// 获取上课时段列表
/// </summary>
/// <param name="group_Id"></param>
/// <returns></returns>
public
List
<
RB_Scroll_CourseTime_ViewModel
>
GetScrollCourseTimeList
(
int
group_Id
)
{
var
list
=
scroll_CourseTimeRepository
.
GetList
(
new
RB_Scroll_CourseTime_ViewModel
()
{
Group_Id
=
group_Id
});
foreach
(
var
item
in
list
)
{
item
.
TimeList
=
new
List
<
CourseTimeModel
>();
if
(!
string
.
IsNullOrEmpty
(
item
.
Content
))
{
item
.
TimeList
=
JsonHelper
.
DeserializeObject
<
List
<
CourseTimeModel
>>(
item
.
Content
);
}
}
return
list
;
}
/// <summary>
/// 获取学员预约列表
...
...
Edu.WebApi/Controllers/Applet/LeaveStudentController.cs
View file @
1c707e3b
...
...
@@ -4,6 +4,7 @@ using Edu.Common.Plugin;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.EduTask
;
using
Edu.Model.ViewModel.Scroll
;
using
Edu.Model.ViewModel.User
;
using
Edu.Module.Course
;
using
Edu.Module.EduTask
;
using
Edu.WebApi.Filter
;
...
...
@@ -104,7 +105,41 @@ namespace Edu.WebApi.Controllers.Applet
/// <returns></returns>
public
ApiResult
GetPlanTime
()
{
return
ApiResult
.
Failed
();
List
<
object
>
result
=
new
List
<
object
>();
var
model
=
planAppoiment
.
GetPlanAppointmentConfigModule
(
new
RB_Dictvalue_Extend
()
{
RB_Group_id
=
base
.
AppletUserInfo
.
Group_Id
,
DictKey
=
Common
.
GlobalKey
.
PlanAppointmentKey
});
var
today
=
DateTime
.
Now
;
Int32
.
TryParse
((
model
?.
Code
??
""
),
out
int
WeekStr
);
WeekStr
=
2
;
DateTime
startTime
=
DateTime
.
Now
;
DateTime
endTime
=
DateTime
.
Now
;
if
((
int
)
today
.
DayOfWeek
<
WeekStr
-
1
)
{
startTime
=
today
.
AddDays
(
0
-
Convert
.
ToInt16
(
today
.
DayOfWeek
)
+
7
+
1
);
endTime
=
today
.
AddDays
(
6
-
Convert
.
ToInt16
(
today
.
DayOfWeek
)
+
7
+
1
);
}
else
{
//下下周_周一
startTime
=
today
.
AddDays
(
0
-
Convert
.
ToInt16
(
today
.
DayOfWeek
)
+
14
+
1
);
//下下周_周日
endTime
=
today
.
AddDays
(
6
-
Convert
.
ToInt16
(
today
.
DayOfWeek
)
+
14
+
1
);
}
int
days
=
(
endTime
-
startTime
).
Days
;
var
timeModel
=
planAppoiment
.
GetScrollCourseTimeList
(
base
.
AppletUserInfo
.
Group_Id
).
FirstOrDefault
();
for
(
var
i
=
0
;
i
<=
days
;
i
++)
{
var
newDate
=
startTime
.
AddDays
(
i
);
result
.
Add
(
new
{
DateStr
=
Common
.
ConvertHelper
.
FormatDate
(
newDate
),
TimeList
=
timeModel
?.
TimeList
?.
Select
(
qitem
=>
new
{
qitem
.
StartTime
,
qitem
.
EndTime
})
});
}
return
ApiResult
.
Success
(
data
:
result
);
}
/// <summary>
...
...
@@ -156,6 +191,7 @@ namespace Edu.WebApi.Controllers.Applet
[
HttpPost
]
public
ApiResult
GetPlanAppointment
()
{
return
ApiResult
.
Failed
();
}
}
...
...
Edu.WebApi/Controllers/Course/PlanAppoimentController.cs
0 → 100644
View file @
1c707e3b
using
Edu.Common.API
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.User
;
using
Edu.Module.Course
;
using
Edu.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
Edu.WebApi.Controllers.Course
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
PlanAppoimentController
:
BaseController
{
/// <summary>
/// 学员预约处理类对象
/// </summary>
private
readonly
PlanAppoimentModule
planAppoiment
=
new
PlanAppoimentModule
();
/// <summary>
/// 获取学员预约配置
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
PlanAppointmentConfig
()
{
var
model
=
planAppoiment
.
GetPlanAppointmentConfigModule
(
new
RB_Dictvalue_Extend
()
{
RB_Group_id
=
base
.
UserInfo
.
Group_Id
,
DictKey
=
Common
.
GlobalKey
.
PlanAppointmentKey
});
var
obj
=
new
{
ID
=
model
?.
ID
??
0
,
DictKey
=
model
?.
DictKey
??
Common
.
GlobalKey
.
PlanAppointmentKey
,
Name
=
model
?.
Name
??
"学员预约截止日期配置"
,
RB_Group_id
=
base
.
UserInfo
.
Group_Id
,
Code
=
model
?.
Code
??
""
};
return
ApiResult
.
Success
(
data
:
obj
);
}
/// <summary>
/// 新增修改学员预约配置
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetPlanAppointmentConfig
()
{
RB_Dictvalue_Extend
model
=
new
RB_Dictvalue_Extend
()
{
ID
=
base
.
ParmJObj
.
GetInt
(
"ID"
),
DictKey
=
Common
.
GlobalKey
.
PlanAppointmentKey
,
SNO
=
0
,
Name
=
"学员预约截止日期配置"
,
Code
=
base
.
ParmJObj
.
GetStringValue
(
"Code"
),
Content
=
""
,
RB_Group_id
=
base
.
UserInfo
.
Group_Id
,
RB_Branch_id
=
0
,
};
bool
flag
=
planAppoiment
.
SetPlanAppointmentConfigModule
(
model
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
}
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