From afb0d090d4409eadbaf70e3ee7b89defc574f1e9 Mon Sep 17 00:00:00 2001 From: liyawei Date: Thu, 21 Jul 2022 18:34:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E8=AF=81-=E5=8F=82=E6=95=B0=E9=A1=B9?= =?UTF-8?q?=E6=94=B6=E9=9B=86=E6=B8=85=E5=8D=95-=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=B8=AD=E7=9A=84=E8=B7=B3=E8=BD=AC=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ParamsCollectManifestEOServiceImpl.java | 74 +++++++++++++++++-- 1 file changed, 68 insertions(+), 6 deletions(-) diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index 424e1ffe3..346534b85 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -1294,6 +1294,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImplthe link,"; + String urlParamsStr = parseUrlParams(paramsManifestEO); + String hrefFeishu = backUrl + "/ParameterItemCollection" + urlParamsStr; + String href = "the link,"; String content = connectBuilder.substring(0, connectBuilder.toString().length()-1) + " and other parameter items, please enter the link to handle it."; String contentInfo = connectBuilder.substring(0, connectBuilder.toString().length()-1) + " please enter " + href + " to handle it."; String msgTitle = "You have a homo parameter task to complete"; @@ -1385,6 +1388,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImplthe link,"; + String urlParamsStr = parseUrlParams(paramsManifestEO); + String hrefFeishu = backUrl + "/ParameterItemCollection" + urlParamsStr; + String href = "the link,"; String contentInfo = connectBuilder.substring(0, connectBuilder.toString().length() - 1) + " and other parameter items, please enter " + href + " and fill in the relevant information."; String msgTitle = "You have a homo parameter task to complete"; @@ -1509,6 +1515,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl updateEOList = new ArrayList<>(); @@ -1576,8 +1584,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImplthe link,"; + String urlParamsStr = parseUrlParams(paramsManifestEO); + String hrefFeishu = backUrl + "/ParameterItemCollection" + urlParamsStr; + String href = "the link,"; String contentInfo = connectBuilder.substring(0, connectBuilder.toString().length() - 1) + " and other parameter items, please enter " + href + " and fill in the relevant information."; String msgTitle = "You have a homo parameter task to complete"; @@ -2446,6 +2455,59 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl list = findAllFieldsOfSelfAndSuperClass(clazz.getClass()); + + StringBuilder requestURL = new StringBuilder(); + try { + + boolean flag = true; + String property, value, params; + for (Field field : list) { + // 允许访问私有变量 + field.setAccessible(true); + // 过滤静态属性 + if (Modifier.isStatic(field.getModifiers())) { + continue; + } + // 属性名 + property = field.getName(); + // 属性值 + if (field.get(clazz) != null) { + if (Date.class.equals(field.getType())) { + Date date = (Date) field.get(clazz); + String pattern = ""; + pattern = "yyyy-MM-dd HH:mm:ss"; + SimpleDateFormat formatter=new SimpleDateFormat(pattern); + String time=formatter.format(date); + value = time; + } else { + value = field.get(clazz).toString(); + } + params = property + "=" + value; + } else { + params = property + "="; + } + if (flag) { + requestURL.append("?").append(params); + flag = false; + } else { + requestURL.append("&").append(params); + } + } + } catch (Exception e) { + log.error("通过实体类获取URL出现异常:" + e.getMessage(), e); + } + return requestURL.toString(); + } + /** * 实体对象转成Map * @param obj 实体对象