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
734fa09f
Commit
734fa09f
authored
Sep 06, 2024
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取消约课调整
parent
05dfdead
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
57 deletions
+65
-57
ScheduleCourseModule.cs
Edu.Module.Course/ScheduleCourseModule.cs
+1
-2
ScrollClassModule.cs
Edu.Module.Course/ScrollClassModule.cs
+34
-26
ScheduleCourseRepository.cs
Edu.Repository/Scroll/ScheduleCourseRepository.cs
+1
-1
ScrollController.cs
Edu.WebApi/Controllers/Course/ScrollController.cs
+29
-28
No files found.
Edu.Module.Course/ScheduleCourseModule.cs
View file @
734fa09f
...
...
@@ -43,7 +43,6 @@ namespace Edu.Module.Course
var
list
=
scheduleCourseRepository
.
GetScheduleCourseStuListRepository
(
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
List
<
int
>
IdList
=
new
List
<
int
>();
foreach
(
var
item
in
list
)
{
...
...
@@ -218,7 +217,7 @@ namespace Edu.Module.Course
{
item
.
TeacherName
=
empList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Id
==
item
.
AccountId
)?.
EmployeeName
??
""
;
item
.
CourseName
=
courseList
?.
FirstOrDefault
(
qitem
=>
qitem
.
CourseId
==
item
.
LearnCourseId
)?.
CourseName
??
""
;
var
tempCheck
=
checkList
?.
FirstOrDefault
(
qitem
=>
qitem
.
ClassPlanId
==
item
.
ClassPlanId
);
var
tempCheck
=
checkList
?.
FirstOrDefault
(
qitem
=>
qitem
.
ClassPlanId
==
item
.
ClassPlanId
&&
qitem
.
OrderGuestId
==
item
.
GuestId
);
item
.
ClassCheckId
=
tempCheck
?.
ClassCheckId
??
0
;
if
(
tempCheck
!=
null
)
{
...
...
Edu.Module.Course/ScrollClassModule.cs
View file @
734fa09f
...
...
@@ -2996,7 +2996,7 @@ namespace Edu.Module.Course
/// <summary>
/// 后台取消预约(取消已确认约课)
/// </summary>
/// <param name="
stuIds">
</param>
/// <param name="
AppointIds">预约编号
</param>
/// <param name="teacherId"></param>
/// <param name="date"></param>
/// <param name="userInfo"></param>
...
...
@@ -3036,17 +3036,20 @@ namespace Edu.Module.Course
#
endregion
foreach
(
var
item
in
list
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
State
),
Common
.
Enum
.
Course
.
CourseAppointStateEnum
.
Cancel
},
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
Remark
),
item
.
Remark
+
";后台管理取消已确认的约课"
},
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
UpdateBy
),
userInfo
.
Id
},
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
UpdateTime
),
DateTime
.
Now
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Scroll_Appointment_ViewModel
.
Id
),
FiledValue
=
item
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
FiledValue
=
item
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
flag
=
scroll_AppointmentRepository
.
Update
(
keyValues
,
wheres
);
...
...
@@ -3058,29 +3061,35 @@ namespace Edu.Module.Course
if
(
item
.
AppointType
==
2
)
{
//更新补课
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Scroll_SkipCourse_ViewModel
.
State
),
1
}
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Scroll_SkipCourse_ViewModel
.
StuId
),
FiledValue
=
item
.
StuId
,
OperatorEnum
=
OperatorEnum
.
Equal
FiledValue
=
item
.
StuId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Scroll_SkipCourse_ViewModel
.
GuestId
),
FiledValue
=
item
.
GuestId
,
OperatorEnum
=
OperatorEnum
.
Equal
FiledValue
=
item
.
GuestId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Scroll_SkipCourse_ViewModel
.
ChapterNo
),
FiledValue
=
item
.
ChapterNo
,
OperatorEnum
=
OperatorEnum
.
Equal
FiledValue
=
item
.
ChapterNo
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Scroll_SkipCourse_ViewModel
.
State
),
FiledValue
=
2
,
OperatorEnum
=
OperatorEnum
.
Equal
FiledValue
=
2
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
scroll_SkipCourseRepository
.
Update
(
keyValues1
,
wheres1
);
...
...
@@ -3134,17 +3143,16 @@ namespace Edu.Module.Course
//给老师推送取消课程 信息
if
(!
string
.
IsNullOrEmpty
(
empModel
.
WorkUserId
))
{
var
recipientPath
=
HttpUtility
.
UrlEncode
(
$"/stu/subscribe"
);
//地址需要后台功能做了之后吧
var
recipientPath
=
HttpUtility
.
UrlEncode
(
$"/stu/subscribe"
);
var
content
=
$"<font color='info'>取消学生预约通知</font>\n>**概要信息** \n>上课日期:<font color='warning'>
{
Common
.
ConvertHelper
.
FormatDate
(
firstModel
.
Date
)}
</font>\n>上课时段:<font color='warning'>
{
CourseTime
}
</font>\n>上课老师:<font color='warning'>
{
firstModel
.
TeacherName
}
</font>\n>取消原因:<font color='comment'>后台管理取消
{
StuName
}
的约课</font>\n>请 点 击:[查看详情](
{
Config
.
ErpUrl
}
/autologin?loginId=
{
empModel
.
Id
}
&target=
{
recipientPath
}
)"
;
PushWorkChatHelper
.
PushToWorkChat
(
content
,
empModel
.
WorkUserId
,
"取消学生预约通知"
);
}
}
}
if
(
MessageCenterHub
.
GlobalContext
!=
null
)
{
await
MessageCenterHub
.
GlobalContext
.
Clients
.
All
.
SendAsync
(
"ChangePlan"
,
"55555555 "
);
}
//if (MessageCenterHub.GlobalContext != null)
//{
// await MessageCenterHub.GlobalContext.Clients.All.SendAsync("ChangePlan", "55555555 ");
//}
}
return
""
;
}
...
...
Edu.Repository/Scroll/ScheduleCourseRepository.cs
View file @
734fa09f
...
...
@@ -95,7 +95,7 @@ SELECT A.Date,A.AccountId,A.State,A.GuestId,A.LearnCourseId,A.CourseGradeId,A.Co
,IFNULL(A.CourseETime,'') AS EndTime
FROM rb_scroll_appointment AS A LEFT JOIN rb_class_time AS B ON A.ClassPlanId=B.ClassPlanId
LEFT JOIN rb_class_check AS C ON B.ClassTimeId=C.ClassTimeId AND A.GuestId=C.OrderGuestId
WHERE 1=1 AND A.State IN(3) AND A.AppointType IN(1,2)
WHERE 1=1 AND A.State IN(
1,2,
3) AND A.AppointType IN(1,2)
"
);
appointBuilder
.
AppendFormat
(
@" AND A.LearnCourseId IN ({0}) "
,
courseIds
);
appointBuilder
.
AppendFormat
(
@" AND A.CourseGradeId IN ({0}) "
,
(
int
)
query
.
QCourseRate
);
...
...
Edu.WebApi/Controllers/Course/ScrollController.cs
View file @
734fa09f
...
...
@@ -483,33 +483,7 @@ namespace Edu.WebApi.Controllers.Course
return
ApiResult
.
Success
();
}
/// <summary>
/// 取消预约
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
CancelAppointment
()
{
var
userInfo
=
base
.
UserInfo
;
string
AppointIds
=
base
.
ParmJObj
.
GetStringValue
(
"AppointIds"
);
int
TeacherId
=
base
.
ParmJObj
.
GetInt
(
"TeacherId"
,
0
);
string
Date
=
base
.
ParmJObj
.
GetStringValue
(
"Date"
);
if
(
string
.
IsNullOrEmpty
(
AppointIds
)
||
TeacherId
<=
0
||
string
.
IsNullOrEmpty
(
Date
))
{
return
ApiResult
.
ParamIsNull
();
}
string
msg
=
scrollClassModule
.
CancelAppointment
(
AppointIds
,
TeacherId
,
Date
,
userInfo
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
(
msg
);
}
}
/// <summary>
/// 确认预约
/// </summary>
...
...
@@ -1029,7 +1003,6 @@ namespace Edu.WebApi.Controllers.Course
{
return
ApiResult
.
ParamIsNull
();
}
string
msg
=
scrollClassModule
.
CancelSureAppointmentAsync
(
AppointIds
,
TeacherId
,
Date
,
ShiftSort
,
userInfo
).
Result
;
if
(
msg
==
""
)
{
...
...
@@ -1041,6 +1014,34 @@ namespace Edu.WebApi.Controllers.Course
}
}
/// <summary>
/// 取消预约
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
CancelAppointment
()
{
var
userInfo
=
base
.
UserInfo
;
string
AppointIds
=
base
.
ParmJObj
.
GetStringValue
(
"AppointIds"
);
int
TeacherId
=
base
.
ParmJObj
.
GetInt
(
"TeacherId"
,
0
);
string
Date
=
base
.
ParmJObj
.
GetStringValue
(
"Date"
);
if
(
string
.
IsNullOrEmpty
(
AppointIds
)
||
TeacherId
<=
0
||
string
.
IsNullOrEmpty
(
Date
))
{
return
ApiResult
.
ParamIsNull
();
}
string
msg
=
scrollClassModule
.
CancelAppointment
(
AppointIds
,
TeacherId
,
Date
,
userInfo
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
(
msg
);
}
}
/// <summary>
/// 切换约课老师
/// </summary>
...
...
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