From 9172cb51efd414653ffd4050736bf353cc1f84eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E4=B8=89=E7=82=AE?= <15856818120@163.com> Date: Tue, 13 May 2025 18:15:09 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E5=8A=A0=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/common/constant/Constants.java | 14 +- .../java/com/bonus/common/utils/RsaUtil.java | 133 ++++++++++++++++++ .../controller/system/SysLoginController.java | 16 ++- 3 files changed, 155 insertions(+), 8 deletions(-) create mode 100644 bonus-common/src/main/java/com/bonus/common/utils/RsaUtil.java diff --git a/bonus-common/src/main/java/com/bonus/common/constant/Constants.java b/bonus-common/src/main/java/com/bonus/common/constant/Constants.java index 686bbc9..baf4dfb 100644 --- a/bonus-common/src/main/java/com/bonus/common/constant/Constants.java +++ b/bonus-common/src/main/java/com/bonus/common/constant/Constants.java @@ -5,7 +5,7 @@ import io.jsonwebtoken.Claims; /** * 通用常量信息 - * + * * @author ruoyi */ public class Constants @@ -170,4 +170,16 @@ public class Constants */ public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config", "com.ruoyi.generator" }; + + /** + * 加密公钥 + */ + public static final String publicKey = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=="; + + /** + * 解密私钥 + */ + public static final String privateKey = "MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKNPuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gAkM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWowcSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99EcvDQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthhYhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3UP8iWi1Qw0Y="; + + } diff --git a/bonus-common/src/main/java/com/bonus/common/utils/RsaUtil.java b/bonus-common/src/main/java/com/bonus/common/utils/RsaUtil.java new file mode 100644 index 0000000..518e2e1 --- /dev/null +++ b/bonus-common/src/main/java/com/bonus/common/utils/RsaUtil.java @@ -0,0 +1,133 @@ +package com.bonus.common.utils; + +import javax.crypto.Cipher; +import java.security.KeyFactory; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; +import java.util.Base64; + +/** + * @Author ma_sh + * @create 2024/5/25 16:07 + */ +public class RsaUtil { + //签名算法名称 + private static final String RSA_KEY_ALGORITHM = "RSA"; + + //RSA密钥长度,默认密钥长度是1024,密钥长度必须是64的倍数,在512到65536位之间,不管是RSA还是RSA2长度推荐使用2048 + private static final int KEY_SIZE = 2048; + + /** + * 公钥加密(用于数据加密) + * + * @param data 加密前的字符串 + * @param publicKeyStr base64编码后的公钥 + * @return base64编码后的字符串 + * @throws Exception + */ + public static String encryptByPublicKey(String data, String publicKeyStr) throws Exception { + //Java原生base64解码 + byte[] pubKey = Base64.getDecoder().decode(publicKeyStr); + //创建X509编码密钥规范 + X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(pubKey); + //返回转换指定算法的KeyFactory对象 + KeyFactory keyFactory = KeyFactory.getInstance(RSA_KEY_ALGORITHM); + //根据X509编码密钥规范产生公钥对象 + PublicKey publicKey = keyFactory.generatePublic(x509KeySpec); + //根据转换的名称获取密码对象Cipher(转换的名称:算法/工作模式/填充模式) + Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); + //用公钥初始化此Cipher对象(加密模式) + cipher.init(Cipher.ENCRYPT_MODE, publicKey); + //对数据加密 + byte[] encrypt = cipher.doFinal(data.getBytes()); + //返回base64编码后的字符串 + return Base64.getEncoder().encodeToString(encrypt); + } + + + /** + * 私钥解密(用于数据解密) + * + * @param data 解密前的字符串 + * @param privateKeyStr 私钥 + * @return 解密后的字符串 + * @throws Exception + */ + public static String decryptByPrivateKey(String data, String privateKeyStr) throws Exception { + //Java原生base64解码 + byte[] priKey = Base64.getDecoder().decode(privateKeyStr); + //创建PKCS8编码密钥规范 + PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(priKey); + //返回转换指定算法的KeyFactory对象 + KeyFactory keyFactory = KeyFactory.getInstance(RSA_KEY_ALGORITHM); + //根据PKCS8编码密钥规范产生私钥对象 + PrivateKey privateKey = keyFactory.generatePrivate(pkcs8KeySpec); + //根据转换的名称获取密码对象Cipher(转换的名称:算法/工作模式/填充模式) + Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); + //用私钥初始化此Cipher对象(解密模式) + cipher.init(Cipher.DECRYPT_MODE, privateKey); + //对数据解密 + byte[] decrypt = cipher.doFinal(Base64.getDecoder().decode(data)); + //返回字符串 + return new String(decrypt); + } + + + + /** + * 私钥加密(用于数据签名) + * + * @param data 加密前的字符串 + * @param privateKeyStr base64编码后的私钥 + * @return base64编码后后的字符串 + * @throws Exception + */ + public static String encryptByPrivateKey(String data, String privateKeyStr) throws Exception { + //Java原生base64解码 + byte[] priKey = Base64.getDecoder().decode(privateKeyStr); + //创建PKCS8编码密钥规范 + PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(priKey); + //返回转换指定算法的KeyFactory对象 + KeyFactory keyFactory = KeyFactory.getInstance(RSA_KEY_ALGORITHM); + //根据PKCS8编码密钥规范产生私钥对象 + PrivateKey privateKey = keyFactory.generatePrivate(pkcs8KeySpec); + //根据转换的名称获取密码对象Cipher(转换的名称:算法/工作模式/填充模式) + Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); + //用私钥初始化此Cipher对象(加密模式) + cipher.init(Cipher.ENCRYPT_MODE, privateKey); + //对数据加密 + byte[] encrypt = cipher.doFinal(data.getBytes()); + //返回base64编码后的字符串 + return Base64.getEncoder().encodeToString(encrypt); + } + + /** + * 公钥解密(用于数据验签) + * + * @param data 解密前的字符串 + * @param publicKeyStr base64编码后的公钥 + * @return 解密后的字符串 + * @throws Exception + */ + public static String decryptByPublicKey(String data, String publicKeyStr) throws Exception { + //Java原生base64解码 + byte[] pubKey = Base64.getDecoder().decode(publicKeyStr); + //创建X509编码密钥规范 + X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(pubKey); + //返回转换指定算法的KeyFactory对象 + KeyFactory keyFactory = KeyFactory.getInstance(RSA_KEY_ALGORITHM); + //根据X509编码密钥规范产生公钥对象 + PublicKey publicKey = keyFactory.generatePublic(x509KeySpec); + //根据转换的名称获取密码对象Cipher(转换的名称:算法/工作模式/填充模式) + Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); + //用公钥初始化此Cipher对象(解密模式) + cipher.init(Cipher.DECRYPT_MODE, publicKey); + //对数据解密 + byte[] decrypt = cipher.doFinal(Base64.getDecoder().decode(data)); + //返回字符串 + return new String(decrypt); + } + +} diff --git a/search-tool/src/main/java/com/bonus/tool/controller/system/SysLoginController.java b/search-tool/src/main/java/com/bonus/tool/controller/system/SysLoginController.java index 04f2ffe..1f89330 100644 --- a/search-tool/src/main/java/com/bonus/tool/controller/system/SysLoginController.java +++ b/search-tool/src/main/java/com/bonus/tool/controller/system/SysLoginController.java @@ -2,6 +2,8 @@ package com.bonus.tool.controller.system; import java.util.List; import java.util.Set; + +import com.bonus.common.utils.RsaUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -21,7 +23,7 @@ import com.bonus.system.service.ISysMenuService; /** * 登录验证 - * + * * @author ruoyi */ @RestController @@ -41,16 +43,16 @@ public class SysLoginController /** * 登录方法 - * + * * @param loginBody 登录信息 * @return 结果 */ @PostMapping("/login") - public AjaxResult login(@RequestBody LoginBody loginBody) - { + public AjaxResult login(@RequestBody LoginBody loginBody) throws Exception { + String decryptedData = RsaUtil.decryptByPrivateKey(loginBody.getPassword(), Constants.privateKey); AjaxResult ajax = AjaxResult.success(); // 生成令牌 - String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), + String token = loginService.login(loginBody.getUsername(), decryptedData, loginBody.getCode(), loginBody.getUuid()); ajax.put(Constants.TOKEN, token); return ajax; @@ -58,7 +60,7 @@ public class SysLoginController /** * 获取用户信息 - * + * * @return 用户信息 */ @GetMapping("getInfo") @@ -84,7 +86,7 @@ public class SysLoginController /** * 获取路由信息 - * + * * @return 路由信息 */ @GetMapping("getRouters") From 7721c92d352155c0f518d53b3b1ed20a7f042a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E4=B8=89=E7=82=AE?= <15856818120@163.com> Date: Fri, 16 May 2025 13:04:49 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E5=8A=A0=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/tool/controller/system/SysLoginController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/search-tool/src/main/java/com/bonus/tool/controller/system/SysLoginController.java b/search-tool/src/main/java/com/bonus/tool/controller/system/SysLoginController.java index 1f89330..66c9d50 100644 --- a/search-tool/src/main/java/com/bonus/tool/controller/system/SysLoginController.java +++ b/search-tool/src/main/java/com/bonus/tool/controller/system/SysLoginController.java @@ -49,10 +49,11 @@ public class SysLoginController */ @PostMapping("/login") public AjaxResult login(@RequestBody LoginBody loginBody) throws Exception { - String decryptedData = RsaUtil.decryptByPrivateKey(loginBody.getPassword(), Constants.privateKey); + String password = RsaUtil.decryptByPrivateKey(loginBody.getPassword(), Constants.privateKey); + String username = RsaUtil.decryptByPrivateKey(loginBody.getUsername(), Constants.privateKey); AjaxResult ajax = AjaxResult.success(); // 生成令牌 - String token = loginService.login(loginBody.getUsername(), decryptedData, loginBody.getCode(), + String token = loginService.login(username, password, loginBody.getCode(), loginBody.getUuid()); ajax.put(Constants.TOKEN, token); return ajax; From 0f3e0cc0e1a44b32aa62d422ea47b7437ae33765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E4=B8=89=E7=82=AE?= <15856818120@163.com> Date: Tue, 3 Jun 2025 16:53:13 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=B9=B4=E9=BE=84=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E5=88=A0=E9=99=A4=EF=BC=8C=E5=B9=B4=E9=BE=84=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E8=AF=81=E5=8F=B7=E5=9C=A8=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E8=AE=A1=E7=AE=97=EF=BC=8C=E8=B5=84=E6=A0=BC?= =?UTF-8?q?=E8=AF=81=E4=B9=A6=E5=92=8C=E8=AF=81=E4=B9=A6=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E9=9D=9E=E5=BF=85=E5=A1=AB=EF=BC=8C=E5=8F=AF=E4=BB=A5=E6=9C=89?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/common/enums/TableType.java | 7 +- .../com/bonus/common/utils/StringUtils.java | 109 +++++++++++++----- .../com/bonus/tool/dto/TbCertificationVo.java | 50 ++++++++ .../com/bonus/tool/dto/TbKeyPeopleVo.java | 5 + .../com/bonus/tool/dto/TbOtherPeopleVo.java | 5 + .../tool/mapper/TbCertificationMapper.java | 18 +++ .../tool/service/TbCertificationService.java | 31 +++++ .../impl/TbCertificationServiceImpl.java | 98 ++++++++++++++++ .../service/impl/TbKeyPeopleServiceImpl.java | 27 ++++- .../impl/TbOtherPeopleServiceImpl.java | 24 +++- .../mapper/TbCertificationMapper.xml | 33 ++++++ 11 files changed, 367 insertions(+), 40 deletions(-) create mode 100644 search-tool/src/main/java/com/bonus/tool/dto/TbCertificationVo.java create mode 100644 search-tool/src/main/java/com/bonus/tool/mapper/TbCertificationMapper.java create mode 100644 search-tool/src/main/java/com/bonus/tool/service/TbCertificationService.java create mode 100644 search-tool/src/main/java/com/bonus/tool/service/impl/TbCertificationServiceImpl.java create mode 100644 search-tool/src/main/resources/mapper/TbCertificationMapper.xml diff --git a/bonus-common/src/main/java/com/bonus/common/enums/TableType.java b/bonus-common/src/main/java/com/bonus/common/enums/TableType.java index a01adcb..85d1875 100644 --- a/bonus-common/src/main/java/com/bonus/common/enums/TableType.java +++ b/bonus-common/src/main/java/com/bonus/common/enums/TableType.java @@ -34,7 +34,12 @@ public enum TableType { /** * 分包商业绩信息 */ - TB_SUB_PERF("tb_sub_perf", "分包商业绩信息"); + TB_SUB_PERF("tb_sub_perf", "分包商业绩信息"), + + /** + * 资格证书 + */ + TB_CERTIFICATION("tb_certification", "资格证书"); private final String code; private final String info; diff --git a/bonus-common/src/main/java/com/bonus/common/utils/StringUtils.java b/bonus-common/src/main/java/com/bonus/common/utils/StringUtils.java index f46ef27..69a40bb 100644 --- a/bonus-common/src/main/java/com/bonus/common/utils/StringUtils.java +++ b/bonus-common/src/main/java/com/bonus/common/utils/StringUtils.java @@ -1,5 +1,9 @@ package com.bonus.common.utils; +import java.time.LocalDate; +import java.time.Period; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; @@ -12,7 +16,7 @@ import com.bonus.common.core.text.StrFormatter; /** * 字符串工具类 - * + * * @author ruoyi */ public class StringUtils extends org.apache.commons.lang3.StringUtils @@ -28,7 +32,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 获取参数不为空值 - * + * * @param value defaultValue 要判断的value * @return value 返回值 */ @@ -39,7 +43,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * * 判断一个Collection是否为空, 包含List,Set,Queue - * + * * @param coll 要判断的Collection * @return true:为空 false:非空 */ @@ -50,7 +54,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * * 判断一个Collection是否非空,包含List,Set,Queue - * + * * @param coll 要判断的Collection * @return true:非空 false:空 */ @@ -61,7 +65,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * * 判断一个对象数组是否为空 - * + * * @param objects 要判断的对象数组 ** @return true:为空 false:非空 */ @@ -72,7 +76,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * * 判断一个对象数组是否非空 - * + * * @param objects 要判断的对象数组 * @return true:非空 false:空 */ @@ -83,7 +87,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * * 判断一个Map是否为空 - * + * * @param map 要判断的Map * @return true:为空 false:非空 */ @@ -94,7 +98,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * * 判断一个Map是否为空 - * + * * @param map 要判断的Map * @return true:非空 false:空 */ @@ -105,7 +109,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * * 判断一个字符串是否为空串 - * + * * @param str String * @return true:为空 false:非空 */ @@ -116,7 +120,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * * 判断一个字符串是否为非空串 - * + * * @param str String * @return true:非空串 false:空串 */ @@ -127,7 +131,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * * 判断一个对象是否为空 - * + * * @param object Object * @return true:为空 false:非空 */ @@ -138,7 +142,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * * 判断一个对象是否非空 - * + * * @param object Object * @return true:非空 false:空 */ @@ -149,7 +153,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * * 判断一个对象是否是数组类型(Java基本型别的数组) - * + * * @param object 对象 * @return true:是数组 false:不是数组 */ @@ -211,7 +215,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 截取字符串 - * + * * @param str 字符串 * @param start 开始 * @return 结果 @@ -242,7 +246,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 截取字符串 - * + * * @param str 字符串 * @param start 开始 * @param end 结束 @@ -288,7 +292,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 在字符串中查找第一个出现的 `open` 和最后一个出现的 `close` 之间的子字符串 - * + * * @param str 要截取的字符串 * @param open 起始字符串 * @param close 结束字符串 @@ -314,7 +318,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 判断是否为空,并且不是空白字符 - * + * * @param str 要判断的value * @return 结果 */ @@ -344,7 +348,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b
* 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a
* 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b
- * + * * @param template 文本模板,被替换的部分用 {} 表示 * @param params 参数值 * @return 格式化后的文本 @@ -360,7 +364,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 是否为http(s)://开头 - * + * * @param link 链接 * @return 结果 */ @@ -371,7 +375,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 字符串转set - * + * * @param str 字符串 * @param sep 分隔符 * @return set集合 @@ -383,7 +387,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 字符串转list - * + * * @param str 字符串 * @param sep 分隔符 * @param filterBlank 过滤纯空白 @@ -520,7 +524,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 是否包含字符串 - * + * * @param str 验证字符串 * @param strs 字符串组 * @return 包含返回true @@ -542,7 +546,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld - * + * * @param name 转换前的下划线大写方式命名的字符串 * @return 转换后的驼峰式命名的字符串 */ @@ -616,7 +620,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串 - * + * * @param str 指定字符串 * @param strs 需要检查的字符串数组 * @return 是否匹配 @@ -638,11 +642,11 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils } /** - * 判断url是否与规则配置: - * ? 表示单个字符; - * * 表示一层路径内的任意字符串,不可跨层级; + * 判断url是否与规则配置: + * ? 表示单个字符; + * * 表示一层路径内的任意字符串,不可跨层级; * ** 表示任意层路径; - * + * * @param pattern 匹配规则 * @param url 需要匹配的url * @return @@ -661,7 +665,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 数字左边补齐0,使之达到指定长度。注意,如果数字转换为字符串后,长度大于size,则只保留 最后size个字符。 - * + * * @param num 数字对象 * @param size 字符串指定长度 * @return 返回数字的字符串格式,该字符串为指定长度。 @@ -673,7 +677,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils /** * 字符串左补齐。如果原始字符串s长度大于size,则只保留最后size个字符。 - * + * * @param s 原始字符串 * @param size 字符串指定长度 * @param c 用于补齐的字符 @@ -707,4 +711,47 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils } return sb.toString(); } -} \ No newline at end of file + + /** + * 根据身份证号码计算年龄 + * @param idCard 身份证号码(15位或18位) + * @return 年龄(周岁),若身份证格式错误返回 -1 + */ + public static int calculateAge(String idCard) { + if (idCard == null || idCard.isEmpty()) { + return -1; + } + + // 去除空格 + idCard = idCard.trim(); + + try { + LocalDate birthDate; + if (idCard.length() == 18) { + // 18位身份证:提取 YYYYMMDD + String birthStr = idCard.substring(6, 14); + birthDate = LocalDate.parse(birthStr, DateTimeFormatter.BASIC_ISO_DATE); + } else if (idCard.length() == 15) { + // 15位身份证:提取 YYMMDD,补全为 19YYMMDD + String birthStr = "19" + idCard.substring(6, 12); + birthDate = LocalDate.parse(birthStr, DateTimeFormatter.BASIC_ISO_DATE); + } else { + return -1; // 长度错误 + } + + // 计算当前日期与出生日期的差值 + LocalDate now = LocalDate.now(); + Period period = Period.between(birthDate, now); + + // 若还未到今年生日,年龄减1 + int age = period.getYears(); + if (now.isBefore(birthDate.withYear(now.getYear()))) { + age--; + } + + return Math.max(age, 0); // 防止负数(如未来日期) + } catch (DateTimeParseException | IndexOutOfBoundsException e) { + return -1; // 解析错误 + } + } +} diff --git a/search-tool/src/main/java/com/bonus/tool/dto/TbCertificationVo.java b/search-tool/src/main/java/com/bonus/tool/dto/TbCertificationVo.java new file mode 100644 index 0000000..7447408 --- /dev/null +++ b/search-tool/src/main/java/com/bonus/tool/dto/TbCertificationVo.java @@ -0,0 +1,50 @@ +package com.bonus.tool.dto; + +import lombok.Data; + +import java.util.List; + +/** + * 资格证书 + * @author 马三炮 + * @date 2025/6/3 + */ +@Data +public class TbCertificationVo { + + /** + * 主键id + */ + private Long id; + + /** + * 表名称(每个主表的表名称) + */ + private String tableName; + + /** + * 资源表id + */ + private Long tableId; + + /** + * 资格证书 + */ + private String diploma; + + /** + * 证书编号 + */ + private String diplomaNum; + + + /** + * 级别 + */ + private String level; + + /*** + * 附件集合 + */ + private List tbFileSourceVoList; +} diff --git a/search-tool/src/main/java/com/bonus/tool/dto/TbKeyPeopleVo.java b/search-tool/src/main/java/com/bonus/tool/dto/TbKeyPeopleVo.java index d287681..0786628 100644 --- a/search-tool/src/main/java/com/bonus/tool/dto/TbKeyPeopleVo.java +++ b/search-tool/src/main/java/com/bonus/tool/dto/TbKeyPeopleVo.java @@ -117,6 +117,11 @@ public class TbKeyPeopleVo { */ private String updateUser; + /** + *资格证书集合 + */ + private List certificateList; + /*** * 附件集合 */ diff --git a/search-tool/src/main/java/com/bonus/tool/dto/TbOtherPeopleVo.java b/search-tool/src/main/java/com/bonus/tool/dto/TbOtherPeopleVo.java index 701a374..e7939f2 100644 --- a/search-tool/src/main/java/com/bonus/tool/dto/TbOtherPeopleVo.java +++ b/search-tool/src/main/java/com/bonus/tool/dto/TbOtherPeopleVo.java @@ -105,6 +105,11 @@ public class TbOtherPeopleVo { */ private String updateUser; + /** + *资格证书集合 + */ + private List certificateList; + /*** * 附件集合 */ diff --git a/search-tool/src/main/java/com/bonus/tool/mapper/TbCertificationMapper.java b/search-tool/src/main/java/com/bonus/tool/mapper/TbCertificationMapper.java new file mode 100644 index 0000000..396f473 --- /dev/null +++ b/search-tool/src/main/java/com/bonus/tool/mapper/TbCertificationMapper.java @@ -0,0 +1,18 @@ +package com.bonus.tool.mapper; + +import com.bonus.tool.dto.TbCertificationVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface TbCertificationMapper { + /** + * 新增资格证书 + * @param tbCertificationVo + */ + void addTbCertification(TbCertificationVo tbCertificationVo); + + List getTbCertificateList(@Param("tableId") Long tableId, @Param("tableName")String tableName); + + void delTbCertification(@Param("tableId") Long tableId, @Param("tableName")String tableName); +} diff --git a/search-tool/src/main/java/com/bonus/tool/service/TbCertificationService.java b/search-tool/src/main/java/com/bonus/tool/service/TbCertificationService.java new file mode 100644 index 0000000..3f0ceee --- /dev/null +++ b/search-tool/src/main/java/com/bonus/tool/service/TbCertificationService.java @@ -0,0 +1,31 @@ +package com.bonus.tool.service; + +import com.bonus.tool.dto.TbCertificationVo; + +import java.util.List; + +public interface TbCertificationService { + + /** + * 新增资格证书 + * @param certificateList + * @param tableId + * @param tableName + */ + void addTbCertification(List certificateList, Long tableId, String tableName); + + /** + * 获取资格证书列表 + * @param tableId + * @param tableName + * @return + */ + List getTbCertificateList(Long tableId, String tableName); + + /** + * 删除资格证书 + * @param tableId + * @param tableName + */ + void delTbCertification(Long tableId, String tableName); +} diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/TbCertificationServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/TbCertificationServiceImpl.java new file mode 100644 index 0000000..5d491a4 --- /dev/null +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/TbCertificationServiceImpl.java @@ -0,0 +1,98 @@ +package com.bonus.tool.service.impl; + +import com.bonus.common.enums.TableType; +import com.bonus.common.utils.SecurityUtils; +import com.bonus.system.service.ISysFileService; +import com.bonus.tool.dto.TbCertificationVo; +import com.bonus.tool.dto.TbFileSourceVo; +import com.bonus.tool.mapper.TbCertificationMapper; +import com.bonus.tool.service.TbCertificationService; +import com.bonus.tool.service.TbFileSourceService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * @author 马三炮 + * @date 2025/6/3 + */ +@Service +@Slf4j +public class TbCertificationServiceImpl implements TbCertificationService { + + @Resource + private TbCertificationMapper tbCertificationMapper; + + @Resource + private TbFileSourceService tbFileSourceService; + + @Resource + private ISysFileService iSysFileService; + + /** + * 新增资格证书 + * @param certificateList + * @param tableId + * @param tableName + */ + @Override + public void addTbCertification(List certificateList, Long tableId, String tableName) { + if (certificateList!=null){ + for (TbCertificationVo tbCertificationVo:certificateList) { + tbCertificationVo.setTableId(tableId); + tbCertificationVo.setTableName(tableName); + tbCertificationMapper.addTbCertification(tbCertificationVo); + //新增附件信息 + tbFileSourceService.addTbFileSource(tbCertificationVo.getTbFileSourceVoList(),tbCertificationVo.getId(), TableType.TB_CERTIFICATION.getCode()); + } + } + } + + /** + * 获取资格证书列表 + * @param tableId + * @param tableName + * @return + */ + @Override + public List getTbCertificateList(Long tableId, String tableName) { + List TbCertificationVoList = tbCertificationMapper.getTbCertificateList(tableId,tableName); + for (TbCertificationVo tbCertificationVo: TbCertificationVoList) { + //获取人员附件 + List tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbCertificationVo.getId(),TableType.TB_CERTIFICATION.getCode()); + tbCertificationVo.setTbFileSourceVoList(tbFileSourceVoList); + } + return TbCertificationVoList; + } + + /** + * 删除资格证书 + * @param tableId + * @param tableName + */ + @Override + public void delTbCertification(Long tableId, String tableName) { + + List TbCertificationVoList = tbCertificationMapper.getTbCertificateList(tableId,tableName); + for (TbCertificationVo tbCertificationVo: TbCertificationVoList) { + //获取人员附件 + List tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbCertificationVo.getId(),TableType.TB_CERTIFICATION.getCode()); + //删除服务器图片 + if (tbFileSourceVoList.size()>0){ + for (TbFileSourceVo TbFileSource:tbFileSourceVoList) { + try { + iSysFileService.deleteFile(TbFileSource.getFilePath()); + }catch (Exception e){ + log.error("删除照片失败!"); + } + } + } + //删除附件信息表中信息 + tbFileSourceService.delTbFileSource(tbCertificationVo.getId(),TableType.TB_KEY_PEOPLE.getCode()); + } + tbCertificationMapper.delTbCertification(tableId,tableName); + } +} diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/TbKeyPeopleServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/TbKeyPeopleServiceImpl.java index 4a42fb9..d22a7fc 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/TbKeyPeopleServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/TbKeyPeopleServiceImpl.java @@ -6,14 +6,12 @@ import com.bonus.common.exception.ServiceException; import com.bonus.common.utils.SecurityUtils; import com.bonus.common.utils.StringUtils; import com.bonus.system.service.ISysFileService; -import com.bonus.tool.dto.ComCorePersonBean; -import com.bonus.tool.dto.TbCompanyPerfRelVo; -import com.bonus.tool.dto.TbKeyPeopleVo; -import com.bonus.tool.dto.TbFileSourceVo; +import com.bonus.tool.dto.*; import com.bonus.tool.mapper.EpcMapper; import com.bonus.tool.mapper.SouthMapper; import com.bonus.tool.mapper.StateGridMapper; import com.bonus.tool.mapper.TbKeyPeopleMapper; +import com.bonus.tool.service.TbCertificationService; import com.bonus.tool.service.TbCompanyPerfRelService; import com.bonus.tool.service.TbFileSourceService; import com.bonus.tool.service.TbKeyPeopleServcie; @@ -55,6 +53,9 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie { @Resource private SouthMapper southMapper; + @Resource + private TbCertificationService tbCertificationService; + /** * 关键人员列表 @@ -67,6 +68,9 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie { List tbKeyPeopleVoList = tbKeyPeopleMapper.getTbKeyPeopleList(tbKeyPeopleVo); if (tbKeyPeopleVoList.size()>0){ for (TbKeyPeopleVo tbKeyPeople: tbKeyPeopleVoList) { + //获取资格证书信息 + List certificateList = tbCertificationService.getTbCertificateList(tbKeyPeople.getId(),TableType.TB_KEY_PEOPLE.getCode()); + tbKeyPeople.setCertificateList(certificateList); //获取人员附件 List tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbKeyPeople.getId(),TableType.TB_KEY_PEOPLE.getCode()); tbKeyPeople.setTbFileSourceVoList(tbFileSourceVoList); @@ -84,6 +88,9 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie { public TbKeyPeopleVo getTbKeyPeopleById(TbKeyPeopleVo tbKeyPeopleVo) { TbKeyPeopleVo tbKeyPeople = tbKeyPeopleMapper.getTbKeyPeopleById(tbKeyPeopleVo); + //获取资格证书信息 + List certificateList = tbCertificationService.getTbCertificateList(tbKeyPeople.getId(),TableType.TB_KEY_PEOPLE.getCode()); + tbKeyPeople.setCertificateList(certificateList); //获取人员附件 List tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbKeyPeople.getId(),TableType.TB_KEY_PEOPLE.getCode()); tbKeyPeople.setTbFileSourceVoList(tbFileSourceVoList); @@ -104,8 +111,13 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie { } tbKeyPeopleVo.setCreateUser(SecurityUtils.getLoginUser().getUsername()); tbKeyPeopleVo.setCreateTime(new Date()); + tbKeyPeopleVo.setAge(String.valueOf(StringUtils.calculateAge(tbKeyPeopleVo.getIdCard()))); log.info("对象信息{}",tbKeyPeopleVo); + //新增关键人员 tbKeyPeopleMapper.addTbKeyPeople(tbKeyPeopleVo); + //新增资格证书 + tbCertificationService.addTbCertification(tbKeyPeopleVo.getCertificateList(),tbKeyPeopleVo.getId(), TableType.TB_KEY_PEOPLE.getCode()); + //新增附件信息 tbFileSourceService.addTbFileSource(tbKeyPeopleVo.getTbFileSourceVoList(),tbKeyPeopleVo.getId(), TableType.TB_KEY_PEOPLE.getCode()); } @@ -121,7 +133,12 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie { throw new ServiceException("身份证已存在"); } tbKeyPeopleVo.setUpdateUser(SecurityUtils.getLoginUser().getUsername()); + tbKeyPeopleVo.setAge(String.valueOf(StringUtils.calculateAge(tbKeyPeopleVo.getIdCard()))); tbKeyPeopleMapper.updateTbKeyPeople(tbKeyPeopleVo); + //先删后增资格证书信息 + tbCertificationService.delTbCertification(tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode()); + tbCertificationService.addTbCertification(tbKeyPeopleVo.getCertificateList(),tbKeyPeopleVo.getId(), TableType.TB_KEY_PEOPLE.getCode()); + //先删后增附件信息 tbFileSourceService.delTbFileSource(tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode()); tbFileSourceService.addTbFileSource(tbKeyPeopleVo.getTbFileSourceVoList(),tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode()); } @@ -156,6 +173,8 @@ public class TbKeyPeopleServiceImpl implements TbKeyPeopleServcie { throw new ServiceException("关键人员已绑定南网模板"); } tbKeyPeopleMapper.delTbKeyPeople(tbKeyPeopleVo); + //删除资格证书信息 + tbCertificationService.delTbCertification(tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode()); //获取人员附件 List tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbKeyPeopleVo.getId(),TableType.TB_KEY_PEOPLE.getCode()); //删除服务器图片 diff --git a/search-tool/src/main/java/com/bonus/tool/service/impl/TbOtherPeopleServiceImpl.java b/search-tool/src/main/java/com/bonus/tool/service/impl/TbOtherPeopleServiceImpl.java index bdc56ff..a827a25 100644 --- a/search-tool/src/main/java/com/bonus/tool/service/impl/TbOtherPeopleServiceImpl.java +++ b/search-tool/src/main/java/com/bonus/tool/service/impl/TbOtherPeopleServiceImpl.java @@ -5,14 +5,12 @@ import com.bonus.common.exception.ServiceException; import com.bonus.common.utils.SecurityUtils; import com.bonus.common.utils.StringUtils; import com.bonus.system.service.ISysFileService; -import com.bonus.tool.dto.ComCorePersonBean; -import com.bonus.tool.dto.ComOtherPersonBean; -import com.bonus.tool.dto.TbFileSourceVo; -import com.bonus.tool.dto.TbOtherPeopleVo; +import com.bonus.tool.dto.*; import com.bonus.tool.mapper.EpcMapper; import com.bonus.tool.mapper.SouthMapper; import com.bonus.tool.mapper.StateGridMapper; import com.bonus.tool.mapper.TbOtherPeopleMapper; +import com.bonus.tool.service.TbCertificationService; import com.bonus.tool.service.TbFileSourceService; import com.bonus.tool.service.TbOtherPeopleService; import lombok.extern.slf4j.Slf4j; @@ -50,6 +48,11 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService { @Resource private SouthMapper southMapper; + @Resource + private TbCertificationService tbCertificationService; + + + /** * 其他人员列表查询 * @param @@ -61,6 +64,9 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService { List tbOtherPeopleVoList = tbOtherPeopleMapper.getTbOtherPeopleList(tbOtherPeopleVo); if (tbOtherPeopleVoList.size()>0){ for (TbOtherPeopleVo tbOtherPeople: tbOtherPeopleVoList) { + //获取资格证书信息 + List certificateList = tbCertificationService.getTbCertificateList(tbOtherPeople.getId(),TableType.TB_OTHER_PEOPLE.getCode()); + tbOtherPeople.setCertificateList(certificateList); //获取人员附件 List tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbOtherPeople.getId(), TableType.TB_OTHER_PEOPLE.getCode()); tbOtherPeople.setTbFileSourceVoList(tbFileSourceVoList); @@ -77,6 +83,9 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService { @Override public TbOtherPeopleVo getTbOtherPeopleById(TbOtherPeopleVo tbOtherPeopleVo) { TbOtherPeopleVo tbOtherPeople = tbOtherPeopleMapper.getTbOtherPeopleById(tbOtherPeopleVo); + //获取资格证书信息 + List certificateList = tbCertificationService.getTbCertificateList(tbOtherPeople.getId(),TableType.TB_OTHER_PEOPLE.getCode()); + tbOtherPeople.setCertificateList(certificateList); //获取人员附件 List tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbOtherPeople.getId(),TableType.TB_OTHER_PEOPLE.getCode()); tbOtherPeople.setTbFileSourceVoList(tbFileSourceVoList); @@ -98,6 +107,8 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService { tbOtherPeopleVo.setCreateUser(SecurityUtils.getLoginUser().getUsername()); tbOtherPeopleVo.setCreateTime(new Date()); tbOtherPeopleMapper.addTbOtherPeople(tbOtherPeopleVo); + //新增资格证书 + tbCertificationService.addTbCertification(tbOtherPeopleVo.getCertificateList(),tbOtherPeopleVo.getId(), TableType.TB_OTHER_PEOPLE.getCode()); tbFileSourceService.addTbFileSource(tbOtherPeopleVo.getTbFileSourceVoList(),tbOtherPeopleVo.getId(), TableType.TB_OTHER_PEOPLE.getCode()); } @@ -116,6 +127,9 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService { } tbOtherPeopleVo.setUpdateUser(SecurityUtils.getLoginUser().getUsername()); tbOtherPeopleMapper.updateTbOtherPeople(tbOtherPeopleVo); + //先删后增资格证书信息 + tbCertificationService.delTbCertification(tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode()); + tbCertificationService.addTbCertification(tbOtherPeopleVo.getCertificateList(),tbOtherPeopleVo.getId(), TableType.TB_OTHER_PEOPLE.getCode()); tbFileSourceService.delTbFileSource(tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode()); tbFileSourceService.addTbFileSource(tbOtherPeopleVo.getTbFileSourceVoList(),tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode()); @@ -147,6 +161,8 @@ public class TbOtherPeopleServiceImpl implements TbOtherPeopleService { throw new ServiceException("关键人员已绑定南网模板"); } tbOtherPeopleMapper.delTbOtherPeople(tbOtherPeopleVo); + //删除资格证书信息 + tbCertificationService.delTbCertification(tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode()); //获取人员附件 List tbFileSourceVoList = tbFileSourceService.getTbFileSourceList(tbOtherPeopleVo.getId(),TableType.TB_OTHER_PEOPLE.getCode()); //删除服务器图片 diff --git a/search-tool/src/main/resources/mapper/TbCertificationMapper.xml b/search-tool/src/main/resources/mapper/TbCertificationMapper.xml new file mode 100644 index 0000000..dbd9743 --- /dev/null +++ b/search-tool/src/main/resources/mapper/TbCertificationMapper.xml @@ -0,0 +1,33 @@ + + + + + + insert into tb_certification + + table_name, + table_id, + diploma, + diploma_num, + level, + del_flag + + + #{tableName}, + #{tableId}, + #{diploma}, + #{diplomaNum}, + #{level}, + 0 + + + + update tb_certification set del_flag=1 where table_id = #{tableId} and table_name = #{tableName} + + + From 928712019bdca852e98b2cd2191ca8699fd00122 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Wed, 4 Jun 2025 13:38:21 +0800 Subject: [PATCH 4/4] =?UTF-8?q?EPC=E3=80=81=E5=9B=BD=E7=BD=91=E3=80=81?= =?UTF-8?q?=E5=8D=97=E7=BD=91=E6=A8=A1=E6=9D=BF=E4=BF=AE=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E7=AB=96=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/tool/service/impl/EpcServiceImpl.java | 2 +- .../java/com/bonus/tool/template/TestEPCDOC.java | 12 ++++++------ .../java/com/bonus/tool/template/TestGWDOC.java | 14 +++++++------- .../src/main/resources/download/EPC_DOC.ftl | 3 ++- search-tool/src/main/resources/download/NW_DOC.ftl | 3 ++- 5 files changed, 18 insertions(+), 16 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 93e7525..002d768 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 @@ -228,7 +228,7 @@ public class EpcServiceImpl implements EpcService { // 设置标题和简介 data.put("title", tbData.getName() != null ? tbData.getName() : "EPC总承包项目投标技术文件"); - data.put("Introduction", "项目经理、设计负责人、采购负责人、施工负责人、商务负责人等主要负责人"); + data.put("Introduction", "项目主要负责人"); int personNum = 1; // 处理项目核心人员信息 diff --git a/search-tool/src/main/java/com/bonus/tool/template/TestEPCDOC.java b/search-tool/src/main/java/com/bonus/tool/template/TestEPCDOC.java index 5edcbb8..15b319c 100644 --- a/search-tool/src/main/java/com/bonus/tool/template/TestEPCDOC.java +++ b/search-tool/src/main/java/com/bonus/tool/template/TestEPCDOC.java @@ -27,7 +27,7 @@ public class TestEPCDOC { String fileName = null; try { data.put("title","中老500千伏联网项目(老挝段)EPC总承包项目投标技术文件"); - data.put("Introduction","项目经理、设计负责人、采购负责人、施工负责人、商务负责人等主要负责人"); + data.put("Introduction","项目主要负责人"); for (int i = 0; i < 4; i++) { Map map = new HashMap<>(); map.put("i",i + 1); @@ -77,13 +77,13 @@ public class TestEPCDOC { map3.put("height", "207.85"); map3.put("index",(100 * (i + 1)) + (j + 1)); if(j == 0){ - map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片3.png")); + map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png")); }else if(j == 1){ - map3.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片4.png")); + map3.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png")); }else if(j == 2){ map3.put("width", "481.15"); map3.put("height", "634.5"); - map3.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png")); + map3.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png")); } if(i == 0 && j == 0){ map3.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png")); @@ -101,7 +101,7 @@ public class TestEPCDOC { map4.put("index",(10000 * (j + 1)) + (k + 1)); map4.put("width", "481.15"); map4.put("height", "634.5"); - map4.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png")); + map4.put("base64Url",FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png")); imgList2.add(map4); } map3.put("imgList",imgList2); @@ -114,7 +114,7 @@ public class TestEPCDOC { } data.put("list",list); data.put("list2",list2); - WordUtils.exportMillCertificateWord2(null,null, data, "test", "EPC_DOC.ftl","C:\\Users\\10488\\Desktop\\test (2)\\"); + WordUtils.exportMillCertificateWord2(null,null, data, "test", "EPC_DOC.ftl","C:\\Users\\10488\\Desktop\\检索工具\\"); } catch (Exception e) { log.error("EPC下载", e); } diff --git a/search-tool/src/main/java/com/bonus/tool/template/TestGWDOC.java b/search-tool/src/main/java/com/bonus/tool/template/TestGWDOC.java index 88e5923..c8cd555 100644 --- a/search-tool/src/main/java/com/bonus/tool/template/TestGWDOC.java +++ b/search-tool/src/main/java/com/bonus/tool/template/TestGWDOC.java @@ -54,7 +54,7 @@ public class TestGWDOC { map2.put("index", (100 * (i + 1)) + (j + 1)); map2.put("width", "375.35"); map2.put("height", "207.85"); - map2.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png")); + map2.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png")); imgList.add(map2); } map.put("imgList", imgList); @@ -86,7 +86,7 @@ public class TestGWDOC { map2.put("index", (1000 * (i + 1)) + (j + 1)); map2.put("width", "481.15"); map2.put("height", "634.5"); - map2.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png")); + map2.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png")); zzList.add(map2); } for (int j = 0; j < 4; j++) { @@ -109,7 +109,7 @@ public class TestGWDOC { map3.put("index", (10000 * (j + 1)) + (k + 1)); map3.put("width", "481.15"); map3.put("height", "634.5"); - map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png")); + map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png")); imgList.add(map3); } map2.put("imgList", imgList); @@ -124,7 +124,7 @@ public class TestGWDOC { map3.put("index", (100000 * (j + 1)) + (k + 1)); map3.put("width", "481.15"); map3.put("height", "634.5"); - map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png")); + map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png")); imgList.add(map3); } map2.put("imgList", imgList); @@ -196,7 +196,7 @@ public class TestGWDOC { map2.put("index", (1000000 * (i + 1)) + (j + 1)); map2.put("width", "481.15"); map2.put("height", "634.5"); - map2.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png")); + map2.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png")); personImgList.add(map2); } map.put("userSettingList", userSettingList); @@ -274,7 +274,7 @@ public class TestGWDOC { map3.put("index", (1000000 * (j + 1)) + (k + 1)); map3.put("width", "481.15"); map3.put("height", "634.5"); - map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png")); + map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png")); imgList.add(map3); } map2.put("imgList", imgList); @@ -290,7 +290,7 @@ public class TestGWDOC { map3.put("index", (1000000 * (j + 1)) + (k + 1)); map3.put("width", "481.15"); map3.put("height", "634.5"); - map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\图片5.png")); + map3.put("base64Url", FreeMarkerUtil.getImageBase("C:\\Users\\10488\\Desktop\\1.png")); imgList.add(map3); } map2.put("imgList", imgList); diff --git a/search-tool/src/main/resources/download/EPC_DOC.ftl b/search-tool/src/main/resources/download/EPC_DOC.ftl index 9b5b5bb..ca23fb0 100644 --- a/search-tool/src/main/resources/download/EPC_DOC.ftl +++ b/search-tool/src/main/resources/download/EPC_DOC.ftl @@ -4257,7 +4257,8 @@ - +<#-- --> + diff --git a/search-tool/src/main/resources/download/NW_DOC.ftl b/search-tool/src/main/resources/download/NW_DOC.ftl index 9b5b5bb..ca23fb0 100644 --- a/search-tool/src/main/resources/download/NW_DOC.ftl +++ b/search-tool/src/main/resources/download/NW_DOC.ftl @@ -4257,7 +4257,8 @@ - +<#-- --> +