diff --git a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java index 9b8c272db..6a8a783ea 100644 --- a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java +++ b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java @@ -74,12 +74,12 @@ public class IdcServiceImpl implements IdcService { "basicCorp//basic_corp/id///updateTime///往来单位","typeThird//thr_bustype_origin/id///updateTime///第三方单据类型", "basicThirdCorp//thr_corp/id///updateTime///第三方往来单位","//thr_dept/id///updateTime///第三方部门", "//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//资质证书信息", "//sup_cert_set/id///updateTime///供应商资质证书设置","companyCert//sup_company/customerId///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; @Resource @@ -217,10 +217,11 @@ public class IdcServiceImpl implements IdcService { List> keyList = dbDao.listKeyMysql(tnames[2]); String keyColumn = keyList!=null&&keyList.size()>0 ? keyList.get(0).get("columnName").toString() : "id"; Map map = new HashMap(); - 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); @@ -472,6 +473,7 @@ public class IdcServiceImpl implements IdcService { childs[childNum] = str; } } + logger.info("子表数:"+(childNum+1)); Map table = dbDao.getMysql(tableName); if(!(table!=null&&table.get("tableName")!=null)) return false; @@ -522,16 +524,18 @@ 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&¶ms.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 childMap = new HashMap<>(); - childMap.put(params.get("subLinkColumn").toString(), keyValue); - List> 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 childMap = new HashMap<>(); + childMap.put(chidTnames[5], keyValue); + List> childList = getList(chidTnames[2],childMap); + list.get(m).put("tableName"+z, chidTnames[2]); + list.get(m).put("data"+z, childList); + logger.info("child-data-->"+JSON.toJSONString(childList)); + } } } }