资料维护调整
This commit is contained in:
+1
-1
@@ -544,7 +544,7 @@ public class PayDataFileController extends JeroController<PayDataFile, IPayDataF
|
||||
zipos = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream()));
|
||||
zipos.setMethod(ZipOutputStream.DEFLATED); //设置压缩方法
|
||||
for (String path : paths){
|
||||
File file = new File(upLoadPath + "\\" + path);
|
||||
File file = new File(upLoadPath + "\\temp\\" + path);
|
||||
if(file.exists()){
|
||||
try {
|
||||
//添加ZipEntry,并ZipEntry中写入文件流w
|
||||
|
||||
+10
-5
@@ -1,6 +1,7 @@
|
||||
package com.jero.data.controller;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.activation.MimetypesFileTypeMap;
|
||||
@@ -8,8 +9,10 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
@@ -108,7 +111,7 @@ public class PayFileDownloadRecordController extends JeroController<PayFileDownl
|
||||
byte[] buff = new byte[1024];
|
||||
BufferedInputStream bis = null;
|
||||
// 读取filename
|
||||
bis = new BufferedInputStream(new FileInputStream(new File(upLoadPath+"\\"+filename)));
|
||||
bis = new BufferedInputStream(new FileInputStream(new File(upLoadPath+"\\temp\\"+filename)));
|
||||
int i = bis.read(buff);
|
||||
while (i != -1) {
|
||||
outputStream.write(buff, 0, buff.length);
|
||||
@@ -126,10 +129,12 @@ public class PayFileDownloadRecordController extends JeroController<PayFileDownl
|
||||
@AutoLog(value = "资料下载记录-导出")
|
||||
@ApiOperation(value="资料下载记录-导出", notes="资料下载记录-导出")
|
||||
@GetMapping(value = "/exportXls",produces = "text/text;charset=utf-8")
|
||||
public ModelAndView customExportXlsList() {
|
||||
QueryWrapper<PayFileDownloadRecord> queryWrapper = Wrappers.query();
|
||||
List<PayFileDownloadRecord> list = payFileDownloadRecordService.list(queryWrapper);
|
||||
// Step.3 AutoPoi 导出Excel
|
||||
public ModelAndView customExportXlsList(@RequestParam(name="ids",required = true) String ids) {
|
||||
ArrayList<String> strings = new ArrayList<>(Arrays.asList(ids.split(",")));
|
||||
LambdaQueryWrapper<PayFileDownloadRecord> objectLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
objectLambdaQueryWrapper.eq(StringUtils.isNotBlank(ids),PayFileDownloadRecord::getId,strings);
|
||||
List<PayFileDownloadRecord> list = payFileDownloadRecordService.list(objectLambdaQueryWrapper);
|
||||
// Step.3 AutoPoi 导出Excelaw
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "资料下载记录"); //此处设置的filename无效 ,前端会重更新设置一下
|
||||
mv.addObject(NormalExcelConstants.CLASS, PayFileDownloadRecord.class);
|
||||
|
||||
Reference in New Issue
Block a user