|
@@ -16,6 +16,7 @@ import com.management.platform.mapper.PicContentKeywordsMapper;
|
|
import com.management.platform.service.ScreenshotService;
|
|
import com.management.platform.service.ScreenshotService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.management.platform.util.*;
|
|
import com.management.platform.util.*;
|
|
|
|
+import net.sourceforge.tess4j.Word;
|
|
import org.apache.log4j.Logger;
|
|
import org.apache.log4j.Logger;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -121,6 +122,7 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public HttpRespMsg saveAndProcessImage(ScreenshotVO screenshotvo) {
|
|
public HttpRespMsg saveAndProcessImage(ScreenshotVO screenshotvo) {
|
|
|
|
+ System.out.println("uid==="+screenshotvo.getUid());
|
|
String filePath = UploadFileToFileNameUtil.uploadFile(screenshotvo.getFile(), path);
|
|
String filePath = UploadFileToFileNameUtil.uploadFile(screenshotvo.getFile(), path);
|
|
Screenshot screenshot = new Screenshot();
|
|
Screenshot screenshot = new Screenshot();
|
|
BeanUtils.copyProperties(screenshotvo, screenshot);
|
|
BeanUtils.copyProperties(screenshotvo, screenshot);
|
|
@@ -156,6 +158,8 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
|
|
|
|
if (isNovel(textContents)) {
|
|
if (isNovel(textContents)) {
|
|
screenshot.setPicType(6);
|
|
screenshot.setPicType(6);
|
|
|
|
+ } else if (isDocument(textContents)) {
|
|
|
|
+ screenshot.setPicType(2);//看文档
|
|
} else {
|
|
} else {
|
|
|
|
|
|
List<String> exeprocessList = ProcessUtil.getExeprocessListfromProcessStr(screenshotvo.getProcessList());
|
|
List<String> exeprocessList = ProcessUtil.getExeprocessListfromProcessStr(screenshotvo.getProcessList());
|
|
@@ -297,16 +301,15 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
// String str = "中文";
|
|
// String str = "中文";
|
|
// System.out.println(str.toCharArray().length);
|
|
// System.out.println(str.toCharArray().length);
|
|
// isEntertainment(new File("C://Users/seya/Desktop/1.jpg"));
|
|
// isEntertainment(new File("C://Users/seya/Desktop/1.jpg"));
|
|
- String browserName = null;
|
|
|
|
- try {
|
|
|
|
- browserName = isBrowser(new File("C://Users/seya/Desktop/chrome.jpg"));
|
|
|
|
- System.out.println(
|
|
|
|
- "找到浏览器==" + browserName
|
|
|
|
- );
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+// String browserName = null;
|
|
|
|
+// try {
|
|
|
|
+// browserName = isBrowser(new File("C://Users/seya/Desktop/chrome.jpg"));
|
|
|
|
+// System.out.println(
|
|
|
|
+// "找到浏览器==" + browserName
|
|
|
|
+// );
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
+// e.printStackTrace();
|
|
|
|
+// }
|
|
}
|
|
}
|
|
|
|
|
|
//娱乐类: 电影+游戏; 画面比较丰富的
|
|
//娱乐类: 电影+游戏; 画面比较丰富的
|
|
@@ -524,4 +527,24 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
return browserName;
|
|
return browserName;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 判断是否是看文档, 具体类型为word, excel, pdf, ppt
|
|
|
|
+ * @param textContents
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public static boolean isDocument(List<String> textContents) {
|
|
|
|
+ boolean find = false;
|
|
|
|
+ for (int i=0;i<textContents.size() && i <= 2; i++) {//出现在前三行
|
|
|
|
+ String text = textContents.get(i);
|
|
|
|
+ if (text.endsWith("Word")
|
|
|
|
+ || text.endsWith("Excel")
|
|
|
|
+ || text.endsWith("Power Point")
|
|
|
|
+ || text.endsWith("Adobe Reader")) {
|
|
|
|
+ find = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return find;
|
|
|
|
+ }
|
|
}
|
|
}
|