Commit 56974d50 authored by 高滢's avatar 高滢

导出

parent 71418e09
package com.ruoyi.domain.vo;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import lombok.Data;
......@@ -10,6 +11,7 @@ public class RecaordUseCasesVO {
private String id;
private String displayID;
@Excel(name = "用例编号")
private String customizedID;
private String name;
private String description;
......
......@@ -6,8 +6,11 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.ReviewStandard;
import com.ruoyi.domain.TTestPlanRecord;
import com.ruoyi.domain.vo.ItemsByUseCaseVO;
import com.ruoyi.domain.vo.RecaordUseCasesVO;
import com.ruoyi.mapper.TTestPlanRecordMapper;
import com.ruoyi.service.TTestPlanRecordService;
import com.ruoyi.service.impl.ReviewStandardServiceImpl;
......@@ -26,7 +29,9 @@ import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.core.controller.BaseController;
import org.springframework.web.bind.annotation.RequestBody;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
......@@ -106,4 +111,22 @@ public class TestPlanRecordController extends BaseController{
public R<Integer> getUseCases(@Validated @RequestBody TestPlanRecordGetInfoRequest testPlanRecordGetInfoRequest ) {
return R.ok(tTestPlanRecordMapper.deleteById(testPlanRecordGetInfoRequest.getId()));
}
@ApiOperation("导出检验记录")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/export")
public void exportPlanRecord(HttpServletResponse respon,@Validated @RequestBody String params) throws IOException{
List<ItemsByUseCaseVO> listUseCase = tTestPlanRecordService.getCarTestDetail(params);
List<RecaordUseCasesVO> list = new ArrayList<>();
listUseCase.forEach(item->{
item.getUseCases().forEach(data->{
list.add(data);
});
});
ExcelUtil<RecaordUseCasesVO> util = new ExcelUtil<RecaordUseCasesVO>(RecaordUseCasesVO.class);
util.exportExcel( respon, list, "自由裁量库(左)数据");
// return R.ok();
}
}
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