需求新增导出及批量导出接口

This commit is contained in:
pfl
2025-04-18 17:05:35 +08:00
parent 497ff672d1
commit f677776c31
3 changed files with 126 additions and 3 deletions

View File

@@ -5,11 +5,13 @@ import com.test.common.core.controller.BaseController;
import com.test.common.core.domain.AjaxResult;
import com.test.common.core.page.TableDataInfo;
import com.test.common.enums.BusinessType;
import com.test.common.utils.poi.ExcelUtil;
import com.test.test.domain.TestProject;
import com.test.test.domain.qo.IDQO;
import com.test.test.domain.qo.TestProjectListQO;
import com.test.test.service.ITestProjectService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
@@ -75,4 +77,27 @@ public class TestProjectController extends BaseController {
public AjaxResult editProject(@RequestBody TestProject testProject) {
return toAjax(testProjectService.updateTestProject(testProject));
}
/**
* 导出需求列表
*/
@Log(title = "需求", businessType = BusinessType.EXPORT)
@PostMapping("/exportProject")
public void exportProject(HttpServletResponse response,
@RequestBody TestProjectListQO qo) {
List<TestProject> list = testProjectService.selectTestProjectList(qo);
ExcelUtil<TestProject> util = new ExcelUtil<TestProject>(TestProject.class);
util.exportExcel(response, list, "需求数据");
}
/**
* 批量导出需求列表
*/
@Log(title = "需求", businessType = BusinessType.EXPORT)
@PostMapping("/batchExportProject")
public void batchExportProject(HttpServletResponse response,
@RequestBody List<TestProject> list) {
ExcelUtil<TestProject> util = new ExcelUtil<TestProject>(TestProject.class);
util.exportExcel(response, list, "需求数据");
}
}