This commit is contained in:
xd 2024-06-19 13:53:44 +08:00
parent 1d92805116
commit 37d2cf2448
14 changed files with 10 additions and 11 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -28,6 +28,7 @@ import com.ruoyi.web.utils.IdUtils;
import com.ruoyi.web.utils.ListSplitUtil; import com.ruoyi.web.utils.ListSplitUtil;
import com.ruoyi.web.utils.rbExcel.excelUtil; import com.ruoyi.web.utils.rbExcel.excelUtil;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.MockMultipartFile;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -266,6 +267,7 @@ public class RedBookController extends BaseController
public AjaxResult madeXjQuot(HttpServletResponse response, @RequestBody OAQuot quot) throws Exception public AjaxResult madeXjQuot(HttpServletResponse response, @RequestBody OAQuot quot) throws Exception
{ {
Quot xjquot = new Quot(); Quot xjquot = new Quot();
File excelFile = null;
try{ try{
xjquot.setQuotId(UUID.fastUUID().toString()); xjquot.setQuotId(UUID.fastUUID().toString());
String quotCode = redBookService.getCode("BJD"); String quotCode = redBookService.getCode("BJD");
@ -280,7 +282,9 @@ public class RedBookController extends BaseController
iQuotService.insertQuot(xjquot); iQuotService.insertQuot(xjquot);
List<OAQuotProduct> list = quot.getSelectedResultData(); List<OAQuotProduct> list = quot.getSelectedResultData();
File file = excelUtil.exportXjQuotExcel(response,xjquot,list);
excelFile = new File("xjQuotFile/"+xjquot.getQuotCode()+".xls");
File file = excelUtil.exportXjQuotExcel(response,excelFile,xjquot,list);
MultipartFile multipartFile = convert(file); MultipartFile multipartFile = convert(file);
/** 上传清单附件 **/ /** 上传清单附件 **/
@ -316,6 +320,7 @@ public class RedBookController extends BaseController
} }
/** 上传清单附件 **/ /** 上传清单附件 **/
FileUtils.delete(excelFile);
return success(xjquot); return success(xjquot);
} }

View File

@ -20,14 +20,9 @@ import jxl.write.*;
import jxl.write.biff.RowsExceededException; import jxl.write.biff.RowsExceededException;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URL;
import java.util.Date; import java.util.Date;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -672,10 +667,8 @@ public class excelUtil {
* @param quot * @param quot
* @param list * @param list
*/ */
public static File exportXjQuotExcel(HttpServletResponse response, Quot quot, List<OAQuotProduct> list){ public static File exportXjQuotExcel(HttpServletResponse response,File excelFile, Quot quot, List<OAQuotProduct> list){
File excelFile = null;
try { try {
excelFile = new File(quot.getQuotCode()+".xls");
WritableWorkbook wwb = Workbook.createWorkbook(excelFile); WritableWorkbook wwb = Workbook.createWorkbook(excelFile);
// 新建一张表 // 新建一张表

View File

@ -88,7 +88,7 @@ spring:
# 密码 # 密码
password: password:
# 连接超时时间 # 连接超时时间
timeout: 30s timeout: 60s
lettuce: lettuce:
pool: pool:
# 连接池中的最小空闲连接 # 连接池中的最小空闲连接
@ -96,7 +96,7 @@ spring:
# 连接池中的最大空闲连接 # 连接池中的最大空闲连接
max-idle: 100 max-idle: 100
# 连接池的最大数据库连接数 # 连接池的最大数据库连接数
max-active: 300 max-active: 500
# #连接池最大阻塞等待时间(使用负值表示没有限制) # #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms max-wait: -1ms
# 关闭超时时间 # 关闭超时时间

View File

@ -43,6 +43,7 @@ public class RedissonConfig {
// 可以用"rediss://"来启用SSL连接 // 可以用"rediss://"来启用SSL连接
String address = "redis://" + host + ":" + port; String address = "redis://" + host + ":" + port;
singleServerConfig.setAddress(address); singleServerConfig.setAddress(address);
config.useSingleServer().setPingConnectionInterval(0); // 防止出现 redis 连接不上的问题
// 设置 数据库编号 // 设置 数据库编号
singleServerConfig.setDatabase(database); singleServerConfig.setDatabase(database);
/* /*