【fix】 调整开始时间结束时间的取值方式,避免空指针
This commit is contained in:
parent
53cc4ac124
commit
5dfbc7c18c
@ -286,11 +286,14 @@ public class DataImportBatchServiceImpl implements DataImportBatchService {
|
|||||||
List<DataField> list = dataFieldService.list(dbQw);
|
List<DataField> list = dataFieldService.list(dbQw);
|
||||||
TimeUnit.MILLISECONDS.sleep(1);
|
TimeUnit.MILLISECONDS.sleep(1);
|
||||||
|
|
||||||
|
String beginDateStr = null;
|
||||||
|
String endDateStr = null;
|
||||||
Date beginDate = param.getBeginCreateDate();
|
Date beginDate = param.getBeginCreateDate();
|
||||||
Date endDate = param.getEndCreateDate();
|
Date endDate = param.getEndCreateDate();
|
||||||
String beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
if (param.getBeginCreateDate() != null && param.getEndCreateDate() != null){
|
||||||
String endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
//表内数据总量
|
//表内数据总量
|
||||||
Integer count = customMapper.countBySQL(api, "where new_id is null and CreatedDate >= '" + beginDateStr + "' and CreatedDate < '" + endDateStr + "'");
|
Integer count = customMapper.countBySQL(api, "where new_id is null and CreatedDate >= '" + beginDateStr + "' and CreatedDate < '" + endDateStr + "'");
|
||||||
log.error("总Insert数据 count:{};-开始时间:{};-结束时间:{};-api:{};", count, beginDateStr, endDateStr, api);
|
log.error("总Insert数据 count:{};-开始时间:{};-结束时间:{};-api:{};", count, beginDateStr, endDateStr, api);
|
||||||
@ -692,11 +695,14 @@ public class DataImportBatchServiceImpl implements DataImportBatchService {
|
|||||||
List<DataField> list = dataFieldService.list(dbQw);
|
List<DataField> list = dataFieldService.list(dbQw);
|
||||||
TimeUnit.MILLISECONDS.sleep(1);
|
TimeUnit.MILLISECONDS.sleep(1);
|
||||||
|
|
||||||
|
String beginDateStr = null;
|
||||||
|
String endDateStr = null;
|
||||||
Date beginDate = param.getBeginCreateDate();
|
Date beginDate = param.getBeginCreateDate();
|
||||||
Date endDate = param.getEndCreateDate();
|
Date endDate = param.getEndCreateDate();
|
||||||
String beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
if (param.getBeginCreateDate() != null && param.getEndCreateDate() != null){
|
||||||
String endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
// 表内数据总量
|
// 表内数据总量
|
||||||
Integer count = customMapper.countBySQL(api, "where new_id is not null and CreatedDate >= '" + beginDateStr + "' and CreatedDate < '" + endDateStr + "'");
|
Integer count = customMapper.countBySQL(api, "where new_id is not null and CreatedDate >= '" + beginDateStr + "' and CreatedDate < '" + endDateStr + "'");
|
||||||
log.error("总Update数据 count:{};-开始时间:{};-结束时间:{};-api:{};", count, beginDateStr, endDateStr, api);
|
log.error("总Update数据 count:{};-开始时间:{};-结束时间:{};-api:{};", count, beginDateStr, endDateStr, api);
|
||||||
@ -1047,10 +1053,14 @@ public class DataImportBatchServiceImpl implements DataImportBatchService {
|
|||||||
List<DataField> list = dataFieldService.list(dbQw);
|
List<DataField> list = dataFieldService.list(dbQw);
|
||||||
TimeUnit.MILLISECONDS.sleep(1);
|
TimeUnit.MILLISECONDS.sleep(1);
|
||||||
|
|
||||||
|
String beginDateStr = null;
|
||||||
|
String endDateStr = null;
|
||||||
Date beginDate = param.getBeginCreateDate();
|
Date beginDate = param.getBeginCreateDate();
|
||||||
Date endDate = param.getEndCreateDate();
|
Date endDate = param.getEndCreateDate();
|
||||||
String beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
if (param.getBeginCreateDate() != null && param.getEndCreateDate() != null){
|
||||||
String endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
|
|
||||||
//表内数据总量
|
//表内数据总量
|
||||||
Integer count = customMapper.countBySQL(api, "where new_id is null and CreatedDate >= '" + beginDateStr + "' and CreatedDate < '" + endDateStr + "'");
|
Integer count = customMapper.countBySQL(api, "where new_id is null and CreatedDate >= '" + beginDateStr + "' and CreatedDate < '" + endDateStr + "'");
|
||||||
|
@ -193,11 +193,14 @@ public class DataImportNewServiceImpl implements DataImportNewService {
|
|||||||
QueryWrapper<DataField> dbQw = new QueryWrapper<>();
|
QueryWrapper<DataField> dbQw = new QueryWrapper<>();
|
||||||
dbQw.eq("api", api);
|
dbQw.eq("api", api);
|
||||||
|
|
||||||
|
String beginDateStr = null;
|
||||||
|
String endDateStr = null;
|
||||||
Date beginDate = param.getBeginCreateDate();
|
Date beginDate = param.getBeginCreateDate();
|
||||||
Date endDate = param.getEndCreateDate();
|
Date endDate = param.getEndCreateDate();
|
||||||
String beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
if (param.getBeginCreateDate() != null && param.getEndCreateDate() != null){
|
||||||
String endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
|
|
||||||
DescribeSObjectResult dsr = partnerConnection.describeSObject(api);
|
DescribeSObjectResult dsr = partnerConnection.describeSObject(api);
|
||||||
Field[] dsrFields = dsr.getFields();
|
Field[] dsrFields = dsr.getFields();
|
||||||
@ -708,13 +711,17 @@ public class DataImportNewServiceImpl implements DataImportNewService {
|
|||||||
dbQw.eq("api", api);
|
dbQw.eq("api", api);
|
||||||
List<DataField> list = dataFieldService.list(dbQw);
|
List<DataField> list = dataFieldService.list(dbQw);
|
||||||
|
|
||||||
Date beginDate = param.getBeginCreateDate();
|
|
||||||
Date endDate = param.getEndCreateDate();
|
|
||||||
String sql = "";
|
String sql = "";
|
||||||
String sql2 = "";
|
String sql2 = "";
|
||||||
|
|
||||||
String beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
String beginDateStr = null;
|
||||||
String endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
String endDateStr = null;
|
||||||
|
Date beginDate = param.getBeginCreateDate();
|
||||||
|
Date endDate = param.getEndCreateDate();
|
||||||
|
if (param.getBeginCreateDate() != null && param.getEndCreateDate() != null){
|
||||||
|
beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
|
|
||||||
if (1 == param.getType()) {
|
if (1 == param.getType()) {
|
||||||
if (api.contains("Share")){
|
if (api.contains("Share")){
|
||||||
@ -1132,11 +1139,14 @@ public class DataImportNewServiceImpl implements DataImportNewService {
|
|||||||
extraSql += " AND IsDeleted = false ";
|
extraSql += " AND IsDeleted = false ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String beginDateStr = null;
|
||||||
|
String endDateStr = null;
|
||||||
Date beginDate = param.getBeginCreateDate();
|
Date beginDate = param.getBeginCreateDate();
|
||||||
Date endDate = param.getEndCreateDate();
|
Date endDate = param.getEndCreateDate();
|
||||||
String beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
if (param.getBeginCreateDate() != null && param.getEndCreateDate() != null){
|
||||||
String endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
String token = Connection.getSessionHeader().getSessionId();
|
String token = Connection.getSessionHeader().getSessionId();
|
||||||
|
|
||||||
String name = "Name";
|
String name = "Name";
|
||||||
@ -1369,10 +1379,14 @@ public class DataImportNewServiceImpl implements DataImportNewService {
|
|||||||
extraSql += " AND IsDeleted = false ";
|
extraSql += " AND IsDeleted = false ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String beginDateStr = null;
|
||||||
|
String endDateStr = null;
|
||||||
Date beginDate = param.getBeginCreateDate();
|
Date beginDate = param.getBeginCreateDate();
|
||||||
Date endDate = param.getEndCreateDate();
|
Date endDate = param.getEndCreateDate();
|
||||||
String beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
if (param.getBeginCreateDate() != null && param.getEndCreateDate() != null){
|
||||||
String endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
|
|
||||||
String token = connection.getSessionHeader().getSessionId();
|
String token = connection.getSessionHeader().getSessionId();
|
||||||
|
|
||||||
@ -1502,11 +1516,14 @@ public class DataImportNewServiceImpl implements DataImportNewService {
|
|||||||
extraSql += " AND IsDeleted = false ";
|
extraSql += " AND IsDeleted = false ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String beginDateStr = null;
|
||||||
|
String endDateStr = null;
|
||||||
Date beginDate = param.getBeginCreateDate();
|
Date beginDate = param.getBeginCreateDate();
|
||||||
Date endDate = param.getEndCreateDate();
|
Date endDate = param.getEndCreateDate();
|
||||||
String beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
if (param.getBeginCreateDate() != null && param.getEndCreateDate() != null){
|
||||||
String endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
String token = connection.getSessionHeader().getSessionId();
|
String token = connection.getSessionHeader().getSessionId();
|
||||||
|
|
||||||
String name = "Name";
|
String name = "Name";
|
||||||
|
@ -262,10 +262,14 @@ public class DataImportServiceImpl implements DataImportService {
|
|||||||
List<DataField> list = dataFieldService.list(dbQw);
|
List<DataField> list = dataFieldService.list(dbQw);
|
||||||
TimeUnit.MILLISECONDS.sleep(1);
|
TimeUnit.MILLISECONDS.sleep(1);
|
||||||
|
|
||||||
|
String beginDateStr = null;
|
||||||
|
String endDateStr = null;
|
||||||
Date beginDate = param.getBeginCreateDate();
|
Date beginDate = param.getBeginCreateDate();
|
||||||
Date endDate = param.getEndCreateDate();
|
Date endDate = param.getEndCreateDate();
|
||||||
String beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
if (param.getBeginCreateDate() != null && param.getEndCreateDate() != null){
|
||||||
String endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
//表内数据总量
|
//表内数据总量
|
||||||
Integer count = customMapper.countBySQL(api, "where new_id is null and CreatedDate >= '" + beginDateStr + "' and CreatedDate < '" + endDateStr + "'");
|
Integer count = customMapper.countBySQL(api, "where new_id is null and CreatedDate >= '" + beginDateStr + "' and CreatedDate < '" + endDateStr + "'");
|
||||||
log.error("总Insert数据 count:{};-开始时间:{};-结束时间:{};-api:{};", count, beginDateStr, endDateStr, api);
|
log.error("总Insert数据 count:{};-开始时间:{};-结束时间:{};-api:{};", count, beginDateStr, endDateStr, api);
|
||||||
@ -620,11 +624,14 @@ public class DataImportServiceImpl implements DataImportService {
|
|||||||
List<DataField> list = dataFieldService.list(dbQw);
|
List<DataField> list = dataFieldService.list(dbQw);
|
||||||
TimeUnit.MILLISECONDS.sleep(1);
|
TimeUnit.MILLISECONDS.sleep(1);
|
||||||
|
|
||||||
|
String beginDateStr = null;
|
||||||
|
String endDateStr = null;
|
||||||
Date beginDate = param.getBeginCreateDate();
|
Date beginDate = param.getBeginCreateDate();
|
||||||
Date endDate = param.getEndCreateDate();
|
Date endDate = param.getEndCreateDate();
|
||||||
String beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
if (param.getBeginCreateDate() != null && param.getEndCreateDate() != null){
|
||||||
String endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
//表内数据总量
|
//表内数据总量
|
||||||
Integer count = customMapper.countBySQL(api, "where new_id is not null and CreatedDate >= '" + beginDateStr + "' and CreatedDate < '" + endDateStr + "'");
|
Integer count = customMapper.countBySQL(api, "where new_id is not null and CreatedDate >= '" + beginDateStr + "' and CreatedDate < '" + endDateStr + "'");
|
||||||
|
|
||||||
@ -773,9 +780,15 @@ public class DataImportServiceImpl implements DataImportService {
|
|||||||
QueryWrapper<DataField> dbQw = new QueryWrapper<>();
|
QueryWrapper<DataField> dbQw = new QueryWrapper<>();
|
||||||
dbQw.eq("api", api);
|
dbQw.eq("api", api);
|
||||||
List<DataField> list = dataFieldService.list(dbQw);
|
List<DataField> list = dataFieldService.list(dbQw);
|
||||||
|
String beginDateStr = null;
|
||||||
|
String endDateStr = null;
|
||||||
Date beginDate = param.getBeginCreateDate();
|
Date beginDate = param.getBeginCreateDate();
|
||||||
Date endDate = param.getEndCreateDate();
|
Date endDate = param.getEndCreateDate();
|
||||||
|
if (param.getBeginCreateDate() != null && param.getEndCreateDate() != null){
|
||||||
|
beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
|
|
||||||
String sql = "";
|
String sql = "";
|
||||||
String sql2 = "";
|
String sql2 = "";
|
||||||
if (2 == param.getType()){
|
if (2 == param.getType()){
|
||||||
@ -784,8 +797,6 @@ public class DataImportServiceImpl implements DataImportService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String beginDateStr = DateUtil.format(beginDate, "yyyy-MM-dd HH:mm:ss");
|
|
||||||
String endDateStr = DateUtil.format(endDate, "yyyy-MM-dd HH:mm:ss");
|
|
||||||
|
|
||||||
if (2 == param.getType()) {
|
if (2 == param.getType()) {
|
||||||
sql = "where new_id is not null and LastModifiedDate >= '" + beginDateStr + "' ";
|
sql = "where new_id is not null and LastModifiedDate >= '" + beginDateStr + "' ";
|
||||||
|
Loading…
Reference in New Issue
Block a user