|
@ -18,6 +18,7 @@ import com.inscloudtech.common.utils.file.FileUploadUtils; |
|
|
import com.inscloudtech.functional.domain.TestReport; |
|
|
import com.inscloudtech.functional.domain.TestReport; |
|
|
import com.inscloudtech.functional.domain.TestReportSubmit; |
|
|
import com.inscloudtech.functional.domain.TestReportSubmit; |
|
|
import com.inscloudtech.functional.service.TestReportService; |
|
|
import com.inscloudtech.functional.service.TestReportService; |
|
|
|
|
|
import com.inscloudtech.functional.service.TestReportSubmitService; |
|
|
import com.inscloudtech.system.domain.SysOss; |
|
|
import com.inscloudtech.system.domain.SysOss; |
|
|
import com.inscloudtech.system.domain.vo.SysOssVo; |
|
|
import com.inscloudtech.system.domain.vo.SysOssVo; |
|
|
import com.inscloudtech.system.service.ISysOssService; |
|
|
import com.inscloudtech.system.service.ISysOssService; |
|
@ -45,6 +46,9 @@ public class TestReportController { |
|
|
|
|
|
|
|
|
private final ISysOssService iSysOssService; |
|
|
private final ISysOssService iSysOssService; |
|
|
|
|
|
|
|
|
|
|
|
private final TestReportSubmitService testReportSubmitService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 分页查询 |
|
|
* 分页查询 |
|
|
* @param |
|
|
* @param |
|
@ -87,14 +91,35 @@ public class TestReportController { |
|
|
@Log(title = "测试报告管理", businessType = BusinessType.INSERT) |
|
|
@Log(title = "测试报告管理", businessType = BusinessType.INSERT) |
|
|
@PostMapping(value = "/add") |
|
|
@PostMapping(value = "/add") |
|
|
public R add(@RequestBody TestReportSubmit vo) { |
|
|
public R add(@RequestBody TestReportSubmit vo) { |
|
|
|
|
|
|
|
|
return R.ok(testReportService.add(vo)); |
|
|
return R.ok(testReportService.add(vo)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 上传测试报告文件 |
|
|
|
|
|
* |
|
|
|
|
|
|
|
|
* 测试报告分页查询 |
|
|
|
|
|
* @param |
|
|
|
|
|
* @param |
|
|
|
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
@GetMapping("/pageSubmit" ) |
|
|
|
|
|
public TableDataInfo<TestReport> pageSubmit(PageQuery pageQuery, TestReportSubmit testReport) { |
|
|
|
|
|
Page page = new Page(); |
|
|
|
|
|
page.setSize(pageQuery.getPageSize()); |
|
|
|
|
|
page.setCurrent(pageQuery.getPageNum()); |
|
|
|
|
|
if (!StpUtil.hasRole("admin")) { |
|
|
|
|
|
testReport.setCreateBy(LoginHelper.getUserId().toString()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Page result = testReportSubmitService.page(page, Wrappers.query(testReport)); |
|
|
|
|
|
TableDataInfo dataInfo = new TableDataInfo(); |
|
|
|
|
|
dataInfo.setTotal(result.getTotal()); |
|
|
|
|
|
dataInfo.setRows(result.getRecords()); |
|
|
|
|
|
return dataInfo; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// /** |
|
|
|
|
|
// * 上传测试报告文件 |
|
|
|
|
|
// * |
|
|
|
|
|
// */ |
|
|
@Log(title = "测试报告管理", businessType = BusinessType.INSERT) |
|
|
@Log(title = "测试报告管理", businessType = BusinessType.INSERT) |
|
|
@PostMapping(value = "/uploadReport", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|
|
@PostMapping(value = "/uploadReport", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
|
|
public R upload( @RequestPart("file") MultipartFile file, |
|
|
public R upload( @RequestPart("file") MultipartFile file, |
|
|