|
|
@ -134,11 +134,13 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { |
|
|
|
Map<String,Object> fileInfo = new HashMap<>(); |
|
|
|
fileInfo.put("fileName",fileName); |
|
|
|
fileInfo.put("fileUrl",fileUrl); |
|
|
|
|
|
|
|
Date now = new Date(); |
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
String updateTime = simpleDateFormat.format(new Date()); |
|
|
|
String updateTime = simpleDateFormat.format(now); |
|
|
|
fileInfo.put("uploadTime",updateTime); |
|
|
|
|
|
|
|
redisCache.setCacheMapValue(RedisKeyConstants.SDHS_EVENT_FILE,updateTime,fileInfo); |
|
|
|
redisCache.setCacheMapValue(RedisKeyConstants.SDHS_EVENT_FILE,now.getTime(),fileInfo); |
|
|
|
return AjaxResult.success("导入成功"); |
|
|
|
} |
|
|
|
|
|
|
@ -242,6 +244,26 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { |
|
|
|
return numbers; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public AjaxResult getFileInfo(){ |
|
|
|
Map<String,Map<String,Object>> allFileInfo = redisCache.getCacheMapValue(RedisKeyConstants.SDHS_EVENT_FILE); |
|
|
|
Map<String, Object> lastFile = new HashMap<>(); |
|
|
|
if (allFileInfo != null && allFileInfo.size() > 0){ |
|
|
|
String maxKeyNumerically = Collections.max(allFileInfo.keySet(), new Comparator<String>() { |
|
|
|
@Override |
|
|
|
public int compare(String o1, String o2) { |
|
|
|
try { |
|
|
|
return Long.compare(Long.parseLong(o1), Long.parseLong(o2)); |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
throw new IllegalArgumentException("Keys cannot be parsed as numbers", e); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
lastFile = allFileInfo.get(maxKeyNumerically); |
|
|
|
} |
|
|
|
return AjaxResult.success(lastFile); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 事故地市分布 |
|
|
|