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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
107 deletions
+23
-107
ChangeClassPlanModule.cs
Edu.Module.EduTask/ChangeClassPlanModule.cs
+22
-106
ChangePlanController.cs
Edu.WebApi/Controllers/EduTask/ChangePlanController.cs
+1
-1
No files found.
Edu.Module.EduTask/ChangeClassPlanModule.cs
View file @
10a15c1b
...
...
@@ -68,123 +68,39 @@ namespace Edu.Module.EduTask
public
List
<
object
>
GetRepeatListModule
(
int
ClassId
,
List
<
ChangePlanItem
>
changeList
,
List
<
TimeItem
>
timeList
)
{
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
)
foreach
(
var
item
in
changeList
)
{
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
)
var
planModel
=
new
RB_Class_Plan_ViewModel
()
{
var
tempRepeatList
=
repeatList
?.
Where
(
qitem
=>
qitem
.
ClassDate
==
item
.
ClassDate
)?.
ToList
();
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
();
if
(
classroomList
!=
null
&&
classroomList
.
Count
>
0
)
{
var
tempIds
=
Common
.
ConvertHelper
.
StringToList
(
string
.
Join
(
","
,
classroomList
.
GroupBy
(
qitem
=>
qitem
.
ClassPlanId
).
Select
(
qitem
=>
qitem
.
Key
)));
if
(
tempIds
!=
null
&&
tempIds
.
Count
>
0
)
{
ids
.
AddRange
(
tempIds
);
}
}
}
}
}
var
planList
=
new
List
<
RB_Class_Plan_ViewModel
>();
var
classTimeList
=
new
List
<
RB_Class_Time_ViewModel
>();
if
(
ids
!=
null
&&
ids
.
Count
>
0
)
ClassPlanId
=
0
,
ClassId
=
ClassId
,
ClassDate
=
item
.
ClassDate
,
ClassRoomId
=
item
.
ClassRoomId
,
TeacherId
=
item
.
TeacherId
,
PlanTimeList
=
new
List
<
RB_Class_Time_ViewModel
>
(),
};
if
(
timeList
!=
null
&&
timeList
.
Count
>
0
)
{
if
(!
string
.
IsNullOrEmpty
(
roomIds
))
{
roomList
=
class_RoomRepository
.
GetClassRoomListRepository
(
new
RB_Class_Room_ViewModel
()
{
QRoomIds
=
roomIds
});
}
if
(!
string
.
IsNullOrEmpty
(
teacherIds
))
foreach
(
var
subItem
in
timeList
)
{
teacherList
=
teacherRepository
.
GetTeacherListRepository
(
new
Model
.
ViewModel
.
User
.
RB_Teacher_ViewModel
()
planModel
.
PlanTimeList
.
Add
(
new
RB_Class_Time_ViewModel
{
QTIds
=
teacherIds
StartTime
=
subItem
.
StartTime
,
EndTime
=
subItem
.
EndTime
,
TimeHour
=
subItem
.
TimeHour
,
});
}
planList
=
class_PlanRepository
.
GetClassPlanListRepository
(
new
RB_Class_Plan_ViewModel
()
{
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
{
item
.
ClassPlanId
,
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
);
}
}
planList
.
Add
(
planModel
);
}
}
if
(
timeList
!=
null
&&
timeList
.
Count
>
0
&&
planList
!=
null
&&
planList
.
Count
>
0
)
{
list
=
GetRepeatDataModule
(
planList
,
2
);
}
return
list
;
}
...
...
Edu.WebApi/Controllers/EduTask/ChangePlanController.cs
View file @
10a15c1b
...
...
@@ -134,7 +134,7 @@ namespace Edu.WebApi.Controllers.EduTask
//var objList = changeClassPlanModule.GetRepeatListModule(model.ClassId, model.NewChangePlanItemList, timeList);
//if (objList != null && objList.Count > 0)
//{
// return ApiResult.Failed("存在上课计划冲突的数据!", data: objList);
//
return ApiResult.Failed("存在上课计划冲突的数据!", data: objList);
//}
}
}
...
...
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