Compare commits

...

148 Commits
kunb ... master

Author SHA1 Message Date
xiang2lin a14706e2a3 联查连接器相关字段 2025-05-12 13:46:43 +08:00
xiang2lin bd9c7b166d 增加nifi字段 2025-05-12 13:46:04 +08:00
xiang2lin a0ab2e87ba 分类权限 2025-05-12 13:45:33 +08:00
xiang2lin 3796a24b94 应用账户 2025-05-12 13:44:58 +08:00
xiang2lin 97840df6a1 流程 2025-05-09 17:38:53 +08:00
xiang2lin adb4a566d4 查询数据字典方法 2025-05-09 17:38:34 +08:00
xiang2lin 257e7c2235 增加联查sys_flow模块的sql 2025-05-09 15:44:55 +08:00
xiang2lin bfd18dce39 增加flow_id字段 2025-05-08 08:50:07 +08:00
xiang2lin 70c6f8adf3 增加flow_id字段 2025-05-08 08:48:18 +08:00
xiang2lin 6e3a47706a crud接口调整 2025-05-07 14:28:48 +08:00
xiang2lin 4c40538ae1 本地配置 2025-05-06 09:31:34 +08:00
xiang2lin 234a2e4efb 连接器代码提交 2025-05-06 09:31:02 +08:00
xiang2lin d2c824e64d 绑定系统字段调整,update方法时 不处理create_user_id和create_time字段 2025-04-29 18:18:27 +08:00
xiang2lin d9feee5a28 本地配置 2025-04-28 16:19:13 +08:00
lvleigang 6b0232e12d post转发ssl认证去除 2025-02-18 16:36:56 +08:00
lvleigang f9b2ebaa7f 修改下发like拼接方法 2024-12-19 14:08:08 +08:00
lvleigang ffb86f43fa esb文件上传 2024-12-09 15:45:16 +08:00
lvleigang f73d39fe1c 主数据修改状态逻辑修改 2024-11-13 10:49:00 +08:00
lvleigang 5a63afd7d8 修改转发描述 2024-11-07 10:03:03 +08:00
lvleigang 21007598a9 钉钉代办更新 2024-10-24 15:02:47 +08:00
lvleigang c943cd82fb 自动数据库备份,备份后用sftp上传 2024-10-22 14:33:30 +08:00
xiang2lin ed5d7fff69 feat: token名字变更,由token变更为zt-token 2024-09-30 11:20:30 +08:00
lvleigang 1d979524f3 Merge branch 'master' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 2024-09-25 16:52:07 +08:00
lvleigang 23d06b59bb 集成任务添加状态字段 2024-09-25 16:52:00 +08:00
username 5eea8dfb96 消息模块,历史消息按推送时间排序 2024-09-25 16:15:11 +08:00
xiang2lin 90386c59a5 fix: 调用完根据授权码获取用户信息后 解析返回报文错误修改 2024-09-25 15:26:41 +08:00
xiang2lin aa591dc1ff fix: 调用完根据授权码获取用户信息后 解析返回报文错误修改 2024-09-25 15:19:16 +08:00
username ae266436d9 插件管理增加插件类型、集成任务日志明细根据插件类型分类任务名称 2024-09-24 16:17:58 +08:00
xiang2lin 62cf866111 删除fw-weixin在master上的代码 2024-09-24 11:36:23 +08:00
xiang2lin 351a7e7a7a fix: 注释 fw-weixin的引用 2024-09-24 11:34:27 +08:00
xiang2lin 5f6648144c fix:
去掉没用的依赖
2024-09-24 11:16:02 +08:00
xiang2lin f582a9601c feat: 添加子模块fw-weixin 2024-09-24 11:13:13 +08:00
xiang2lin c398ecde8b feat: 依赖fw-weixin 2024-09-24 11:12:43 +08:00
xiang2lin 0baa4e0bf3 feat: 企业微信单点登录 2024-09-24 11:11:38 +08:00
xiang2lin 3bddc46c9a fix:授权码接口默认设置token 2024-09-24 10:33:12 +08:00
xiang2lin 5ff781e133 feat: 企业微信接口 2024-09-24 08:56:49 +08:00
lvleigang cff92f2399 修改master依赖 2024-09-24 08:54:44 +08:00
lvleigang a778197694 修改适配钉钉单点登录 2024-09-20 15:50:29 +08:00
lvleigang 61b0cdfaee 主数据显示查看数据格式功能 2024-09-20 09:54:27 +08:00
lvleigang fa2583176e Merge branch 'master' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 2024-09-19 08:39:09 +08:00
username 165e548056 消息推送模块代码更新 2024-09-18 16:51:20 +08:00
lvleigang d9405aad90 dev默认端口修改为10086,同步修改代码获取url地址方法 2024-09-14 16:59:04 +08:00
476474485@qq.com 2874005465 Merge remote-tracking branch 'origin/master' 2024-09-14 16:58:03 +08:00
476474485@qq.com 6e0b588959 解决移动端跨域问题 2024-09-14 16:57:45 +08:00
lvleigang 55aa4c4a92 dev默认端口修改为10086,同步修改代码获取url地址方法 2024-09-14 16:30:05 +08:00
476474485@qq.com 44fb1eaca1 编写移动端钉钉登录 2024-09-14 15:21:44 +08:00
lvleigang f0db5772a2 master分支结构上传 2024-09-14 08:52:25 +08:00
lvleigang 482f0533c4 修改结构是否可以启动 2024-09-13 11:26:12 +08:00
lvleigang 6e6d219719 修改结构是否可以启动 2024-09-13 11:25:17 +08:00
lvleigang 0e471d20a3 修改结构 2024-09-13 09:45:32 +08:00
lvleigang f33447e4f2 修改结构 2024-09-12 14:28:07 +08:00
lvleigang cb58463319 修改结构 2024-09-12 14:27:30 +08:00
lvleigang 504c9e54c0 修改主数据保存信息 2024-09-11 14:07:03 +08:00
lvleigang 54867aee2c Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-09-11 14:05:20 +08:00
lvleigang 17518aa2d4 修改主数据保存信息 2024-09-11 14:04:44 +08:00
yuqh 916a133c0c OA无流程表单公用删除接口 2024-09-10 08:45:52 +08:00
lvleigang d6bdd3605f u8c封装接口,测试修改 2024-09-09 17:32:47 +08:00
lvleigang c78e10f059 esb添加消息推送方法 2024-09-09 14:20:48 +08:00
lvleigang 7af6143514 Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-09-09 11:57:03 +08:00
username 927f8c5a7b 推送消息日志记录 2024-09-07 16:30:36 +08:00
username c2ad1e3ea3 预警配置,预警接口,定时插件推送消息,消息模版配置,推送消息日志 2024-09-07 16:13:21 +08:00
username 24ab9a9dc1 Revert "预警配置,预警接口,定时插件推送消息,消息模版配置,推送消息日志"
This reverts commit 37b66cee8b.
2024-09-07 16:07:53 +08:00
username 37b66cee8b 预警配置,预警接口,定时插件推送消息,消息模版配置,推送消息日志 2024-09-07 16:02:27 +08:00
username 07d8962046 预警配置,定时插件推送消息,消息模版配置,推送消息日志 2024-09-07 14:12:25 +08:00
lvleigang 4391df3e02 u8c封装接口 2024-09-06 11:15:55 +08:00
lvleigang 9b514c36e9 Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-09-06 10:09:29 +08:00
xiang2lin 1f2d0584e2 钉钉接口
2024年9月5日16:00:12
xel
2024-09-05 16:00:23 +08:00
lvleigang 5e7975ec5e Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-09-04 16:16:42 +08:00
lvleigang a3da542b56 u8c封装接口 2024-09-04 16:16:35 +08:00
xiang2lin ad23819b59 测试类
2024年9月4日14:21:28
2024-09-04 14:21:33 +08:00
xiang2lin 798dfbd3f1 增加mdm_up_id
通用接口保存树形结构数据时要用这个字段绑定上下级关系
2024年9月4日14:19:30
2024-09-04 14:19:36 +08:00
xiang2lin 38d1b88bd1 Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-09-04 14:13:40 +08:00
lvleigang a068e1a434 修改转发的日志请求级别 2024-09-04 09:37:11 +08:00
hecan 96cb15eeff 显示类型为组织树时候,展示和新增组织树 2024-09-03 09:10:43 +08:00
xiang2lin f5b69825dc @Value注解配置修改
2024年8月26日10:10:06
2024-09-02 15:54:23 +08:00
xiang2lin bc37dab6d0 XEL配置文件
2024年8月22日09:37:00
2024-09-02 15:54:23 +08:00
username 2651fecbe9 Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-08-29 15:08:18 +08:00
username a1b601a41d 首页异常日志预警,异常日志重新推送功能 2024-08-29 15:08:08 +08:00
hecan 9e54b38c9a 返回return 2024-08-28 18:26:53 +08:00
hecan ef85056b11 先查询是否存在,存在则更新 2024-08-28 14:06:50 +08:00
lvleigang a7b25fa268 修改图标判断方法 2024-08-28 11:00:11 +08:00
lvleigang 45d37f1339 修改主数据生成菜单目录id 2024-08-28 10:19:42 +08:00
hecan 4da74d01ca Merge remote-tracking branch 'origin/dev' into dev 2024-08-27 15:16:10 +08:00
hecan 4c50b026f8 根据凭证号查询指标 2024-08-27 15:11:56 +08:00
username ef5d366074 插件附件上传、插件附件下载、插件发布、插件撤回 2024-08-27 14:43:34 +08:00
username 3ac8fbf8aa Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-08-27 13:52:58 +08:00
username 6836a3e230 插件附件上传、插件附件下载、插件发布、插件撤回 2024-08-27 13:52:46 +08:00
lvleigang 1e31b472d2 mongodb初始化注销 2024-08-23 15:11:21 +08:00
lvleigang ce177ef4b5 Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev
 Conflicts:
	buildpackage/src/main/resources/application-llg.yml
