fix(新旧拆分单对比): 对比结果调整
This commit is contained in:
+18
-12
@@ -7,7 +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.MinioUtil;
|
||||
import com.jero.common.util.obs.ObsBootUtil;
|
||||
import com.jero.modules.compare.entity.*;
|
||||
import com.jero.modules.compare.enums.AssessConsistencyEnum;
|
||||
import com.jero.modules.compare.mapper.SarFileCompareItemCommentMapper;
|
||||
@@ -409,12 +409,18 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
|
||||
}
|
||||
}
|
||||
|
||||
// 左、右条款内容
|
||||
String leftContent = String.valueOf(row.getCell(3));
|
||||
String rightContent = String.valueOf(row.getCell(7));
|
||||
// 左、右条款名称
|
||||
String leftName = String.valueOf(row.getCell(2));
|
||||
String rightName = String.valueOf(row.getCell(6));
|
||||
// 左右条款内容对比
|
||||
if (StringUtils.isNotBlank(itemIdLeft) && StringUtils.isNotBlank(itemIdRight)) {
|
||||
if (StringUtils.isNotBlank(leftContent) && StringUtils.isNotBlank(rightContent)) {
|
||||
// 获取对比结果
|
||||
DiffUtils dmp = new DiffUtils();
|
||||
List<String> htmlDiffStrContent = dmp.getHtmlDiffStr(rowDataAndPathLeft, rowDataAndPathRight);
|
||||
List<String> htmlDiffStrName = dmp.getHtmlDiffStr(itemLeft.getItemsName(), itemRight.getItemsName());
|
||||
List<String> htmlDiffStrContent = dmp.getHtmlDiffStr(leftContent, rightContent);
|
||||
List<String> htmlDiffStrName = dmp.getHtmlDiffStr(leftName, rightName);
|
||||
|
||||
Font redFont = workbook.createFont();
|
||||
redFont.setColor(HSSFColor.HSSFColorPredefined.RED.getIndex());
|
||||
@@ -459,19 +465,19 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
|
||||
// 设置单独字体样式
|
||||
String[] split = tagIndex.split(",");
|
||||
leftNameRich.applyFont(Integer.parseInt(split[0]), Integer.parseInt(split[1]), redFont);
|
||||
row.createCell(2).setCellValue(leftRich);
|
||||
row.createCell(2).setCellValue(leftNameRich);
|
||||
}
|
||||
|
||||
List<String> rightNameRedTagIndex = getTagIndex(htmlDiffStrName.get(1), greenTag);
|
||||
List<String> rightNameGreenTagIndex = getTagIndex(htmlDiffStrName.get(1), greenTag);
|
||||
HSSFRichTextString rightNameRich = new HSSFRichTextString(
|
||||
htmlDiffStrName.get(0)
|
||||
.replace(redTag, "")
|
||||
htmlDiffStrName.get(1)
|
||||
.replace(greenTag, "")
|
||||
.replace("</span>", ""));
|
||||
for (String tagIndex : rightNameRedTagIndex) {
|
||||
for (String tagIndex : rightNameGreenTagIndex) {
|
||||
// 设置单独字体样式
|
||||
String[] split = tagIndex.split(",");
|
||||
rightNameRich.applyFont(Integer.parseInt(split[0]), Integer.parseInt(split[1]), greenFont);
|
||||
row.createCell(6).setCellValue(leftRich);
|
||||
row.createCell(6).setCellValue(rightNameRich);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -599,8 +605,8 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
|
||||
//先将图片下载到本地
|
||||
log.info("-------------------------将图片下载到本地文件夹中----------------------------");
|
||||
String fileLastName = text.substring(text.lastIndexOf("/") + 1);
|
||||
if (MinioUtil.doesObjectExist(text)) {
|
||||
try (InputStream in = MinioUtil.download(text)) {
|
||||
if (StringUtils.isNotBlank(text)) {
|
||||
try (InputStream in = ObsBootUtil.getOssFile(text)) {
|
||||
copyFile2(in, dir + File.separator + fileLastName);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user