From e53d20ac907e9fd33cdb8413f766aaebe3d6eafc Mon Sep 17 00:00:00 2001 From: sunyu Date: Mon, 14 Apr 2025 11:02:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/access_token1.1.jar | Bin 30144 -> 30147 bytes pom.xml | 56 +++++------ .../impl/BizMessageProducerServiceImpl.java | 36 +++---- .../impl/BizShortMessageServiceImpl.java | 2 +- .../extend/shortmessage/utils/SignUtil.java | 12 +-- .../impl/ExpertSignatureServiceImpl.java | 89 +++++++++--------- src/main/resources/application-dev.yml | 58 +++++++----- src/main/resources/application.yml | 89 +++++++++++++++++- 8 files changed, 216 insertions(+), 126 deletions(-) diff --git a/lib/access_token1.1.jar b/lib/access_token1.1.jar index ca28bb3f4655e354eb7f0a4641baf9467deef578..4de3b9495ab91c4a3278ae45af04abe3bb4f27ac 100644 GIT binary patch delta 13 VcmX@`n(^>!M&|ds_is2*3IH`62dw}A delta 19 bcmX^7n(@GEMwS3?W|qlPxl$Vy7nK44O```N diff --git a/pom.xml b/pom.xml index 97225f0..b9f0cc7 100644 --- a/pom.xml +++ b/pom.xml @@ -3,11 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - + com.chinaunicom.ebtp mall-ebtp-cloud-parent - 2.3.0-SNAPSHOT + 2.4.1-zyhy-SNAPSHOT com.chinaunicom.mall.ebtp @@ -16,22 +16,22 @@ biz_service_ebtp_extend - + com.chinaunicom.mall.ebtp uboot-core - 2.3.0-SNAPSHOT + 2.4.1-zyhy-SNAPSHOT - - com.cuca - cucasecuritysdk - 1.7 - - - + + + + + + + com.deepoove @@ -75,11 +75,11 @@ ${basedir}/lib/access_token1.3.jar - - cn.chinaunicom.sdsi - mall-xxljob-core - 0.0.1 - + + + + + org.apache.velocity velocity-tools @@ -91,11 +91,11 @@ - - e-iceblue - spire.doc.free - 3.9.0 - + + + + + org @@ -155,12 +155,12 @@ - - - org.springframework.boot - spring-boot-maven-plugin - - + + + + + + - \ No newline at end of file + diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/service/impl/BizMessageProducerServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/service/impl/BizMessageProducerServiceImpl.java index 682dfca..09f7752 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/service/impl/BizMessageProducerServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/service/impl/BizMessageProducerServiceImpl.java @@ -17,8 +17,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; -import org.apache.velocity.VelocityContext; -import org.apache.velocity.app.Velocity; +//import org.apache.velocity.VelocityContext; +//import org.apache.velocity.app.Velocity; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -83,8 +83,8 @@ public class BizMessageProducerServiceImpl implements BizMessageProducerService BeanUtils.copyProperties(messageRaw, bizmessage); bizmessage.setId(messageId); bizmessage.setCategory(convertCodeToName(messageRaw.getCategory())); - bizmessage.setContent(fill(dao.getBody(), messageRaw.getBody())); - bizmessage.setUrl(fill(dao.getRouter(), messageRaw.getExtra())); + //bizmessage.setContent(fill(dao.getBody(), messageRaw.getBody())); + //bizmessage.setUrl(fill(dao.getRouter(), messageRaw.getExtra())); bizmessage.setParams(toJson(messageRaw.getExtra())); bizmessage.setServicecode(toJson(messageRaw.getServicecode())); bizmessage.setTemplatecode(dao.getCode()); @@ -132,20 +132,20 @@ public class BizMessageProducerServiceImpl implements BizMessageProducerService * @param body * @return */ - private String fill(String tempalte, Map map) { - return Optional.ofNullable(tempalte).map(source -> { - log.debug("message body tempalte: {}", tempalte); - try (StringWriter out = new StringWriter()) { - log.debug("template engine receive: {}, generate message: {}", map, out); - Velocity.evaluate(new VelocityContext(map), out, "log.chinaunicom", tempalte); - - return out.toString(); - } catch (IOException e) { - log.error(e.getMessage()); - } - return StringUtils.EMPTY; - }).orElseGet(() -> StringUtils.EMPTY); - } +// private String fill(String tempalte, Map map) { +// return Optional.ofNullable(tempalte).map(source -> { +// log.debug("message body tempalte: {}", tempalte); +// try (StringWriter out = new StringWriter()) { +// log.debug("template engine receive: {}, generate message: {}", map, out); +// Velocity.evaluate(new VelocityContext(map), out, "log.chinaunicom", tempalte); +// +// return out.toString(); +// } catch (IOException e) { +// log.error(e.getMessage()); +// } +// return StringUtils.EMPTY; +// }).orElseGet(() -> StringUtils.EMPTY); +// } /** * @param obj diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/service/impl/BizShortMessageServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/service/impl/BizShortMessageServiceImpl.java index 9aafd34..4355de8 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/service/impl/BizShortMessageServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/shortmessage/service/impl/BizShortMessageServiceImpl.java @@ -113,7 +113,7 @@ public class BizShortMessageServiceImpl extends BaseServiceImpl) d2.getSections()) { - for (DocumentObject obj : (Iterable) section.getBody().getChildObjects() - ) { - lastsec.getBody().getChildObjects().add(obj.deepClone()); - } - } - - //保存合并后的文档 - d1.saveToFile(path + "merged.docx", FileFormat.Docx_2010); - - //转为pdf - long l = System.currentTimeMillis(); - if (!getLicense()) { - return null; - } - - File f = new File(path + "merged.pdf"); - - FontSettings.getDefaultInstance().setFontsFolder(fontAddress, true); - try (FileOutputStream fos = new FileOutputStream(f);) { - com.aspose.words.Document doc = new com.aspose.words.Document(path + "merged.docx"); - doc.save(fos, SaveFormat.PDF); - } catch (Exception e) { - log.info(ExceptionUtil.stacktraceToString(e)); - } finally { - source.close(); - addObj.close(); - } - - long l1 = System.currentTimeMillis(); - log.info(" ======= " + (l1 - l) + " ======= "); - - return IOUtils.toByteArray(new FileInputStream(f)); +// Document d1 = new Document(source); +// Document d2 = new Document(addObj); +// +// //获取文档1的最后一节 +// Section lastsec = d1.getLastSection(); +// +// //遍历文档2的所有段落内容,添加到文档1 +// for (Section section : (Iterable
) d2.getSections()) { +// for (DocumentObject obj : (Iterable) section.getBody().getChildObjects() +// ) { +// lastsec.getBody().getChildObjects().add(obj.deepClone()); +// } +// } +// +// //保存合并后的文档 +// d1.saveToFile(path + "merged.docx", FileFormat.Docx_2010); +// +// //转为pdf +// long l = System.currentTimeMillis(); +// if (!getLicense()) { +// return null; +// } +// +// File f = new File(path + "merged.pdf"); +// +// FontSettings.getDefaultInstance().setFontsFolder(fontAddress, true); +// try (FileOutputStream fos = new FileOutputStream(f);) { +// com.aspose.words.Document doc = new com.aspose.words.Document(path + "merged.docx"); +// doc.save(fos, SaveFormat.PDF); +// } catch (Exception e) { +// log.info(ExceptionUtil.stacktraceToString(e)); +// } finally { +// source.close(); +// addObj.close(); +// } +// +// long l1 = System.currentTimeMillis(); +// log.info(" ======= " + (l1 - l) + " ======= "); +// +// return IOUtils.toByteArray(new FileInputStream(f)); + return null; } private boolean getLicense() { diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index f3ea5e3..6d0517e 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -2,50 +2,50 @@ server: port: 18018 servlet: context-path: / - + seata: service: vgroup-mapping: biz-service-ebtp-extend-service-group: default grouplist: default: 10.242.37.148:18035 - + #registry: # type: eureka # eureka: # serviceUrl: http://10.242.37.148:5001/eureka,http://10.242.37.148:5002/eureka,http://10.242.37.148:5003/eureka - + # 对应 apollo 配置中心的应用名 app: id: biz-service-ebtp-extend - + # Apollo 配置信息 apollo: - meta: http://10.242.37.148:6001/ + meta: http://localhost:8070 bootstrap: namespace: application enabled: true eagerLoad: enabled: true - + spring: aop: auto: true #开启spring的aop配置 proxy-target-class: true - + application: name: biz-service-ebtp-extend - + shardingsphere: datasource: names: ds0 ds0: type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.cj.jdbc.Driver - username: mall - password: unicom - jdbc-url: jdbc:mysql://10.125.160.26:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true - url: jdbc:mysql://10.125.160.26:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + username: root + password: Unicom@2024 + jdbc-url: jdbc:mysql://59.110.10.99:53306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://59.110.10.99:53306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true filters: stat,wall,log4j maxActive: 20 initialSize: 1 @@ -69,22 +69,22 @@ spring: time-zone: GMT+8 serialization: write-dates-as-timestamps: false - - # 天宫Kafka增加了安全认证,需要配置安全属性 + + # 天宫Kafka增加了安全认证,需要配置安全属性 kafka: bootstrap-servers: 10.125.164.192:32005,10.125.164.193:32005,10.125.164.194:32005 template: default-topic: jl_test - + # 生产者配置参数 producer: client-id: core-service-ebtp-crypt - properties: + properties: security.protocol: SASL_PLAINTEXT sasl.mechanism: SCRAM-SHA-256 sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="jltest" password="Unicom#123"; - - # 消费者配置参数 + + # 消费者配置参数 consumer: group-id: core-service-ebtp-crypt-consumer auto-offset-reset: latest @@ -92,19 +92,25 @@ spring: security.protocol: SASL_PLAINTEXT sasl.mechanism: SCRAM-SHA-256 sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="jltest" password="Unicom#123"; - + # 天宫 redis 需要使用哨兵进行访问 redis: sentinel: master: eshop-redis - nodes: 10.125.164.124:32718, 10.125.164.118:32716, 10.125.164.121:32716 - password: Unicom#135 - +# nodes: 10.125.164.124:32718, 10.125.164.118:32716, 10.125.164.121:32716 + nodes: localhost:6379 +# password: Unicom#135 + database: + idempotent: 1 + sharding: 1 + cache: 1 + userinfo: 1 # 天宫Eureka配置 eureka: client: service-url: - defaultZone: http://eureka-1-svc:8080/eureka, http://eureka-2-svc:8080/eureka, http://eureka-3-svc:8080/eureka +# defaultZone: http://eureka-1-svc:8080/eureka, http://eureka-2-svc:8080/eureka, http://eureka-3-svc:8080/eureka + defaultZone: http://localhost:8080/eureka/ instance: prefer-ip-address: true instance-id: http://10.242.37.148:${server.port} @@ -151,13 +157,13 @@ hystrix: circuitBreaker: sleepWindowInMilliseconds: 20000 forceClosed: true - + ribbon: ReadTimeout: 20000 #请求处理的超时时间 ConnectTimeout: 20000 #请求连接超时时间 MaxAutoRetries: 0 #对当前实例的重试次数 MaxAutoRetriesNextServer: 1 #切换实例的重试次数 1 - + mconfig: workerId: 1 datacenterId: 1 @@ -180,7 +186,7 @@ document: -# 用户暴露给 prometheus 的健康数据 +# 用户暴露给 prometheus 的健康数据 management: endpoints: web: diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 3e5b391..1eb5633 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -2,12 +2,95 @@ app: id: biz-service-ebtp-extend +spring: + profiles: + active: dev + # Apollo 配置信息 apollo: bootstrap: enabled: true namespace: application -jasypt: - encryptor: - bean: stringEncryptor \ No newline at end of file +client: + clientHttpUrl: 1 + +user: + auth: + resource: + serviceId:mall-auth: 1 + + + +unifast: + sso: + getCode: + url: 1 + redirectUrl: 1 + clientId: 1 + public-key: 1 + +jury: + loginCheck: + privateKey: 1 + +message: + privateKey: 1 + callBackUrl: 1 + appCode: 1 + checkVerifycodeHttpUrl: 1 + sendVerifycodeHttpUrl: 1 + +oss: + bucketName: 1 + accessKeySecret: 1 + accessKeyId: 1 + endpoint: 1 + +KingSoftWps: + downloadUrl: 1 + downloadUrl2: 1 + publicKey: 1 + privateKey: 1 + host: 1 + time_limit: 1 + kswpsurl: 1 + kswpsurl-preview: 1 + tempDocFileId: 1 + +mconfig: + wps: + bss: + appTokenUrl: 1 + previewUrl: 1 + editUrl: 1 + url: + appTokenUrl: 1 + previewUrl: 1 + downFileUrl: 1 + editUrl: 1 + bssAppId: 1 + bssAppSecret: 1 + bssAppUrl: 1 + appid: 1 + appKey: 1 + + bss: + app-url: 1 + app-url-test: 1 + app-secret: 1 + app-id: 1 + feign: + name: + usercenter: 1 + tender: 1 + rsms: 1 + strategy-center: 1 + resps: 1 + project: 2 + process: 1 + notification: 1 + documentcenter: 2 +#jasypt: +# encryptor: +# bean: stringEncryptor