fix: 体系搜索导出添加序号和文本状态

This commit is contained in:
wxyclub
2023-12-05 16:12:11 +08:00
parent 9e5e68574e
commit 9c399ca46e
2 changed files with 13 additions and 0 deletions
@@ -27,6 +27,10 @@ public class StandSystemDTO {
@ApiModelProperty(value = "节点Id") @ApiModelProperty(value = "节点Id")
private String menuId; private String menuId;
@ApiModelProperty(value = "序号")
@Excel(name = "序号", width = 10, orderNum = "0")
private Integer standIndex;
@Excel(name = "体系结构", width = 40, orderNum = "1") @Excel(name = "体系结构", width = 40, orderNum = "1")
@ApiModelProperty(value = "体系结构") @ApiModelProperty(value = "体系结构")
private String standSystem; private String standSystem;
@@ -49,6 +53,7 @@ public class StandSystemDTO {
private String standName; private String standName;
@ApiModelProperty(value = "标准状态") @ApiModelProperty(value = "标准状态")
@Excel(name = "文本状态", width = 25, orderNum = "4")
private String standState; private String standState;
@ApiModelProperty(value = "文本状态") @ApiModelProperty(value = "文本状态")
@@ -351,6 +351,11 @@ public class SarMenuStandardNewServiceNewImpl extends ServiceImpl<SarMenuStandar
// 获取当前页面的数据 // 获取当前页面的数据
List<StandSystemDTO> pageList = resultList.subList(start, end); List<StandSystemDTO> pageList = resultList.subList(start, end);
int standIndex = 1;
for (StandSystemDTO dto : pageList) {
dto.setStandIndex(standIndex);
standIndex++;
}
// 使用MyBatis Plus的Page类来构造分页对象 // 使用MyBatis Plus的Page类来构造分页对象
Page<StandSystemDTO> page = new Page<>(pageNum, pageSize, total); Page<StandSystemDTO> page = new Page<>(pageNum, pageSize, total);
@@ -391,6 +396,9 @@ public class SarMenuStandardNewServiceNewImpl extends ServiceImpl<SarMenuStandar
List<StandSystemDTO> dataList; List<StandSystemDTO> dataList;
standSystemDTO.setPage(1); standSystemDTO.setPage(1);
standSystemDTO.setPageSize(Integer.MAX_VALUE); standSystemDTO.setPageSize(Integer.MAX_VALUE);
if (StringUtils.isBlank(standSystemDTO.getExportName())) {
standSystemDTO.setExportName("标准体系");
}
try { try {
response.setHeader("Content-Disposition", response.setHeader("Content-Disposition",
"attachment; filename=" + ReadExcel.encodeFileName(standSystemDTO.getExportName() + ".xlsx", "attachment; filename=" + ReadExcel.encodeFileName(standSystemDTO.getExportName() + ".xlsx",