fix(88835): 标准比对--对比结果--导出结果文件内容不正确

This commit is contained in:
yjz
2024-08-19 09:52:53 +08:00
parent eea9d06db1
commit 8f625c60a7
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.LanguageEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.util.MessageUtils;
import com.jero.common.util.SnowflakeUtils;
import com.jero.common.util.obs.ObsBootUtil;
import com.jero.modules.compare.entity.*;
import com.jero.modules.compare.enums.AssessConsistencyEnum;
@@ -686,7 +687,7 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
}
String cnt = "\n";
tableHtml = tableHtml.replaceAll("<[\\s]*?br[^>]*?>|<[\\s]*?\\/[\\s]*?br[\\s]*?>", cnt);
String tableSheetName = "表格" + System.currentTimeMillis();
String tableSheetName = "表格" + SnowflakeUtils.snowflake();
ConvertHtml2Excel.table2Excel(tableHtml, (HSSFWorkbook) workbook, tableSheetName);
log.info("-------------------------表格生产完毕----------------------------");
//添加超链接
@@ -749,6 +750,9 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
if (text.contains("<img")) {
String txtLeft = text.substring(0, text.indexOf("<img"));
String txtRight = text.substring(text.indexOf("g\">") + 3);
if (text.indexOf("<img") == -1 || text.indexOf("g\">") == -1){
return;
}
String img = text.substring(text.indexOf("<img"), text.indexOf("g\">"));
String path = img.substring(img.lastIndexOf("=") + 1)+"g";
text = txtLeft + "---" + path + "---" + txtRight;