From 59e628be5d53a4399763e38a97495419295dec90 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 1 Apr 2023 21:45:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9UDI=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E5=8F=82=E6=95=B0=E4=BD=BF=E7=94=A8syncIp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../idc/service/impl/IdcServiceImpl.java | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java index e5726fb..04611c1 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java @@ -168,16 +168,24 @@ public class IdcServiceImpl implements IdcService { initTable(); Map map = dbDao.get("select * from sync_data_set limit 1"); if(map!=null&&map.get("downstreamEnable")!=null&&map.get("downstreamEnable").toString().equals("1")) { + if(isUpload) { + if(!(map.get("syncIp")!=null&&!StringUtils.isEmpty(map.get("syncIp").toString()))) { + logger.error("中继服务地址未配置"); + return; + } + } for(int i=0;i params,boolean isUplaod) { + private boolean syncMasterData(Map params,boolean isUplaod,String syncIp) { boolean success=false; String tableName = params.get("tableName").toString(); String tableKey = params.get("tableKey").toString(); @@ -487,7 +496,7 @@ public class IdcServiceImpl implements IdcService { if(isUplaod) { String result = ""; try { - result = relay("",JSON.toJSONString(data),files); + result = relay("",JSON.toJSONString(data),files,syncIp); } catch (Exception ex) { } @@ -682,8 +691,8 @@ public class IdcServiceImpl implements IdcService { /*转发下级或上级中继服务*/ - private String relay(String reqNo,String content,String[] files) { - String host = getNextHost(); + private String relay(String reqNo,String content,String[] files,String ip) { + String host = ip; String result=""; if(StringUtils.isEmpty(reqNo)) reqNo = UUID.randomUUID().toString();