Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
mall
Commits
abfb6c13
Commit
abfb6c13
authored
Aug 24, 2018
by
zhh
Browse files
定时任务添加
parent
16794132
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
abfb6c13
...
@@ -53,13 +53,13 @@ JTA事务处理 | ✔
...
@@ -53,13 +53,13 @@ JTA事务处理 | ✔
OSS上传功能 | ✔
OSS上传功能 | ✔
Elasticsearch搜索功能 | ✔
Elasticsearch搜索功能 | ✔
HTTPS支持 | ✔
HTTPS支持 | ✔
SpringSecurity权限管理功能 |
ELK日志收集功能 |
ELK日志收集功能 |
Redis数字型ID生成 |
Redis数字型ID生成 |
SpringTask定时任务支持 |
SpringTask定时任务支持 |
✔
RestTemplate服务间调用 |
RestTemplate服务间调用 |
docker容器化部署 | ✔
docker容器化部署 | ✔
配置区分生产和测试环境 | ✔
配置区分生产和测试环境 | ✔
SpringSecurity权限管理功能 |
### 使用工具
### 使用工具
...
...
mall-portal/src/main/java/com/macro/mall/portal/MallPortalApplication.java
View file @
abfb6c13
...
@@ -3,9 +3,11 @@ package com.macro.mall.portal;
...
@@ -3,9 +3,11 @@ package com.macro.mall.portal;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
@SpringBootApplication
@SpringBootApplication
@MapperScan
({
"com.macro.mall.mapper"
,
"com.macro.mall.portal.dao"
})
@MapperScan
({
"com.macro.mall.mapper"
,
"com.macro.mall.portal.dao"
})
@EnableScheduling
public
class
MallPortalApplication
{
public
class
MallPortalApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
mall-portal/src/main/java/com/macro/mall/portal/component/OrderTimeOutCancelTask.java
0 → 100644
View file @
abfb6c13
package
com.macro.mall.portal.component
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
/**
* Created by macro on 2018/8/24.
* 订单超时取消并解锁库存的定时器
*/
@Component
public
class
OrderTimeOutCancelTask
{
private
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
OrderTimeOutCancelTask
.
class
);
/**
* cron表达式:Seconds Minutes Hours DayofMonth Month DayofWeek [Year]
* 每10分钟扫描一次,扫描超时时间*2时间内所下订单,如果没支付则取消该订单
*/
@Scheduled
(
cron
=
"0 0/10 * ? * ?"
)
private
void
cancelTimeOutOrder
(){
LOGGER
.
info
(
"取消订单,并根据sku编号释放锁定库存"
);
}
}
Write
Preview
Supports
Markdown
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