updateTime

master
chengqf 2 years ago
parent a9683c7675
commit 116c59ba90

@ -255,7 +255,7 @@ public class IdcServiceImpl implements IdcService {
try { try {
String[] tnames = t.split("/"); String[] tnames = t.split("/");
String lastUpdateTime = getUpdateTime(tnames[2] + "." + tnames[0]); String lastUpdateTime = getUpdateTime(tnames[2] + "." + tnames[0]+"."+tnames[1]);
Date nowUpdateTime = new Date(); Date nowUpdateTime = new Date();
// if (!StringUtils.isEmpty(tnames[0])) { // if (!StringUtils.isEmpty(tnames[0])) {
@ -301,7 +301,7 @@ public class IdcServiceImpl implements IdcService {
if (sync) { if (sync) {
result = syncMasterData(map, isUpload, syncIp); result = syncMasterData(map, isUpload, syncIp);
if (result) { if (result) {
setUpdateTime(tnames[2] + "." + tnames[0], DateUtil.formatDate(nowUpdateTime, "yyyy-MM-dd HH:mm:ss")); setUpdateTime(tnames[2] + "." + tnames[0]+"."+tnames[1], DateUtil.formatDate(nowUpdateTime, "yyyy-MM-dd HH:mm:ss"));
} }
} }
//} //}
@ -1015,22 +1015,24 @@ public class IdcServiceImpl implements IdcService {
if (MediaType.parse("application/force-download").equals(result.body().contentType())) { if (MediaType.parse("application/force-download").equals(result.body().contentType())) {
try (InputStream inputStream = result.body().byteStream()) { try (InputStream inputStream = result.body().byteStream()) {
String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : "/";
String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : "/";
FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + fileName);
FileOutputStream outputStream = new FileOutputStream(filePath + filePathSlash + fileName);
byte b[] = new byte[1024];
byte b[] = new byte[1024];
int len = 0;
int len = 0;
while ((len = inputStream.read(b)) != -1) {
while ((len = inputStream.read(b)) != -1) {
outputStream.write(b, 0, len);
outputStream.write(b, 0, len);
}
}
outputStream.flush();
outputStream.close(); outputStream.flush();
outputStream.close();
} catch (Exception e) { } catch (Exception e) {

Loading…
Cancel
Save