Compare commits
148 Commits
Author | SHA1 | Date |
---|---|---|
|
a14706e2a3 | |
|
bd9c7b166d | |
|
a0ab2e87ba | |
|
3796a24b94 | |
|
97840df6a1 | |
|
adb4a566d4 | |
|
257e7c2235 | |
|
bfd18dce39 | |
|
70c6f8adf3 | |
|
6e3a47706a | |
|
4c40538ae1 | |
|
234a2e4efb | |
|
d2c824e64d | |
|
d9feee5a28 | |
|
6b0232e12d | |
|
f9b2ebaa7f | |
|
ffb86f43fa | |
|
f73d39fe1c | |
|
5a63afd7d8 | |
|
21007598a9 | |
|
c943cd82fb | |
|
ed5d7fff69 | |
|
1d979524f3 | |
|
23d06b59bb | |
|
5eea8dfb96 | |
|
90386c59a5 | |
|
aa591dc1ff | |
|
ae266436d9 | |
|
62cf866111 | |
|
351a7e7a7a | |
|
5f6648144c | |
|
f582a9601c | |
|
c398ecde8b | |
|
0baa4e0bf3 | |
|
3bddc46c9a | |
|
5ff781e133 | |
|
cff92f2399 | |
|
a778197694 | |
|
61b0cdfaee | |
|
fa2583176e | |
|
165e548056 | |
|
d9405aad90 | |
|
2874005465 | |
|
6e0b588959 | |
|
55aa4c4a92 | |
|
44fb1eaca1 | |
|
f0db5772a2 | |
|
482f0533c4 | |
|
6e6d219719 | |
|
0e471d20a3 | |
|
f33447e4f2 | |
|
cb58463319 | |
|
504c9e54c0 | |
|
54867aee2c | |
|
17518aa2d4 | |
|
916a133c0c | |
|
d6bdd3605f | |
|
c78e10f059 | |
|
7af6143514 | |
|
927f8c5a7b | |
|
c2ad1e3ea3 | |
|
24ab9a9dc1 | |
|
37b66cee8b | |
|
07d8962046 | |
|
4391df3e02 | |
|
9b514c36e9 | |
|
1f2d0584e2 | |
|
5e7975ec5e | |
|
a3da542b56 | |
|
ad23819b59 | |
|
798dfbd3f1 | |
|
38d1b88bd1 | |
|
a068e1a434 | |
|
96cb15eeff | |
|
f5b69825dc | |
|
bc37dab6d0 | |
|
2651fecbe9 | |
|
a1b601a41d | |
|
9e54b38c9a | |
|
ef85056b11 | |
|
a7b25fa268 | |
|
45d37f1339 | |
|
4da74d01ca | |
|
4c50b026f8 | |
|
ef5d366074 | |
|
3ac8fbf8aa | |
|
6836a3e230 | |
|
1e31b472d2 | |
|
ce177ef4b5 | |
|
2eaafe65d5 | |
|
3d6a292ae9 | |
|
43f01064ee | |
|
442f0f452c | |
|
0d67875878 | |
|
88bd9c5e0e | |
|
472484d8c6 | |
|
1ec337f22a | |
|
bd7b4fd77d | |
|
2379d9dd7a | |
|
432abf3943 | |
|
2f93dded99 | |
|
0a5a589c36 | |
|
197762e530 | |
|
a3acc9a1d1 | |
|
4ac86bfe86 | |
|
3aeb5699a9 | |
|
c6735a739e | |
|
5e4d290f27 | |
|
d1e416aa2c | |
|
cc3380766a | |
|
33e3737728 | |
|
35be2fc876 | |
|
b3b70f9990 | |
|
776b5804dc | |
|
d808021db1 | |
|
885b0e4d28 | |
|
0e717cd182 | |
|
1a299b15f1 | |
|
58b61fd613 | |
|
5ad6cff94b | |
|
4fb8ae52a7 | |
|
2f2dee7613 | |
|
7b39bfadb5 | |
|
ac9205418d | |
|
ef9ad4727a | |
|
c1aaa48771 | |
|
1276832742 | |
|
512ccb5157 | |
|
aa124c9657 | |
|
b07e646333 | |
|
2a49ba7221 | |
|
c7c53a65a3 | |
|
47cd2a538d | |
|
86d4bf5d53 | |
|
b125e46f9b | |
|
47d8ae286f | |
|
1d5ffd0854 | |
|
58f18f6ac1 | |
|
883c388d9f | |
|
3c6cd595ca | |
|
4612125c75 | |
|
66ad9e41d2 | |
|
9dabf05268 | |
|
e02a6114ed | |
|
6eb4dd9908 | |
|
dce400eb37 | |
|
cdacfbc9bf | |
|
51fb2476e7 |
|
@ -60,3 +60,9 @@ $RECYCLE.BIN/
|
|||
/common/target/
|
||||
/buildpackage/target/
|
||||
/webapp/target/
|
||||
/base-buildpackage/target/
|
||||
/base-common/target/
|
||||
/base-core/target/
|
||||
/base-webapp/target/classes/com/hzya/frame/
|
||||
/fw-weixin/target/
|
||||
/E:/yongansystem/log/2024-10-15/
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
<parent>
|
||||
<artifactId>kangarooDataCenterV3</artifactId>
|
||||
<groupId>com.hzya.frame</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>base-buildpackage</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>${revision}</version>
|
||||
<!-- 统一管理依赖版本-->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.hzya.frame</groupId>
|
||||
<artifactId>base-webapp</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>dev</id> <!--开发环境-->
|
||||
<properties>
|
||||
<profile.active>dev</profile.active>
|
||||
</properties>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
|
||||
|
||||
<profile>
|
||||
<id>llg</id> <!--吕磊钢-->
|
||||
<properties>
|
||||
<profile.active>llg</profile.active>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>xel</id> <!--xel-->
|
||||
<properties>
|
||||
<profile.active>xel</profile.active>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>zqtlocal</id> <!--曾庆拓-->
|
||||
<properties>
|
||||
<profile.active>zqtlocal</profile.active>
|
||||
</properties>
|
||||
</profile>
|
||||
|
||||
</profiles>
|
||||
<build>
|
||||
<finalName>kangarooDataCenterV3</finalName>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,386 @@
|
|||
package com.hzya.frame.plugin.BackUpDatabase.plugin;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
import com.jcraft.jsch.Channel;
|
||||
import com.jcraft.jsch.ChannelSftp;
|
||||
import com.jcraft.jsch.JSch;
|
||||
import com.jcraft.jsch.Session;
|
||||
import com.jcraft.jsch.SftpATTRS;
|
||||
import com.jcraft.jsch.SftpException;
|
||||
import org.apache.commons.net.ftp.FTPClient;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.file.Files;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Properties;
|
||||
|
||||
|
||||
/**
|
||||
* 主数据模版(MdmModule)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-06-18 10:33:32
|
||||
*/
|
||||
public class BackUpDatabaseInitializer extends PluginBaseEntity {
|
||||
Logger logger = LoggerFactory.getLogger(BackUpDatabaseInitializer.class);
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "BackUpDatabasePlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "数据库备份下发";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "BackUpDatabasePlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
@Value("${database.filePase:}")
|
||||
private String filePase;//文件保存路径
|
||||
|
||||
@Value("${database.fileName:data.sql}")
|
||||
private String fileName;//文件保存名称
|
||||
|
||||
@Value("${database.databaseName:}")
|
||||
private String databaseName;//库名
|
||||
|
||||
@Value("${database.host:}")
|
||||
private String host;//地址
|
||||
|
||||
@Value("${database.port:}")
|
||||
private String port;//端口
|
||||
|
||||
@Value("${database.username:}")
|
||||
private String username;//用户名
|
||||
|
||||
@Value("${database.password:}")
|
||||
private String password;//密码
|
||||
|
||||
|
||||
@Value("${sftp.host:}")
|
||||
private String sftpHost;
|
||||
|
||||
@Value("${sftp.port:}")
|
||||
private Integer sftpPort;
|
||||
|
||||
@Value("${sftp.username:}")
|
||||
private String sftpUsername;
|
||||
|
||||
@Value("${sftp.password:}")
|
||||
private String sftpPassword;
|
||||
|
||||
@Value("${sftp.filePase:}")
|
||||
private String sftpFilePase;
|
||||
|
||||
|
||||
private ChannelSftp sftp = null;
|
||||
private Session sshSession = null;
|
||||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||
try {
|
||||
if(filePase == null || "".equals(filePase)
|
||||
|| databaseName == null || "".equals(databaseName)
|
||||
|| fileName == null || "".equals(fileName)
|
||||
|| host == null || "".equals(host)
|
||||
|| port == null || "".equals(port)
|
||||
|| username == null || "".equals(username)
|
||||
|| password == null || "".equals(password)
|
||||
){
|
||||
return BaseResult.getSuccessMessageEntity("系统参数未配置不执行,数据库备份");
|
||||
}
|
||||
//查找是否存在当天数据库
|
||||
//格式化日期
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String data = sdf.format(new Date());
|
||||
//当天路径
|
||||
String nowDatabasePase = filePase + File.separator + data;
|
||||
//不判断文件是否存在,直接执行
|
||||
if(!backFile(nowDatabasePase)){
|
||||
return BaseResult.getFailureMessageEntity("备份失败");
|
||||
}
|
||||
//判断是否有sftp配置,有的备份,没有的不备份
|
||||
if(sftpHost != null && !"".equals(sftpHost)
|
||||
&& sftpPort != null && !"".equals(sftpPort)
|
||||
&& sftpUsername != null && !"".equals(sftpUsername)
|
||||
&& sftpPassword != null && !"".equals(sftpPassword)
|
||||
&& sftpFilePase != null && !"".equals(sftpFilePase)
|
||||
){
|
||||
String sftpnowDatabasePase = sftpFilePase + File.separator + data;
|
||||
if(!sendFile(nowDatabasePase,sftpnowDatabasePase)){
|
||||
return BaseResult.getFailureMessageEntity("备份失败");
|
||||
}
|
||||
}
|
||||
logger.info("执行成功");
|
||||
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||
} catch (Exception e) {
|
||||
logger.error("执行失败{}", e.getMessage());
|
||||
return BaseResult.getFailureMessageEntity("备份失败");
|
||||
}
|
||||
}
|
||||
|
||||
private boolean backFile(String nowDatabasePase) {
|
||||
try {
|
||||
// 构建 mysqldump 命令
|
||||
ProcessBuilder processBuilder = new ProcessBuilder(
|
||||
"mysqldump",
|
||||
"--ssl-mode=DISABLED",
|
||||
"-h", host,
|
||||
"-u", username,
|
||||
"-p" + password,
|
||||
"-P" + port,
|
||||
databaseName);
|
||||
// 启动进程并获取输入流
|
||||
Process process = processBuilder.start();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||
File f = creatFile(nowDatabasePase,fileName);
|
||||
// 将备份内容写入文件
|
||||
FileWriter writer = new FileWriter(f);
|
||||
String line;
|
||||
while ((line = reader.readLine())!= null) {
|
||||
writer.write(line + "\n");
|
||||
}
|
||||
// 关闭资源
|
||||
reader.close();
|
||||
writer.close();
|
||||
process.waitFor();
|
||||
logger.info("文件备份成功路径:"+nowDatabasePase+ File.separator +fileName);
|
||||
return true;
|
||||
} catch (IOException | InterruptedException e) {
|
||||
logger.info("文件备份失败:"+e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 创建目录及文件
|
||||
* @Date 8:59 上午 2024/10/22
|
||||
* @param filePath
|
||||
* @param fileName
|
||||
* @return java.io.File
|
||||
**/
|
||||
public File creatFile(String filePath, String fileName) {
|
||||
File folder = new File(filePath);
|
||||
//文件夹路径不存在
|
||||
if (!folder.exists()) {
|
||||
boolean mkdirs = folder.mkdirs();
|
||||
}
|
||||
// 如果文件不存在就创建
|
||||
File file = new File(filePath + File.separator + fileName);
|
||||
if (!file.exists()) {
|
||||
try {
|
||||
file.createNewFile();
|
||||
} catch (IOException e) {
|
||||
logger.error("创建备份文件失败:"+e.getMessage());
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
private boolean sendFile(String localFilePath,String remoteFileName) {
|
||||
try {
|
||||
connect();
|
||||
uploadFile(remoteFileName,fileName,localFilePath,fileName);
|
||||
disconnect();
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
logger.error("sftp文件上传失败:"+e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void connect() {
|
||||
try {
|
||||
JSch jsch = new JSch();
|
||||
jsch.getSession(sftpUsername, sftpHost, sftpPort);
|
||||
sshSession = jsch.getSession(sftpUsername, sftpHost, sftpPort);
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Session created.");
|
||||
}
|
||||
sshSession.setPassword(sftpPassword);
|
||||
Properties sshConfig = new Properties();
|
||||
sshConfig.put("StrictHostKeyChecking", "no");
|
||||
sshSession.setConfig(sshConfig);
|
||||
sshSession.connect();
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Session connected.");
|
||||
}
|
||||
Channel channel = sshSession.openChannel("sftp");
|
||||
channel.connect();
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Opening Channel.");
|
||||
}
|
||||
sftp = (ChannelSftp) channel;
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Connected to " + host + ".");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭连接
|
||||
*/
|
||||
public void disconnect() {
|
||||
if (this.sftp != null) {
|
||||
if (this.sftp.isConnected()) {
|
||||
this.sftp.disconnect();
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("sftp is closed already");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.sshSession != null) {
|
||||
if (this.sshSession.isConnected()) {
|
||||
this.sshSession.disconnect();
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("sshSession is closed already");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传单个文件
|
||||
*
|
||||
* @param remotePath:远程保存目录
|
||||
* @param remoteFileName:保存文件名
|
||||
* @param localPath:本地上传目录(以路径符号结束)
|
||||
* @param localFileName:上传的文件名
|
||||
* @return
|
||||
*/
|
||||
public boolean uploadFile(String remotePath, String remoteFileName, String localPath, String localFileName) {
|
||||
FileInputStream in = null;
|
||||
try {
|
||||
createDir(remotePath);
|
||||
File file = new File(localPath + File.separator + localFileName);
|
||||
in = new FileInputStream(file);
|
||||
sftp.put(in, remoteFileName, 65536);
|
||||
return true;
|
||||
} catch (FileNotFoundException e) {
|
||||
} catch (SftpException e) {
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建目录
|
||||
*
|
||||
* @param createpath
|
||||
* @return
|
||||
*/
|
||||
public boolean createDir(String createpath) {
|
||||
try {
|
||||
if (isDirExist(createpath)) {
|
||||
this.sftp.cd(createpath);
|
||||
return true;
|
||||
}
|
||||
String pathArry[] = createpath.split("/");
|
||||
StringBuffer filePath = new StringBuffer("/");
|
||||
for (String path : pathArry) {
|
||||
if (path.equals("")) {
|
||||
continue;
|
||||
}
|
||||
filePath.append(path + "/");
|
||||
if (isDirExist(filePath.toString())) {
|
||||
sftp.cd(filePath.toString());
|
||||
} else {
|
||||
// 建立目录
|
||||
sftp.mkdir(filePath.toString());
|
||||
// 进入并设置为当前目录
|
||||
sftp.cd(filePath.toString());
|
||||
}
|
||||
|
||||
}
|
||||
this.sftp.cd(createpath);
|
||||
return true;
|
||||
} catch (SftpException e) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断目录是否存在
|
||||
*
|
||||
* @param directory
|
||||
* @return
|
||||
*/
|
||||
public boolean isDirExist(String directory) {
|
||||
boolean isDirExistFlag = false;
|
||||
try {
|
||||
SftpATTRS sftpATTRS = sftp.lstat(directory);
|
||||
isDirExistFlag = true;
|
||||
return sftpATTRS.isDir();
|
||||
} catch (Exception e) {
|
||||
if (e.getMessage().toLowerCase().equals("no such file")) {
|
||||
isDirExistFlag = false;
|
||||
}
|
||||
}
|
||||
return isDirExistFlag;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 如果目录不存在就创建目录
|
||||
*
|
||||
* @param path
|
||||
*/
|
||||
public void mkdirs(String path) {
|
||||
File f = new File(path);
|
||||
|
||||
String fs = f.getParent();
|
||||
|
||||
f = new File(fs);
|
||||
|
||||
if (!f.exists()) {
|
||||
f.mkdirs();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -452,6 +452,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.info("执行异常错误原因:"+e);
|
||||
logger.error("新增返回脚本解析保存三方id错误"+jsonResultEntity.getAttribute());
|
||||
taskDetailEntity.setResult("新增返回脚本解析保存三方id错误");
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
|
||||
|
@ -543,7 +544,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
map1.put("tableName",mainDb);
|
||||
map1.put("dataStatus", "N");
|
||||
map1.put("deleteStatus", "0");
|
||||
map1.put("size", 10);
|
||||
map1.put("size", 50);
|
||||
objects = mdmModuleDao.queryMdmSTs(map1);
|
||||
objects = toLowerCaseKeys(objects);
|
||||
|
||||
|
@ -704,7 +705,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
continue;
|
||||
}else {
|
||||
//保存日志
|
||||
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3");
|
||||
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -738,7 +739,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
map1.put("tableName",mainDb);
|
||||
//map1.put("dataStatus", "F");
|
||||
map1.put("updateStatus", "0");
|
||||
map1.put("size", 10);
|
||||
map1.put("size", 50);
|
||||
objects = mdmModuleDao.queryMdmSTs(map1);
|
||||
objects = toLowerCaseKeys(objects);
|
||||
|
||||
|
@ -885,7 +886,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
continue;
|
||||
}else {
|
||||
//保存日志
|
||||
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2");
|
||||
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -926,7 +927,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
map1.put("tableName",mainDb);
|
||||
//map1.put("dataStatus", "Y");
|
||||
map1.put("addStatus", "0");
|
||||
map1.put("size", 10);
|
||||
map1.put("size", 50);
|
||||
objects = mdmModuleDao.queryMdmSTs(map1);
|
||||
objects = toLowerCaseKeys(objects);
|
||||
|
||||
|
@ -991,6 +992,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
mdmModuleSendLogEntity.setTableName(mainDb+"_send_log");
|
||||
mdmModuleSendLogEntity.setFormmainId(doObjects.get(i).getString("id"));
|
||||
mdmModuleSendLogEntity.setSts("Y");
|
||||
mdmModuleSendLogEntity.setDataType("1");
|
||||
mdmModuleSendLogEntity.setAppId(sysApplicationEntity.getId());
|
||||
mdmModuleSendLogEntity.setApiId(apiEntity.getId());
|
||||
//mdmModuleSendLogEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId());
|
||||
|
@ -1121,10 +1123,12 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
}
|
||||
//保存日志
|
||||
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1");
|
||||
objects.get(i).put("sendsanfzt123",true);
|
||||
continue;
|
||||
}else {
|
||||
//保存日志
|
||||
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1");
|
||||
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1");
|
||||
objects.get(i).put("sendsanfzt123",false);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -1132,6 +1136,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
|
||||
//所有下发发送完成,修改数据状态
|
||||
for (int i = 0; i < objects.size(); i++) {
|
||||
if(objects.get(i).getBoolean("sendsanfzt123")){
|
||||
Map<String, Object> updateMap = new HashMap<>();
|
||||
updateMap.put("tableName",mainDb);
|
||||
//updateMap.put("dataStatus", "Y");
|
||||
|
@ -1140,6 +1145,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
mdmModuleDao.updateMdmSTs(updateMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void saveMdmModuleSendLogEntity(Long mdmCode,String distributeId,String dataType,String remark,String dbname,String formmain_id, String target_app, String appId, String target_api,String apiID, String source_data, String option_type) throws Exception {
|
||||
MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity();
|
|
@ -0,0 +1,7 @@
|
|||
package com.hzya.frame.plugin.pushMessage.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
|
||||
|
||||
public interface IPushMessageDao extends IBaseDao<PushMessageEntity, String> {
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.hzya.frame.plugin.pushMessage.dao.impl;
|
||||
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao;
|
||||
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
|
||||
|
||||
public class PushMessageDaoImpl extends MybatisGenericDao<PushMessageEntity, String> implements IPushMessageDao {
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
package com.hzya.frame.plugin.pushMessage.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
public class PushMessageEntity extends BaseEntity {
|
||||
|
||||
private String pushMethod;
|
||||
private String warningAppCode;
|
||||
private String warningApiCode;
|
||||
private String recipientIdList;
|
||||
private String warningAppType;
|
||||
private String sendAppName;
|
||||
private String receiveAppName;
|
||||
private String receiveApiName;
|
||||
private String returnData;
|
||||
private String receiveApiCode;
|
||||
private String status;
|
||||
|
||||
public String getPushMethod() {
|
||||
return pushMethod;
|
||||
}
|
||||
|
||||
public void setPushMethod(String pushMethod) {
|
||||
this.pushMethod = pushMethod;
|
||||
}
|
||||
|
||||
public String getWarningAppCode() {
|
||||
return warningAppCode;
|
||||
}
|
||||
|
||||
public void setWarningAppCode(String warningAppCode) {
|
||||
this.warningAppCode = warningAppCode;
|
||||
}
|
||||
|
||||
public String getWarningApiCode() {
|
||||
return warningApiCode;
|
||||
}
|
||||
|
||||
public void setWarningApiCode(String warningApiCode) {
|
||||
this.warningApiCode = warningApiCode;
|
||||
}
|
||||
|
||||
public String getRecipientIdList() {
|
||||
return recipientIdList;
|
||||
}
|
||||
|
||||
public void setRecipientIdList(String recipientIdList) {
|
||||
this.recipientIdList = recipientIdList;
|
||||
}
|
||||
|
||||
public String getWarningAppType() {
|
||||
return warningAppType;
|
||||
}
|
||||
|
||||
public void setWarningAppType(String warningAppType) {
|
||||
this.warningAppType = warningAppType;
|
||||
}
|
||||
|
||||
public String getSendAppName() {
|
||||
return sendAppName;
|
||||
}
|
||||
|
||||
public void setSendAppName(String sendAppName) {
|
||||
this.sendAppName = sendAppName;
|
||||
}
|
||||
|
||||
public String getReceiveAppName() {
|
||||
return receiveAppName;
|
||||
}
|
||||
|
||||
public void setReceiveAppName(String receiveAppName) {
|
||||
this.receiveAppName = receiveAppName;
|
||||
}
|
||||
|
||||
public String getReceiveApiName() {
|
||||
return receiveApiName;
|
||||
}
|
||||
|
||||
public void setReceiveApiName(String receiveApiName) {
|
||||
this.receiveApiName = receiveApiName;
|
||||
}
|
||||
|
||||
public String getReturnData() {
|
||||
return returnData;
|
||||
}
|
||||
|
||||
public void setReturnData(String returnData) {
|
||||
this.returnData = returnData;
|
||||
}
|
||||
|
||||
public String getReceiveApiCode() {
|
||||
return receiveApiCode;
|
||||
}
|
||||
|
||||
public void setReceiveApiCode(String receiveApiCode) {
|
||||
this.receiveApiCode = receiveApiCode;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.plugin.pushMessage.dao.impl.PushMessageDaoImpl">
|
||||
|
||||
<resultMap id="get-PushMessageEntity-result" type="com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity" >
|
||||
<result property="pushMessage" column="push_message" jdbcType="VARCHAR"/>
|
||||
<result property="warningAppCode" column="warning_app_code" jdbcType="VARCHAR"/>
|
||||
<result property="warningApiCode" column="warning_api_code" jdbcType="VARCHAR"/>
|
||||
<result property="appType" column="app_type" jdbcType="VARCHAR"/>
|
||||
<result property="recipientIdList" column="recipient_id_list" jdbcType="VARCHAR"/>
|
||||
<result property="sendAppName" column="send_app_name" jdbcType="VARCHAR"/>
|
||||
<result property="receiveAppName" column="receive_app_name" jdbcType="VARCHAR"/>
|
||||
<result property="receiveApiName" column="receive_api_name" jdbcType="VARCHAR"/>
|
||||
<result property="receiveApiCode" column="receive_api_code" jdbcType="VARCHAR"/>
|
||||
<result property="returnData" column="return_data" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-PushMessageEntity-result" parameterType = "com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity">
|
||||
SELECT
|
||||
warning_config.push_method,
|
||||
warning_config.sendAppid AS warning_app_code,
|
||||
warning_config.endApiCode AS warning_api_code,
|
||||
warning_config.app_type,
|
||||
warning_config.recipient_id AS recipient_id_list,
|
||||
log.send_app_name,
|
||||
log.receive_app_name,
|
||||
receive_api_name,
|
||||
log.receive_api_code,
|
||||
log.return_data,
|
||||
log.STATUS
|
||||
FROM
|
||||
v_hzya_sys_warning warning_config
|
||||
LEFT JOIN v_hzya_sys_send_message_log log ON warning_config.api_code = log.receive_api_code
|
||||
WHERE
|
||||
log.STATUS = '4'
|
||||
AND warning_config.push_method = '定时'
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.hzya.frame.plugin.pushMessage.plugin;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao;
|
||||
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
|
||||
import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService;
|
||||
import com.hzya.frame.sysnew.pushMessage.dao.ISysPushMessageDao;
|
||||
import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity;
|
||||
import com.hzya.frame.sysnew.pushMessage.service.ISysPushMessageService;
|
||||
import com.hzya.frame.sysnew.sendMessageLog.service.ISysSendMessageLogService;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service("PushMessagePluginInitializer")
|
||||
public class PushMessagePluginInitializer extends PluginBaseEntity {
|
||||
Logger logger = LoggerFactory.getLogger(PushMessagePluginInitializer.class);
|
||||
|
||||
@Autowired
|
||||
private ISysPushMessageDao sysPushMessageDao;
|
||||
|
||||
@Resource
|
||||
public ISysSendMessageLogService sysSendMessageLogService;
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "PushMessagePlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "PushMessagePlugin插件";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "PushMessagePlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||
try {
|
||||
logger.info("======开始执行定时消息推送========");
|
||||
//目前只查询一周内的异常日志进行消息推送
|
||||
List<SysPushMessageEntity> list = sysPushMessageDao.getAll();
|
||||
|
||||
for(SysPushMessageEntity entity : list){
|
||||
sysSendMessageLogService.sendMessage(entity);
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("定时推送消息成功");
|
||||
}catch (Exception e){
|
||||
logger.info("======执行定时消息推送失败:{}========",e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.hzya.frame.plugin.pushMessage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
public interface IPushMessageService extends IBaseService<PushMessageEntity, String> {
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.hzya.frame.plugin.pushMessage.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao;
|
||||
import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity;
|
||||
import com.hzya.frame.plugin.pushMessage.service.IPushMessageService;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PushMessageServiceImpl extends BaseService<PushMessageEntity, String> implements IPushMessageService {
|
||||
|
||||
private IPushMessageDao pushMessageDao;
|
||||
|
||||
@Autowired
|
||||
public void setPushMessageDao(IPushMessageDao dao) {
|
||||
this.pushMessageDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
}
|
|
@ -19,6 +19,11 @@ spring:
|
|||
savefile:
|
||||
# 文件保存路径
|
||||
path: /home/webservice/zt/file
|
||||
# path: D:\webservice\file
|
||||
# pluginpath: D:\webservice\plugin
|
||||
pluginpath: /home/webservice/zt/plugin
|
||||
# tomcatpath: D:\apache-tomcat-9.0.69\webapps\kangarooDataCenter\WEB-INF\classes\
|
||||
tomcatpath: /home/webservice/zt/tomcatV3/webapps/kangarooDataCenterV3/WEB-INF/classes/
|
||||
cbs8:
|
||||
appId: 1P4AGrpz
|
||||
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
|
|
@ -12,11 +12,11 @@ spring:
|
|||
dynamic:
|
||||
datasource:
|
||||
master:
|
||||
# url: jdbc:mysql://hzya.ufyct.com:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
# url: jdbc:mysql://ufidahz.com.cn:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
# username: root
|
||||
# password: bd993088e8a7c3dc5f44441617f9b4bf
|
||||
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||
url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
username: root
|
||||
password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
|
@ -8,6 +8,14 @@ logging:
|
|||
# 日志保存路径
|
||||
path: /Users/apple/Desktop/log/local
|
||||
spring:
|
||||
data:
|
||||
mongodb:
|
||||
# host: 192.168.2.237
|
||||
# port: 27017
|
||||
# database: businesscenter
|
||||
# auto-index-creation: true
|
||||
# password: hzya1314
|
||||
# username: hzya
|
||||
flyway:
|
||||
# 启动flyway migration, 默认为true
|
||||
enabled: false
|
||||
|
@ -34,8 +42,10 @@ spring:
|
|||
savefile:
|
||||
# 文件保存路径
|
||||
path: /Users/apple/Desktop/log/local
|
||||
tomcatpath: /Users/apple/Desktop/log/local
|
||||
pluginpath: /Users/apple/Desktop/log/local
|
||||
zt:
|
||||
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
|
||||
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface
|
||||
cbs8:
|
||||
appId: 1P4AGrpz
|
||||
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
|
||||
|
@ -50,3 +60,23 @@ cbs8:
|
|||
elec_path: /Users/xiangerlin/Downloads/
|
||||
OA:
|
||||
data_source_code: yc_oa
|
||||
server:
|
||||
port: 10086
|
||||
|
||||
# mysqldump -d mylm -hhzya.ufyct.com -p9096 -uroot -phzya1314 >%dirName%\table_view.sql
|
||||
|
||||
|
||||
database:
|
||||
databaseName: businesscenter
|
||||
host: 192.168.2.237
|
||||
port: 3306
|
||||
username: root
|
||||
password: hzya@1314
|
||||
filePase: /Users/apple/Desktop/log
|
||||
fileName: data.sql
|
||||
#sftp:
|
||||
# host: 192.168.2.237
|
||||
# port: 9091
|
||||
# username: cs237
|
||||
# password: hzya@1314
|
||||
# filePase: /databaseBack
|
|
@ -12,7 +12,7 @@ spring:
|
|||
dynamic:
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
username: root
|
||||
password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
|
@ -0,0 +1,23 @@
|
|||
#######################本地环境#######################
|
||||
logging:
|
||||
#日志级别 指定目录级别
|
||||
level:
|
||||
root: info
|
||||
encodings: UTF-8
|
||||
file:
|
||||
# 日志保存路径
|
||||
path: /Users/xiangerlin/work/app/logs/dev
|
||||
spring:
|
||||
datasource:
|
||||
dynamic:
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
username: root
|
||||
password: bd993088e8a7c3dc5f44441617f9b4bf
|
||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||
savefile:
|
||||
# 文件保存路径
|
||||
path: /Users/xiangerlin/work/app/file/dev
|
||||
pluginpath: /Users/xiangerlin/work/app/file/dev
|
||||
tomcatpath: /Users/xiangerlin/work/app/file/dev
|
|
@ -39,7 +39,7 @@
|
|||
# dynamic:
|
||||
# datasource:
|
||||
# master:
|
||||
# url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
# url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
# username: root
|
||||
# password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||
# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||
|
@ -67,7 +67,7 @@ spring:
|
|||
filters: stat,log4j2
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
|
||||
url: jdbc:dm://ufidahz.com.cn:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
|
||||
username: hzyazt
|
||||
password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||
driver-class-name: dm.jdbc.driver.DmDriver
|
|
@ -12,7 +12,7 @@ spring:
|
|||
dynamic:
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://hzya.ufyct.com:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
url: jdbc:mysql://ufidahz.com.cn:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
username: root
|
||||
password: bd993088e8a7c3dc5f44441617f9b4bf
|
||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
|
@ -12,7 +12,7 @@ spring:
|
|||
dynamic:
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
username: root
|
||||
password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
|
@ -12,7 +12,7 @@ spring:
|
|||
dynamic:
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://hzya.ufyct.com:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
url: jdbc:mysql://ufidahz.com.cn:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
username: root
|
||||
password: bd993088e8a7c3dc5f44441617f9b4bf
|
||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
|
@ -1,4 +1,4 @@
|
|||
#######################本地环境#######################
|
||||
#######################zqtlocal环境#######################
|
||||
logging:
|
||||
#日志级别 指定目录级别
|
||||
level:
|
||||
|
@ -6,19 +6,21 @@ logging:
|
|||
encodings: UTF-8
|
||||
file:
|
||||
# 日志保存路径
|
||||
path: /Users/xiangerlin/work/app/logs/ydc
|
||||
path: D:/local/logs/
|
||||
spring:
|
||||
datasource:
|
||||
dynamic:
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://hzya.ufyct.com:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
username: root
|
||||
password: 62e4295b615a30dbf3b8ee96f41c820b
|
||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||
savefile:
|
||||
# 文件保存路径
|
||||
path: /Users/xiangerlin/work/app/logs/ydc
|
||||
path: D:/local/upload/
|
||||
pluginpath : D:/local/plugin/
|
||||
tomcatpath: E:\apache-tomcat-9.0.27\webapps\kangarooDataCenterV3\WEB-INF\classes\
|
||||
cbs8:
|
||||
appId: 1P4AGrpz
|
||||
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
|
||||
|
@ -28,8 +30,10 @@ cbs8:
|
|||
# 这个私钥到时候上传到cbs,和下面到是同一对
|
||||
#ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
|
||||
ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
|
||||
cbs_public_key: 0469146F06BF3B01236E84632441E826F3067A6B93BC3839C836A06007869CD351FBBE388B51F742859388BBC1DE089923AAFBC69E448F15141DDF30EE6CE90185
|
||||
cbs_public_key: 0469146F06BF3B01236E84632441E826
|
||||
#电子回单下载临时存放位置
|
||||
elec_path: /Users/xiangerlin/Downloads/
|
||||
OA:
|
||||
data_source_code: yc-test
|
||||
data_source_code: yc_oa
|
||||
zt:
|
||||
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface
|
|
@ -1,11 +1,13 @@
|
|||
server:
|
||||
port: 9999
|
||||
port: 10086
|
||||
servlet:
|
||||
context-path: /kangarooDataCenterV3
|
||||
localIP: 127.0.0.1
|
||||
tomcat:
|
||||
uri-encoding: utf-8
|
||||
spring:
|
||||
autoconfigure:
|
||||
exclude: org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration
|
||||
flyway:
|
||||
# 启动flyway migration, 默认为true
|
||||
enabled: true
|
||||
|
@ -91,7 +93,7 @@ mybatis-plus:
|
|||
db-config:
|
||||
id-type: auto # 主键策略
|
||||
zt:
|
||||
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
|
||||
url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface
|
||||
#JimuReport[minidao配置]
|
||||
minidao :
|
||||
base-package: org.jeecg.modules.jmreport.desreport.dao*
|
||||
|
@ -124,3 +126,17 @@ jeecg :
|
|||
bucketName: ??
|
||||
data:
|
||||
use: true
|
||||
database:
|
||||
databaseName:
|
||||
host:
|
||||
port:
|
||||
username:
|
||||
password:
|
||||
filePase:
|
||||
fileName:
|
||||
sftp:
|
||||
host:
|
||||
port:
|
||||
username:
|
||||
password:
|
||||
filePase:
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>BackUpDatabasePlugin</id>
|
||||
<name>BackUpDatabasePlugin插件</name>
|
||||
<category>20241021</category>
|
||||
</plugin>
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="seeyonExtPluginInitializer" class="com.hzya.frame.plugin.seeyonExt.plugin.SeeyonExtPluginInitializer" />
|
||||
<bean name="backUpDatabaseInitializer" class="com.hzya.frame.plugin.BackUpDatabase.plugin.BackUpDatabaseInitializer" />
|
||||
</beans>
|
|
@ -1,4 +1,4 @@
|
|||
INSERT INTO sys_application (id, app_logo, app_status, name, version_number, access_mode, affiliation_field, manufacturer, app_introduction, client_path, app_id, system_address, web_path, program_path, public_key, secret_key, interface_address, interface_status, app_type, db_status, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id) VALUES ('82bd4293fda94d6896217509f11b6c4c', '-7421991978796695038', '1', '数智中台', '1.0', '[\"1\"]', '1', '用安', '默认应用', NULL, 800004, NULL, NULL, NULL, 'ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj', 'fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=', 'http://hzya.ufyct.com:9067/', '1', '', '2', 6, NULL, 'Y', '2023-10-20 11:49:23', 'c796fd9ba4c9f5ff3cc2fa41a040e443', '2024-06-21 10:35:03', '1');
|
||||
INSERT INTO sys_application (id, app_logo, app_status, name, version_number, access_mode, affiliation_field, manufacturer, app_introduction, client_path, app_id, system_address, web_path, program_path, public_key, secret_key, interface_address, interface_status, app_type, db_status, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id) VALUES ('82bd4293fda94d6896217509f11b6c4c', '-7421991978796695038', '1', '数智中台', '1.0', '[\"1\"]', '1', '用安', '默认应用', NULL, 800004, NULL, NULL, NULL, 'ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj', 'fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=', 'http://ufidahz.com.cn:9067/', '1', '', '2', 6, NULL, 'Y', '2023-10-20 11:49:23', 'c796fd9ba4c9f5ff3cc2fa41a040e443', '2024-06-21 10:35:03', '1');
|
||||
|
||||
INSERT INTO sys_application_api (id, api_code, api_path, api_status, app_id, catalogue_id, api_name, api_remark, need_Login, authentication_port, parameter_passing_mode, destination_address, request_coding, request_method, timeout_period, current_limiting, header_in, query_in, body_in_type, body_in, body_out, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, bean_name, fun_name, extension_api, return_success_field, return_success_value, return_msg) VALUES ('01b8d8e2bc724e22a511afda7c12a610', 8000040010, NULL, '1', '82bd4293fda94d6896217509f11b6c4c', '56c766d53d9f4de2846a16b1383c5374', '客商删除', NULL, '2', NULL, '1', 'kangarooDataCenterV3/entranceController/platformInterface', '1', '1', '10000', '100', '[]', '[]', '1', '[{\"id\":\"a7be5a9e-62eb-47f2-ab86-72bcf75b0396\",\"parameterName\":\"body\",\"first\":true}]', '[]', 181, '1', '2024-04-26 10:20:30', '1', '2024-04-26 10:20:30', 'Y', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO sys_application_api (id, api_code, api_path, api_status, app_id, catalogue_id, api_name, api_remark, need_Login, authentication_port, parameter_passing_mode, destination_address, request_coding, request_method, timeout_period, current_limiting, header_in, query_in, body_in_type, body_in, body_out, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, bean_name, fun_name, extension_api, return_success_field, return_success_value, return_msg) VALUES ('0bddf53ab22c48d288384f3fa1b06c22', 8000040015, NULL, '1', '82bd4293fda94d6896217509f11b6c4c', '56c766d53d9f4de2846a16b1383c5374', '存货分类修改', NULL, '2', NULL, '1', 'kangarooDataCenterV3/entranceController/platformInterface', '1', '1', '10000', '100', '[]', '[]', '1', '[{\"id\":\"41255cc5-66cd-4d43-a21d-8d0f504e5e60\",\"parameterName\":\"body\",\"first\":true}]', '[]', 186, '1', '2024-04-28 13:56:06', '1', '2024-04-28 13:56:06', 'Y', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
@ -35,7 +35,7 @@ INSERT INTO sys_application_api_type (id, app_id, name, sorts, org_id, sts, crea
|
|||
INSERT INTO sys_application_api_type (id, app_id, name, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id) VALUES ('a15437331f7a4cb4895545742547d192', '82bd4293fda94d6896217509f11b6c4c', '档案对照', 52, NULL, 'Y', '2024-05-08 09:22:13', '1', '2024-05-08 09:22:13', '1');
|
||||
|
||||
|
||||
INSERT INTO sys_application_database (id, app_id, source_code, source_name, source_type, source_ip, source_port, login_name, password, db_name, service_name, db_status, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) VALUES ('c11bfa04c7384bd98d3e08566130fc4b', '82bd4293fda94d6896217509f11b6c4c', 'oldData', 'V2数据源', '3', 'hzya.ufyct.com', '9096', 'root', 'bd993088e8a7c3dc5f44441617f9b4bf', 'businesscenter', NULL, '2', 1, '1', '2024-05-13 13:54:12', '1', '2024-06-21 10:35:03', 'Y', NULL);
|
||||
INSERT INTO sys_application_database (id, app_id, source_code, source_name, source_type, source_ip, source_port, login_name, password, db_name, service_name, db_status, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) VALUES ('c11bfa04c7384bd98d3e08566130fc4b', '82bd4293fda94d6896217509f11b6c4c', 'oldData', 'V2数据源', '3', 'ufidahz.com.cn', '9096', 'root', 'bd993088e8a7c3dc5f44441617f9b4bf', 'businesscenter', NULL, '2', 1, '1', '2024-05-13 13:54:12', '1', '2024-06-21 10:35:03', 'Y', NULL);
|
||||
|
||||
INSERT INTO sys_application_plugin (id, app_id, plugin_name, plugin_code, plugin_version, plugin_remark, release_date, plugin_status, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) VALUES ('11fb9d8434c04660a88527cf097c579b', '82bd4293fda94d6896217509f11b6c4c', '测试定时任务', 'SysMessageManageLogPlugin', '1.0', '测试定时任务', '2024-05-01 00:00:00', '1', 3, '1', '2024-05-07 14:32:57', '1', '2024-05-07 14:32:57', 'Y', NULL);
|
||||
INSERT INTO sys_application_plugin (id, app_id, plugin_name, plugin_code, plugin_version, plugin_remark, release_date, plugin_status, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) VALUES ('b7e0020d9ff7435196862bfa62d9ff40', '82bd4293fda94d6896217509f11b6c4c', '主数据抽取', 'MdmCustomerPlugin', '1', NULL, '2024-06-25 00:00:00', '1', 15, '1', '2024-06-25 14:45:47', '1', '2024-06-25 14:45:47', 'Y', NULL);
|
|
@ -0,0 +1,146 @@
|
|||
package com.hzya.frame;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.util.AESUtil;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPut;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName dsasas
|
||||
* @Description
|
||||
* @Author llg
|
||||
* Date 2023/7/16 8:18 上午
|
||||
*/
|
||||
//@RunWith(SpringRunner.class)
|
||||
//@SpringBootTest(classes = {WebappApplication.class})
|
||||
public class temButtom {
|
||||
|
||||
@Test
|
||||
public void test01() {
|
||||
String a = AESUtil.encrypt("hzya@1314");
|
||||
System.out.println(a);
|
||||
String b = AESUtil.decrypt("62e4295b615a30dbf3b8ee96f41c820b");
|
||||
System.out.println(b);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test02() {
|
||||
// 1056162015172640840 -7858803986346327947 3178176833471791293 合同评审-待办测试(bdmanager 2024-10-22 16:45) 7743552636545550897 bdmanager 18058147870 pending start success 新增成功!
|
||||
// success 更新待办为已办成功!
|
||||
// task7803207f54ff047d6008dcce31c2628f 新增成功!
|
||||
// 2024-10-24 2024-10-24
|
||||
|
||||
String phone ="19357235324";
|
||||
String taskid ="task8b0c7ca72439bc9b0c1c89e8866c8275";
|
||||
//token
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
String token ="https://oapi.dingtalk.com/gettoken?appkey=dingxewtjaserj292ggu&appsecret=DuRw6EEEvhGXfr6Q8wN_x4025qKjrffIGCXF9KeCKKIID-LVSsR6_8KWMei6sug1";
|
||||
String body = sendGet(token,headers);
|
||||
JSONObject tokenobject = JSONObject.parseObject(body);
|
||||
|
||||
//钉钉id
|
||||
headers = new HashMap<>();
|
||||
//https://oapi.dingtalk.com/user/get_by_mobile?access_token=9abd3996cb103ba48dd8c69fea5473e7&mobile=15700100840
|
||||
String ddid ="https://oapi.dingtalk.com/user/get_by_mobile?access_token="+tokenobject.get("access_token")+"&mobile="+phone;
|
||||
String ddidbody = sendGet(ddid,headers);
|
||||
JSONObject ddidobject = JSONObject.parseObject(ddidbody);
|
||||
|
||||
//人员id
|
||||
headers = new HashMap<>();
|
||||
//https://oapi.dingtalk.com/user/get?userid=111336474727636213&access_token=3d21a6614fb037a98542a537336e8149
|
||||
String userid ="https://oapi.dingtalk.com/user/get?userid="+ddidobject.get("userid")+"&access_token="+tokenobject.get("access_token");
|
||||
String useridbody = sendGet(userid,headers);
|
||||
JSONObject useridobject = JSONObject.parseObject(useridbody);
|
||||
|
||||
|
||||
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
HttpPut httpPut = new HttpPut("https://api.dingtalk.com/v1.0/todo/users/"+useridobject.get("unionid")+"/tasks/"+taskid);
|
||||
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000).setConnectionRequestTimeout(35000).setSocketTimeout(60000).build();
|
||||
httpPut.setConfig(requestConfig);
|
||||
httpPut.setHeader("Content-type", "application/json");
|
||||
httpPut.setHeader("x-acs-dingtalk-access-token", tokenobject.getString("access_token"));
|
||||
Map<String, Object> dataMap = new HashMap();
|
||||
dataMap.put("done", true);
|
||||
CloseableHttpResponse httpResponse = null;
|
||||
|
||||
try {
|
||||
httpPut.setEntity(new StringEntity("{\"done\": true}"));
|
||||
httpResponse = httpClient.execute(httpPut);
|
||||
HttpEntity entity = httpResponse.getEntity();
|
||||
String results = EntityUtils.toString(entity);
|
||||
System.out.println(results);
|
||||
} catch (Exception var15) {
|
||||
} finally {
|
||||
try {
|
||||
httpResponse.close();
|
||||
httpClient.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private String sendGet(String url, Map<String, String> headers) {
|
||||
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
|
||||
// HttpClient
|
||||
CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build();
|
||||
HttpGet get = new HttpGet(url.toString());
|
||||
CloseableHttpResponse response = null;
|
||||
|
||||
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(60000).build();
|
||||
get.setConfig(requestConfig);//设置请求参数【超时时间】
|
||||
if (headers != null && headers.size() > 0) {
|
||||
for (String key : headers.keySet()) {
|
||||
get.setHeader(key, headers.get(key));
|
||||
}
|
||||
}
|
||||
StringBuilder body = new StringBuilder();
|
||||
|
||||
try {
|
||||
|
||||
response = closeableHttpClient.execute(get);
|
||||
HttpEntity entity = response.getEntity();
|
||||
body.append(EntityUtils.toString(entity,"UTF-8"));
|
||||
} catch (Exception e) {
|
||||
body.append(e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
// 关闭响应对象
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
// 关闭响应对象
|
||||
if (closeableHttpClient != null) {
|
||||
closeableHttpClient.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return body.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -8,8 +8,9 @@
|
|||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>common</artifactId>
|
||||
<artifactId>base-common</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>${revision}</version>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue