Compare commits
2 Commits
72fbd0fa94
...
5091c84f8f
Author | SHA1 | Date | |
---|---|---|---|
5091c84f8f | |||
cce039dfcf |
9
.idea/.gitignore
vendored
9
.idea/.gitignore
vendored
@ -6,3 +6,12 @@
|
|||||||
# Datasource local storage ignored files
|
# Datasource local storage ignored files
|
||||||
/dataSources/
|
/dataSources/
|
||||||
/dataSources.local.xml
|
/dataSources.local.xml
|
||||||
|
|
||||||
|
#忽略所有.svn目录
|
||||||
|
.svn/
|
||||||
|
#忽略所有target目录
|
||||||
|
target/
|
||||||
|
#忽略所有.idea目录
|
||||||
|
.idea/
|
||||||
|
#忽略所有.iml文件
|
||||||
|
*.iml
|
@ -2,7 +2,7 @@
|
|||||||
# xxl job数据库链接
|
# xxl job数据库链接
|
||||||
dbUrl="jdbc:mysql://127.0.0.1:3306/data-dump-xxl-job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai"
|
dbUrl="jdbc:mysql://127.0.0.1:3306/data-dump-xxl-job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai"
|
||||||
dbUsername="root"
|
dbUsername="root"
|
||||||
dbPassword="shida@202502.Celnet"
|
dbPassword="celnet@2025.bln"
|
||||||
#dbUrl="jdbc:mysql://127.0.0.113306/data-dump-xxl-job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai"
|
#dbUrl="jdbc:mysql://127.0.0.113306/data-dump-xxl-job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai"
|
||||||
#dbUsername="msg"
|
#dbUsername="msg"
|
||||||
#dbPassword="msg@2021"
|
#dbPassword="msg@2021"
|
||||||
|
@ -122,6 +122,31 @@ public class DataDumpJob {
|
|||||||
return dataImportService.immigration(param);
|
return dataImportService.immigration(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成新SFID
|
||||||
|
* @param paramStr
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@XxlJob("dataImportJobNew")
|
||||||
|
public ReturnT<String> dataImportJobNew(String paramStr) throws Exception {
|
||||||
|
log.info("dataImportJob execute start ..................");
|
||||||
|
SalesforceParam param = new SalesforceParam();
|
||||||
|
try {
|
||||||
|
if (StringUtils.isNotBlank(paramStr)) {
|
||||||
|
param = JSON.parseObject(paramStr, SalesforceParam.class);
|
||||||
|
}
|
||||||
|
} catch (Throwable throwable) {
|
||||||
|
return new ReturnT<>(500, "参数解析失败!");
|
||||||
|
}
|
||||||
|
param.setType(1);
|
||||||
|
// 参数转换
|
||||||
|
param.setBeginCreateDate(param.getBeginDate());
|
||||||
|
param.setEndCreateDate(param.getEndDate());
|
||||||
|
|
||||||
|
return dataImportService.immigrationNew(param);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新目标org数据
|
* 更新目标org数据
|
||||||
*
|
*
|
||||||
|
@ -14,5 +14,8 @@ public interface DataImportService {
|
|||||||
|
|
||||||
ReturnT<String> immigration(SalesforceParam param) throws Exception;
|
ReturnT<String> immigration(SalesforceParam param) throws Exception;
|
||||||
|
|
||||||
|
ReturnT<String> immigrationNew(SalesforceParam param) throws Exception;
|
||||||
|
|
||||||
|
|
||||||
ReturnT<String> immigrationUpdate(SalesforceParam param) throws Exception;
|
ReturnT<String> immigrationUpdate(SalesforceParam param) throws Exception;
|
||||||
}
|
}
|
||||||
|
@ -91,6 +91,28 @@ public class DataImportServiceImpl implements DataImportService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReturnT<String> immigrationNew(SalesforceParam param) throws Exception {
|
||||||
|
List<Future<?>> futures = Lists.newArrayList();
|
||||||
|
try {
|
||||||
|
if (StringUtils.isNotBlank(param.getApi())) {
|
||||||
|
// 手动任务
|
||||||
|
ReturnT<String> result = manualImmigration(param, futures);
|
||||||
|
if (result != null) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 自动任务
|
||||||
|
autoImmigration(param, futures);
|
||||||
|
}
|
||||||
|
return ReturnT.SUCCESS;
|
||||||
|
} catch (Exception exception) {
|
||||||
|
salesforceExecutor.remove(futures.toArray(new Future<?>[]{}));
|
||||||
|
log.error("immigration error", exception);
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ReturnT<String> manualImmigration(SalesforceParam param, List<Future<?>> futures) throws Exception {
|
public ReturnT<String> manualImmigration(SalesforceParam param, List<Future<?>> futures) throws Exception {
|
||||||
List<String> apis;
|
List<String> apis;
|
||||||
@ -314,21 +336,21 @@ public class DataImportServiceImpl implements DataImportService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//object类型转Date类型
|
//object类型转Date类型
|
||||||
// Date date;
|
Date date;
|
||||||
// try {
|
try {
|
||||||
// date = sdf.parse(String.valueOf(data.get(j - 1).get("CreatedDate")));
|
date = sdf.parse(String.valueOf(data.get(j - 1).get("CreatedDate")));
|
||||||
// }catch (ParseException e){
|
}catch (ParseException e){
|
||||||
// //解决当时间秒为0时,转换秒精度丢失问题
|
//解决当时间秒为0时,转换秒精度丢失问题
|
||||||
// date = sdf.parse(data.get(j - 1).get("CreatedDate")+":00");
|
date = sdf.parse(data.get(j - 1).get("CreatedDate")+":00");
|
||||||
// }
|
}
|
||||||
// Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
// calendar.setTime(date);
|
calendar.setTime(date);
|
||||||
// account.setField("CreatedDate", calendar);
|
account.setField("CreatedDate", calendar);
|
||||||
// log.info("-----打印时间参数-----" + calendar);
|
log.info("-----打印时间参数-----" + calendar);
|
||||||
// Map<String, Object> CreatedByIdMap = customMapper.getById("new_id", "User", data.get(j-1).get("CreatedById").toString());
|
Map<String, Object> CreatedByIdMap = customMapper.getById("new_id", "User", data.get(j-1).get("CreatedById").toString());
|
||||||
// if(CreatedByIdMap.get("new_id") != null && StringUtils.isNotEmpty(CreatedByIdMap.get("new_id").toString())){
|
if(CreatedByIdMap.get("new_id") != null && StringUtils.isNotEmpty(CreatedByIdMap.get("new_id").toString())){
|
||||||
// account.setField("CreatedById", CreatedByIdMap.get("new_id"));
|
account.setField("CreatedById", CreatedByIdMap.get("new_id"));
|
||||||
// }
|
}
|
||||||
if (api.equals("Task")){
|
if (api.equals("Task")){
|
||||||
account.setField("TaskSubtype",data.get(j - 1).get("TaskSubtype"));
|
account.setField("TaskSubtype",data.get(j - 1).get("TaskSubtype"));
|
||||||
}
|
}
|
||||||
@ -345,7 +367,6 @@ public class DataImportServiceImpl implements DataImportService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
log.info("打印sf对象数据------"+ JSONArray.toJSONString(accounts[0]));
|
|
||||||
SaveResult[] saveResults = partnerConnection.create(accounts);
|
SaveResult[] saveResults = partnerConnection.create(accounts);
|
||||||
log.info("sf return saveResults------"+ JSONArray.toJSONString(saveResults));
|
log.info("sf return saveResults------"+ JSONArray.toJSONString(saveResults));
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
@ -2,9 +2,9 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://127.0.0.1:3306/shida?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/cook?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: shida@202502.Celnet
|
password: celnet@2025.bln
|
||||||
# url: jdbc:mysql://183.6.105.131:13306/zhonghe_test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
# url: jdbc:mysql://183.6.105.131:13306/zhonghe_test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
# username: root
|
# username: root
|
||||||
# password: Celnet@2022
|
# password: Celnet@2022
|
||||||
@ -19,8 +19,8 @@ spring:
|
|||||||
#sf webservice配置
|
#sf webservice配置
|
||||||
sf:
|
sf:
|
||||||
# 附件下载url
|
# 附件下载url
|
||||||
file-download-url: https://zhonghe.my.salesforce.com
|
file-download-url: https://cookmedicalasia.my.salesforce.com
|
||||||
file-upload-url: https://yihui-medical.my.sfcrmproducts.cn
|
file-upload-url: https://cookchina--sandbox.sandbox.my.sfcrmproducts.cn
|
||||||
# #线程数
|
# #线程数
|
||||||
# executor-size: 5
|
# executor-size: 5
|
||||||
# list:
|
# list:
|
||||||
|
@ -2,9 +2,9 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://127.0.0.1:3306/shida?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
url: jdbc:mysql://127.0.0.1:3306/cook?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: shida@202502.Celnet
|
password: celnet@2025.bln
|
||||||
mail:
|
mail:
|
||||||
host: smtp.mxhichina.com
|
host: smtp.mxhichina.com
|
||||||
port: 465
|
port: 465
|
||||||
@ -16,8 +16,8 @@ spring:
|
|||||||
#sf webservice配置
|
#sf webservice配置
|
||||||
sf:
|
sf:
|
||||||
# 附件下载url
|
# 附件下载url
|
||||||
file-download-url: https://starrapid.my.salesforce.com
|
file-download-url: https://cookmedicalasia.my.salesforce.com
|
||||||
file-upload-url: https://procision.my.salesforce.com
|
file-upload-url: https://cookchina--sandbox.sandbox.my.sfcrmproducts.cn
|
||||||
#线程数
|
#线程数
|
||||||
executor-size: 5
|
executor-size: 5
|
||||||
list:
|
list:
|
||||||
|
@ -2,9 +2,9 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://127.0.0.1:3306/shida?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
url: jdbc:mysql://127.0.0.1:3306/cook?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: shida@202502.Celnet
|
password: celnet@2025.bln
|
||||||
mail:
|
mail:
|
||||||
host: smtp.163.com
|
host: smtp.163.com
|
||||||
port: 465
|
port: 465
|
||||||
@ -16,8 +16,8 @@ spring:
|
|||||||
#sf webservice配置
|
#sf webservice配置
|
||||||
sf:
|
sf:
|
||||||
# 附件下载url
|
# 附件下载url
|
||||||
file-download-url: https://starrapid.lightning.force.com/
|
file-download-url: https://cookmedicalasia.my.salesforce.com
|
||||||
file-upload-url: https://yihui-medical.my.sfcrmproducts.cn
|
file-upload-url: https://cookchina--sandbox.sandbox.my.sfcrmproducts.cn
|
||||||
#线程数
|
#线程数
|
||||||
executor-size: 5
|
executor-size: 5
|
||||||
list:
|
list:
|
||||||
|
@ -2,9 +2,9 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://127.0.0.1:3306/shida?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/cook?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: shida@202502.Celnet
|
password: celnet@2025.bln
|
||||||
# url: jdbc:mysql://183.6.105.131:13306/zhonghe_test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
# url: jdbc:mysql://183.6.105.131:13306/zhonghe_test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
# username: root
|
# username: root
|
||||||
# password: Celnet@2022
|
# password: Celnet@2022
|
||||||
|
@ -2,9 +2,9 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://127.0.0.1:3306/shida?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
url: jdbc:mysql://127.0.0.1:3306/cook?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: shida@202502.Celnet
|
password: celnet@2025.bln
|
||||||
mail:
|
mail:
|
||||||
host: smtp.mxhichina.com
|
host: smtp.mxhichina.com
|
||||||
port: 465
|
port: 465
|
||||||
|
@ -2,9 +2,9 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://127.0.0.1:3306/shida?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
url: jdbc:mysql://127.0.0.1:3306/cook?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: shida@202502.Celnet
|
password: celnet@2025.bln
|
||||||
mail:
|
mail:
|
||||||
host: smtp.163.com
|
host: smtp.163.com
|
||||||
port: 465
|
port: 465
|
||||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user