Merge remote-tracking branch 'origin/master'

master
anthonywj 2 years ago
commit 9663209f2a

@ -210,17 +210,19 @@ public class IdcServiceImpl implements IdcService {
boolean sync = true;
String[] tnames = t.split("/");
String lastUpdateTime = getUpdateTime(tnames[0]);
String lastUpdateTime = getUpdateTime(tnames[2]);
Date nowUpdateTime = new Date();
if(!StringUtils.isEmpty(tnames[0])) {
List<Map<String, String>> keyList = dbDao.listKeyMysql(tnames[2]);
String keyColumn = keyList!=null&&keyList.size()>0 ? keyList.get(0).get("columnName").toString() : "id";
Map<String,Object> map = new HashMap<String,Object>();
String sqlWhere = "not exists (select fkId from idc_record where type='"+tnames[2]+"' and fkId="+tnames[2]+"."+keyColumn+")";
String sqlWhere = "";
if(!StringUtils.isEmpty(tnames[6])) {
sqlWhere+=" and "+tnames[6]+">=cast('"+lastUpdateTime+"' as datetime)";
sqlWhere+=" "+tnames[6]+">=cast('"+lastUpdateTime+"' as datetime)";
} else {
sqlWhere = "not exists (select fkId from idc_record where type='"+tnames[2]+"' and fkId="+tnames[2]+"."+keyColumn+")";
map.put("isEnd", "1");
}
map.put("sqlWhere", sqlWhere);
@ -523,20 +525,21 @@ public class IdcServiceImpl implements IdcService {
}
recordSql+=!StringUtils.isEmpty(recordSql) ? "," : "";
recordSql+="('"+UUID.randomUUID().toString().replaceAll("-", "")+"','"+tableName+"','"+list.get(m).get(keyColumn)+"','"+isEnd+"',now())";
if(childNum>-1&&params.get("masterLinkColumn")!=null&&!StringUtils.isEmpty(params.get("masterLinkColumn").toString())&&
params.get("subLinkColumn")!=null&&!StringUtils.isEmpty(params.get("subLinkColumn").toString())) {
if(childNum>-1) {
for(int z=0;z<childNum+1;z++) {
String[] chidTnames = childs[z].split("/");
String keyValue = list.get(i).get(params.get("masterLinkColumn")).toString();
Map<String,Object> childMap = new HashMap<>();
childMap.put(params.get("subLinkColumn").toString(), keyValue);
List<Map<String,Object>> childList = getList(chidTnames[2],childMap);
list.get(m).put("tableName"+z, chidTnames[2]);
list.get(m).put("data"+z, childList);
if(!StringUtils.isEmpty(chidTnames[4])&&!StringUtils.isEmpty(chidTnames[5])) {
String keyValue = list.get(i).get(chidTnames[4]).toString();
Map<String,Object> childMap = new HashMap<>();
childMap.put(chidTnames[5], keyValue);
List<Map<String,Object>> childList = getList(chidTnames[2],childMap);
list.get(m).put("tableName"+z, chidTnames[2]);
list.get(m).put("data"+z, childList);
}
}
}
}
data.replace("data", list);
orderNum++;
if(isUpload) {

Loading…
Cancel
Save