|
@@ -593,6 +593,7 @@ public class WindTowerDataParentTableServiceImpl extends ServiceImpl<WindTowerDa
|
|
|
map.put("list", maps.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList()));
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
//原实时数据查询
|
|
|
public List<Map<String, Object>> selectByBetweenTimeAndEquipmetIdOld(Date startTime, Date endTime, String equipmentId) {
|
|
|
List<Entity> windTowerDataParentTables = baseMapper.selectDataByBetweenTimeAndEquipmetId(equipmentId, startTime, endTime);
|
|
@@ -641,10 +642,11 @@ public class WindTowerDataParentTableServiceImpl extends ServiceImpl<WindTowerDa
|
|
|
|
|
|
/**
|
|
|
* 实时数据查询
|
|
|
- * @param timeBegin 开始时间
|
|
|
- * @param timeEnd 结束时间
|
|
|
+ *
|
|
|
+ * @param timeBegin 开始时间
|
|
|
+ * @param timeEnd 结束时间
|
|
|
* @param equipmentId 设备编号
|
|
|
- * @return List<Map<String, Object>> 实时数据
|
|
|
+ * @return List<Map < String, Object>> 实时数据
|
|
|
*/
|
|
|
private List<Map<String, Object>> selectByBetweenTimeAndEquipmetId(Date timeBegin, Date timeEnd, String equipmentId) {
|
|
|
Timestamp startTime = new Timestamp(timeBegin.getTime());
|
|
@@ -818,13 +820,29 @@ public class WindTowerDataParentTableServiceImpl extends ServiceImpl<WindTowerDa
|
|
|
*
|
|
|
* @param equipmentId
|
|
|
*/
|
|
|
- public void exportAll(HttpServletRequest request, HttpServletResponse response, String equipmentId) {
|
|
|
+ public void exportAll(HttpServletRequest request, HttpServletResponse response, String equipmentId, Long startTime, Long endTime) {
|
|
|
try {
|
|
|
File dataFile = new File(FileUtil.getSystemFilePath() + File.separator + equipmentId);
|
|
|
File[] files = dataFile.listFiles();
|
|
|
String zipPath = FileUtil.getSystemFilePath() + File.separator + equipmentId + File.separator + equipmentId + "数据文件.zip";
|
|
|
|
|
|
- List<File> files1 = Arrays.stream(files).filter(file -> file.getName().contains(equipmentId)).collect(Collectors.toList());
|
|
|
+ List<File> files1 = Arrays.stream(files).map(file -> {
|
|
|
+ String name = file.getName();
|
|
|
+ if (name.contains(".rld")) {
|
|
|
+ String[] rldNameTime = name.split("_");
|
|
|
+ long time = DateUtil.parse(rldNameTime[1], "yyyy-MM-dd").getTime();
|
|
|
+ if (time >= startTime && time <= endTime) {
|
|
|
+ return file;
|
|
|
+ }
|
|
|
+ } else if (name.contains(".RWD")) {
|
|
|
+ String rwdNameTime = name.substring(equipmentId.length(), equipmentId.length() + 8);
|
|
|
+ long time = DateUtil.parse(rwdNameTime, "yyyyMMdd").getTime();
|
|
|
+ if (time >= startTime && time <= endTime) {
|
|
|
+ return file;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }).filter(file -> file != null && file.getName().contains(equipmentId)).collect(Collectors.toList());
|
|
|
String[] strDir = new String[files1.size()];
|
|
|
for (int i = 0; i < files1.size(); i++) {
|
|
|
strDir[i] = files1.get(i).toString();
|