导出后的文件无法打开

This commit is contained in:
caozehui
2024-11-05 13:47:48 +08:00
parent da38577e70
commit bb5e5dfec5
2 changed files with 84 additions and 2 deletions

View File

@@ -0,0 +1,78 @@
package com.njcn.gather.system.dictionary.pojo.vo;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @author caozehui
* @since 2024-11-05
*/
@Data
@AllArgsConstructor
public class DictTypeVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 字典类型表Id
*/
//private String id;
/**
* 名称
*/
private String name;
/**
* 编码
*/
private String code;
/**
* 排序
*/
//private Integer sort;
/**
* 开启等级0-不开启1-开启,默认不开启
*/
//private Integer openLevel;
/**
* 开启描述0-不开启1-开启,默认不开启
*/
//private Integer openDescribe;
/**
* 描述
*/
//private String remark;
/**
* 状态0-删除 1-正常
*/
//private Integer state;
/**
* 创建人
*/
//private String createBy;
/**
* 创建时间
*/
//private String createTime;
/**
* 更新人
*/
//private String updateBy;
/**
* 更新时间
*/
//private String updateTime;
}

View File

@@ -13,6 +13,7 @@ import com.njcn.db.mybatisplus.constant.DbConstant;
import com.njcn.gather.system.dictionary.mapper.DictTypeMapper;
import com.njcn.gather.system.dictionary.pojo.param.DictTypeParam;
import com.njcn.gather.system.dictionary.pojo.po.DictType;
import com.njcn.gather.system.dictionary.pojo.vo.DictTypeVO;
import com.njcn.gather.system.dictionary.service.IDictTypeService;
import com.njcn.gather.system.pojo.enums.SystemResponseEnum;
import com.njcn.web.factory.PageFactory;
@@ -77,8 +78,11 @@ public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictType> i
@Override
public void exportDictType(DictTypeParam.DictTypeQueryParam queryParam) {
List<DictType> dictTypes=this.listDictTypes(queryParam).getRecords();
ExcelUtil.exportExcel("字典类型导出数据.xls", "字典类型", DictType.class, dictTypes);
List<DictType> dictTypes = this.listDictTypes(queryParam).getRecords();
//List<DictTypeVO> dictTypeVOS = BeanUtil.copyToList(dictTypes, DictTypeVO.class);
List<DictTypeVO> dictTypeVOS = new ArrayList<>();
dictTypeVOS.add(new DictTypeVO("性别","SEX"));
ExcelUtil.exportExcel("字典类型导出数据.xls", "字典类型", DictTypeVO.class, dictTypeVOS);
}