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
10a15c1b
Commit
10a15c1b
authored
Jul 30, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
211d1d75
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
106 deletions
+22
-106
ChangeClassPlanModule.cs
Edu.Module.EduTask/ChangeClassPlanModule.cs
+22
-106
No files found.
Edu.Module.EduTask/ChangeClassPlanModule.cs
View file @
10a15c1b
...
@@ -68,122 +68,38 @@ namespace Edu.Module.EduTask
...
@@ -68,122 +68,38 @@ namespace Edu.Module.EduTask
public
List
<
object
>
GetRepeatListModule
(
int
ClassId
,
List
<
ChangePlanItem
>
changeList
,
List
<
TimeItem
>
timeList
)
public
List
<
object
>
GetRepeatListModule
(
int
ClassId
,
List
<
ChangePlanItem
>
changeList
,
List
<
TimeItem
>
timeList
)
{
{
List
<
object
>
list
=
new
List
<
object
>();
List
<
object
>
list
=
new
List
<
object
>();
if
(
timeList
!=
null
&&
timeList
.
Count
>
0
)
var
planList
=
new
List
<
RB_Class_Plan_ViewModel
>();
{
if
(
changeList
!=
null
&&
changeList
.
Count
>
0
)
var
repeatList
=
CheckClassPlanModule
(
ClassId
,
timeList
);
if
(
repeatList
!=
null
&&
repeatList
.
Count
>
0
)
{
{
List
<
RB_Class_Room_ViewModel
>
roomList
=
new
List
<
RB_Class_Room_ViewModel
>();
List
<
RB_Teacher_ViewModel
>
teacherList
=
new
List
<
RB_Teacher_ViewModel
>();
string
roomIds
=
string
.
Join
(
","
,
changeList
.
Where
(
qitem
=>
qitem
.
ClassRoomId
>
0
).
Select
(
qitem
=>
qitem
.
ClassRoomId
));
string
teacherIds
=
string
.
Join
(
","
,
changeList
.
Where
(
qitem
=>
qitem
.
TeacherId
>
0
).
Select
(
qitem
=>
qitem
.
TeacherId
));
//冲突的上课计划编号
List
<
int
>
ids
=
new
List
<
int
>();
foreach
(
var
item
in
changeList
)
foreach
(
var
item
in
changeList
)
{
{
var
tempRepeatList
=
repeatList
?.
Where
(
qitem
=>
qitem
.
ClassDate
==
item
.
ClassDate
)?.
ToList
();
var
planModel
=
new
RB_Class_Plan_ViewModel
()
if
(
tempRepeatList
!=
null
&&
tempRepeatList
.
Count
>
0
)
{
if
(
item
.
TeacherId
>
0
)
{
var
tempTeacherList
=
tempRepeatList
?.
Where
(
qitem
=>
qitem
.
TeacherId
==
item
.
TeacherId
)?.
ToList
();
if
(
tempTeacherList
!=
null
&&
tempTeacherList
.
Count
>
0
)
{
var
tempIds
=
Common
.
ConvertHelper
.
StringToList
(
string
.
Join
(
","
,
tempTeacherList
.
GroupBy
(
qitem
=>
qitem
.
ClassPlanId
).
Select
(
qitem
=>
qitem
.
Key
)));
if
(
tempIds
!=
null
&&
tempIds
.
Count
>
0
)
{
ids
.
AddRange
(
tempIds
);
}
}
}
if
(
item
.
ClassRoomId
>
0
)
{
{
var
classroomList
=
tempRepeatList
?.
Where
(
qitem
=>
qitem
.
ClassRoomId
==
item
.
ClassRoomId
)?.
ToList
();
ClassPlanId
=
0
,
if
(
classroomList
!=
null
&&
classroomList
.
Count
>
0
)
ClassId
=
ClassId
,
{
ClassDate
=
item
.
ClassDate
,
var
tempIds
=
Common
.
ConvertHelper
.
StringToList
(
string
.
Join
(
","
,
classroomList
.
GroupBy
(
qitem
=>
qitem
.
ClassPlanId
).
Select
(
qitem
=>
qitem
.
Key
)));
ClassRoomId
=
item
.
ClassRoomId
,
if
(
tempIds
!=
null
&&
tempIds
.
Count
>
0
)
TeacherId
=
item
.
TeacherId
,
{
PlanTimeList
=
new
List
<
RB_Class_Time_ViewModel
>
(),
ids
.
AddRange
(
tempIds
);
};
}
if
(
timeList
!=
null
&&
timeList
.
Count
>
0
)
}
}
}
}
var
planList
=
new
List
<
RB_Class_Plan_ViewModel
>();
var
classTimeList
=
new
List
<
RB_Class_Time_ViewModel
>();
if
(
ids
!=
null
&&
ids
.
Count
>
0
)
{
{
if
(!
string
.
IsNullOrEmpty
(
roomIds
)
)
foreach
(
var
subItem
in
timeList
)
{
{
roomList
=
class_RoomRepository
.
GetClassRoomListRepository
(
new
RB_Class_Room_ViewModel
()
planModel
.
PlanTimeList
.
Add
(
new
RB_Class_Time_ViewModel
{
{
QRoomIds
=
roomIds
StartTime
=
subItem
.
StartTime
,
EndTime
=
subItem
.
EndTime
,
TimeHour
=
subItem
.
TimeHour
,
});
});
}
}
if
(!
string
.
IsNullOrEmpty
(
teacherIds
))
{
teacherList
=
teacherRepository
.
GetTeacherListRepository
(
new
Model
.
ViewModel
.
User
.
RB_Teacher_ViewModel
()
{
QTIds
=
teacherIds
});
}
}
planList
=
class_PlanRepository
.
GetClassPlanListRepository
(
new
RB_Class_Plan_ViewModel
()
planList
.
Add
(
planModel
);
{
QClassPlanIds
=
string
.
Join
(
","
,
ids
)
});
classTimeList
=
class_TimeRepository
.
GetClassTimeListRepository
(
new
RB_Class_Time_ViewModel
()
{
QClassPlanIds
=
string
.
Join
(
","
,
ids
)
});
foreach
(
var
item
in
changeList
)
{
List
<
object
>
PlanRepeatList
=
new
List
<
object
>();
var
tempRepeatList
=
planList
?.
Where
(
qitem
=>
qitem
.
ClassDate
==
item
.
ClassDate
)?.
ToList
();
if
(
tempRepeatList
!=
null
&&
tempRepeatList
.
Count
>
0
)
{
foreach
(
var
subItem
in
tempRepeatList
)
{
var
tempObj
=
new
{
subItem
.
ClassPlanId
,
subItem
.
ClassId
,
subItem
.
ClassName
,
ClassDate
=
Common
.
ConvertHelper
.
FormatDate
(
subItem
.
ClassDate
),
subItem
.
TeacherId
,
subItem
.
TeacherName
,
subItem
.
ClassRoomId
,
subItem
.
RoomName
,
PlanTimeList
=
classTimeList
.
Where
(
qitem
=>
qitem
.
ClassPlanId
==
subItem
.
ClassPlanId
).
Select
(
qitem
=>
new
{
qitem
.
StartTime
,
qitem
.
EndTime
,
qitem
.
TimeHour
}),
};
PlanRepeatList
.
Add
(
tempObj
);
}
}
}
}
var
obj
=
new
if
(
timeList
!=
null
&&
timeList
.
Count
>
0
&&
planList
!=
null
&&
planList
.
Count
>
0
)
{
{
item
.
ClassPlanId
,
list
=
GetRepeatDataModule
(
planList
,
2
);
ClassDate
=
Common
.
ConvertHelper
.
FormatDate
(
item
.
ClassDate
),
item
.
TeacherId
,
TeacherName
=
teacherList
?.
Where
(
qitem
=>
qitem
.
TId
==
item
.
TeacherId
)?.
FirstOrDefault
()?.
TeacherName
??
""
,
item
.
ClassRoomId
,
RoomName
=
roomList
?.
Where
(
qitem
=>
qitem
.
RoomId
==
item
.
ClassRoomId
)?.
FirstOrDefault
()?.
RoomName
??
""
,
PlanTimeList
=
item
.
PlanTimeList
.
Select
(
qitem
=>
new
{
qitem
.
StartTime
,
qitem
.
EndTime
,
}),
PlanRepeatList
};
list
.
Add
(
obj
);
}
}
}
}
}
return
list
;
return
list
;
}
}
...
...
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