提交 65e5e193 authored 作者: inroi's avatar inroi

微调

上级 5b2db04e
/*
SQLyog Enterprise v13.1.1 (64 bit)
MySQL - 5.7.25 : Database - db_integrate_shop
MySQL - 5.7.25 : Database - db_shopping
*********************************************************************
*/
......@@ -12,9 +12,9 @@ MySQL - 5.7.25 : Database - db_integrate_shop
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`db_integrate_shop` /*!40100 DEFAULT CHARACTER SET utf8 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`db_shopping` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `db_integrate_shop`;
USE `db_shopping`;
/*Table structure for table `qrtz_blob_triggers` */
......
......@@ -6,9 +6,11 @@ import com.system.constants.CommonGetConstants;
import com.system.constants.Constants;
import com.system.dao.SynchronizationOperationMapper;
import com.system.serivce.ISynchronizationService;
import com.system.utils.HttpUtil;
import com.system.utils.JsonUtil;
import com.system.utils.SnowFlakeIdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
......@@ -44,19 +46,23 @@ public class SynchronizationServiceImpl implements ISynchronizationService {
@Override
public void synchronization() {
List<Map<String, Object>> tempList = synchronizationOperationMapper.synchronizationOperationList("com.system.quartz.job.SynchronizationJob");
for (Map<String, Object> temp : tempList) {
threadPool.execute(() -> {
Map<String, String> config = commonGetConstants.get(String.valueOf(temp.get("doc_type")));
String queueId = SnowFlakeIdUtil.generateId().toString();
String result = commonGetApi.commonGet(config, "", queueId);
ResponseEntity<String> responseEntity = HttpUtil.httpPost("http://192.168.0.9:8089/api/dataSyn/getSyn", "");
List<Object> objectList = JsonUtil.toList(responseEntity.getBody(), Object.class);
for (Object object : objectList) {
Map<String, Object> temp = JsonUtil.toMap(JsonUtil.toString(object), String.class, Object.class);
Map<String, Object> map = JsonUtil.toMap(result, String.class, Object.class);
if (!CollectionUtils.isEmpty(map) && Constants.SUCCESS_CODE.equals(String.valueOf(map.get(Constants.SUCCESS_NAME)))) {
Map<String, Object> data = JsonUtil.toMap(JsonUtil.toString(map.get("data")), String.class, Object.class);
commonGetApi.commonSync(String.valueOf(temp.get("response_address")), queueId, config, JsonUtil.toString(data));
}
});
Map<String, String> config = commonGetConstants.get(String.valueOf(temp.get("form")));
if (!CollectionUtils.isEmpty(config)) {
continue;
}
String queueId = SnowFlakeIdUtil.generateId().toString();
String result = commonGetApi.commonGet(config, "", queueId);
Map<String, Object> map = JsonUtil.toMap(result, String.class, Object.class);
if (!CollectionUtils.isEmpty(map) && Constants.SUCCESS_CODE.equals(String.valueOf(map.get(Constants.SUCCESS_NAME)))) {
Map<String, Object> data = JsonUtil.toMap(JsonUtil.toString(map.get("data")), String.class, Object.class);
commonGetApi.commonSync(String.valueOf(temp.get("response_address")), queueId, config, JsonUtil.toString(data));
}
}
}
......
......@@ -47,7 +47,7 @@ spring:
threadsInheritContextClassLoaderOfInitializingThread: true
datasource:
url: jdbc:mysql://integrate-mysql:3306/db_integrate?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true&useAffectedRows=true
url: jdbc:mysql://integrate-mysql:3306/db_shopping?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true&useAffectedRows=true
username: root
password: gf^*i6%&9J83&(*kJ653F&L
driver-class-name: com.mysql.cj.jdbc.Driver
......
......@@ -47,7 +47,7 @@ spring:
threadsInheritContextClassLoaderOfInitializingThread: true
datasource:
url: jdbc:mysql://127.0.0.1:3306/db_integrate?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
url: jdbc:mysql://127.0.0.1:3306/db_shopping?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
username: inori
password: inori
driver-class-name: com.mysql.cj.jdbc.Driver
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论