上传代码
This commit is contained in:
Binary file not shown.
50
pom.xml
50
pom.xml
@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>com.chinaunicom.ebtp</groupId>
|
||||
<artifactId>mall-ebtp-cloud-parent</artifactId>
|
||||
<version>2.3.0-SNAPSHOT</version>
|
||||
<version>2.4.1-zyhy-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.chinaunicom.mall.ebtp</groupId>
|
||||
@ -20,18 +20,18 @@
|
||||
<dependency>
|
||||
<groupId>com.chinaunicom.mall.ebtp</groupId>
|
||||
<artifactId>uboot-core</artifactId>
|
||||
<version>2.3.0-SNAPSHOT</version>
|
||||
<version>2.4.1-zyhy-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 证书加密签名 -->
|
||||
<dependency>
|
||||
<groupId>com.cuca</groupId>
|
||||
<artifactId>cucasecuritysdk</artifactId>
|
||||
<version>1.7</version>
|
||||
<!-- <scope>system</scope>-->
|
||||
<!-- <systemPath>${project.basedir}/libs/cucasecuritysdk-1.7.jar</systemPath>-->
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.cuca</groupId>-->
|
||||
<!-- <artifactId>cucasecuritysdk</artifactId>-->
|
||||
<!-- <version>1.7</version>-->
|
||||
<!--<!– <scope>system</scope>–>-->
|
||||
<!--<!– <systemPath>${project.basedir}/libs/cucasecuritysdk-1.7.jar</systemPath>–>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.deepoove</groupId>
|
||||
@ -75,11 +75,11 @@
|
||||
<systemPath>${basedir}/lib/access_token1.3.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.chinaunicom.sdsi</groupId>
|
||||
<artifactId>mall-xxljob-core</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.chinaunicom.sdsi</groupId>-->
|
||||
<!-- <artifactId>mall-xxljob-core</artifactId>-->
|
||||
<!-- <version>0.0.1</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-tools</artifactId>
|
||||
@ -91,11 +91,11 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>e-iceblue</groupId>
|
||||
<artifactId>spire.doc.free</artifactId>
|
||||
<version>3.9.0</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>e-iceblue</groupId>-->
|
||||
<!-- <artifactId>spire.doc.free</artifactId>-->
|
||||
<!-- <version>3.9.0</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org</groupId>
|
||||
@ -155,12 +155,12 @@
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<!-- <plugins>-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
|
||||
<!-- </plugin>-->
|
||||
<!-- </plugins>-->
|
||||
</build>
|
||||
|
||||
</project>
|
@ -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<String, Object> 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<String, Object> 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
|
||||
|
@ -113,7 +113,7 @@ public class BizShortMessageServiceImpl extends BaseServiceImpl<BizShortMessageM
|
||||
smsCheckRequest.setBizSn(value.toString());
|
||||
//生成签名
|
||||
byte[] signByte = SignUtil.sign(privateKey,value.toString().getBytes(StandardCharsets.UTF_8));
|
||||
String sign = com.cuca.bouncycastle.util.encoders.Base64.toBase64String(signByte);
|
||||
String sign = null;//com.cuca.bouncycastle.util.encoders.Base64.toBase64String(signByte);
|
||||
smsCheckRequest.setSign(sign);
|
||||
//手机号
|
||||
smsCheckRequest.setMobile(mobile);
|
||||
|
@ -1,15 +1,15 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.shortmessage.utils;
|
||||
|
||||
import com.cuca.security.algorithm.impl.soft.SoftSM2;
|
||||
import com.cuca.security.soft.sm2.SM2PrivateKey;
|
||||
import com.cuca.security.util.KeyFromDER;
|
||||
//import com.cuca.security.algorithm.impl.soft.SoftSM2;
|
||||
//import com.cuca.security.soft.sm2.SM2PrivateKey;
|
||||
//import com.cuca.security.util.KeyFromDER;
|
||||
|
||||
/**
|
||||
* 签名生成演示方法
|
||||
*/
|
||||
public class SignUtil {
|
||||
|
||||
private static final SoftSM2 SM2 = new SoftSM2();
|
||||
// private static final SoftSM2 SM2 = new SoftSM2();
|
||||
private static final String SIGN_ALG = "SM3withSM2";
|
||||
|
||||
/**
|
||||
@ -19,7 +19,7 @@ public class SignUtil {
|
||||
* @return 签名值
|
||||
*/
|
||||
public static byte[] sign(String priKey, byte[] inData) {
|
||||
SM2PrivateKey privateKey = KeyFromDER.getSM2PrivateKey("", priKey);
|
||||
return SM2.externalSign(SIGN_ALG, privateKey, inData);
|
||||
// SM2PrivateKey privateKey = KeyFromDER.getSM2PrivateKey("", priKey);
|
||||
return null;//SM2.externalSign(SIGN_ALG, privateKey, inData);
|
||||
}
|
||||
}
|
||||
|
@ -16,10 +16,10 @@ import com.chinaunicom.mall.ebtp.extend.signature.entity.ExpertSignature;
|
||||
import com.chinaunicom.mall.ebtp.extend.signature.service.ExpertSignatureService;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.data.PictureRenderData;
|
||||
import com.spire.doc.Document;
|
||||
import com.spire.doc.DocumentObject;
|
||||
import com.spire.doc.FileFormat;
|
||||
import com.spire.doc.Section;
|
||||
//import com.spire.doc.Document;
|
||||
//import com.spire.doc.DocumentObject;
|
||||
//import com.spire.doc.FileFormat;
|
||||
//import com.spire.doc.Section;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@ -100,48 +100,49 @@ public class ExpertSignatureServiceImpl implements ExpertSignatureService {
|
||||
* @throws IOException
|
||||
*/
|
||||
private byte[] mergeWord(InputStream source, InputStream addObj, String path) throws IOException {
|
||||
Document d1 = new Document(source);
|
||||
Document d2 = new Document(addObj);
|
||||
|
||||
//获取文档1的最后一节
|
||||
Section lastsec = d1.getLastSection();
|
||||
|
||||
//遍历文档2的所有段落内容,添加到文档1
|
||||
for (Section section : (Iterable<Section>) d2.getSections()) {
|
||||
for (DocumentObject obj : (Iterable<DocumentObject>) section.getBody().getChildObjects()
|
||||
) {
|
||||
lastsec.getBody().getChildObjects().add(obj.deepClone());
|
||||
}
|
||||
}
|
||||
|
||||
//保存合并后的文档
|
||||
d1.saveToFile(path + "merged.docx", FileFormat.Docx_2010);
|
||||
|
||||
//转为pdf
|
||||
long l = System.currentTimeMillis();
|
||||
if (!getLicense()) {
|
||||
// Document d1 = new Document(source);
|
||||
// Document d2 = new Document(addObj);
|
||||
//
|
||||
// //获取文档1的最后一节
|
||||
// Section lastsec = d1.getLastSection();
|
||||
//
|
||||
// //遍历文档2的所有段落内容,添加到文档1
|
||||
// for (Section section : (Iterable<Section>) d2.getSections()) {
|
||||
// for (DocumentObject obj : (Iterable<DocumentObject>) 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;
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
private boolean getLicense() {
|
||||
boolean result = false;
|
||||
InputStream is = ExpertSignatureServiceImpl.class.getClassLoader().getResourceAsStream("/license/aspose-license.xml");
|
||||
|
@ -21,7 +21,7 @@ app:
|
||||
|
||||
# Apollo 配置信息
|
||||
apollo:
|
||||
meta: http://10.242.37.148:6001/
|
||||
meta: http://localhost:8070
|
||||
bootstrap:
|
||||
namespace: application
|
||||
enabled: true
|
||||
@ -42,10 +42,10 @@ spring:
|
||||
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
|
||||
@ -97,14 +97,20 @@ spring:
|
||||
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}
|
||||
|
@ -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
|
||||
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
|
||||
|
Reference in New Issue
Block a user