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 ff8adb1e3..94b802abe 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,7 +40,6 @@ 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; @@ -203,7 +202,7 @@ public class IdcServiceImpl implements IdcService { } } - + private void fetchFailFile(String host) { Map map = new HashMap(); map.put("sql", "select * from idc_file where createTimesuccess(delete)", i * limit, total); } else { success = false; - + saveIdcLog(tnames[9], "", tnames[2] + ">" + result, i * limit, total); } } else { success = false; saveIdcLog(tnames[9], "", syncIp + ":" + tnames[2] + ">fail:上传地址未连通", i * limit, total); } - + } else { saveIdcLog(tnames[9], "", tnames[2] + ">success(delete)", i * limit, total); } @@ -716,7 +715,7 @@ public class IdcServiceImpl implements IdcService { Map whereParams = new HashMap(); whereParams.put("sqlWhere", params.get("sqlWhere")); - + String dataWhere = params.get("dataWhere")!=null ? params.get("dataWhere").toString() : ""; Map map = new HashMap(); String where = DBAUtils.convertWhere(column, whereParams, dataWhere); @@ -951,7 +950,7 @@ public class IdcServiceImpl implements IdcService { private boolean analyToDB(String host, String tableName, String uniqueColumn, String filePathColumn, List> list, boolean isUpload) { - + String tName = DBAUtils.tableRealName(tableName); String sql = "replace " + tName + "("; String del = "delete from " + tName + " where "; @@ -1184,27 +1183,27 @@ public class IdcServiceImpl implements IdcService { int total = 0; if (result!=null&&result.isSuccessful()&&MediaType.parse("application/force-download").equals(result.body().contentType())) { try (InputStream inputStream = result.body().byteStream()) { - - - + + + FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + imagePath+fileName); - + byte b[] = new byte[1024]; - + int len = 0; while ((len = inputStream.read(b)) != -1) { total += len; outputStream.write(b, 0, len); - + } - + outputStream.flush(); outputStream.close(); if(!(total>0)) { new File(filePath + filePathSlash + imagePath+fileName).delete(); executeSql("delete from idc_file where filePath='"+fileName+"'"); } - + } catch (Exception e) { @@ -1403,7 +1402,7 @@ public class IdcServiceImpl implements IdcService { } - + private void executeSql(String sql) { try { jdbcTemplate.execute(sql); @@ -1414,4 +1413,4 @@ public class IdcServiceImpl implements IdcService { } -} \ No newline at end of file +}