Commit e1935976 authored by 刘林's avatar 刘林

fix(jg):监管查询,使用登记证列表导出字段超过Excel单元格限制问题处理

parent cad671e8
...@@ -436,12 +436,29 @@ public class JgTableDataExportServiceImpl implements IJgTableDataExportService { ...@@ -436,12 +436,29 @@ public class JgTableDataExportServiceImpl implements IJgTableDataExportService {
} }
List<RegistrationVo> exportData = registrationMapper.queryRegistrationInIds(dto, client); List<RegistrationVo> exportData = registrationMapper.queryRegistrationInIds(dto, client);
for (RegistrationVo vo : exportData) { for (RegistrationVo vo : exportData) {
vo.setEquCode(limitByComma(vo.getEquCode()));
vo.setSupervisoryCode(limitByComma(vo.getSupervisoryCode()));
vo.setRegType(RegTypeEnum.getNameByCode(vo.getRegType()).orElse(RegTypeEnum.REGISTRATION_NEW.getName())); vo.setRegType(RegTypeEnum.getNameByCode(vo.getRegType()).orElse(RegTypeEnum.REGISTRATION_NEW.getName()));
} }
ExcelUtil.createTemplate(response, "使用登记列表数据", "使用登记列表", exportData, RegistrationVo.class, null, false); ExcelUtil.createTemplate(response, "使用登记列表数据", "使用登记列表", exportData, RegistrationVo.class, null, false);
} }
/** /**
* 截取逗号分隔字符串,只保留前100项,多余用 "..." 代替
*/
private String limitByComma(String equCode) {
if (equCode == null || equCode.trim().isEmpty()) {
return "";
}
String[] parts = equCode.split(",");
if (parts.length <= 100) {
return equCode;
}
// 只保留前100项并添加省略号
return String.join(",", Arrays.copyOf(parts, 100)) + "...";
}
/**
* 单位变更列表数据导出 * 单位变更列表数据导出
* *
* @param response 响应 * @param response 响应
......
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