From 997235868d154a2d7c817a787a3f185047544cf7 Mon Sep 17 00:00:00 2001 From: fl <3098731433@qq.com> Date: Thu, 8 May 2025 09:32:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E7=89=88=E4=B8=8B=E8=BD=BD=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tool/service/impl/EpcServiceImpl.java | 34 +++++++-------- .../tool/service/impl/SouthServiceImpl.java | 2 +- .../service/impl/StateGridServiceImpl.java | 43 ++++++++----------- 3 files changed, 37 insertions(+), 42 deletions(-) diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/EpcServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/EpcServiceImpl.java index ff23c63..9381b03 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/EpcServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/EpcServiceImpl.java @@ -197,7 +197,7 @@ public class EpcServiceImpl implements EpcService { personFileGroup(item, comOtherList); }); //将数据转换为模版数据 - dealWithWordData(request,response,data,"EPC.ftl"); + dealWithWordData(request,response,data,"EPC_DOC.ftl"); } } @@ -315,8 +315,8 @@ public class EpcServiceImpl implements EpcService { if (item.getIdCardFileList() != null) { for (TbFileSourceVo file : item.getIdCardFileList()) { Map imgMap = new HashMap<>(); - imgMap.put("width", "4959860"); - imgMap.put("height", "3492375"); + imgMap.put("width", "375.35"); + imgMap.put("height", "207.85"); imgMap.put("index", (100 * (i + 1)) + imgIndex++); imgMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath + file.getFilePath()) : ""); @@ -327,8 +327,8 @@ public class EpcServiceImpl implements EpcService { if (item.getDiplomaFileList() != null) { for (TbFileSourceVo file : item.getDiplomaFileList()) { Map imgMap = new HashMap<>(); - imgMap.put("width", "5325745"); - imgMap.put("height", "7534910"); + imgMap.put("width", "481.15"); + imgMap.put("height", "634.5"); imgMap.put("index", (100 * (i + 1)) + imgIndex++); imgMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath + file.getFilePath()) : ""); @@ -340,8 +340,8 @@ public class EpcServiceImpl implements EpcService { if (item.getOtherFileList() != null) { for (TbFileSourceVo file : item.getOtherFileList()) { Map imgMap = new HashMap<>(); - imgMap.put("width", "5325745"); - imgMap.put("height", "7534910"); + imgMap.put("width", "481.15"); + imgMap.put("height", "634.5"); imgMap.put("index", (100 * (i + 1)) + imgIndex++); imgMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath + file.getFilePath()) : ""); @@ -363,8 +363,8 @@ public class EpcServiceImpl implements EpcService { TbFileSourceVo file = item.getOtherFileList().get(k); Map imgMap = new HashMap<>(); imgMap.put("index", (10000 * (j + 1)) + (k + 1)); - imgMap.put("width", "5325745"); - imgMap.put("height", "7534910"); + imgMap.put("width", "481.15"); + imgMap.put("height", "634.5"); imgMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath + file.getFilePath()) : ""); imgList2.add(imgMap); @@ -398,8 +398,8 @@ public class EpcServiceImpl implements EpcService { if (item.getIdCardFileList() != null) { for (TbFileSourceVo file : item.getIdCardFileList()) { Map imgMap = new HashMap<>(); - imgMap.put("width", "4959860"); - imgMap.put("height", "3492375"); + imgMap.put("width", "375.35"); + imgMap.put("height", "207.85"); imgMap.put("index", (100 * (i + 1)) + imgIndex++); imgMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath + file.getFilePath()) : ""); @@ -410,8 +410,8 @@ public class EpcServiceImpl implements EpcService { if (item.getDiplomaFileList() != null) { for (TbFileSourceVo file : item.getDiplomaFileList()) { Map imgMap = new HashMap<>(); - imgMap.put("width", "5325745"); - imgMap.put("height", "7534910"); + imgMap.put("width", "481.15"); + imgMap.put("height", "634.5"); imgMap.put("index", (100 * (i + 1)) + imgIndex++); imgMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath + file.getFilePath()) : ""); @@ -422,8 +422,8 @@ public class EpcServiceImpl implements EpcService { if (item.getOtherFileList() != null) { for (TbFileSourceVo file : item.getOtherFileList()) { Map imgMap = new HashMap<>(); - imgMap.put("width", "5325745"); - imgMap.put("height", "7534910"); + imgMap.put("width", "481.15"); + imgMap.put("height", "634.5"); imgMap.put("index", (100 * (i + 1)) + imgIndex++); imgMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath + file.getFilePath()) : ""); @@ -439,8 +439,8 @@ public class EpcServiceImpl implements EpcService { List> imgList2 = new ArrayList<>(); Map imgMap = new HashMap<>(); imgMap.put("index", 10000) ; - imgMap.put("width", "5325745"); - imgMap.put("height", "7534910"); + imgMap.put("width", "481.15"); + imgMap.put("height", "634.5"); imgMap.put("base64Url", ""); imgList2.add(imgMap); yjMap.put("imgList", imgList2); diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/SouthServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/SouthServiceImpl.java index 9540c70..dff0a5c 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/SouthServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/SouthServiceImpl.java @@ -199,7 +199,7 @@ public class SouthServiceImpl implements SouthService { List comOtherList = stateGridMapper.getFileSourceList(item.getId(),TableType.TB_SUB_PEOPLE.getCode()); personFileGroup(item, comOtherList); }); - epcServiceImpl.dealWithWordData(request, response, data, "NW.ftl"); + epcServiceImpl.dealWithWordData(request, response, data, "NW_DOC.ftl"); } } diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/StateGridServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/StateGridServiceImpl.java index b3e521e..58f3bbf 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/StateGridServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/StateGridServiceImpl.java @@ -269,11 +269,6 @@ public class StateGridServiceImpl implements StateGridService { @Value("${file.path}") private String filePath; - public static void main(String[] args) throws Exception { - String bast64= FreeMarkerUtil.getImageBase("F:\\File\\tool\\2025\\05\\07\\3_20250507104937A005.png"); - System.err.println(bast64); - } - /** * 将数据转换为模版数据 * @param request @@ -316,8 +311,8 @@ public class StateGridServiceImpl implements StateGridService { for (TbFileSourceVo file : item.getFileList()) { Map imgMap = new HashMap<>(); imgMap.put("index", 100 * index + imgIndex++); - imgMap.put("width", "5325745"); - imgMap.put("height", "7534910"); + imgMap.put("width", "481.15"); + imgMap.put("height", "634.5"); String bast64=FreeMarkerUtil.getImageBase(filePath+file.getFilePath()); imgMap.put("base64Url", file.getFilePath() != null ? bast64: ""); imgList.add(imgMap); @@ -370,8 +365,8 @@ public class StateGridServiceImpl implements StateGridService { for (TbFileSourceVo file : perfItem.getSubPerfFileList()) { Map imgMap = new HashMap<>(); imgMap.put("index", 100000 * perfIndex + imgIndex++); - imgMap.put("width", "5325745"); - imgMap.put("height", "7534910"); + imgMap.put("width", "481.15"); + imgMap.put("height", "634.5"); imgMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath+file.getFilePath()) : ""); imgList.add(imgMap); } @@ -386,8 +381,8 @@ public class StateGridServiceImpl implements StateGridService { for (TbFileSourceVo file : item.getSubFileList()) { Map zzMap = new HashMap<>(); zzMap.put("index", 1000 * subIndex + zzIndex++); - zzMap.put("width", "5325745"); - zzMap.put("height", "7534910"); + zzMap.put("width", "481.15"); + zzMap.put("height", "634.5"); zzMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath+file.getFilePath()) : ""); zzList.add(zzMap); } @@ -415,8 +410,8 @@ public class StateGridServiceImpl implements StateGridService { for (TbFileSourceVo file : personItem.getIdCardFileList()) { Map imgMap = new HashMap<>(); imgMap.put("index", 10000 * personIndex + imgIndex++); - imgMap.put("width", "4959860"); - imgMap.put("height", "3492375"); + imgMap.put("width", "375.35"); + imgMap.put("height", "207.85"); imgMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath+file.getFilePath()) : ""); imgList.add(imgMap); } @@ -426,8 +421,8 @@ public class StateGridServiceImpl implements StateGridService { for (TbFileSourceVo file : personItem.getDiplomaFileList()) { Map imgMap = new HashMap<>(); imgMap.put("index", 10000 * personIndex + imgIndex++); - imgMap.put("width", "5325745"); - imgMap.put("height", "7534910"); + imgMap.put("width", "481.15"); + imgMap.put("height", "634.5"); imgMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath+file.getFilePath()) : ""); imgList.add(imgMap); } @@ -437,8 +432,8 @@ public class StateGridServiceImpl implements StateGridService { for (TbFileSourceVo file : personItem.getOtherFileList()) { Map imgMap = new HashMap<>(); imgMap.put("index", 10000 * personIndex + imgIndex++); - imgMap.put("width", "5325745"); - imgMap.put("height", "7534910"); + imgMap.put("width", "481.15"); + imgMap.put("height", "634.5"); imgMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath+file.getFilePath()) : ""); imgList.add(imgMap); } @@ -497,8 +492,8 @@ public class StateGridServiceImpl implements StateGridService { for (TbFileSourceVo file : item.getIdCardFileList()) { Map imgMap = new HashMap<>(); imgMap.put("index", 1000000 * otherIndex + imgIndex++); - imgMap.put("width", "4959860"); - imgMap.put("height", "3492375"); + imgMap.put("width", "375.35"); + imgMap.put("height", "207.85"); imgMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath+file.getFilePath()) : ""); personImgList.add(imgMap); } @@ -514,8 +509,8 @@ public class StateGridServiceImpl implements StateGridService { for (TbFileSourceVo file : allImages) { Map imgMap = new HashMap<>(); imgMap.put("index", 1000000 * otherIndex + imgIndex++); - imgMap.put("width", "5325745"); - imgMap.put("height", "7534910"); + imgMap.put("width", "481.15"); + imgMap.put("height", "634.5"); imgMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath+file.getFilePath()) : ""); personImgList.add(imgMap); } @@ -632,8 +627,8 @@ public class StateGridServiceImpl implements StateGridService { for (TbFileSourceVo file : allImages) { Map imgMap = new HashMap<>(); imgMap.put("index", imgIndex++); - imgMap.put("width", "5325745"); - imgMap.put("height", "7534910"); + imgMap.put("width", "481.15"); + imgMap.put("height", "634.5"); imgMap.put("base64Url", file.getFilePath() != null ? FreeMarkerUtil.getImageBase(filePath+file.getFilePath()) : ""); imgList.add(imgMap); } @@ -652,7 +647,7 @@ public class StateGridServiceImpl implements StateGridService { data.put("list3", list3); data.put("list4", list4); data.put("list5", list5); - WordUtils.exportMillCertificateWord(request,response,data,tbData.getName(),"GW.ftl" ); + WordUtils.exportMillCertificateWord(request,response,data,tbData.getName(),"GW_DOC.ftl" ); } catch (Exception e) { log.error("处理国网模版下载数据失败", e); }