Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
practical_train
Commits
0f48de00
Commit
0f48de00
authored
Sep 02, 2026
by
wujipeng
Browse files
Merge remote-tracking branch 'origin/dev-v1.0' into dev-v1.0
parents
64e183dc
35b7dc2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
practical-business/src/main/java/com/platform/business/service/impl/ClassAdminServiceImpl.java
View file @
0f48de00
...
@@ -135,6 +135,10 @@ public class ClassAdminServiceImpl implements ClassAdminService {
...
@@ -135,6 +135,10 @@ public class ClassAdminServiceImpl implements ClassAdminService {
if
(
existing
==
null
)
{
if
(
existing
==
null
)
{
throw
new
BusinessException
(
"班级不存在或已删除"
);
throw
new
BusinessException
(
"班级不存在或已删除"
);
}
}
String
status
=
resolveClassStatus
(
existing
.
getStartDate
(),
existing
.
getEndDate
(),
businessToday
());
if
(!
ClassAdminConstants
.
STATUS_UPCOMING
.
equals
(
status
))
{
throw
new
BusinessException
(
"只有待开课班级可以编辑"
);
}
int
actualCount
=
classMapper
.
countAdminStudents
(
classId
);
int
actualCount
=
classMapper
.
countAdminStudents
(
classId
);
validateSaveRequest
(
request
,
classId
,
actualCount
);
validateSaveRequest
(
request
,
classId
,
actualCount
);
...
...
practical-business/src/main/java/com/platform/business/service/impl/CourseAdminServiceImpl.java
View file @
0f48de00
...
@@ -158,6 +158,7 @@ public class CourseAdminServiceImpl implements CourseAdminService {
...
@@ -158,6 +158,7 @@ public class CourseAdminServiceImpl implements CourseAdminService {
try
{
try
{
PreparedCourse
prepared
=
prepareCourse
(
PreparedCourse
prepared
=
prepareCourse
(
item
,
request
.
getClassId
(),
managedClass
,
batchType
);
item
,
request
.
getClassId
(),
managedClass
,
batchType
);
validateNewCourseDate
(
prepared
,
managedClass
);
requireWritablePeriod
(
prepared
.
period
);
requireWritablePeriod
(
prepared
.
period
);
LocalDate
courseDate
=
toLocalDate
(
prepared
.
entity
.
getDate
());
LocalDate
courseDate
=
toLocalDate
(
prepared
.
entity
.
getDate
());
...
@@ -752,6 +753,23 @@ public class CourseAdminServiceImpl implements CourseAdminService {
...
@@ -752,6 +753,23 @@ public class CourseAdminServiceImpl implements CourseAdminService {
}
}
}
}
private
void
validateNewCourseDate
(
PreparedCourse
course
,
ClassEntity
managedClass
)
{
validateCourseDate
(
course
.
entity
.
getDate
(),
managedClass
);
LocalDate
courseDate
=
toLocalDate
(
course
.
entity
.
getDate
());
LocalDate
today
=
LocalDate
.
now
(
ClassAdminConstants
.
BUSINESS_ZONE
);
if
(
courseDate
.
isBefore
(
today
))
{
throw
new
BusinessException
(
"课程日期不能早于当前日期"
);
}
if
(
courseDate
.
equals
(
today
))
{
LocalTime
now
=
LocalTime
.
now
(
ClassAdminConstants
.
BUSINESS_ZONE
);
boolean
started
=
course
.
timeRanges
.
stream
()
.
anyMatch
(
range
->
!
range
.
start
.
isAfter
(
now
));
if
(
started
)
{
throw
new
BusinessException
(
"课程开始时间不能早于当前时间"
);
}
}
}
private
void
validateQueryDateRange
(
Date
startDate
,
Date
endDate
)
{
private
void
validateQueryDateRange
(
Date
startDate
,
Date
endDate
)
{
if
(
startDate
!=
null
&&
endDate
!=
null
if
(
startDate
!=
null
&&
endDate
!=
null
&&
toLocalDate
(
startDate
).
isAfter
(
toLocalDate
(
endDate
)))
{
&&
toLocalDate
(
startDate
).
isAfter
(
toLocalDate
(
endDate
)))
{
...
...
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