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 94b802abe..409896854 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 @@ -40,6 +40,7 @@ import com.glxp.api.entity.system.SystemParamConfigEntity; import com.glxp.api.idc.service.IdcService; import com.glxp.api.idc.utils.DBAUtils; import com.glxp.api.idc.utils.IDCUtils; +import com.glxp.api.idc.utils.TableUtils; import com.glxp.api.req.system.ScheduledRequest; import com.glxp.api.service.system.SystemParamConfigService; import com.glxp.api.util.CustomUtil; @@ -1177,10 +1178,11 @@ public class IdcServiceImpl implements IdcService { .post(body) .addHeader("Content-Type", "application/x-www-form-urlencoded") .build(); + int total = 0; try { Response result = client.newCall(request).execute(); String msg = result!=null ? result.message().length()>200 ? result.message().substring(0,200) : result.message() : ""; - int total = 0; + if (result!=null&&result.isSuccessful()&&MediaType.parse("application/force-download").equals(result.body().contentType())) { try (InputStream inputStream = result.body().byteStream()) { @@ -1219,7 +1221,7 @@ public class IdcServiceImpl implements IdcService { e.printStackTrace(); } - return true; + return (total>0); } /*获取转发服务地址,当前值允许单向,只使用参数upper_server_ip*/ @@ -1293,16 +1295,7 @@ public class IdcServiceImpl implements IdcService { return systemParamConfigEntity; } - private void writeFile(byte[] file, String filePath, String fileName) throws Exception { - File targetFile = new File(filePath); - if (!targetFile.exists()) { - targetFile.mkdirs(); - } - FileOutputStream out = new FileOutputStream(filePath + fileName); - out.write(file); - out.flush(); - out.close(); - } + /*把列数据转Map*/ @@ -1411,6 +1404,15 @@ public class IdcServiceImpl implements IdcService { } } - + private void writeFile(byte[] file, String filePath, String fileName) throws Exception { + File targetFile = new File(filePath); + if (!targetFile.exists()) { + targetFile.mkdirs(); + } + FileOutputStream out = new FileOutputStream(filePath + fileName); + out.write(file); + out.flush(); + out.close(); + } }