Commit 335a5949 authored by tangwei's avatar tangwei

导出功能统一增加过滤条件,目前实现类都没有传入参数,进行过滤

parent 87a7eca3
...@@ -7,13 +7,7 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl; ...@@ -7,13 +7,7 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -21,6 +15,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -21,6 +15,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/** /**
* 导出导入 * 导出导入
...@@ -53,15 +48,22 @@ public class ExcelController extends BaseController { ...@@ -53,15 +48,22 @@ public class ExcelController extends BaseController {
throw new RuntimeException("系统异常!"); throw new RuntimeException("系统异常!");
} }
} }
/**
* * @param Map par 可以传递过滤条件,传入具体实现类中
* @return
* <PRE>
* author tw
* date 2021/9/13
* </PRE>
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出公用类") @ApiOperation(value = "导出公用类")
@GetMapping("/export/{type}") @GetMapping("/export/{type}")
public void getFireStationFile(HttpServletResponse response, @PathVariable(value = "type") String type) { public void getFireStationFile(HttpServletResponse response, @PathVariable(value = "type") String type , @RequestParam Map par) {
try { try {
ExcelEnums excelEnums= ExcelEnums.getByKey(type); ExcelEnums excelEnums= ExcelEnums.getByKey(type);
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType()); ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
excelService.commonExport(response, excelDto); excelService.commonExport(response, excelDto,par);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("系统异常!"); throw new RuntimeException("系统异常!");
......
...@@ -158,7 +158,7 @@ public class ExcelServiceImpl { ...@@ -158,7 +158,7 @@ public class ExcelServiceImpl {
true); true);
} }
public void commonExport(HttpServletResponse response, ExcelDto excelDto) { public void commonExport(HttpServletResponse response, ExcelDto excelDto,Map par) {
switch (excelDto.getType()) { switch (excelDto.getType()) {
case "WHP": case "WHP":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment