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
961fbcc1
Commit
961fbcc1
authored
4 years ago
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
f4949532
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
22 deletions
+28
-22
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+12
-1
RB_Class_PlanRepository.cs
Edu.Repository/Course/RB_Class_PlanRepository.cs
+10
-4
RB_Class_TimeRepository.cs
Edu.Repository/Course/RB_Class_TimeRepository.cs
+6
-17
No files found.
Edu.Module.Course/ClassModule.cs
View file @
961fbcc1
...
...
@@ -420,6 +420,17 @@ namespace Edu.Module.Course
/// <returns></returns>
private
List
<
RB_Class_Plan_ViewModel
>
CreateClassPlanList
(
RB_Class_ViewModel
model
,
List
<
RB_Class_Time_ViewModel
>
defaultPlanTimeList
)
{
var
planList
=
class_PlanRepository
.
GetClassPlanListRepository
(
new
RB_Class_Plan_ViewModel
()
{
ClassId
=
model
.
ClassId
,
StartTime
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
});
if
(
planList
!=
null
&&
planList
.
Count
>
0
)
{
string
ids
=
string
.
Join
(
","
,
planList
.
Select
(
qitem
=>
qitem
.
ClassPlanId
));
if
(!
string
.
IsNullOrEmpty
(
ids
))
{
var
flag1
=
class_TimeRepository
.
DeleteClassTimeByPlanIdsRepository
(
ids
);
var
flag2
=
class_PlanRepository
.
DeleteClassPlanRepository
(
ids
);
}
}
List
<
RB_Class_Plan_ViewModel
>
classPlanList
=
new
List
<
RB_Class_Plan_ViewModel
>();
double
totalMinutes
=
0
;
foreach
(
var
item
in
defaultPlanTimeList
)
...
...
@@ -824,7 +835,7 @@ namespace Edu.Module.Course
//现在没有设置时间【直接删除以前的时间】
if
(
extModel
.
PlanTimeList
==
null
||
(
extModel
.
PlanTimeList
!=
null
&&
extModel
.
PlanTimeList
.
Count
==
0
))
{
class_TimeRepository
.
DeleteClassTimeByPlanId
Repository
(
extModel
.
ClassPlanId
);
class_TimeRepository
.
DeleteClassTimeByPlanId
sRepository
(
extModel
.
ClassPlanId
.
ToString
()
);
}
//找出差异的数据
var
deleteList
=
oldPlanList
.
Where
(
qitem
=>
!
extModel
.
PlanTimeList
.
Any
(
oldItem
=>
qitem
.
ClassTimeId
==
oldItem
.
ClassTimeId
)).
ToList
();
...
...
This diff is collapsed.
Click to expand it.
Edu.Repository/Course/RB_Class_PlanRepository.cs
View file @
961fbcc1
...
...
@@ -55,6 +55,10 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND DATE_FORMAT(A.{0},'%y/%m')= DATE_FORMAT('{1}-01','%y/%m') "
,
nameof
(
RB_Class_Plan_ViewModel
.
ClassDate
),
query
.
QMonth
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
StartTime
))
{
builder
.
AppendFormat
(
" AND DATE_FORMAT(A.{0},'%y/%m')>='{1}' "
,
nameof
(
RB_Class_Plan_ViewModel
.
ClassDate
),
query
.
StartTime
);
}
}
return
Get
<
RB_Class_Plan_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
...
...
@@ -92,13 +96,15 @@ WHERE ClassId={1} AND ClassDate>'{2}'
}
/// <summary>
/// 根据
班级
编号删除班级上课计划
/// 根据编号删除班级上课计划
/// </summary>
/// <param name="Class
Id
"></param>
/// <param name="Class
PlanIds
"></param>
/// <returns></returns>
public
bool
DeleteClassPlanRepository
(
int
ClassId
)
public
bool
DeleteClassPlanRepository
(
string
ClassPlanIds
)
{
return
base
.
DeleteOne
(
new
VT
.
FW
.
DB
.
WhereHelper
(
nameof
(
RB_Class_Plan_ViewModel
.
ClassId
),
ClassId
));
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@" DELETE FROM RB_Class_Plan WHERE ClassPlanId IN({0}) "
,
ClassPlanIds
);
return
base
.
Execute
(
builder
.
ToString
())
>
0
;
}
/// <summary>
...
...
This diff is collapsed.
Click to expand it.
Edu.Repository/Course/RB_Class_TimeRepository.cs
View file @
961fbcc1
...
...
@@ -66,26 +66,15 @@ WHERE 1=1
}
/// <summary>
/// 根据
计划删除班级上课时间
/// 根据
上课计划编号删除上课计划
/// </summary>
/// <param name="ClassPlanId
">班级编号
</param>
/// <param name="ClassPlanId
s">
</param>
/// <returns></returns>
public
bool
DeleteClassTimeByPlanId
Repository
(
int
ClassPlanId
)
public
bool
DeleteClassTimeByPlanId
sRepository
(
string
ClassPlanIds
)
{
return
base
.
DeleteOne
(
new
VT
.
FW
.
DB
.
WhereHelper
(
nameof
(
RB_Class_Time_ViewModel
.
ClassPlanId
),
ClassPlanId
));
}
/// <summary>
/// 获取班级上课时间
/// </summary>
/// <param name="classIds"></param>
/// <returns></returns>
public
List
<
RB_Class_Time_ViewModel
>
GetClassTimeForProduct
(
string
classIds
)
{
string
sql
=
$@"SELECT t.ClassId,t.StartTime,t.EndTime FROM rb_class_time t
LEFT JOIN rb_class_plan p on t.ClassPlanId = p.ClassPlanId
WHERE p.`Status`=0 AND t.ClassId =1 GROUP BY t.ClassId,t.StartTime,t.EndTime"
;
return
Get
<
RB_Class_Time_ViewModel
>(
sql
).
ToList
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@" DELETE FROM RB_Class_Time WHERE ClassPlanId IN({0}) "
,
ClassPlanIds
);
return
base
.
Execute
(
builder
.
ToString
())
>
0
;
}
/// <summary>
...
...
This diff is collapsed.
Click to expand it.
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