Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
course
Commits
1ed1e0cc
Commit
1ed1e0cc
authored
Sep 03, 2024
by
lilingye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Init
parent
3c57292a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
35 deletions
+35
-35
cloud-course/pom.xml
+5
-5
cloud-course/src/main/java/com/yizhi/course/application/service/impl/AccreditServiceImpl.java
+30
-30
No files found.
cloud-course/pom.xml
View file @
1ed1e0cc
...
@@ -29,11 +29,11 @@
...
@@ -29,11 +29,11 @@
<artifactId>
cloud-site-api
</artifactId>
<artifactId>
cloud-site-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency
>
<!-- <dependency>--
>
<groupId>
com.yizhi
</groupId
>
<!-- <groupId>com.yizhi</groupId>--
>
<artifactId>
cloud-job-api
</artifactId
>
<!-- <artifactId>cloud-job-api</artifactId>--
>
<version>
1.0-SNAPSHOT
</version
>
<!-- <version>1.0-SNAPSHOT</version>--
>
</dependency
>
<!-- </dependency>--
>
<dependency>
<dependency>
<groupId>
com.yizhi
</groupId>
<groupId>
com.yizhi
</groupId>
...
...
cloud-course/src/main/java/com/yizhi/course/application/service/impl/AccreditServiceImpl.java
View file @
1ed1e0cc
...
@@ -6,10 +6,10 @@ import com.baomidou.mybatisplus.service.impl.ServiceImpl;
...
@@ -6,10 +6,10 @@ import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
//
import
com.yizhi.application.job.remote.vo.VmyJobVO
;
//
import com.yizhi.application.job.remote.vo.VmyJobVO;
import
com.yizhi.core.application.vo.AccreditVO
;
import
com.yizhi.core.application.vo.AccreditVO
;
import
com.yizhi.application.job.remote.JobClient
;
//
import com.yizhi.application.job.remote.JobClient;
import
com.yizhi.application.orm.id.IdGenerator
;
import
com.yizhi.application.orm.id.IdGenerator
;
import
com.yizhi.application.orm.util.QueryUtil
;
import
com.yizhi.application.orm.util.QueryUtil
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.ContextHolder
;
...
@@ -55,8 +55,8 @@ public class AccreditServiceImpl extends ServiceImpl<AccreditMapper, Accredit> i
...
@@ -55,8 +55,8 @@ public class AccreditServiceImpl extends ServiceImpl<AccreditMapper, Accredit> i
@Autowired
@Autowired
ICourseService
courseService
;
ICourseService
courseService
;
@Autowired
//
@Autowired
JobClient
jobClient
;
//
JobClient jobClient;
@Autowired
@Autowired
SiteClient
siteClient
;
SiteClient
siteClient
;
...
@@ -118,25 +118,25 @@ public class AccreditServiceImpl extends ServiceImpl<AccreditMapper, Accredit> i
...
@@ -118,25 +118,25 @@ public class AccreditServiceImpl extends ServiceImpl<AccreditMapper, Accredit> i
nowTime
.
add
(
Calendar
.
MINUTE
,
-
10
);
nowTime
.
add
(
Calendar
.
MINUTE
,
-
10
);
try
{
//
try {
VmyJobVO
job
=
new
VmyJobVO
();
//
VmyJobVO job=new VmyJobVO();
job
.
setGroup
(
jobGroup
);
//
job.setGroup(jobGroup);
job
.
setJobName
(
id
.
toString
());
//
job.setJobName(id.toString());
job
.
setJobClassName
(
"com.yizhi.course.application.handle.quartz.job.CourseInvalidJob"
);
//
job.setJobClassName("com.yizhi.course.application.handle.quartz.job.CourseInvalidJob");
String
cron
=
DateUtil
.
getCron
(
accredit
.
getUseDuration
());
//
String cron= DateUtil.getCron(accredit.getUseDuration());
String
[]
cronArr
=
cron
.
split
(
" "
);
//
String[] cronArr=cron.split(" ");
job
.
setSecond
(
cronArr
[
0
]);
//
job.setSecond(cronArr[0]);
job
.
setMinute
(
cronArr
[
1
]);
//
job.setMinute(cronArr[1]);
job
.
setHour
(
cronArr
[
2
]);
//
job.setHour(cronArr[2]);
job
.
setDay
(
cronArr
[
3
]);
//
job.setDay(cronArr[3]);
job
.
setMonth
(
cronArr
[
4
]);
//
job.setMonth(cronArr[4]);
job
.
setWeek
(
cronArr
[
5
]);
//
job.setWeek(cronArr[5]);
job
.
setYear
(
cronArr
[
6
]);
//
job.setYear(cronArr[6]);
jobClient
.
insert
(
job
);
//
jobClient.insert(job);
//
}
catch
(
Exception
e
)
{
//
} catch (Exception e) {
LOGGER
.
error
(
"创建任务失败,id="
+
id
+
"错误消息={}"
,
e
);
//
LOGGER.error("创建任务失败,id="+id+"错误消息={}",e);
}
//
}
return
true
;
return
true
;
}
}
...
@@ -506,12 +506,12 @@ public class AccreditServiceImpl extends ServiceImpl<AccreditMapper, Accredit> i
...
@@ -506,12 +506,12 @@ public class AccreditServiceImpl extends ServiceImpl<AccreditMapper, Accredit> i
* @param id 任务id
* @param id 任务id
*/
*/
private
void
delAuthorizeCourse
(
Long
id
){
private
void
delAuthorizeCourse
(
Long
id
){
try
{
//
try {
// 删除定时任务
//
// 删除定时任务
jobClient
.
delete
(
jobGroup
+
"."
+
id
);
//
jobClient.delete(jobGroup+"."+id);
}
catch
(
Exception
e
)
{
//
} catch (Exception e) {
log
.
info
(
"删除报错:"
+
e
.
getLocalizedMessage
());
//
log.info("删除报错:"+e.getLocalizedMessage());
}
//
}
}
}
}
}
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