fix:检查报告导出接口提交

pg_adapter
wangxy 8 months ago
parent aa51d18d92
commit 4f98d90312

@ -5,10 +5,11 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.TdCheck; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.check.TdCheckReport; import com.ruoyi.system.domain.check.TdCheckReport;
import com.ruoyi.system.domain.check.dto.TdCheckReportDTO; import com.ruoyi.system.domain.check.dto.TdCheckReportDTO;
import com.ruoyi.web.controller.manager.CheckReportManager; import com.ruoyi.web.controller.manager.CheckReportManager;
import com.ruoyi.web.controller.manager.SysAreaManager;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
@ -36,6 +37,9 @@ public class CheckReportController extends BaseController {
@Resource @Resource
private CheckReportManager checkReportManager; private CheckReportManager checkReportManager;
@Resource
private SysAreaManager sysAreaManager;
@RequiresPermissions("system:check:view") @RequiresPermissions("system:check:view")
@GetMapping() @GetMapping()
public String place() { public String place() {
@ -54,6 +58,22 @@ public class CheckReportController extends BaseController {
return getDataTable(tdCheckReports); return getDataTable(tdCheckReports);
} }
/**
*
*/
@RequiresPermissions("system:check:export")
@Log(title = "检查报告", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(TdCheckReport tdCheckReport) {
List<TdCheckReport> tdCheckReports = checkReportManager.selectTdCheckReportList(tdCheckReport);
tdCheckReports.forEach(tdCheck1 -> {
tdCheck1.setFramework(sysAreaManager.getAreaName(tdCheck1.getFramework()));
tdCheck1.setArea(sysAreaManager.getAreaName(tdCheck1.getArea()));
});
ExcelUtil<TdCheckReport> util = new ExcelUtil<TdCheckReport>(TdCheckReport.class);
return util.exportExcel(tdCheckReports, "检查报告管理数据");
}
/** /**
* *

@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import com.ruoyi.common.annotation.Excel;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
@ -28,46 +30,57 @@ public class TdCheckReport implements Serializable {
/** /**
* *
*/ */
@Excel(name = "报告人员")
private String adduser; private String adduser;
/** /**
* *
*/ */
@Excel(name = "报告人单位")
private String depart; private String depart;
/** /**
* *
*/ */
@Excel(name = "检查开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date checkStartTime; private Date checkStartTime;
/** /**
* *
*/ */
@Excel(name = "检查结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date checkEndTime; private Date checkEndTime;
/** /**
* 0. 1. * 0. 1.
*/ */
@Excel(name = "检查类型", readConverterExp = "0=自检,1=保密局检查")
private String checkType; private String checkType;
/**
*
*/
private String area;
/** /**
* *
*/ */
@Excel(name = "所属市州")
private String framework; private String framework;
/**
*
*/
@Excel(name = "所属区县")
private String area;
/** /**
* 012 * 012
*/ */
@Excel(name = "检查状态", readConverterExp = "0=通过,1=未通过,2=待检查")
private String checkState; private String checkState;
/** /**
* *
*/ */
@Excel(name = "检查人名")
private String checkName; private String checkName;
/** /**

Loading…
Cancel
Save