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
cfe1f516
Commit
cfe1f516
authored
Jun 17, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
7e69f43c
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
202 additions
and
81 deletions
+202
-81
ClassStyleEnum.cs
Edu.Common/Enum/Course/ClassStyleEnum.cs
+1
-0
RB_Duty_Content.cs
Edu.Model/Entity/Duty/RB_Duty_Content.cs
+5
-0
RB_Duty_PlanDetails.cs
Edu.Model/Entity/Duty/RB_Duty_PlanDetails.cs
+11
-0
RB_Class_Plan_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Class_Plan_ViewModel.cs
+10
-1
RB_Duty_PlanDetails_ViewModel.cs
Edu.Model/ViewModel/Duty/RB_Duty_PlanDetails_ViewModel.cs
+0
-10
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+92
-18
DutyPlanModule.cs
Edu.Module.Duty/DutyPlanModule.cs
+38
-8
RB_Class_CheckRepository.cs
Edu.Repository/Course/RB_Class_CheckRepository.cs
+4
-0
RB_Class_PlanRepository.cs
Edu.Repository/Course/RB_Class_PlanRepository.cs
+7
-3
AppIndexController.cs
Edu.WebApi/Controllers/APP/AppIndexController.cs
+2
-2
ClassController.cs
Edu.WebApi/Controllers/Course/ClassController.cs
+23
-38
DutyPlanController.cs
Edu.WebApi/Controllers/Duty/DutyPlanController.cs
+9
-1
No files found.
Edu.Common/Enum/Course/ClassStyleEnum.cs
View file @
cfe1f516
...
...
@@ -45,6 +45,7 @@ namespace Edu.Common.Enum.Course
/// </summary>
[
EnumField
(
"未开班"
)]
NonOpenClass
=
1
,
/// <学习中>
/// 开课中
/// </summary>
...
...
Edu.Model/Entity/Duty/RB_Duty_Content.cs
View file @
cfe1f516
...
...
@@ -90,5 +90,10 @@ namespace Edu.Model.Entity.Duty
/// 更新时间
/// </summary>
public
DateTime
UpdateTime
{
get
;
set
;
}
/// <summary>
/// 事项类型(1-选择,2-手动填写)
/// </summary>
public
int
ItemType
{
get
;
set
;
}
}
}
Edu.Model/Entity/Duty/RB_Duty_PlanDetails.cs
View file @
cfe1f516
...
...
@@ -56,5 +56,16 @@ namespace Edu.Model.Entity.Duty
/// 早退分钟数
/// </summary>
public
int
FinishLateTime
{
get
;
set
;
}
/// <summary>
/// 班次上班打卡设置时间
/// </summary>
public
string
StartTime
{
get
;
set
;
}
/// <summary>
/// 班次下班打卡设置时间
/// </summary>
public
string
EndTime
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Course/RB_Class_Plan_ViewModel.cs
View file @
cfe1f516
...
...
@@ -18,7 +18,6 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public
List
<
RB_Class_Time_ViewModel
>
PlanTimeList
{
get
;
set
;
}
/// <summary>
///班级学员
/// </summary>
...
...
@@ -103,5 +102,15 @@ namespace Edu.Model.ViewModel.Course
/// 每一节课分钟数
/// </summary>
public
int
ClassMinutes
{
get
;
set
;
}
/// <summary>
/// 完成情况
/// </summary>
public
decimal
CompleteProgress
{
get
;
set
;
}
/// <summary>
/// 上课计划时间id
/// </summary>
public
int
ClassTimeId
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Duty/RB_Duty_PlanDetails_ViewModel.cs
View file @
cfe1f516
...
...
@@ -21,16 +21,6 @@ namespace Edu.Model.ViewModel.Duty
/// </summary>
public
string
ShiftName
{
get
;
set
;
}
/// <summary>
/// 值班开始时间
/// </summary>
public
string
StartTime
{
get
;
set
;
}
/// <summary>
/// 值班结束时间
/// </summary>
public
string
EndTime
{
get
;
set
;
}
/// <summary>
/// 值班人员
/// </summary>
...
...
Edu.Module.Course/ClassModule.cs
View file @
cfe1f516
...
...
@@ -785,18 +785,30 @@ namespace Edu.Module.Course
}
var
minDate
=
planList
.
Min
(
qitem
=>
qitem
.
ClassDate
);
var
maxDate
=
planList
.
Max
(
qitem
=>
qitem
.
ClassDate
);
var
checkList
=
classCheckRepository
.
GetClassCheckListRepository
(
new
RB_Class_Check_ViewModel
()
{
ClassId
=
classId
,
StartDate
=
Common
.
ConvertHelper
.
FormatDate
(
minDate
),
EndDate
=
Common
.
ConvertHelper
.
FormatDate
(
maxDate
)
});
var
checkList
=
classCheckRepository
.
GetClassCheckListRepository
(
new
RB_Class_Check_ViewModel
()
{
ClassId
=
classId
,
StartDate
=
Common
.
ConvertHelper
.
FormatDate
(
minDate
),
EndDate
=
Common
.
ConvertHelper
.
FormatDate
(
maxDate
)
});
DateTime
today
=
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
));
foreach
(
var
item
in
planList
)
{
item
.
PlanTimeList
=
timeList
?.
Where
(
qitem
=>
qitem
.
ClassPlanId
==
item
.
ClassPlanId
)?.
ToList
();
var
tempCheckList
=
checkList
?.
Where
(
qitem
=>
qitem
.
ClassId
==
item
.
ClassId
&&
qitem
.
ClassDate
==
item
.
ClassDate
)?.
ToList
()
??
new
List
<
RB_Class_Check_ViewModel
>();
List
<
object
>
classTimeList
=
new
List
<
object
>();
item
.
PlanTimeList
=
timeList
?.
Where
(
qitem
=>
qitem
.
ClassPlanId
==
item
.
ClassPlanId
)?.
OrderBy
(
qitem
=>
qitem
.
StartTime
)?.
ToList
();
if
(
item
.
PlanTimeList
!=
null
&&
item
.
PlanTimeList
.
Count
>
0
)
{
foreach
(
var
subItem
in
item
.
PlanTimeList
)
{
var
tempCheckList
=
checkList
?.
Where
(
qitem
=>
qitem
.
ClassId
==
item
.
ClassId
&&
qitem
.
ClassDate
==
item
.
ClassDate
&&
qitem
.
ClassTimeId
==
subItem
.
ClassTimeId
)?.
ToList
()
??
new
List
<
RB_Class_Check_ViewModel
>();
classTimeList
.
Add
(
new
{
subItem
.
ClassTimeId
,
subItem
.
StartTime
,
subItem
.
EndTime
,
CheckNum
=
tempCheckList
?.
Where
(
qitem
=>
qitem
.
CheckStatus
==
0
)?.
Count
(),
NoCheckNum
=
tempCheckList
?.
Where
(
qitem
=>
qitem
.
CheckStatus
==
1
)?.
Count
(),
});
}
}
list
.
Add
(
new
{
IsEndDate
=
item
.
ClassDate
<=
today
,
TotalNum
=
tempCheckList
?.
Count
(),
CheckNum
=
tempCheckList
?.
Where
(
qitem
=>
qitem
.
CheckStatus
==
0
)?.
Count
(),
NoCheckNum
=
tempCheckList
?.
Where
(
qitem
=>
qitem
.
CheckStatus
==
1
)?.
Count
(),
item
.
ClassPlanId
,
item
.
ClassId
,
item
.
ClassDate
,
...
...
@@ -806,7 +818,7 @@ namespace Edu.Module.Course
item
.
TeacherId
,
item
.
TeacherName
,
item
.
UserIcon
,
TimeList
=
item
?.
PlanTimeList
?.
Select
(
qitem
=>
new
{
qitem
.
ClassTimeId
,
qitem
.
StartTime
,
qitem
.
EndTime
})?.
OrderBy
(
qitem
=>
qitem
.
StartTime
)
TimeList
=
classTimeList
});
}
}
...
...
@@ -1205,7 +1217,7 @@ namespace Edu.Module.Course
public
virtual
bool
AddClassCheckModule
(
List
<
RB_Class_Check_ViewModel
>
list
)
{
//基础课时分钟数
var
BasicMinutes
=
class_ConfigRepository
.
GetBasicMinutesRepository
(
list
[
0
].
Group_Id
);
var
BasicMinutes
=
class_ConfigRepository
.
GetBasicMinutesRepository
(
list
[
0
].
Group_Id
);
var
totalMinutes
=
classCheckRepository
.
CalcPlanMinutesRepository
(
new
RB_Class_Plan_ViewModel
()
{
ClassId
=
list
[
0
].
ClassId
,
...
...
@@ -1249,7 +1261,7 @@ namespace Edu.Module.Course
}
if
(
flag
&&
item
.
CheckStatus
==
1
)
{
flag
=
CalcGuestHoursModule
(
guestModel
,
item
);
//
flag = CalcGuestHoursModule(guestModel, item);
}
}
}
...
...
@@ -1357,9 +1369,60 @@ namespace Edu.Module.Course
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Class_Plan_ViewModel
>
GetClassPlanLogPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Class_Plan_ViewModel
query
)
public
object
GetClassPlanLogPageListModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Class_Plan_ViewModel
query
)
{
List
<
object
>
result
=
new
List
<
object
>();
var
list
=
class_PlanRepository
.
GetClassPlanLogPageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
List
<
RB_Class_Check_ViewModel
>
checkLogList
=
new
List
<
RB_Class_Check_ViewModel
>();
List
<
RB_Class_Time_ViewModel
>
timeList
=
new
List
<
RB_Class_Time_ViewModel
>();
if
(
list
!=
null
&&
list
.
Any
())
{
return
class_PlanRepository
.
GetClassPlanLogPageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
checkLogList
=
classCheckRepository
.
GetClassCheckListRepository
(
new
RB_Class_Check_ViewModel
{
Group_Id
=
query
.
Group_Id
,
School_Id
=
query
.
School_Id
,
ClassId
=
query
.
ClassId
,
StartDate
=
list
.
Min
(
x
=>
x
.
ClassDate
).
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
EndDate
=
list
.
Max
(
x
=>
x
.
ClassDate
).
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
});
}
string
Ids
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
ClassPlanId
));
if
(!
string
.
IsNullOrEmpty
(
Ids
))
{
timeList
=
class_TimeRepository
.
GetClassTimeListRepository
(
new
RB_Class_Time_ViewModel
()
{
QClassPlanIds
=
Ids
});
}
foreach
(
var
item
in
list
)
{
List
<
object
>
time
=
new
List
<
object
>();
var
tempTimeList
=
timeList
?.
Where
(
qitem
=>
qitem
.
ClassPlanId
==
item
.
ClassPlanId
)?.
OrderBy
(
qitem
=>
qitem
.
StartTime
)?.
ToList
();
if
(
tempTimeList
!=
null
&&
tempTimeList
.
Count
>
0
)
{
foreach
(
var
subItem
in
tempTimeList
)
{
int
totalNum
=
checkLogList
.
Where
(
x
=>
x
.
ClassTimeId
==
subItem
.
ClassTimeId
).
Count
();
var
checkList
=
checkLogList
.
Where
(
x
=>
x
.
CheckStatus
==
0
&&
x
.
ClassTimeId
==
subItem
.
ClassTimeId
).
ToList
();
var
noCheckList
=
checkLogList
.
Where
(
x
=>
x
.
CheckStatus
==
1
&&
x
.
ClassTimeId
==
subItem
.
ClassTimeId
).
ToList
();
var
obj
=
new
{
subItem
.
StartTime
,
subItem
.
EndTime
,
CheckNum
=
checkList
.
Count
(),
CheckList
=
checkList
.
Select
(
qitem
=>
new
{
qitem
.
GuestName
}),
NoCheckNum
=
noCheckList
.
Count
(),
NoCheckList
=
noCheckList
.
Select
(
qitem
=>
new
{
qitem
.
GuestName
}),
ColorType
=
item
.
TeacherId
!=
item
.
Teacher_Id
?
1
:
(
totalNum
==
noCheckList
.
Count
()
?
2
:
3
),
};
time
.
Add
(
obj
);
}
}
var
planCheckObj
=
new
{
item
.
TeacherName
,
IsAlternate
=
item
.
TeacherId
==
item
.
Teacher_Id
?
0
:
1
,
//是否代课老师
MonthStr
=
item
.
ClassDate
.
ToString
(
"MM"
),
DayStr
=
item
.
ClassDate
.
ToString
(
"dd"
),
YearStr
=
item
.
ClassDate
.
ToString
(
"yyyy"
),
TimeList
=
time
};
result
.
Add
(
planCheckObj
);
}
}
return
result
;
}
/// <summary>
...
...
@@ -1400,11 +1463,21 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Class_Plan_ViewModel
>
GetClassPlanList
Repository
(
RB_Class_Plan_ViewModel
query
)
public
List
<
RB_Class_Plan_ViewModel
>
GetClassPlanList
Module
(
RB_Class_Plan_ViewModel
query
)
{
return
class_PlanRepository
.
GetClassPlanListRepository
(
query
);
}
/// <summary>
/// 获取班级上课计划列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Class_Plan_ViewModel
>
GetClassPlanListExtModule
(
RB_Class_Plan_ViewModel
query
)
{
return
class_PlanRepository
.
GetClassPlanListExtRepository
(
query
);
}
/// <summary>
/// 获取上课计划
...
...
@@ -2024,23 +2097,23 @@ namespace Edu.Module.Course
var
startTime
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
GetWeekMonday
(
query
.
StartTime
));
var
endTime
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
GetWeekSunday
(
query
.
EndTime
));
TimeSpan
sp
=
endTime
.
Subtract
(
startTime
);
var
days
=
sp
.
Days
+
1
;
var
days
=
sp
.
Days
+
1
;
var
list
=
class_PlanRepository
.
GetClassPlanStatisticalRepository
(
query
);
if
(
list
!=
null
)
{
string
classIds
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
ClassId
));
string
planIds
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
ClassPlanId
));
var
timeList
=
class_TimeRepository
.
GetClassTimeListRepository
(
new
RB_Class_Time_ViewModel
()
{
QClassIds
=
classIds
,
QClassPlanIds
=
planIds
});
var
timeList
=
class_TimeRepository
.
GetClassTimeListRepository
(
new
RB_Class_Time_ViewModel
()
{
QClassIds
=
classIds
,
QClassPlanIds
=
planIds
});
var
guestList
=
order_GuestRepository
.
GetList
(
new
RB_Order_Guest_ViewModel
()
{
ClassIds
=
classIds
});
for
(
var
i
=
0
;
i
<
days
;
i
++)
{
var
ClassDate
=
startTime
.
AddDays
(
i
);
List
<
object
>
subList
=
new
List
<
object
>();
var
tempList
=
list
.
Where
(
qitem
=>
qitem
.
ClassDate
==
ClassDate
).
OrderBy
(
qitem
=>
qitem
.
StartTime
);
var
tempList
=
list
.
Where
(
qitem
=>
qitem
.
ClassDate
==
ClassDate
).
OrderBy
(
qitem
=>
qitem
.
StartTime
);
foreach
(
var
subItem
in
tempList
)
{
var
tempTimeList
=
timeList
?.
Where
(
qitem
=>
qitem
.
ClassPlanId
==
subItem
.
ClassPlanId
)?.
ToList
()?.
OrderBy
(
qitem
=>
qitem
.
StartTime
);
var
currentDate
=
Common
.
ConvertHelper
.
FormatDate
(
ClassDate
)
+
" "
+
(
tempTimeList
?.
FirstOrDefault
()?.
StartTime
??
""
);
var
currentDate
=
Common
.
ConvertHelper
.
FormatDate
(
ClassDate
)
+
" "
+
(
tempTimeList
?.
FirstOrDefault
()?.
StartTime
??
""
);
subList
.
Add
(
new
{
subItem
.
ClassId
,
...
...
@@ -2048,6 +2121,7 @@ namespace Edu.Module.Course
subItem
.
CourseName
,
subItem
.
RoomName
,
subItem
.
TeacherName
,
subItem
.
CompleteProgress
,
TimeStr
=
Common
.
ConvertHelper
.
GetTimeStr
(
currentDate
),
StartTime
=
tempTimeList
?.
FirstOrDefault
()?.
StartTime
??
""
,
EndTime
=
tempTimeList
?.
LastOrDefault
()?.
EndTime
??
""
,
...
...
@@ -2086,7 +2160,7 @@ namespace Edu.Module.Course
}
}
}
return
new
{
mondayList
,
tuesdayList
,
wednesdayList
,
thursdayList
,
fridayList
,
saturdayList
,
sundayList
};
return
new
{
mondayList
,
tuesdayList
,
wednesdayList
,
thursdayList
,
fridayList
,
saturdayList
,
sundayList
};
}
/// <summary>
...
...
@@ -2108,7 +2182,7 @@ namespace Edu.Module.Course
var
obj
=
new
{
item
.
TeacherName
,
TeacherId
=
item
.
Teacher_Id
,
TeacherId
=
item
.
Teacher_Id
,
ClassHours
=
totalClassMinutes
/
BasicMinutes
};
result
.
Add
(
obj
);
...
...
Edu.Module.Duty/DutyPlanModule.cs
View file @
cfe1f516
...
...
@@ -51,6 +51,11 @@ namespace Edu.Module.Duty
/// </summary>
private
readonly
RB_VisitorRepository
visitorRepository
=
new
RB_VisitorRepository
();
/// <summary>
/// 班次仓储层对象
/// </summary>
private
readonly
RB_Duty_FrequencyRepository
duty_FrequencyRepository
=
new
RB_Duty_FrequencyRepository
();
/// <summary>
/// 获取值班计划分页列表【管理端】
/// </summary>
...
...
@@ -580,7 +585,8 @@ namespace Edu.Module.Duty
UpdateBy
=
userId
,
UpdateTime
=
DateTime
.
Now
,
WorkContent
=
""
,
WorkIsFinish
=
0
WorkIsFinish
=
0
,
ItemType
=
(
int
)
dayItem
.
ItemType
});
}
contentList
=
duty_ContentRepository
.
GetDutyContentListRepository
(
new
RB_Duty_Content_ViewModel
()
{
PlanId
=
model
.
Id
});
...
...
@@ -607,6 +613,11 @@ namespace Edu.Module.Duty
{
workIsFinish
=
item
?.
WorkIsFinish
??
0
;
}
List
<
string
>
ItemImgList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
c_itemModel
.
ItemImg
))
{
ItemImgList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
string
>>(
c_itemModel
.
ItemImg
);
}
var
pObj
=
new
{
Id
=
item
?.
Id
??
0
,
...
...
@@ -615,9 +626,9 @@ namespace Edu.Module.Duty
ItemType
=
c_itemModel
?.
ItemType
??
ItemTypeEnum
.
FillIn
,
IsChecked
=
workIsFinish
,
WorkContent
=
item
?.
WorkContent
??
""
,
item
?.
FileList
,
item
.
FileList
,
ItemImgList
};
pList
.
Add
(
pObj
);
}
}
...
...
@@ -653,7 +664,8 @@ namespace Edu.Module.Duty
item
.
ItemType
,
IsChecked
=
workIsFinish
,
WorkContent
=
c_workModel
?.
WorkContent
??
""
,
ItemImgList
ItemImgList
,
c_workModel
?.
FileList
};
pList
.
Add
(
pObj
);
}
...
...
@@ -869,12 +881,13 @@ namespace Edu.Module.Duty
{
nameof
(
RB_Duty_PlanDetails_ViewModel
.
Status
),
Status
},
};
DateTime
dt
=
DateTime
.
Now
;
var
planModel
=
GetDutyPlanDetailsListModule
(
new
RB_Duty_PlanDetails_ViewModel
()
{
PlanId
=
Id
,
Shift
=
Shift
,
QDutyStatus
=-
1
,
QDutyMan
=
DutyMan
.
ToString
()
})?
.
FirstOrDefault
();
var
startTime
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
dt
)
+
" "
+
planModel
?.
StartTime
);
var
endTime
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
dt
)
+
" "
+
planModel
?.
EndTime
);
var
DutyFrequency
=
duty_FrequencyRepository
.
GetDutyFrequencyListRepository
(
new
RB_Duty_Frequency_ViewModel
()
{
Id
=
Shift
})
.
FirstOrDefault
();
var
startTime
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
dt
)
+
" "
+
DutyFrequency
?.
StartTime
);
var
endTime
=
Convert
.
ToDateTime
(
Common
.
ConvertHelper
.
FormatDate
(
dt
)
+
" "
+
DutyFrequency
?.
EndTime
);
if
(
Status
==
1
)
{
fileds
.
Add
(
nameof
(
RB_Duty_PlanDetails_ViewModel
.
CheckTime
),
dt
);
fileds
.
Add
(
nameof
(
RB_Duty_PlanDetails_ViewModel
.
StartTime
),
DutyFrequency
?.
StartTime
);
int
minute
=
Common
.
ConvertHelper
.
CalcMinutes
(
startTime
,
dt
);
if
(
minute
>
0
)
{
...
...
@@ -887,6 +900,16 @@ namespace Edu.Module.Duty
}
if
(
Status
==
2
)
{
var
workList
=
duty_ContentRepository
.
GetDutyContentListRepository
(
new
RB_Duty_Content_ViewModel
()
{
PlanId
=
Id
,
PlanShift
=
Shift
,
PlanType
=
1
,
CreateBy
=
DutyMan
}).
ToList
();
if
(
workList
!=
null
&&
workList
.
Count
>
0
)
{
var
tempWorkList
=
workList
.
Where
(
qitem
=>
qitem
.
WorkIsFinish
==
0
).
ToList
();
if
(
tempWorkList
!=
null
&&
tempWorkList
.
Count
>
0
)
{
message
=
"工作清单内还有没有完成的项目,请检查后再提交!"
;
return
false
;
}
}
if
(
dt
<
startTime
)
{
message
=
"还未到下班时间,不能打卡!"
;
...
...
@@ -898,6 +921,7 @@ namespace Edu.Module.Duty
return
false
;
}
fileds
.
Add
(
nameof
(
RB_Duty_PlanDetails_ViewModel
.
FinishTime
),
dt
);
fileds
.
Add
(
nameof
(
RB_Duty_PlanDetails_ViewModel
.
EndTime
),
DutyFrequency
?.
EndTime
);
int
minute
=
Common
.
ConvertHelper
.
CalcMinutes
(
dt
,
endTime
);
if
(
minute
>
0
)
{
...
...
@@ -968,9 +992,15 @@ namespace Edu.Module.Duty
bool
flag
=
false
;
if
(
model
.
PlanType
==
1
)
{
model
.
FileURL
=
""
;
model
.
OtherContent
=
""
;
model
.
OtherRemark
=
""
;
if
(
model
.
WorkIsFinish
==
0
)
{
if
(!
string
.
IsNullOrEmpty
(
model
.
WorkContent
)
||
!
string
.
IsNullOrEmpty
(
model
.
FileURL
))
{
model
.
WorkIsFinish
=
1
;
}
}
}
else
{
...
...
Edu.Repository/Course/RB_Class_CheckRepository.cs
View file @
cfe1f516
...
...
@@ -367,6 +367,10 @@ GROUP BY A.ClassId
{
builder
.
AppendFormat
(
" AND DATE_FORMAT(A.{0},'%Y-%m-%d')<=DATE_FORMAT('{1}','%Y-%m-%d') "
,
nameof
(
RB_Class_Check_ViewModel
.
ClassDate
),
query
.
EndDate
);
}
if
(
query
.
ClassTimeId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Class_Check_ViewModel
.
ClassTimeId
),
query
.
ClassTimeId
);
}
}
return
Get
<
RB_Class_Check_ViewModel
>(
builder
.
ToString
()).
ToList
();
...
...
Edu.Repository/Course/RB_Class_PlanRepository.cs
View file @
cfe1f516
...
...
@@ -103,6 +103,10 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Class_Plan_ViewModel
.
School_Id
),
query
.
School_Id
);
}
if
(
query
.
ClassTimeId
>
0
)
{
builder
.
AppendFormat
(
" AND time.{0}={1} "
,
nameof
(
RB_Class_Plan_ViewModel
.
ClassTimeId
),
query
.
ClassTimeId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QClassIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Class_Plan_ViewModel
.
ClassId
),
query
.
QClassIds
);
...
...
@@ -501,11 +505,11 @@ where sog.Account_Id={query.StuId} and c.ClassStatus in(1,2) and c.`Status`=0 an
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.ClassPlanId,A.ClassId,A.ClassDate,A.ClassRoomId,A.ClassName,A.CourseName,A.Teacher_Id,A.TeacherName,A.RoomName
,SUM(A.minNum) AS ClassMinutes,MIN(A.StartTime) AS StartTime,MAX(A.EndTime) AS EndTime
,SUM(A.minNum) AS ClassMinutes,MIN(A.StartTime) AS StartTime,MAX(A.EndTime) AS EndTime
,A.CompleteProgress
FROM
(
SELECT A.ClassPlanId, A.ClassId,A.ClassDate,A.ClassRoomId,B.ClassName,C.CourseName,B.Teacher_Id,IFNULL(D.TeacherName,'') AS TeacherName,E.RoomName
,TIMESTAMPDIFF(MINUTE, CONCAT('2020-12-16',' ',F.StartTime), CONCAT('2020-12-16',' ',F.EndTime)) AS minNum,F.StartTime,F.EndTime
,TIMESTAMPDIFF(MINUTE, CONCAT('2020-12-16',' ',F.StartTime), CONCAT('2020-12-16',' ',F.EndTime)) AS minNum,F.StartTime,F.EndTime
,B.CompleteProgress
FROM rb_class_plan AS A INNER JOIN rb_class AS B ON A.ClassId=B.ClassId
LEFT JOIN rb_course AS C ON B.CouseId=C.CourseId
LEFT JOIN rb_teacher AS D ON B.Teacher_Id=D.TId
...
...
@@ -513,7 +517,7 @@ FROM rb_class_plan AS A INNER JOIN rb_class AS B ON A.ClassId=B.ClassId
LEFT JOIN rb_class_time F on A.ClassPlanId = F.ClassPlanId
WHERE 1=1 AND A.`Status`=0 {0}
) AS A
GROUP BY A.ClassPlanId,A.ClassId ,A.ClassDate,A.ClassRoomId
GROUP BY A.ClassPlanId,A.ClassId ,A.ClassDate,A.ClassRoomId
,A.CompleteProgress
"
,
where
.
ToString
());
return
Get
<
RB_Class_Plan_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
...
...
Edu.WebApi/Controllers/APP/AppIndexController.cs
View file @
cfe1f516
...
...
@@ -237,14 +237,14 @@ namespace Edu.WebApi.Controllers.APP
{
courseClassTypeResult
.
Add
(
new
{
Name
=
courseClassTypeItem
.
Name
,
courseClassTypeItem
.
Name
,
courseClassTypeItem
.
Id
,
OrderStudentCount
=
list
.
Where
(
x
=>
(
int
)
x
.
StudentNumType
==
item
.
Id
&&
(
int
)
x
.
CourseClassType
==
courseClassTypeItem
.
Id
).
FirstOrDefault
()?.
OrderStudentCount
??
0
});
}
result
.
Add
(
new
{
Name
=
item
.
Name
,
item
.
Name
,
item
.
Id
,
ChildrenList
=
courseClassTypeResult
});
...
...
Edu.WebApi/Controllers/Course/ClassController.cs
View file @
cfe1f516
...
...
@@ -722,11 +722,19 @@ namespace Edu.WebApi.Controllers.Course
var
classId
=
base
.
ParmJObj
.
GetInt
(
"ClassId"
);
var
classPlanId
=
base
.
ParmJObj
.
GetInt
(
"ClassPlanId"
);
var
schoolId
=
base
.
ParmJObj
.
GetInt
(
"School_Id"
);
var
ClassTimeId
=
base
.
ParmJObj
.
GetInt
(
"ClassTimeId"
);
if
(
classId
==
0
||
classPlanId
==
0
||
schoolId
==
0
)
{
return
ApiResult
.
ParamIsNull
();
}
var
data
=
classModule
.
GetClassPlanListRepository
(
new
RB_Class_Plan_ViewModel
{
ClassId
=
classId
,
ClassPlanId
=
classPlanId
,
Group_Id
=
base
.
UserInfo
.
Group_Id
,
School_Id
=
schoolId
}).
FirstOrDefault
();
var
data
=
classModule
.
GetClassPlanListExtModule
(
new
RB_Class_Plan_ViewModel
{
ClassId
=
classId
,
ClassPlanId
=
classPlanId
,
Group_Id
=
base
.
UserInfo
.
Group_Id
,
School_Id
=
schoolId
,
ClassTimeId
=
ClassTimeId
}).
FirstOrDefault
();
if
(
data
==
null
||
data
.
ClassPlanId
==
0
)
{
return
ApiResult
.
Failed
(
"数据不存在"
);
...
...
@@ -836,46 +844,16 @@ namespace Edu.WebApi.Controllers.Course
ClassId
=
base
.
ParmJObj
.
GetInt
(
"ClassId"
),
TeacherId
=
base
.
ParmJObj
.
GetInt
(
"TeacherId"
)
};
var
list
=
classModule
.
GetClassPlanLogPageListRepository
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
List
<
RB_Class_Check_ViewModel
>
checkLogList
=
new
List
<
RB_Class_Check_ViewModel
>();
if
(
list
!=
null
&&
list
.
Any
())
{
checkLogList
=
classModule
.
GetClassCheckListRepository
(
new
RB_Class_Check_ViewModel
{
Group_Id
=
query
.
Group_Id
,
School_Id
=
query
.
School_Id
,
ClassId
=
query
.
ClassId
,
StartDate
=
list
.
Min
(
x
=>
x
.
ClassDate
).
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
EndDate
=
list
.
Max
(
x
=>
x
.
ClassDate
).
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
});
}
var
list
=
classModule
.
GetClassPlanLogPageListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
List
<
object
>
resultList
=
new
List
<
object
>();
var
dateList
=
list
.
GroupBy
(
x
=>
new
{
MonthStr
=
x
.
ClassDate
.
ToString
(
"MM"
),
YearStr
=
x
.
ClassDate
.
ToString
(
"yyyy"
)
}).
Select
(
x
=>
new
{
x
.
Key
.
MonthStr
,
x
.
Key
.
YearStr
});
foreach
(
var
item
in
list
)
{
int
totalNum
=
checkLogList
.
Where
(
x
=>
x
.
ClassId
==
item
.
ClassId
&&
x
.
ClassRoomId
==
item
.
ClassRoomId
&&
x
.
Group_Id
==
item
.
Group_Id
&&
x
.
School_Id
==
item
.
School_Id
&&
x
.
ClassDate
==
item
.
ClassDate
).
Count
();
var
checkList
=
checkLogList
.
Where
(
x
=>
x
.
CheckStatus
==
0
&&
x
.
ClassId
==
item
.
ClassId
&&
x
.
ClassRoomId
==
item
.
ClassRoomId
&&
x
.
Group_Id
==
item
.
Group_Id
&&
x
.
School_Id
==
item
.
School_Id
&&
x
.
ClassDate
==
item
.
ClassDate
).
ToList
();
var
noCheckList
=
checkLogList
.
Where
(
x
=>
x
.
CheckStatus
==
1
&&
x
.
ClassId
==
item
.
ClassId
&&
x
.
ClassRoomId
==
item
.
ClassRoomId
&&
x
.
Group_Id
==
item
.
Group_Id
&&
x
.
School_Id
==
item
.
School_Id
&&
x
.
ClassDate
==
item
.
ClassDate
).
ToList
();
var
planCheckObj
=
new
{
item
.
TeacherName
,
IsAlternate
=
item
.
TeacherId
==
item
.
Teacher_Id
?
0
:
1
,
//是否代课老师
MonthStr
=
item
.
ClassDate
.
ToString
(
"MM"
),
DayStr
=
item
.
ClassDate
.
ToString
(
"dd"
),
YearStr
=
item
.
ClassDate
.
ToString
(
"yyyy"
),
CheckNum
=
checkList
.
Count
(),
CheckList
=
checkList
.
Select
(
qitem
=>
new
{
qitem
.
GuestName
}),
NoCheckNum
=
noCheckList
.
Count
(),
NoCheckList
=
noCheckList
.
Select
(
qitem
=>
new
{
qitem
.
GuestName
}),
ColorType
=
item
.
TeacherId
!=
item
.
Teacher_Id
?
1
:
(
totalNum
==
noCheckList
.
Count
()
?
2
:
3
),
};
resultList
.
Add
(
planCheckObj
);
}
var
result
=
new
{
dateList
,
resultList
};
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
resul
t
;
pageModel
.
PageData
=
lis
t
;
return
ApiResult
.
Success
(
data
:
pageModel
);
}
/// <summary>
///
签到
///
多人签到【后台】
/// </summary>
/// <returns></returns>
public
ApiResult
AddClassCheck
()
...
...
@@ -897,6 +875,7 @@ namespace Edu.WebApi.Controllers.Course
StudyNum
=
obj
.
GetInt
(
"StudyNum"
),
TeacherId
=
obj
.
GetInt
(
"TeacherId"
),
ClassId
=
obj
.
GetInt
(
"classId"
),
ClassTimeId
=
obj
.
GetInt
(
"ClassTimeId"
),
});
}
}
...
...
@@ -911,7 +890,6 @@ namespace Edu.WebApi.Controllers.Course
return
ApiResult
.
Failed
(
"签到总人数错误,请先检查信息"
);
}
//判断今天有课没有
var
planList
=
classModule
.
GetClassPlanModelRepository
(
new
RB_Class_Plan_ViewModel
{
...
...
@@ -925,7 +903,14 @@ namespace Edu.WebApi.Controllers.Course
}
//判断当天是否有已签到数据
var
checkLogList
=
classModule
.
GetClassCheckList
(
new
RB_Class_Check_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
list
.
FirstOrDefault
().
ClassId
,
StartDate
=
list
.
FirstOrDefault
().
ClassDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
EndDate
=
list
.
FirstOrDefault
().
ClassDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
});
var
checkLogList
=
classModule
.
GetClassCheckList
(
new
RB_Class_Check_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
list
.
FirstOrDefault
().
ClassId
,
StartDate
=
list
.
FirstOrDefault
().
ClassDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
EndDate
=
list
.
FirstOrDefault
().
ClassDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
ClassTimeId
=
list
.
FirstOrDefault
().
ClassTimeId
,
});
foreach
(
var
item
in
list
)
{
...
...
@@ -1272,7 +1257,7 @@ namespace Edu.WebApi.Controllers.Course
};
Class_LessonPlan_ViewModel
model
=
new
Class_LessonPlan_ViewModel
();
//获取班级上课新以及老师名称
var
planDate
=
classModule
.
GetClassPlanList
Repository
(
new
RB_Class_Plan_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
extModel
.
ClassId
,
ClassPlanId
=
extModel
.
ClassPlanId
}).
FirstOrDefault
();
var
planDate
=
classModule
.
GetClassPlanList
Module
(
new
RB_Class_Plan_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
extModel
.
ClassId
,
ClassPlanId
=
extModel
.
ClassPlanId
}).
FirstOrDefault
();
if
(
planDate
==
null
||
planDate
.
ClassPlanId
==
0
)
{
return
ApiResult
.
Failed
(
"班级上课计划不存在"
);
...
...
Edu.WebApi/Controllers/Duty/DutyPlanController.cs
View file @
cfe1f516
...
...
@@ -331,6 +331,7 @@ namespace Edu.WebApi.Controllers.Duty
WorkContent
=
base
.
ParmJObj
.
GetStringValue
(
"WorkContent"
),
WorkIsFinish
=
base
.
ParmJObj
.
GetInt
(
"WorkIsFinish"
),
ItemId
=
base
.
ParmJObj
.
GetInt
(
"ItemId"
),
ItemType
=
base
.
ParmJObj
.
GetInt
(
"ItemType"
),
};
try
{
...
...
@@ -344,7 +345,14 @@ namespace Edu.WebApi.Controllers.Duty
{
model
.
FileList
=
new
List
<
string
>();
}
if
(
model
.
FileList
!=
null
&&
model
.
FileList
.
Count
>
0
)
{
model
.
FileURL
=
Common
.
Plugin
.
JsonHelper
.
Serialize
(
model
.
FileList
);
}
else
{
model
.
FileURL
=
""
;
}
model
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
model
.
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
;
model
.
CreateBy
=
base
.
UserInfo
.
Id
;
...
...
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