新增查报告接口导出

master
宇宙皮皮娃 11 months ago
parent 0b4e3a8563
commit 603f8f2bbb

@ -1,7 +1,10 @@
package com.docus.server.collection.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.exception.BaseException;
import com.docus.infrastructure.util.easyexcel.ExcelUtil;
import com.docus.infrastructure.web.api.CommonResult;
import com.docus.infrastructure.web.api.ResultCode;
import com.docus.server.collection.converter.FirstPageCheckoutConverter;
@ -23,6 +26,8 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.List;
@Api("梅州中西HIS相关接口")
@ -73,7 +78,22 @@ public class MzZyHisController {
List<VJsjWzh7addnjreport> reports = vmp.getReport(dto);
return CommonResult.success(reports);
}
@ApiOperation("修改记录导出excel---按勾选")
@PostMapping("/export")
public void export(HttpServletResponse resp, @RequestBody List<VJsjWzh7addnjreport> vos) {
OutputStream outputStream = ExcelUtil.getOutputStream("档案修改记录.xls", resp);
ExcelWriterBuilder write = EasyExcel.write(outputStream, VJsjWzh7addnjreport.class);
write.sheet("sheet1").doWrite(vos);
}
@ApiOperation("修改导出excel---按条件")
@PostMapping("/exportAll")
public void exportAll(HttpServletResponse resp,
@RequestBody VJsjWzh7addnjreportDto dto) {
List<VJsjWzh7addnjreport> reports = vmp.getReport(dto);
export(resp, reports);
}
@ApiOperation("测试")
@GetMapping("/test")
public CommonResult<List> test() {

@ -1,5 +1,7 @@
package com.docus.server.collection.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -14,26 +16,33 @@ import java.util.Date;
* @Version: 1.0
*/
@Data
public class VJsjWzh7addnjreport {
public class VJsjWzh7addnjreport extends BaseRowModel {
@ApiModelProperty(value = "姓名")
@ExcelProperty(value = {"姓名"}, index =0 )
private String name;
@ApiModelProperty(value = "住院号")
@ExcelProperty(value = {"住院号"}, index =1 )
private String inpatientNo;
@ApiModelProperty(value = "类型")
@ExcelProperty(value = {"类型"}, index =2 )
private String type;
@ApiModelProperty(value = "申请科室")
@ExcelProperty(value = {"申请科室"}, index =3 )
private String dept;
@ApiModelProperty(value = "项目")
@ExcelProperty(value = {"项目"}, index =4 )
private String item;
@ApiModelProperty(value = "登记时间")
@ExcelProperty(value = {"登记时间"}, index =5 )
private Date RegistDateTime;
@ApiModelProperty(value = "报告时间")
@ExcelProperty(value = {"报告时间"}, index =6 )
private Date ReportDateTime;
}

Loading…
Cancel
Save