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
ac1d12a6
Commit
ac1d12a6
authored
Aug 11, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
3e12e62f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
192 additions
and
56 deletions
+192
-56
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+5
-1
ScrollClassModule.cs
Edu.Module.Course/ScrollClassModule.cs
+178
-42
ScrollController.cs
Edu.WebApi/Controllers/Course/ScrollController.cs
+9
-13
No files found.
Edu.Module.Course/ClassModule.cs
View file @
ac1d12a6
...
...
@@ -4756,12 +4756,14 @@ namespace Edu.Module.Course
x
.
Date
,
x
.
TeacherId
,
x
.
TeacherName
,
x
.
RoomId
,
x
.
RoomName
,
x
.
RoomId
,
x
.
RoomName
,
x
.
CourseId
,
x
.
CourseName
,
x
.
ShiftSort
,
x
.
CourseSTime
,
x
.
ChapterNo
,
x
.
State
,
//x.CourseGradeNo,
})
.
OrderBy
(
x
=>
x
.
Key
.
CourseSTime
).
ToList
();
...
...
@@ -4817,6 +4819,8 @@ namespace Edu.Module.Course
AppointState
=
item
.
Where
(
x
=>
x
.
State
==
CourseAppointStateEnum
.
WaitSure
).
Any
()
?
1
:
2
,
item
.
Key
.
ShiftSort
,
EnrollNum
=
item
.
Count
(),
item
.
Key
.
State
,
StateName
=
item
.
Key
.
State
.
ToName
(),
subAppointList
.
FirstOrDefault
().
ScrollMinNum
,
subAppointList
.
FirstOrDefault
().
ScrollMaxNum
});
...
...
Edu.Module.Course/ScrollClassModule.cs
View file @
ac1d12a6
...
...
@@ -1794,13 +1794,32 @@ 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
});
if
(
list
.
Where
(
x
=>
x
.
State
!=
Common
.
Enum
.
Course
.
CourseAppointStateEnum
.
WaitSure
).
Any
())
{
return
"已确认预约,无法再次确认"
;
}
if
(!
list
.
Any
())
{
return
"不存在预约,无法确认"
;
}
if
(
list
.
Where
(
x
=>
x
.
State
==
Common
.
Enum
.
Course
.
CourseAppointStateEnum
.
WaitSure
).
Count
()<=
0
)
{
return
"已确认预约,无法再次确认"
;
}
if
(!
list
.
Any
())
{
return
"不存在预约,无法确认"
;
}
//写入计划
var
firstModel
=
list
.
FirstOrDefault
();
if
(
list
.
Where
(
x
=>
x
.
AppointType
!=
3
).
Count
()
<
firstModel
.
ScrollMinNum
)
{
return
"最小成班人数:"
+
firstModel
.
ScrollMinNum
;
}
if
(
list
.
Where
(
x
=>
x
.
AppointType
!=
3
).
Count
()
<
firstModel
.
ScrollMinNum
)
{
return
"最小成班人数:"
+
firstModel
.
ScrollMinNum
;
}
int
planId
=
class_PlanRepository
.
Insert
(
new
RB_Class_Plan
()
var
planList
=
class_PlanRepository
.
GetClassPlanListRepository
(
new
RB_Class_Plan_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
School_Id
=
firstModel
.
RoomSchoolId
,
TeacherId
=
firstModel
.
TeacherId
,
ClassRoomId
=
firstModel
.
RoomId
,
PlanType
=
2
,
QClassDateStr
=
Common
.
ConvertHelper
.
FormatDate
(
firstModel
.
Date
)
});
var
planModel
=
new
RB_Class_Plan
()
{
ClassPlanId
=
0
,
ClassId
=
0
,
...
...
@@ -1816,8 +1835,47 @@ namespace Edu.Module.Course
RepeatPlanIds
=
""
,
PlanType
=
2
,
CourseId
=
firstModel
.
CourseId
});
};
var
CourseTimeList
=
JsonHelper
.
DeserializeObject
<
List
<
CourseTimeModel
>>(
firstModel
.
CourseTime
);
var
oldModel
=
planList
?.
FirstOrDefault
(
qitem
=>
qitem
.
Group_Id
==
planModel
.
Group_Id
&&
qitem
.
School_Id
==
planModel
.
School_Id
&&
qitem
.
TeacherId
==
planModel
.
TeacherId
&&
qitem
.
ClassRoomId
==
planModel
.
ClassRoomId
&&
Common
.
ConvertHelper
.
FormatDate
(
qitem
.
ClassDate
)
==
Common
.
ConvertHelper
.
FormatDate
(
planModel
.
ClassDate
)
&&
qitem
.
PlanType
==
2
&&
qitem
.
StartTime
==
CourseTimeList
.
FirstOrDefault
().
StartTime
&&
qitem
.
EndTime
==
CourseTimeList
.
FirstOrDefault
().
EndTime
&&
qitem
.
CourseId
==
planModel
.
CourseId
);
planModel
.
ClassPlanId
=
oldModel
?.
ClassPlanId
??
0
;
if
(
planModel
.
ClassPlanId
>
0
)
{
}
else
{
int
planId
=
class_PlanRepository
.
Insert
(
planModel
);
planModel
.
ClassPlanId
=
planId
;
//写入时间
foreach
(
var
citem
in
CourseTimeList
)
{
class_TimeRepository
.
Insert
(
new
RB_Class_Time
()
{
ClassTimeId
=
0
,
ClassId
=
0
,
ClassPlanId
=
planModel
.
ClassPlanId
,
StartTime
=
citem
.
StartTime
,
EndTime
=
citem
.
EndTime
,
Group_Id
=
userInfo
.
Group_Id
,
School_Id
=
firstModel
.
RoomSchoolId
,
//暂时 应该要赋值 订单上的预约校区
ClassStatus
=
0
,
SuiPai
=
""
,
VideoUrl
=
""
,
TimeHour
=
citem
.
ClassHours
});
}
}
#
region
获取
token
推送订阅消息
string
Appid
=
Config
.
JiaXiaoHeAppId
;
...
...
@@ -1842,34 +1900,14 @@ namespace Edu.Module.Course
}
#
endregion
if
(
planId
>
0
)
if
(
plan
Model
.
ClassPlan
Id
>
0
)
{
var
CourseTimeList
=
JsonHelper
.
DeserializeObject
<
List
<
CourseTimeModel
>>(
firstModel
.
CourseTime
);
//写入时间
foreach
(
var
citem
in
CourseTimeList
)
{
class_TimeRepository
.
Insert
(
new
RB_Class_Time
()
{
ClassTimeId
=
0
,
ClassId
=
0
,
ClassPlanId
=
planId
,
StartTime
=
citem
.
StartTime
,
EndTime
=
citem
.
EndTime
,
Group_Id
=
userInfo
.
Group_Id
,
School_Id
=
firstModel
.
RoomSchoolId
,
//暂时 应该要赋值 订单上的预约校区
ClassStatus
=
0
,
SuiPai
=
""
,
VideoUrl
=
""
,
TimeHour
=
citem
.
ClassHours
});
}
foreach
(
var
item
in
list
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
State
),
Common
.
Enum
.
Course
.
CourseAppointStateEnum
.
WaitCourse
},
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
ClassPlanId
),
planId
},
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
ClassPlanId
),
plan
Model
.
ClassPlan
Id
},
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
UpdateBy
),
userInfo
.
Id
},
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
UpdateTime
),
DateTime
.
Now
}
};
...
...
@@ -3055,14 +3093,17 @@ namespace Edu.Module.Course
bool
flag
=
false
;
foreach
(
var
item
in
appointList
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
RoomId
),
roomId
}
};
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
);
...
...
@@ -3073,14 +3114,17 @@ namespace Edu.Module.Course
if
(
appointModel
.
State
==
Common
.
Enum
.
Course
.
CourseAppointStateEnum
.
WaitCourse
||
appointModel
.
State
==
Common
.
Enum
.
Course
.
CourseAppointStateEnum
.
Coursed
)
{
//待上课 需要更新 上课计划 class_plan
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Class_Plan_ViewModel
.
ClassRoomId
),
roomId
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Class_Plan_ViewModel
.
ClassPlanId
),
FiledValue
=
appointModel
.
ClassPlanId
,
OperatorEnum
=
OperatorEnum
.
Equal
FiledValue
=
appointModel
.
ClassPlanId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
class_PlanRepository
.
Update
(
keyValues
,
wheres
);
...
...
@@ -3091,14 +3135,106 @@ namespace Edu.Module.Course
var
checkList
=
class_CheckRepository
.
GetClassCheckListRepository
(
new
RB_Class_Check_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
QClassPlanIds
=
appointModel
.
ClassPlanId
.
ToString
()
});
foreach
(
var
qitem
in
checkList
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Class_Check_ViewModel
.
ClassRoomId
),
roomId
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Class_Check_ViewModel
.
ClassCheckId
),
FiledValue
=
qitem
.
ClassCheckId
,
OperatorEnum
=
OperatorEnum
.
Equal
FiledValue
=
qitem
.
ClassCheckId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
class_CheckRepository
.
Update
(
keyValues
,
wheres
);
}
}
if
(
MessageCenterHub
.
GlobalContext
!=
null
)
{
await
MessageCenterHub
.
GlobalContext
.
Clients
.
All
.
SendAsync
(
"ChangePlan"
,
"55555555 "
);
}
}
}
return
""
;
}
/// <summary>
/// 修改上课老师
/// </summary>
/// <param name="teacherId"></param>
/// <param name="date"></param>
/// <param name="shiftSort"></param>
/// <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
)
{
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
.
TeacherId
==
NewTeacherId
).
Any
())
{
return
"请选择其他老师"
;
}
var
accountModel
=
accountRepository
.
GetAccountListRepository
(
new
RB_Account_ViewModel
()
{
AccountType
=
Common
.
Enum
.
User
.
AccountTypeEnum
.
Teacher
,
AccountId
=
NewTeacherId
}).
FirstOrDefault
();
bool
flag
=
false
;
foreach
(
var
item
in
appointList
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Scroll_Appointment_ViewModel
.
AccountId
),
accountModel
.
Id
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Scroll_Appointment_ViewModel
.
Id
),
FiledValue
=
item
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
flag
=
scroll_AppointmentRepository
.
Update
(
keyValues
,
wheres
);
}
if
(
flag
)
{
var
appointModel
=
appointList
.
FirstOrDefault
();
if
(
appointModel
.
State
==
Common
.
Enum
.
Course
.
CourseAppointStateEnum
.
WaitCourse
||
appointModel
.
State
==
Common
.
Enum
.
Course
.
CourseAppointStateEnum
.
Coursed
)
{
//待上课 需要更新 上课计划 class_plan
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Class_Plan_ViewModel
.
TeacherId
),
teacherId
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Class_Plan_ViewModel
.
ClassPlanId
),
FiledValue
=
appointModel
.
ClassPlanId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
class_PlanRepository
.
Update
(
keyValues
,
wheres
);
}
if
(
appointModel
.
State
==
Common
.
Enum
.
Course
.
CourseAppointStateEnum
.
Coursed
)
{
//已上课 需要更新 签到数据 class_check
var
checkList
=
class_CheckRepository
.
GetClassCheckListRepository
(
new
RB_Class_Check_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
QClassPlanIds
=
appointModel
.
ClassPlanId
.
ToString
()
});
foreach
(
var
qitem
in
checkList
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Class_Check_ViewModel
.
TeacherId
),
teacherId
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Class_Check_ViewModel
.
ClassCheckId
),
FiledValue
=
qitem
.
ClassCheckId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
class_CheckRepository
.
Update
(
keyValues
,
wheres
);
...
...
Edu.WebApi/Controllers/Course/ScrollController.cs
View file @
ac1d12a6
...
...
@@ -1062,22 +1062,20 @@ 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
))
{
return
ApiResult
.
ParamIsNull
();
}
string
msg
=
scrollClassModule
.
SetScrollTeacherAsync
(
TeacherId
,
Date
,
ShiftSort
,
NewTeacherId
,
userInfo
).
Result
;
if
(
msg
==
""
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
(
msg
);
}
//string msg = scrollClassModule.SetScrollTeacher(TeacherId, Date, ShiftSort, NewTeacherId, userInfo);
//if (msg == "")
//{
// return ApiResult.Success();
//}
//else
//{
// return ApiResult.Failed(msg);
//}
return
ApiResult
.
Success
();
}
/// <summary>
...
...
@@ -1092,12 +1090,10 @@ namespace Edu.WebApi.Controllers.Course
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
.
SetScrollRoomAsync
(
TeacherId
,
Date
,
ShiftSort
,
RoomId
,
userInfo
).
Result
;
if
(
msg
==
""
)
{
...
...
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