添加线程池配置
This commit is contained in:
parent
7f168fe62d
commit
98d8b99d82
@ -3,17 +3,17 @@ package com.fuint.business.marketingActivity.cardFule.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel;
|
||||
import com.fuint.business.marketingActivity.cardFule.service.CardFuelDieselService;
|
||||
import com.fuint.business.marketingActivity.cardGift.entity.CardGift;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
@ -24,6 +24,8 @@ public class CardFuelDiesel extends Model<CardFuelDiesel> {
|
||||
private Integer storeId;
|
||||
//储值卡状态 1:在用 2:挂失 3:停用
|
||||
private String status;
|
||||
//油卡类型 0:汽油卡 1:柴油卡 2:天然气
|
||||
private String type;
|
||||
//油品类型:0:0# 1:-10# 2:京0#
|
||||
private String oilType;
|
||||
//锁价单价
|
||||
@ -86,6 +88,14 @@ public class CardFuelDiesel extends Model<CardFuelDiesel> {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getOilType() {
|
||||
return oilType;
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
package com.fuint.framework.config;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/**
|
||||
* @Description 异步任务线程池配置类
|
||||
* @Author 纪寒
|
||||
* @Date 2023-03-17 09:55:36
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@EnableAsync
|
||||
public class AsyncExecutorConfig {
|
||||
/**
|
||||
* 创建一个核心线程为10个,最大线程为20,等待队列为10,拒绝策略为线程最大需求满就返回给调度线程执行
|
||||
*
|
||||
* @return 创建完的线程池
|
||||
*/
|
||||
@Bean
|
||||
public Executor asyncThreadServiceExecutor() {
|
||||
log.info("异步线程池配置执行");
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(10);
|
||||
executor.setMaxPoolSize(20);
|
||||
executor.setQueueCapacity(10);
|
||||
executor.setThreadNamePrefix("async-thread-service-");
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
}
|
@ -45,6 +45,10 @@
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>3.14</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<!-- poi end -->
|
||||
</dependencies>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user