| | |
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.PageQuery; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | |
| | | @ApiOperation("查询测试单表列表") |
| | | @SaCheckPermission("demo:demo:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<TestDemoVo> list(@Validated(QueryGroup.class) TestDemoBo bo) { |
| | | return iTestDemoService.queryPageList(bo); |
| | | public TableDataInfo<TestDemoVo> list(@Validated(QueryGroup.class) TestDemoBo bo, PageQuery pageQuery) { |
| | | return iTestDemoService.queryPageList(bo, pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页查询 |
| | | */ |
| | | @ApiOperation("自定义分页查询") |
| | | @SaCheckPermission("demo:demo:list") |
| | | @GetMapping("/page") |
| | | public TableDataInfo<TestDemoVo> page(@Validated(QueryGroup.class) TestDemoBo bo) { |
| | | return iTestDemoService.customPageList(bo); |
| | | } |
| | | /** |
| | | * 自定义分页查询 |
| | | */ |
| | | @ApiOperation("自定义分页查询") |
| | | @SaCheckPermission("demo:demo:list") |
| | | @GetMapping("/page") |
| | | public TableDataInfo<TestDemoVo> page(@Validated(QueryGroup.class) TestDemoBo bo, PageQuery pageQuery) { |
| | | return iTestDemoService.customPageList(bo, pageQuery); |
| | | } |
| | | |
| | | @ApiOperation("导入测试-校验") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "file", value = "导入文件", dataType = "java.io.File", required = true), |
| | | }) |
| | | @Log(title = "测试单表", businessType = BusinessType.IMPORT) |
| | | @PreAuthorize("@ss.hasPermi('demo:demo:import')") |
| | | @SaCheckPermission("demo:demo:import") |
| | | @PostMapping("/importData") |
| | | public AjaxResult<Void> importData(@RequestPart("file") MultipartFile file) throws Exception { |
| | | ExcelResult<TestDemoImportVo> excelResult = ExcelUtil.importExcel(file.getInputStream(), TestDemoImportVo.class, true); |
| | | List<TestDemoImportVo> volist = excelResult.getList(); |
| | | List<TestDemo> list = BeanUtil.copyToList(volist, TestDemo.class); |
| | | iTestDemoService.saveAll(list); |
| | | iTestDemoService.saveBatch(list); |
| | | return AjaxResult.success(excelResult.getAnalysis()); |
| | | } |
| | | |
| | |
| | | List<TestDemoVo> list = iTestDemoService.queryList(bo); |
| | | // 测试雪花id导出 |
| | | // for (TestDemoVo vo : list) { |
| | | // vo.setId(1234567891234567893L); |
| | | // } |
| | | // vo.setId(1234567891234567893L); |
| | | // } |
| | | ExcelUtil.exportExcel(list, "测试单表", TestDemoVo.class, response); |
| | | } |
| | | |