2024-08-23 15:07:55 +08:00
lvleigang 2eaafe65d5 mongodb初始化注销 2024-08-23 15:06:36 +08:00
476474485@qq.com 3d6a292ae9 调整公司外网数据库连接 2024-08-23 14:01:39 +08:00
lvleigang 43f01064ee 修改数据查询,匹配sqlservice 2024-08-22 11:10:26 +08:00
lvleigang 442f0f452c Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-08-22 08:51:41 +08:00
lvleigang 0d67875878 mongodb测试类使用 2024-08-22 08:51:33 +08:00
lvleigang 88bd9c5e0e mongodb测试类使用 2024-08-22 08:51:20 +08:00
xiang2lin 472484d8c6 查询语句queryOerDjml 增加 djlxid字段
2024年8月21日18:14:00
2024-08-21 18:14:45 +08:00
xiang2lin 1ec337f22a 差旅报销单修改
2024年8月21日 17:56:16
2024-08-21 17:57:08 +08:00
lvleigang bd7b4fd77d mongodb 2024-08-20 17:17:25 +08:00
xiang2lin 2379d9dd7a 保存方法增加 ssrq字段
2024年8月20日14:51:34
2024-08-20 14:52:15 +08:00
xiang2lin 432abf3943 差旅报销单
2024年8月20日 14:22:10
2024-08-20 14:22:51 +08:00
lvleigang 2f93dded99 报销接口编写 2024-08-19 17:58:43 +08:00
xiang2lin 0a5a589c36 Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-08-19 17:24:02 +08:00
xiang2lin 197762e530 报销单参数组装
2024年8月19日 17:23:44
2024-08-19 17:23:53 +08:00
hecan a3acc9a1d1 操作日志,指标来源,辅助项资料,文号 2024-08-19 17:20:54 +08:00
hecan 4ac86bfe86 Merge remote-tracking branch 'origin/dev' into dev 2024-08-19 17:10:58 +08:00
hecan 3aeb5699a9 指标项目表 2024-08-19 17:10:17 +08:00
xiang2lin c6735a739e 增加差旅相关字段
2024年8月19日 17:06:01
2024-08-19 17:06:08 +08:00
lvleigang 5e4d290f27 Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-08-19 16:55:04 +08:00
lvleigang d1e416aa2c 报销接口添加字段 2024-08-19 16:54:44 +08:00
hecan cc3380766a 职员接口中增加数据源编码 2024-08-19 16:23:01 +08:00
hecan 33e3737728 调整部门修改接口 2024-08-19 16:22:14 +08:00
hecan 35be2fc876 预算指标增删改接口 2024-08-19 16:19:24 +08:00
hecan b3b70f9990 Merge branch 'dev' of http://192.168.2.237:3000/root/kangarooDataCenterV3 into dev
# Conflicts:
#	service/src/main/java/com/hzya/frame/grpU8/nxproof/oeryszb/dao/IOerYszbDao.java
#	service/src/main/java/com/hzya/frame/grpU8/nxproof/oeryszb/dao/impl/OerYszbDaoImpl.java
2024-08-19 16:13:02 +08:00
hecan 776b5804dc 预算指标增删改接口 2024-08-19 16:12:10 +08:00
yuqh d808021db1 基础数据初始化SQL 2024-08-19 10:58:13 +08:00
lvleigang 885b0e4d28 报销接口编写,添加事物 2024-08-19 09:17:09 +08:00
lvleigang 0e717cd182 报销接口编写 2024-08-16 17:35:15 +08:00
xiang2lin 1a299b15f1 增加附件对象
2024年8月16日15:31:58
2024-08-16 15:32:06 +08:00
lvleigang 58b61fd613 报销接口编写 2024-08-16 15:24:25 +08:00
lvleigang 5ad6cff94b Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-08-16 15:23:25 +08:00
xiang2lin 4fb8ae52a7 查询协同附件列表返回对象
2024年8月16日 15:20:49
2024-08-16 15:20:56 +08:00
lvleigang 2f2dee7613 Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-08-16 15:15:11 +08:00
xiang2lin 7b39bfadb5 差旅报销单
2024年8月16日 15:14:15
2024-08-16 15:14:33 +08:00
lvleigang ac9205418d Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-08-16 15:11:53 +08:00
lvleigang ef9ad4727a 报销接口编写修改 2024-08-16 15:11:45 +08:00
xiang2lin c1aaa48771 删除没用的代码
2024年8月16日14:00:54
2024-08-16 14:01:06 +08:00
xiang2lin 1276832742 Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-08-16 13:57:57 +08:00
xiang2lin 512ccb5157 附件上传
2024年8月16日 13:56:42
2024-08-16 13:56:51 +08:00
lvleigang aa124c9657 Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev 2024-08-16 13:54:17 +08:00
lvleigang b07e646333 报销接口编写 2024-08-16 13:53:59 +08:00
xiang2lin 2a49ba7221 增加summaryId字段
2024年8月16日 11:45:00
2024-08-16 11:45:06 +08:00
xiang2lin c7c53a65a3 附件上传
2024年8月16日 11:42:20
2024-08-16 11:43:34 +08:00
xiang2lin 47cd2a538d grp报销单
/2024年8月16日 11:38:10
2024-08-16 11:39:55 +08:00
xiang2lin 86d4bf5d53 处理冲突
2024年8月15日 17:31:26
2024-08-15 17:31:36 +08:00
xiang2lin b125e46f9b Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev
# Conflicts:
#	service/src/main/java/com/hzya/frame/grpU8/nxproof/oerdjml/entity/OerDjmlEntity.java
2024-08-15 17:29:55 +08:00
xiang2lin 47d8ae286f 差旅报销单
2024年8月15日 17:27:26
2024-08-15 17:27:36 +08:00
lvleigang 1d5ffd0854 报销接口编写 2024-08-15 16:44:37 +08:00
xiang2lin 58f18f6ac1 增加差旅费字段
2024年8月15日 14:05:52
2024-08-15 14:05:57 +08:00
lvleigang 883c388d9f 报销接口编写,esb转发修改校验规则 2024-08-15 14:00:52 +08:00
xiang2lin 3c6cd595ca 组装参数方法
2024年8月15日 11:43:41
2024-08-15 11:43:46 +08:00
xiang2lin 4612125c75 流程事件
2024年8月15日 11:02:13
2024-08-15 11:02:44 +08:00
xiang2lin 66ad9e41d2 Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev
# Conflicts:
#	service/src/main/java/com/hzya/frame/grpU8/nxproof/oerdjml/service/IOerDjmlService.java
#	service/src/main/java/com/hzya/frame/grpU8/nxproof/oerdjml/service/impl/OerDjmlServiceImpl.java
2024-08-15 10:56:48 +08:00
xiang2lin 9dabf05268 保存前组装参数方法
2024年8月15日 10:53:59
2024-08-15 10:54:09 +08:00
lvleigang e02a6114ed Merge branch 'dev' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dev
 Conflicts:
	service/src/main/java/com/hzya/frame/grpU8/nxproof/oerdjml/entity/OerDjmlEntity.java
