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
d62bbc93
Commit
d62bbc93
authored
Mar 17, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
daf88ea1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
12 deletions
+79
-12
ScrollClassModule.cs
Edu.Module.Course/ScrollClassModule.cs
+48
-10
RB_Class_RoomRepository.cs
Edu.Repository/Grade/RB_Class_RoomRepository.cs
+2
-2
ScrollController.cs
Edu.WebApi/Controllers/Course/ScrollController.cs
+29
-0
No files found.
Edu.Module.Course/ScrollClassModule.cs
View file @
d62bbc93
...
...
@@ -2432,15 +2432,15 @@ namespace Edu.Module.Course
AppointId
=
0
;
#
region
初步验证
//提前天数
int
AdvanceDay
=
Convert
.
ToInt32
(
dictvalueRepository
.
GetList
(
new
Model
.
ViewModel
.
User
.
RB_Dictvalue_Extend
()
{
RB_Group_id
=
demodel
.
Group_Id
,
DictKey
=
"Scroll_AdvanceDay"
}).
FirstOrDefault
()?.
Content
??
"1"
);
if
(
demodel
.
Date
<
Convert
.
ToDateTime
(
DateTime
.
Now
.
AddDays
(
AdvanceDay
).
ToString
(
"yyyy-MM-dd"
)))
{
return
"需要提前"
+
AdvanceDay
+
"天约课"
;
}
if
(
AdvanceDay
==
1
&&
demodel
.
Date
.
ToString
(
"yyyy-MM-dd"
)
==
DateTime
.
Now
.
AddDays
(
1
).
ToString
(
"yyyy-MM-dd"
))
{
//可预约的时间 (提前1天时启用)
string
ScrollETime
=
dictvalueRepository
.
GetList
(
new
Model
.
ViewModel
.
User
.
RB_Dictvalue_Extend
()
{
RB_Group_id
=
demodel
.
Group_Id
,
DictKey
=
"Scroll_Time"
}).
FirstOrDefault
()?.
Content
??
""
;
if
(
DateTime
.
Now
>
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
ScrollETime
))
{
return
"需要在当日"
+
ScrollETime
+
"之前约课"
;
}
}
//提前天数
2022-03-17
//
int AdvanceDay = Convert.ToInt32(dictvalueRepository.GetList(new Model.ViewModel.User.RB_Dictvalue_Extend() { RB_Group_id = demodel.Group_Id, DictKey = "Scroll_AdvanceDay" }).FirstOrDefault()?.Content ?? "1");
//
if (demodel.Date < Convert.ToDateTime(DateTime.Now.AddDays(AdvanceDay).ToString("yyyy-MM-dd"))) { return "需要提前" + AdvanceDay + "天约课"; }
//
if (AdvanceDay == 1 && demodel.Date.ToString("yyyy-MM-dd") == DateTime.Now.AddDays(1).ToString("yyyy-MM-dd"))
//
{
//
//可预约的时间 (提前1天时启用)
//
string ScrollETime = dictvalueRepository.GetList(new Model.ViewModel.User.RB_Dictvalue_Extend() { RB_Group_id = demodel.Group_Id, DictKey = "Scroll_Time" }).FirstOrDefault()?.Content ?? "";
//
if (DateTime.Now > Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " " + ScrollETime)) { return "需要在当日" + ScrollETime + "之前约课"; }
//
}
#
endregion
#
region
学生的课程
...
...
@@ -2577,7 +2577,10 @@ namespace Edu.Module.Course
demodel
.
CourseEndTime
=
Convert
.
ToDateTime
(
Date
+
" "
+
timeList
.
Max
(
x
=>
x
.
EndTime
));
//上完课的时间
demodel
.
CourseTime
=
JsonHelper
.
Serialize
(
timeList
.
Select
(
x
=>
new
{
x
.
Sort
,
x
.
StartTime
,
x
.
EndTime
,
x
.
Minutes
,
x
.
ClassHours
}));
if
(
demodel
.
RoomId
<=
0
)
{
demodel
.
RoomId
=
planModel
.
RoomId
;
//上课教室
}
demodel
.
GuestId
=
learnModel
.
GuestId
;
demodel
.
OrderId
=
learnModel
.
OrderId
;
demodel
.
CourseSTime
=
timeList
.
Min
(
x
=>
x
.
StartTime
);
...
...
@@ -2927,6 +2930,41 @@ namespace Edu.Module.Course
}
return
""
;
}
/// <summary>
/// 修改上课教师
/// </summary>
/// <param name="teacherId"></param>
/// <param name="date"></param>
/// <param name="shiftSort"></param>
/// <param name="roomId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
string
SetScrollRoom
(
int
teacherId
,
string
date
,
string
shiftSort
,
int
roomId
,
UserInfo
userInfo
)
{
var
appointList
=
scroll_AppointmentRepository
.
GetList
(
new
RB_Scroll_Appointment_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
StartTime
=
date
,
EntTime
=
date
,
TeacherId
=
teacherId
,
ShiftSort
=
shiftSort
});
if
(
appointList
.
Any
())
{
if
(
appointList
.
Where
(
x
=>
x
.
RoomId
==
roomId
).
Any
())
{
return
"请选择其他教室"
;
}
foreach
(
var
item
in
appointList
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
RoomId
),
roomId
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Scroll_Appointment_ViewModel
.
Id
),
FiledValue
=
item
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
scroll_AppointmentRepository
.
Update
(
keyValues
,
wheres
);
}
}
return
""
;
}
#
endregion
#
region
初始化
...
...
Edu.Repository/Grade/RB_Class_RoomRepository.cs
View file @
d62bbc93
...
...
@@ -67,8 +67,8 @@ WHERE 1=1
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM RB_Class_Room AS A
SELECT A.*
,B.SName AS SchoolName
FROM RB_Class_Room AS A
LEFT JOIN rb_school AS B ON A.School_Id=B.SId
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND A.{0}<>{1} "
,
nameof
(
RB_Class_Room_ViewModel
.
Status
),
(
int
)(
DateStateEnum
.
Delete
));
...
...
Edu.WebApi/Controllers/Course/ScrollController.cs
View file @
d62bbc93
...
...
@@ -938,6 +938,35 @@ namespace Edu.WebApi.Controllers.Course
return
ApiResult
.
Success
();
}
/// <summary>
/// 修改约课教室
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetScrollRoom
()
{
var
userInfo
=
base
.
UserInfo
;
int
TeacherId
=
base
.
ParmJObj
.
GetInt
(
"TeacherId"
,
0
);
string
Date
=
base
.
ParmJObj
.
GetStringValue
(
"Date"
);
string
ShiftSort
=
base
.
ParmJObj
.
GetStringValue
(
"ShiftSort"
);
int
RoomId
=
base
.
ParmJObj
.
GetInt
(
"RoomId"
,
0
);
//新教室ID
if
(
TeacherId
<=
0
||
RoomId
<=
0
||
string
.
IsNullOrEmpty
(
Date
)
||
string
.
IsNullOrEmpty
(
ShiftSort
))
{
return
ApiResult
.
ParamIsNull
();
}
string
msg
=
scrollClassModule
.
SetScrollRoom
(
TeacherId
,
Date
,
ShiftSort
,
RoomId
,
userInfo
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
(
msg
);
}
}
#
endregion
#
region
初始化约课数据
...
...
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