Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage

This commit is contained in:
gaosong
2022-08-15 15:41:48 +08:00
3 changed files with 12 additions and 4 deletions
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
@@ -120,7 +121,8 @@ public class ExcelUtil {
int partNameNum = 0; int partNameNum = 0;
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {//获取每个Sheet表 for (int i = 0; i < workbook.getNumberOfSheets(); i++) {//获取每个Sheet表
sheet = workbook.getSheetAt(i); sheet = workbook.getSheetAt(i);
WorksheetPart worksheetPart = (WorksheetPart) pkg.getParts().get(new PartName("/xl/worksheets/" + sheet.getSheetName().toLowerCase() + ".xml")); String sheetName = "sheet" + (i+1); // xml下的表格名称 不是sheet页签名称
WorksheetPart worksheetPart = (WorksheetPart) pkg.getParts().get(new PartName("/xl/worksheets/" + sheetName + ".xml"));
partNameNum++; partNameNum++;
//获得数据的总行数 //获得数据的总行数
@@ -153,7 +155,7 @@ public class ExcelUtil {
String key = (String) imgMap.get("key"); String key = (String) imgMap.get("key");
String text = (String) imgMap.get("text"); String text = (String) imgMap.get("text");
byte[] bytes = (byte[]) imgMap.get("bytes"); byte[] bytes = (byte[]) imgMap.get("bytes");
if (("${" + key + "}").equals(cellValue)) { if (StringUtils.isNotEmpty(cellValue) && cellValue.contains("${" + key + "}")) {
// 根据图片大小调整行高 // 根据图片大小调整行高
ByteArrayInputStream in = new ByteArrayInputStream(bytes); ByteArrayInputStream in = new ByteArrayInputStream(bytes);
@@ -165,7 +167,7 @@ public class ExcelUtil {
} }
// 插入图片到表格 // 插入图片到表格
putImagePOI(worksheetPart, pkg, cell, bytes, sheet.getSheetName().toLowerCase(), String.valueOf(partNameNum)); putImagePOI(worksheetPart, pkg, cell, bytes, sheetName, String.valueOf(partNameNum));
} }
} }
j++; // 单元格非空才++ j++; // 单元格非空才++
@@ -140,6 +140,9 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
iNewOpinionTemplateEOService.remove(wrapper); iNewOpinionTemplateEOService.remove(wrapper);
//新增 //新增
List<NewOpinionTemplateEO> newOpinionTemplateEOList = lawsMonthlyReportWriteEO.getNewOpinionTemplateEOList(); List<NewOpinionTemplateEO> newOpinionTemplateEOList = lawsMonthlyReportWriteEO.getNewOpinionTemplateEOList();
for (NewOpinionTemplateEO newOpinionTemplateEO : newOpinionTemplateEOList) {
newOpinionTemplateEO.setLawsMonthlyReportWriteId(lawsMonthlyReportWriteEO.getId());
}
iNewOpinionTemplateEOService.saveBatch(newOpinionTemplateEOList); iNewOpinionTemplateEOService.saveBatch(newOpinionTemplateEOList);
}else if (ContentTemplateEnum.NEW_RELEASE_STANDARD_MANIFEST_TEMPLATE.getValue().equals(lawsMonthlyReportWriteEO.getContentTemplate())){ }else if (ContentTemplateEnum.NEW_RELEASE_STANDARD_MANIFEST_TEMPLATE.getValue().equals(lawsMonthlyReportWriteEO.getContentTemplate())){
@@ -150,6 +153,9 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
iNewStandardTemplateEOService.remove(lambdaQueryWrapper); iNewStandardTemplateEOService.remove(lambdaQueryWrapper);
//新增 //新增
List<NewStandardTemplateEO> newStandardTemplateEOList = lawsMonthlyReportWriteEO.getNewStandardTemplateEOList(); List<NewStandardTemplateEO> newStandardTemplateEOList = lawsMonthlyReportWriteEO.getNewStandardTemplateEOList();
for (NewStandardTemplateEO newStandardTemplateEO : newStandardTemplateEOList) {
newStandardTemplateEO.setLawsMonthlyReportWriteId(lawsMonthlyReportWriteEO.getId());
}
iNewStandardTemplateEOService.saveBatch(newStandardTemplateEOList); iNewStandardTemplateEOService.saveBatch(newStandardTemplateEOList);
} }
@@ -131,7 +131,7 @@
align: 'center', align: 'center',
width: 170, width: 170,
ellipsis: true, ellipsis: true,
dataIndex: 'lawsContact' dataIndex: 'lawsContactName'
}, },
{ {
title: this.$t('completedBy'), title: this.$t('completedBy'),