2024-08-15 10:20:20 +08:00
lvleigang 6eb4dd9908 报销接口编写,esb转发修改校验规则 2024-08-15 10:18:00 +08:00
xiang2lin dce400eb37 增加差旅费字段
2024年8月15日 08:40:57
2024-08-15 08:41:04 +08:00
xiang2lin cdacfbc9bf 增加差旅报销单用到的字段
2024年8月15日 08:39:04
2024-08-15 08:39:09 +08:00
xiang2lin 51fb2476e7 流程事件类型枚举
2024年8月14日 16:26:44
2024-08-14 16:26:48 +08:00
1555 changed files with 16682 additions and 50284 deletions

6
.gitignore vendored
View File

@ -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/

59
base-buildpackage/pom.xml Normal file
View File

@ -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>

View File

@ -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();
}
}
}

View File

@ -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,12 +1136,14 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
//所有下发发送完成修改数据状态
for (int i = 0; i < objects.size(); i++) {
Map<String, Object> updateMap = new HashMap<>();
updateMap.put("tableName",mainDb);
//updateMap.put("dataStatus", "Y");
updateMap.put("addStatus", "1");
updateMap.put("id", objects.get(i).getString("id"));
mdmModuleDao.updateMdmSTs(updateMap);
if(objects.get(i).getBoolean("sendsanfzt123")){
Map<String, Object> updateMap = new HashMap<>();
updateMap.put("tableName",mainDb);
//updateMap.put("dataStatus", "Y");
updateMap.put("addStatus", "1");
updateMap.put("id", objects.get(i).getString("id"));
mdmModuleDao.updateMdmSTs(updateMap);
}
}
}

