master
admin 2 years ago
parent 21bc4f8de0
commit 6a8dceef2a

@ -74,12 +74,12 @@ public class IdcServiceImpl implements IdcService {
"basicCorp//basic_corp/id///updateTime///往来单位","typeThird//thr_bustype_origin/id///updateTime///第三方单据类型", "basicCorp//basic_corp/id///updateTime///往来单位","typeThird//thr_bustype_origin/id///updateTime///第三方单据类型",
"basicThirdCorp//thr_corp/id///updateTime///第三方往来单位","//thr_dept/id///updateTime///第三方部门", "basicThirdCorp//thr_corp/id///updateTime///第三方往来单位","//thr_dept/id///updateTime///第三方部门",
"//thr_inv_products/id///updateTime///第三方库存","basicThirdInv//thr_inv_warehouse/id//////第三方仓库", "//thr_inv_products/id///updateTime///第三方库存","basicThirdInv//thr_inv_warehouse/id//////第三方仓库",
"basicThirdBusOrder//thr_order/id///updateTime///第三方业务单据","/basicThirdBusOrder/thr_order_detail/orderIdFk///updateTime///第三方单据详情", "basicThirdBusOrder//thr_order/id///updateTime///第三方业务单据","/basicThirdBusOrder/thr_order_detail/orderIdFk/id/orderIdFk/updateTime///第三方单据详情",
"basicThirdProducts//thr_products/id///updateTime///第三方产品信息","//sup_cert/id///updateTime/filePath//资质证书信息", "basicThirdProducts//thr_products/id///updateTime///第三方产品信息","//sup_cert/id///updateTime/filePath//资质证书信息",
"//sup_cert_set/id///updateTime///供应商资质证书设置","companyCert//sup_company/customerId///updateTime///配送企业", "//sup_cert_set/id///updateTime///供应商资质证书设置","companyCert//sup_company/customerId///updateTime///配送企业",
"manufacturerCert//sup_manufacturer/id///updateTime///生产企业","productCert//sup_product/id///updateTime///产品资质信息", "manufacturerCert//sup_manufacturer/id///updateTime///生产企业","productCert//sup_product/id///updateTime///产品资质信息",
"dbDiProducts//productinfo/id///updateTime///DI产品信息","//udicompany/id///updateTime///国际库医疗器械注册人信息"}; "//udicompany/id///updateTime///国际库医疗器械注册人信息"};
//"dbDiProducts//productinfo/id///updateTime///DI产品信息",
private int orderNum=0; private int orderNum=0;
@Resource @Resource
@ -217,10 +217,11 @@ public class IdcServiceImpl implements IdcService {
List<Map<String, String>> keyList = dbDao.listKeyMysql(tnames[2]); List<Map<String, String>> keyList = dbDao.listKeyMysql(tnames[2]);
String keyColumn = keyList!=null&&keyList.size()>0 ? keyList.get(0).get("columnName").toString() : "id"; String keyColumn = keyList!=null&&keyList.size()>0 ? keyList.get(0).get("columnName").toString() : "id";
Map<String,Object> map = new HashMap<String,Object>(); 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])) { if(!StringUtils.isEmpty(tnames[6])) {
sqlWhere+=" and "+tnames[6]+">=cast('"+lastUpdateTime+"' as datetime)"; sqlWhere+=" "+tnames[6]+">=cast('"+lastUpdateTime+"' as datetime)";
} else { } else {
sqlWhere = "not exists (select fkId from idc_record where type='"+tnames[2]+"' and fkId="+tnames[2]+"."+keyColumn+")";
map.put("isEnd", "1"); map.put("isEnd", "1");
} }
map.put("sqlWhere", sqlWhere); map.put("sqlWhere", sqlWhere);
@ -472,6 +473,7 @@ public class IdcServiceImpl implements IdcService {
childs[childNum] = str; childs[childNum] = str;
} }
} }
logger.info("子表数:"+(childNum+1));
Map<String,String> table = dbDao.getMysql(tableName); Map<String,String> table = dbDao.getMysql(tableName);
if(!(table!=null&&table.get("tableName")!=null)) if(!(table!=null&&table.get("tableName")!=null))
return false; return false;
@ -522,16 +524,18 @@ public class IdcServiceImpl implements IdcService {
} }
recordSql+=!StringUtils.isEmpty(recordSql) ? "," : ""; recordSql+=!StringUtils.isEmpty(recordSql) ? "," : "";
recordSql+="('"+UUID.randomUUID().toString().replaceAll("-", "")+"','"+tableName+"','"+list.get(m).get(keyColumn)+"','"+isEnd+"',now())"; 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())&& if(childNum>-1) {
params.get("subLinkColumn")!=null&&!StringUtils.isEmpty(params.get("subLinkColumn").toString())) {
for(int z=0;z<childNum+1;z++) { for(int z=0;z<childNum+1;z++) {
String[] chidTnames = childs[z].split("/"); String[] chidTnames = childs[z].split("/");
String keyValue = list.get(i).get(params.get("masterLinkColumn")).toString(); if(!StringUtils.isEmpty(chidTnames[4])&&!StringUtils.isEmpty(chidTnames[5])) {
Map<String,Object> childMap = new HashMap<>(); String keyValue = list.get(i).get(chidTnames[4]).toString();
childMap.put(params.get("subLinkColumn").toString(), keyValue); Map<String,Object> childMap = new HashMap<>();
List<Map<String,Object>> childList = getList(chidTnames[2],childMap); childMap.put(chidTnames[5], keyValue);
list.get(m).put("tableName"+z, chidTnames[2]); List<Map<String,Object>> childList = getList(chidTnames[2],childMap);
list.get(m).put("data"+z, childList); list.get(m).put("tableName"+z, chidTnames[2]);
list.get(m).put("data"+z, childList);
logger.info("child-data-->"+JSON.toJSONString(childList));
}
} }
} }
} }

Loading…
Cancel
Save