fix(excel): 字典/表字典分隔符从 _ 改为 , 解决含下划线值被截断
- ExcelAnnotationUtils split 分隔符由 _ 改为 , - AutoPoiDictConfig 去掉 --- escape 机制,改用 , 分隔 - 修复 username 等含下划线字段在 Excel 导入导出时被错误转换 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -27,8 +27,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AutoPoiDictConfig implements AutoPoiDictServiceI {
|
||||
final static String EXCEL_SPLIT_TAG = "_";
|
||||
final static String TEMP_EXCEL_SPLIT_TAG = "---";
|
||||
final static String EXCEL_SPLIT_TAG = ",";
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
@@ -62,14 +61,7 @@ public class AutoPoiDictConfig implements AutoPoiDictServiceI {
|
||||
//update-begin---author:liusq Date:20230517 for:[issues/4917]excel 导出异常---
|
||||
if(t!=null && t.getText()!=null && t.getValue()!=null){
|
||||
//update-end---author:liusq Date:20230517 for:[issues/4917]excel 导出异常---
|
||||
//update-begin---author:scott Date:20211220 for:[issues/I4MBB3]@Excel dicText字段的值有下划线时,导入功能不能正确解析---
|
||||
if(t.getValue().contains(EXCEL_SPLIT_TAG)){
|
||||
String val = t.getValue().replace(EXCEL_SPLIT_TAG,TEMP_EXCEL_SPLIT_TAG);
|
||||
dictReplaces.add(t.getText() + EXCEL_SPLIT_TAG + val);
|
||||
}else{
|
||||
dictReplaces.add(t.getText() + EXCEL_SPLIT_TAG + t.getValue());
|
||||
}
|
||||
//update-end---author:20211220 Date:20211220 for:[issues/I4MBB3]@Excel dicText字段的值有下划线时,导入功能不能正确解析---
|
||||
dictReplaces.add(t.getText() + EXCEL_SPLIT_TAG + t.getValue());
|
||||
}
|
||||
}
|
||||
if (dictReplaces != null && dictReplaces.size() != 0) {
|
||||
|
||||
Reference in New Issue
Block a user