View File

@ -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> {
}

View File

@ -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 {
}

View File

@ -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;
}
}

View File

@ -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>

View File

@ -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;
}
}

View File

@ -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> {
}

View File

@ -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;
}
}

View File

@ -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

View File

@ -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可省略此配置
@ -24,4 +24,4 @@ savefile:
# 文件保存路径
path: D:\yongansystem\kangarooDataCenter\v3\logs
zt:
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface

View File

@ -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
@ -49,4 +59,24 @@ cbs8:
#电子回单下载临时存放位置
elec_path: /Users/xiangerlin/Downloads/
OA:
data_source_code: yc_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

View File

@ -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可省略此配置
@ -20,4 +20,4 @@ savefile:
# 文件保存路径
path: /Users/apple/Desktop/log/local
zt:
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface

View File

@ -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

View File

@ -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
@ -87,4 +87,4 @@ cbs8:
#电子回单下载临时存放位置
elec_path: /zt/elecfile
OA:
data_source_code: yc_oa
data_source_code: yc_oa

View File

@ -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可省略此配置

View File

@ -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可省略此配置
@ -28,4 +28,4 @@ cbs8:
# 这个私钥到时候上传到cbs和下面到是同一对
#ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
cbs_public_key: 0469146F06BF3B01236E84632441E826F3067A6B93BC3839C836A06007869CD351FBBE388B51F742859388BBC1DE089923AAFBC69E448F15141DDF30EE6CE90185
cbs_public_key: 0469146F06BF3B01236E84632441E826F3067A6B93BC3839C836A06007869CD351FBBE388B51F742859388BBC1DE089923AAFBC69E448F15141DDF30EE6CE90185

View File

@ -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可省略此配置
@ -20,4 +20,4 @@ savefile:
# 文件保存路径
path: E:\yongansystem\log
zt:
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface

View File

@ -1,35 +1,39 @@
#######################本地环境#######################
#######################zqtlocal环境#######################
logging:
#日志级别 指定目录级别
level:
root: info
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
url: https://cbs8-openapi-reprd.csuat.cmburl.cn
# 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
# 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44
# 这个私钥到时候上传到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

View File

@ -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*
@ -123,4 +125,18 @@ jeecg :
minio_pass: ??
bucketName: ??
data:
use: true
use: true
database:
databaseName:
host:
port:
username:
password:
filePase:
fileName:
sftp:
host:
port:
username:
password:
filePase:

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<id>BackUpDatabasePlugin</id>
<name>BackUpDatabasePlugin插件</name>
<category>20241021</category>
</plugin>

View File

@ -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>

View File

@ -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);

View File

@ -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();
}
}

View File

@ -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