|
@@ -56,7 +56,6 @@ import org.apache.poi.ss.usermodel.Sheet;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -968,7 +967,7 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
|
|
|
//摘要及图片
|
|
|
if (StringUtils.isNotBlank(res.getSummary())) {
|
|
|
buildTitleContent(builder, DEFAULT_FONT_NAME, StyleIdentifier.NORMAL, 10, false, res.getSummary(), null);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
buildTitleContent(builder, DEFAULT_FONT_NAME, StyleIdentifier.NORMAL, 10, false, "", null);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(res.getAnnex())) {
|
|
@@ -2292,7 +2291,7 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
|
|
|
//摘要及图片
|
|
|
if (StringUtils.isNotBlank(res.getSummary())) {
|
|
|
buildTitleContent(builder, DEFAULT_FONT_NAME, StyleIdentifier.NORMAL, 10, false, res.getSummary(), null);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
buildTitleContent(builder, DEFAULT_FONT_NAME, StyleIdentifier.NORMAL, 10, false, "", null);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(res.getAnnex())) {
|
|
@@ -2358,7 +2357,7 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
|
|
|
builder.insertCell();
|
|
|
builder.getCellFormat().setHorizontalMerge(CellMerge.PREVIOUS); // 设置为合并到前一个单元格
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
count++;
|
|
|
// 插入表格的第一行
|
|
|
//builder.insertCell();
|
|
@@ -2447,12 +2446,12 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
|
|
|
|
|
|
// 查找图片所在的标题
|
|
|
String title = ImportCommissionHelp.findTitleForImage(shape, doc);
|
|
|
- if(ObjectUtil.isEmpty(title)) {
|
|
|
+ if (ObjectUtil.isEmpty(title)) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
List<String> imgList = docImgMap.get(title);
|
|
|
- if(ObjectUtil.isNull(imgList)) {
|
|
|
+ if (ObjectUtil.isNull(imgList)) {
|
|
|
imgList = new ArrayList<>();
|
|
|
}
|
|
|
|
|
@@ -2463,11 +2462,11 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
|
|
|
.build();
|
|
|
final SysFileItemDo fileItemDo = sysFileItemService.assembleItem(itemParamDto, null);
|
|
|
fileItemDo.setFilename(String.format("img_word_%s.%s", fileItemDo.getId(), FileFormatUtil.imageTypeToExtension(shape.getImageData().getImageType())));
|
|
|
- fileItemDo.setFilename(fileItemDo.getFilename().replaceAll("\\.\\.","."));
|
|
|
+ fileItemDo.setFilename(fileItemDo.getFilename().replaceAll("\\.\\.", "."));
|
|
|
// 设置图片的路径
|
|
|
String filePath = sysConfigService.getContentByConfigCode(Constants.CONFIG_FILE_ROOT_PATH);
|
|
|
- fileItemDo.setFullpath(filePath+"\\by_files\\driveinspection_files\\"+fileItemDo.getFilename());
|
|
|
- fileItemDo.setUrlpath("\\files\\by_files\\driveinspection_files\\"+fileItemDo.getFilename());
|
|
|
+ fileItemDo.setFullpath(filePath + "\\by_files\\driveinspection_files\\" + fileItemDo.getFilename());
|
|
|
+ fileItemDo.setUrlpath("\\files\\by_files\\driveinspection_files\\" + fileItemDo.getFilename());
|
|
|
FileOutputStream out = new FileOutputStream(fileItemDo.getFullpath());
|
|
|
out.write(shape.getImageData().getImageBytes());
|
|
|
out.close();
|
|
@@ -2482,7 +2481,7 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
|
|
|
throw new CustomException("图片解析失败");
|
|
|
}
|
|
|
|
|
|
- if(ObjectUtil.isNotEmpty(fileList)) {
|
|
|
+ if (ObjectUtil.isNotEmpty(fileList)) {
|
|
|
sysFileItemService.saveBatch(fileList);
|
|
|
}
|
|
|
|
|
@@ -2742,6 +2741,10 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
|
|
|
detail.setId(SecurityUtil.getUUID());
|
|
|
detail.setPid(templateDo.getId());
|
|
|
|
|
|
+ if (ImportCommissionHelp.getNodeText(cells[0]).equals("") && ImportCommissionHelp.getNodeText(cells[1]).equals("")) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
int colIdx = 1; //列数 共8列
|
|
|
for (Cell cell : cells) {
|
|
|
String cellVal = ImportCommissionHelp.getNodeText(cell);
|
|
@@ -2910,7 +2913,7 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public R wordExportPrj2(Map<String, Object> map, HttpServletResponse response) throws Exception{
|
|
|
+ public R wordExportPrj2(Map<String, Object> map, HttpServletResponse response) throws Exception {
|
|
|
// 前端传来模板id
|
|
|
String fileId = "52f8f612f1ab43e58d9e3b46ceef6c2c";
|
|
|
Object projectObj = map.get("projectId");
|
|
@@ -3101,7 +3104,7 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
|
|
|
//摘要及图片
|
|
|
if (StringUtils.isNotBlank(res.getSummary())) {
|
|
|
buildTitleContent(builder, DEFAULT_FONT_NAME, StyleIdentifier.NORMAL, 10, false, res.getSummary(), null);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
buildTitleContent(builder, DEFAULT_FONT_NAME, StyleIdentifier.NORMAL, 10, false, "", null);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(res.getAnnex())) {
|
|
@@ -3164,7 +3167,7 @@ public class ZhcxCommissionCheckServiceImpl extends ServiceImpl<ZhcxCommissionCh
|
|
|
builder.insertCell();
|
|
|
builder.getCellFormat().setHorizontalMerge(CellMerge.PREVIOUS); // 设置为合并到前一个单元格
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
count++;
|
|
|
// 插入表格的第一行
|
|
|
//builder.insertCell();
|