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
22167bba
Commit
22167bba
authored
Sep 23, 2024
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
约课调整
parent
517d56ea
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
21 deletions
+45
-21
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+13
-0
ScrollClassModule.cs
Edu.Module.Course/ScrollClassModule.cs
+18
-11
RB_Scroll_AppointmentRepository.cs
Edu.Repository/Scroll/RB_Scroll_AppointmentRepository.cs
+6
-6
ScrollController.cs
Edu.WebApi/Controllers/Course/ScrollController.cs
+8
-4
No files found.
Edu.Module.Course/ClassModule.cs
View file @
22167bba
...
...
@@ -4132,6 +4132,14 @@ namespace Edu.Module.Course
//获取所有老师的列表
var
TeacherList
=
teacherRepository
.
GetTeacherListRepository
(
new
RB_Teacher_ViewModel
()
{
Group_Id
=
group_Id
,
TId
=
teacherId
})?.
OrderBy
(
qitem
=>
qitem
.
SortNum
)?.
ToList
();
if
(
TeacherList
!=
null
)
{
TeacherList
.
Add
(
new
RB_Teacher_ViewModel
()
{
TId
=
0
,
TeacherName
=
"无"
});
}
for
(
var
i
=
0
;
i
<
days
;
i
++)
{
...
...
@@ -4195,6 +4203,11 @@ namespace Edu.Module.Course
});
}
if
(
titem
.
TId
==
0
)
{
string
str
=
""
;
}
var
tempAppointList
=
appointList
.
Where
(
x
=>
x
.
TeacherId
==
titem
.
TId
&&
x
.
Date
==
ClassDate
)
.
GroupBy
(
x
=>
new
{
...
...
Edu.Module.Course/ScrollClassModule.cs
View file @
22167bba
...
...
@@ -1535,6 +1535,7 @@ namespace Edu.Module.Course
bool
flag
=
false
;
//查询当日 所有的预约记录
var
list
=
scroll_AppointmentRepository
.
GetAppointList
(
new
RB_Scroll_Appointment_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
StartTime
=
date
,
EntTime
=
date
,
TeacherId
=
teacherId
,
ShiftSort
=
shiftSort
});
list
=
list
.
Where
(
qitem
=>
qitem
.
TeacherId
==
teacherId
).
ToList
();
if
(
list
.
Where
(
x
=>
x
.
State
==
Common
.
Enum
.
Course
.
CourseAppointStateEnum
.
WaitSure
).
Count
()
<=
0
)
{
return
"已确认预约,无法再次确认"
;
...
...
@@ -3351,22 +3352,30 @@ namespace Edu.Module.Course
/// <param name="NewTeacherId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
async
Task
<
string
>
SetScrollTeacherAsync
(
int
teacherId
,
string
date
,
string
shiftSort
,
int
NewTeacherId
,
UserInfo
userInfo
)
public
string
SetScrollTeacherAsync
(
int
teacherId
,
string
date
,
string
shiftSort
,
int
NewTeacherId
,
UserInfo
userInfo
)
{
bool
flag
=
false
;
var
appointList
=
scroll_AppointmentRepository
.
GetList
(
new
RB_Scroll_Appointment_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
StartTime
=
date
,
EntTime
=
date
,
TeacherId
=
teacherId
,
ShiftSort
=
shiftSort
});
appointList
=
appointList
?.
Where
(
qitem
=>
qitem
.
TeacherId
==
teacherId
)?.
ToList
();
if
(
appointList
.
Any
())
{
if
(
appointList
.
Where
(
x
=>
x
.
TeacherId
==
NewTeacherId
).
Any
())
{
return
"请选择其他老师"
;
}
var
accountModel
=
accountRepository
.
GetAccountListRepository
(
new
RB_Account_ViewModel
()
{
AccountType
=
Common
.
Enum
.
User
.
AccountTypeEnum
.
Teacher
,
AccountId
=
NewTeacherId
}).
FirstOrDefault
();
bool
flag
=
false
;
int
newAccountId
=
0
;
if
(
NewTeacherId
>
0
)
{
var
accountModel
=
accountRepository
.
GetAccountListRepository
(
new
RB_Account_ViewModel
()
{
AccountType
=
Common
.
Enum
.
User
.
AccountTypeEnum
.
Teacher
,
AccountId
=
NewTeacherId
}).
FirstOrDefault
();
newAccountId
=
accountModel
?.
Id
??
0
;
}
foreach
(
var
item
in
appointList
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
AccountId
),
accountModel
.
Id
}
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
AccountId
),
newAccount
Id
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
...
...
@@ -3379,6 +3388,7 @@ namespace Edu.Module.Course
};
flag
=
scroll_AppointmentRepository
.
Update
(
keyValues
,
wheres
);
}
Common
.
Plugin
.
LogHelper
.
WriteInfo
(
$"约课修改老师SetScrollTeacherAsync:: date:
{
date
}
teacherId:
{
teacherId
}
NewTeacherId:
{
NewTeacherId
}
shiftSort:
{
shiftSort
}
修改人:
{
userInfo
.
AccountName
}
"
);
if
(
flag
)
{
...
...
@@ -3392,9 +3402,9 @@ namespace Edu.Module.Course
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Class_Plan_ViewModel
.
ClassPlanId
),
FiledValue
=
appointModel
.
ClassPlanId
,
OperatorEnum
=
OperatorEnum
.
Equal
FiledName
=
nameof
(
RB_Class_Plan_ViewModel
.
ClassPlanId
),
FiledValue
=
appointModel
.
ClassPlanId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
class_PlanRepository
.
Update
(
keyValues
,
wheres
);
...
...
@@ -3420,10 +3430,7 @@ namespace Edu.Module.Course
};
class_CheckRepository
.
Update
(
checkFileds
,
checkWheres
);
}
if
(
MessageCenterHub
.
GlobalContext
!=
null
)
{
await
MessageCenterHub
.
GlobalContext
.
Clients
.
All
.
SendAsync
(
"ChangePlan"
,
"55555555 "
);
}
}
}
return
""
;
...
...
Edu.Repository/Scroll/RB_Scroll_AppointmentRepository.cs
View file @
22167bba
...
...
@@ -86,10 +86,10 @@ namespace Edu.Repository.Scroll
}
string
sql
=
$@"
SELECT r.*,c.AccountId as TeacherId,s.StuName,cou.CourseName,cou.ScrollMinNum,cou.ScrollMaxNum
From RB_Scroll_Appointment r
inner join
rb_account c on r.AccountId = c.Id
inner join
rb_student s on r.StuId = s.StuId
inner join
rb_course cou on r.CourseId = cou.CourseId
SELECT r.*,c.AccountId as TeacherId,s.StuName,cou.CourseName,cou.ScrollMinNum,cou.ScrollMaxNum
FROM RB_Scroll_Appointment r LEFT JOIN
rb_account c on r.AccountId = c.Id
INNER JOIN
rb_student s on r.StuId = s.StuId
INNER JOIN
rb_course cou on r.CourseId = cou.CourseId
WHERE
{
where
}
ORDER BY r.Id asc "
;
return
Get
<
RB_Scroll_Appointment_ViewModel
>(
sql
,
parameters
).
ToList
();
...
...
@@ -310,8 +310,8 @@ SELECT r.*,c.AccountId as TeacherId,c.WorkUserId,t.TeacherName,t.TeacherHead,s.S
,cr.School_Id as RoomSchoolId,sc.SName as RoomSchoolName ,og.TotalChapterNo,IFNULL(c2.CourseName,'') AS LearnCourseName,og.CourseChapterNo,og.OrderId
FROM RB_Scroll_Appointment r
INNER JOIN rb_order_guest og on r.GuestId = og.Id
INNER
JOIN rb_account c on r.AccountId = c.Id
INNER
JOIN rb_teacher t on c.AccountId = t.TId
LEFT
JOIN rb_account c on r.AccountId = c.Id
LEFT
JOIN rb_teacher t on c.AccountId = t.TId
INNER JOIN rb_student s on r.StuId = s.StuId
INNER JOIN rb_account sch on sch.AccountId = s.StuId and sch.AccountType =4
INNER JOIN rb_course cou on r.CourseId = cou.CourseId
...
...
Edu.WebApi/Controllers/Course/ScrollController.cs
View file @
22167bba
...
...
@@ -437,7 +437,7 @@ namespace Edu.WebApi.Controllers.Course
string
ShiftSort
=
base
.
ParmJObj
.
GetStringValue
(
"ShiftSort"
);
int
TeacherId
=
base
.
ParmJObj
.
GetInt
(
"TeacherId"
,
0
);
string
Date
=
base
.
ParmJObj
.
GetStringValue
(
"Date"
);
if
(
string
.
IsNullOrEmpty
(
ShiftSort
)
||
TeacherId
<=
0
||
string
.
IsNullOrEmpty
(
Date
))
if
(
string
.
IsNullOrEmpty
(
ShiftSort
)
||
string
.
IsNullOrEmpty
(
Date
))
{
return
ApiResult
.
ParamIsNull
();
}
...
...
@@ -745,7 +745,11 @@ namespace Edu.WebApi.Controllers.Course
newModel
.
UpdateTime
=
DateTime
.
Now
;
newModel
.
Id
=
sObj
.
GetInt
(
"AppointmentId"
);
newModel
.
StuName
=
sObj
.
GetStringValue
(
"StuName"
);
newModel
.
IsCalcStuCheck
=
sObj
.
GetInt
(
"IsCalcStuCheck"
);
newModel
.
IsCalcStuCheck
=
1
;
if
(
newModel
.
TeacherId
<=
0
)
{
newModel
.
State
=
CourseAppointStateEnum
.
StuCheck
;
}
if
(
newModel
.
ChapterNo
==
0
&&
newModel
.
CourseGradeNo
>
0
)
{
newModel
.
ChapterNo
=
newModel
.
CourseGradeNo
;
...
...
@@ -1009,11 +1013,11 @@ namespace Edu.WebApi.Controllers.Course
string
Date
=
base
.
ParmJObj
.
GetStringValue
(
"Date"
);
string
ShiftSort
=
base
.
ParmJObj
.
GetStringValue
(
"ShiftSort"
);
int
NewTeacherId
=
base
.
ParmJObj
.
GetInt
(
"NewTeacherId"
,
0
);
if
(
TeacherId
<=
0
||
NewTeacherId
<=
0
||
string
.
IsNullOrEmpty
(
Date
)
||
string
.
IsNullOrEmpty
(
ShiftSort
))
if
(
string
.
IsNullOrEmpty
(
Date
)
||
string
.
IsNullOrEmpty
(
ShiftSort
))
{
return
ApiResult
.
ParamIsNull
();
}
string
msg
=
scrollClassModule
.
SetScrollTeacherAsync
(
TeacherId
,
Date
,
ShiftSort
,
NewTeacherId
,
userInfo
)
.
Result
;
string
msg
=
scrollClassModule
.
SetScrollTeacherAsync
(
TeacherId
,
Date
,
ShiftSort
,
NewTeacherId
,
userInfo
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
();
...
...
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