21 changed files with 447 additions and 429 deletions
-
3.idea/compiler.xml
-
4.idea/misc.xml
-
2.idea/modules.xml
-
4cl_query_data_job/pom.xml
-
9cl_query_data_job/src/main/java/com/bfd/mf/job/config/ESConstants.java
-
153cl_query_data_job/src/main/java/com/bfd/mf/job/domain/entity/Alarm.java
-
9cl_query_data_job/src/main/java/com/bfd/mf/job/domain/repository/AlarmRepository.java
-
140cl_query_data_job/src/main/java/com/bfd/mf/job/domain/repository/TaskRepository.java
-
105cl_query_data_job/src/main/java/com/bfd/mf/job/service/es/EsQueryMiniService.java
-
60cl_query_data_job/src/main/java/com/bfd/mf/job/service/statistics/StatisticsService.java
-
67cl_query_data_job/src/main/resources/application.yml
-
1cl_search_api/cl_search_api.iml
-
18cl_search_api/pom.xml
-
243cl_search_api/src/main/java/com/bfd/mf/common/util/ReadLine.java
-
1cl_search_api/src/main/java/com/bfd/mf/common/util/constants/ESConstant.java
-
10cl_search_api/src/main/java/com/bfd/mf/common/web/vo/view/monitor/ESMonitorBaseEntity.java
-
7cl_search_api/src/main/java/com/bfd/mf/service/SearchDataService.java
-
0cl_stream_3.1.2.iml
-
12cl_stream_3.1.iml
-
4pom.xml
@ -0,0 +1,153 @@ |
|||
package com.bfd.mf.job.domain.entity; |
|||
|
|||
import javax.persistence.Entity; |
|||
import javax.persistence.Table; |
|||
|
|||
@Entity |
|||
@Table(name = "cl_alarm") |
|||
public class Alarm extends AbstractEntity { |
|||
private int alarmTag; |
|||
private int alarmReason; |
|||
private String alarmMessage; |
|||
private String alarmTaskUrl; |
|||
private String alarmTaskContent; |
|||
private String alarmCid; |
|||
private String alarmConfig; |
|||
private String alarmTriggerTime; |
|||
private String alarmAssignTime; |
|||
private String alarmFinishTime; |
|||
private String alarmHandler; |
|||
private String opinion; |
|||
private int status; |
|||
private String createTime; |
|||
private String updateTime; |
|||
private int del; |
|||
|
|||
public int getAlarmTag() { |
|||
return alarmTag; |
|||
} |
|||
|
|||
public void setAlarmTag(int alarmTag) { |
|||
this.alarmTag = alarmTag; |
|||
} |
|||
|
|||
public int getAlarmReason() { |
|||
return alarmReason; |
|||
} |
|||
|
|||
public void setAlarmReason(int alarmReason) { |
|||
this.alarmReason = alarmReason; |
|||
} |
|||
|
|||
public String getAlarmMessage() { |
|||
return alarmMessage; |
|||
} |
|||
|
|||
public void setAlarmMessage(String alarmMessage) { |
|||
this.alarmMessage = alarmMessage; |
|||
} |
|||
|
|||
public String getAlarmTaskUrl() { |
|||
return alarmTaskUrl; |
|||
} |
|||
|
|||
public void setAlarmTaskUrl(String alarmTaskUrl) { |
|||
this.alarmTaskUrl = alarmTaskUrl; |
|||
} |
|||
|
|||
public String getAlarmTaskContent() { |
|||
return alarmTaskContent; |
|||
} |
|||
|
|||
public void setAlarmTaskContent(String alarmTaskContent) { |
|||
this.alarmTaskContent = alarmTaskContent; |
|||
} |
|||
|
|||
public String getAlarmCid() { |
|||
return alarmCid; |
|||
} |
|||
|
|||
public void setAlarmCid(String alarmCid) { |
|||
this.alarmCid = alarmCid; |
|||
} |
|||
|
|||
public String getAlarmConfig() { |
|||
return alarmConfig; |
|||
} |
|||
|
|||
public void setAlarmConfig(String alarmConfig) { |
|||
this.alarmConfig = alarmConfig; |
|||
} |
|||
|
|||
public String getAlarmTriggerTime() { |
|||
return alarmTriggerTime; |
|||
} |
|||
|
|||
public void setAlarmTriggerTime(String alarmTriggerTime) { |
|||
this.alarmTriggerTime = alarmTriggerTime; |
|||
} |
|||
|
|||
public String getAlarmAssignTime() { |
|||
return alarmAssignTime; |
|||
} |
|||
|
|||
public void setAlarmAssignTime(String alarmAssignTime) { |
|||
this.alarmAssignTime = alarmAssignTime; |
|||
} |
|||
|
|||
public String getAlarmFinishTime() { |
|||
return alarmFinishTime; |
|||
} |
|||
|
|||
public void setAlarmFinishTime(String alarmFinishTime) { |
|||
this.alarmFinishTime = alarmFinishTime; |
|||
} |
|||
|
|||
public String getAlarmHandler() { |
|||
return alarmHandler; |
|||
} |
|||
|
|||
public void setAlarmHandler(String alarmHandler) { |
|||
this.alarmHandler = alarmHandler; |
|||
} |
|||
|
|||
public String getOpinion() { |
|||
return opinion; |
|||
} |
|||
|
|||
public void setOpinion(String opinion) { |
|||
this.opinion = opinion; |
|||
} |
|||
|
|||
public int getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
public void setStatus(int status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
public String getCreateTime() { |
|||
return createTime; |
|||
} |
|||
|
|||
public void setCreateTime(String createTime) { |
|||
this.createTime = createTime; |
|||
} |
|||
|
|||
public String getUpdateTime() { |
|||
return updateTime; |
|||
} |
|||
|
|||
public void setUpdateTime(String updateTime) { |
|||
this.updateTime = updateTime; |
|||
} |
|||
|
|||
public int getDel() { |
|||
return del; |
|||
} |
|||
|
|||
public void setDel(int del) { |
|||
this.del = del; |
|||
} |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.bfd.mf.job.domain.repository; |
|||
|
|||
import com.bfd.mf.job.domain.entity.Alarm; |
|||
import org.springframework.data.repository.CrudRepository; |
|||
|
|||
public interface AlarmRepository extends CrudRepository<Alarm, Long> { |
|||
|
|||
|
|||
} |
@ -1,243 +0,0 @@ |
|||
package com.bfd.mf.common.util; |
|||
|
|||
import it.sauronsoftware.jave.Encoder; |
|||
|
|||
import javax.imageio.ImageIO; |
|||
import javax.imageio.ImageReader; |
|||
import javax.imageio.stream.FileImageInputStream; |
|||
import javax.imageio.stream.ImageInputStream; |
|||
import java.awt.image.BufferedImage; |
|||
import java.io.*; |
|||
import java.util.ArrayList; |
|||
import java.util.Iterator; |
|||
import java.util.List; |
|||
import java.io.File; |
|||
import java.io.FileInputStream; |
|||
import java.io.IOException; |
|||
|
|||
|
|||
|
|||
/** |
|||
* Created by BFD-229 on 2017/7/6. |
|||
*/ |
|||
public class ReadLine { |
|||
|
|||
public static List<String> readLine( File fileName){ |
|||
List<String> list = new ArrayList<String> (); |
|||
String line; |
|||
try { |
|||
InputStreamReader read = new InputStreamReader(new FileInputStream(fileName), "utf-8"); |
|||
BufferedReader reader = new BufferedReader(read); |
|||
while ((line = reader.readLine()) != null) { |
|||
try { |
|||
if (line.length() > 0) { |
|||
list.add(line); |
|||
} |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
return list; |
|||
}catch (UnsupportedEncodingException e) { |
|||
e.printStackTrace(); |
|||
return null; |
|||
} catch (FileNotFoundException e) { |
|||
e.printStackTrace(); |
|||
return null; |
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
|
|||
// public static List<JSONObject> readLine(File fileName){ |
|||
// List<JSONObject> list = new ArrayList<JSONObject> (); |
|||
// String line; |
|||
// try { |
|||
// InputStreamReader read = new InputStreamReader(new FileInputStream(fileName), "utf-8"); |
|||
// BufferedReader reader = new BufferedReader(read); |
|||
// while ((line = reader.readLine()) != null) { |
|||
// try { |
|||
// if (line.length() > 0) { |
|||
// list.add(line); |
|||
// } |
|||
// } catch (Exception e) { |
|||
// e.printStackTrace(); |
|||
// } |
|||
// } |
|||
// return list; |
|||
// }catch (UnsupportedEncodingException e) { |
|||
// e.printStackTrace(); |
|||
// return null; |
|||
// } catch (FileNotFoundException e) { |
|||
// e.printStackTrace(); |
|||
// return null; |
|||
// } catch (IOException e) { |
|||
// e.printStackTrace(); |
|||
// return null; |
|||
// } |
|||
// } |
|||
|
|||
// 读取文件内容 |
|||
public static String readFile(String path){ |
|||
File file = new File(path); |
|||
StringBuilder result = new StringBuilder(); |
|||
try{ |
|||
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));//构造一个BufferedReader类来读取文件 |
|||
String s = null; |
|||
while((s = br.readLine())!=null){//使用readLine方法,一次读一行 |
|||
result.append( System.lineSeparator() + s); |
|||
} |
|||
br.close(); |
|||
}catch(Exception e){ |
|||
e.printStackTrace(); |
|||
} |
|||
return result.toString(); |
|||
} |
|||
|
|||
|
|||
public static void readFiles(File file){ |
|||
if (file.exists()) { |
|||
System.err.println("exist"); |
|||
try { |
|||
FileInputStream fis = new FileInputStream(file); |
|||
InputStreamReader isr = new InputStreamReader(fis, "UTF-8"); |
|||
BufferedReader br = new BufferedReader(isr); |
|||
String line; |
|||
while((line = br.readLine()) != null){ |
|||
System.out.println(line); |
|||
} |
|||
br.close(); |
|||
isr.close(); |
|||
fis.close(); |
|||
} catch (FileNotFoundException e) { |
|||
e.printStackTrace(); |
|||
} catch (UnsupportedEncodingException e) { |
|||
e.printStackTrace(); |
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
public static String getResolution1(File file) throws IOException { |
|||
BufferedImage image = ImageIO.read(file); |
|||
return image.getWidth() + "x" + image.getHeight(); |
|||
} |
|||
|
|||
|
|||
// public static String getResolution(File file){ |
|||
// Encoder encoder = new Encoder(); |
|||
// try { |
|||
// MultimediaInfo m = encoder.getInfo(file); |
|||
// int height = m.getVideo().getSize().getHeight(); |
|||
// int width = m.getVideo().getSize().getWidth(); |
|||
// System.out.println("width:"+width); |
|||
// System.out.println("height:" + height); |
|||
// FileInputStream fis = new FileInputStream(source); |
|||
// FileChannel fc = fis.getChannel(); |
|||
// BigDecimal fileSize = new BigDecimal(fc.size()); |
|||
// String size = fileSize.divide(new BigDecimal(1048576), 2, RoundingMode.HALF_UP) + "MB"; |
|||
// System.out.println("size:" + size); |
|||
// long duration = m.getDuration()/1000; |
|||
// System.out.println("duration:" + duration + "s"); |
|||
// } catch (Exception e) { |
|||
// e.printStackTrace(); |
|||
// } |
|||
// } |
|||
|
|||
public static String getImageDim(String path) { |
|||
String result = null; |
|||
String suffix = getFileSuffix(path); |
|||
//解码具有给定后缀的文件 |
|||
Iterator<ImageReader> iter = ImageIO.getImageReadersBySuffix(suffix); |
|||
// System.out.println(ImageIO.getImageReadersBySuffix(suffix)); |
|||
if (iter.hasNext()) { |
|||
ImageReader reader = iter.next(); |
|||
try { |
|||
ImageInputStream stream = new FileImageInputStream(new File(path)); |
|||
reader.setInput(stream); |
|||
int width = reader.getWidth(reader.getMinIndex()); |
|||
int height = reader.getHeight(reader.getMinIndex()); |
|||
result = width + "×" + height; |
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
} finally { |
|||
reader.dispose(); |
|||
} |
|||
} |
|||
// System.out.println("getImageDim:" + result); |
|||
return result; |
|||
} |
|||
|
|||
private static String getFileSuffix(final String path) { |
|||
String result = null; |
|||
if (path != null) { |
|||
result = ""; |
|||
if (path.lastIndexOf('.') != -1) { |
|||
result = path.substring(path.lastIndexOf('.')); |
|||
if (result.startsWith(".")) { |
|||
result = result.substring(1); |
|||
} |
|||
} |
|||
} |
|||
// System.out.println("getFileSuffix:" + result); |
|||
return result; |
|||
} |
|||
|
|||
|
|||
public static String videosize(String video) { |
|||
File source = new File(video); |
|||
Encoder encoder = new Encoder(); |
|||
try { |
|||
it.sauronsoftware.jave.MultimediaInfo m = encoder.getInfo(source); |
|||
return m.getVideo().getSize().getHeight() + "×" + m.getVideo().getSize().getWidth(); |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
// public static String getVideoTime (String path){ |
|||
// File source = new File(path); |
|||
// Encoder encoder = new Encoder(); |
|||
// File[] file = source.listFiles(); |
|||
// long sum =0; |
|||
// for (File file2 : file) { |
|||
// try { |
|||
// MultimediaInfo m = encoder.getInfo(file2); |
|||
// long ls = m.getDuration()/1000; //ls是获取到的秒数 |
|||
// sum += ls; |
|||
// } catch (Exception e) { |
|||
// e.printStackTrace(); |
|||
// } |
|||
// } |
|||
// double sum1 = (double)sum; |
|||
// double sum2 =sum1/3600;// 转换成为了小时 |
|||
// System.out.println(sum2); |
|||
// return sum2+""; |
|||
// } |
|||
// |
|||
|
|||
|
|||
// public static byte[] readFile(String path){ |
|||
// try { |
|||
// FileInputStream fileInputStream = new FileInputStream(path); |
|||
// BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream)); |
|||
// String line = null; |
|||
// while ((line = bufferedReader.readLine()) != null) { |
|||
// System.out.println(line); |
|||
// } |
|||
// fileInputStream.close(); |
|||
// }catch (Exception e){ |
|||
// e.printStackTrace(); |
|||
// } |
|||
// } |
|||
|
|||
|
|||
|
|||
} |
@ -1,12 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> |
|||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> |
|||
<output url="file://$MODULE_DIR$/target/classes" /> |
|||
<output-test url="file://$MODULE_DIR$/target/test-classes" /> |
|||
<content url="file://$MODULE_DIR$"> |
|||
<excludeFolder url="file://$MODULE_DIR$/target" /> |
|||
</content> |
|||
<orderEntry type="inheritedJdk" /> |
|||
<orderEntry type="sourceFolder" forTests="false" /> |
|||
</component> |
|||
</module> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue