You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
100 lines
2.7 KiB
Java
100 lines
2.7 KiB
Java
package com.glxp.api.controller.inv;
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
import com.glxp.api.entity.inout.IoStatDayEntity;
|
|
import com.glxp.api.req.inout.FilterStatDataDetailRequest;
|
|
import com.glxp.api.service.inout.ExcelService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* @author : zhangsan
|
|
* @date : 2023/4/17 11:14
|
|
* @modyified By :
|
|
*/
|
|
|
|
@RestController
|
|
@Api(tags = "文件接口")
|
|
public class ApiExcelController {
|
|
|
|
@Resource
|
|
private ExcelService excelService;
|
|
|
|
/**
|
|
* excel导入-单个sheet
|
|
*
|
|
* @param multipartFile 文件流
|
|
* @return
|
|
* @throws Exception
|
|
*/
|
|
@PostMapping("/excelImport")
|
|
@ApiOperation(value = "excel导入")
|
|
public BaseResponse<Object> excelImport(@RequestParam("file") MultipartFile multipartFile){
|
|
excelService.excelImport(multipartFile);
|
|
return new BaseResponse<>();
|
|
}
|
|
|
|
/**
|
|
* excel导出-单个sheet
|
|
*
|
|
* @param response 响应流
|
|
*/
|
|
@GetMapping("/udiwms/inv/excelExportOut")
|
|
public void export(HttpServletResponse response,String billNo,String key) {
|
|
excelService.excelExport(response,billNo,key);
|
|
}
|
|
|
|
/**
|
|
* excel导入-多个sheet
|
|
*
|
|
* @param multipartFile 文件流
|
|
* @return 响应体
|
|
*/
|
|
@PostMapping("/excelSheetImport")
|
|
@ApiOperation(value = "excel导入-多个sheet")
|
|
public BaseResponse<Object> excelSheetImport(@RequestParam("file") MultipartFile multipartFile){
|
|
excelService.excelSheetImport(multipartFile);
|
|
return new BaseResponse<>();
|
|
}
|
|
|
|
/**
|
|
* excel导出-多个sheet
|
|
*
|
|
* @param response 响应流
|
|
*/
|
|
@ApiOperation(value = "excel导出-多个sheet", httpMethod = "GET")
|
|
@GetMapping("/excelSheetExport")
|
|
public void excelSheetExport(HttpServletResponse response) {
|
|
excelService.excelSheetExport(response);
|
|
}
|
|
|
|
/**
|
|
* excel模板导出-单个sheet
|
|
*
|
|
* @param response 响应流
|
|
*/
|
|
@ApiOperation(value = "excel模板导出", httpMethod = "GET")
|
|
@GetMapping("/excelTemplate")
|
|
public void excelTemplate(HttpServletResponse response) {
|
|
excelService.excelTemplate(response);
|
|
}
|
|
|
|
/**
|
|
* excel模板导出-多个sheet
|
|
*
|
|
* @param response 响应流
|
|
*/
|
|
@ApiOperation(value = "excel模板导出-多个sheet", httpMethod = "GET")
|
|
@GetMapping("/excelSheetTemplate")
|
|
public void excelSheetTemplate(HttpServletResponse response) throws Exception {
|
|
excelService.excelSheetTemplate(response);
|
|
}
|
|
|
|
}
|