|
@@ -122,7 +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());
|
|
|
|
|
|
+ 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);
|
|
@@ -454,15 +454,18 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
//单独记录当前的时间以便使用
|
|
//单独记录当前的时间以便使用
|
|
LocalTime currentTime = screenshot.getIndate().toLocalTime();
|
|
LocalTime currentTime = screenshot.getIndate().toLocalTime();
|
|
if (latestRecord != null) {
|
|
if (latestRecord != null) {
|
|
- //如果有记录的话 准备计算上次结束和新的开始的时间差
|
|
|
|
- LocalTime estimatedTime = latestRecord.getEndTime();
|
|
|
|
- Integer durationSecond = ((currentTime.getHour() - estimatedTime.getHour()) * 3600
|
|
|
|
- + (currentTime.getMinute() - estimatedTime.getMinute()) * 60
|
|
|
|
- + (currentTime.getSecond() - estimatedTime.getSecond()));
|
|
|
|
- //如果断层不大于600秒的话
|
|
|
|
- if (durationSecond <= DETECTION_INTERVAL) {
|
|
|
|
- //确认连续 将状态改为连续
|
|
|
|
- isConsecutive = true;
|
|
|
|
|
|
+ //首先对比类型
|
|
|
|
+ if (latestRecord.getActionType().equals(screenshot.getPicType())) {
|
|
|
|
+ //如果有记录的话 准备计算上次结束和新的开始的时间差
|
|
|
|
+ LocalTime estimatedTime = latestRecord.getEndTime();
|
|
|
|
+ Integer durationSecond = ((currentTime.getHour() - estimatedTime.getHour()) * 3600
|
|
|
|
+ + (currentTime.getMinute() - estimatedTime.getMinute()) * 60
|
|
|
|
+ + (currentTime.getSecond() - estimatedTime.getSecond()));
|
|
|
|
+ //断层不大于600秒的话
|
|
|
|
+ if (durationSecond <= DETECTION_INTERVAL) {
|
|
|
|
+ //确认连续 将状态改为连续
|
|
|
|
+ isConsecutive = true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (isConsecutive) {
|
|
if (isConsecutive) {
|
|
@@ -530,12 +533,13 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
|
|
|
|
/**
|
|
/**
|
|
* 判断是否是看文档, 具体类型为word, excel, pdf, ppt
|
|
* 判断是否是看文档, 具体类型为word, excel, pdf, ppt
|
|
|
|
+ *
|
|
* @param textContents
|
|
* @param textContents
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public static boolean isDocument(List<String> textContents) {
|
|
public static boolean isDocument(List<String> textContents) {
|
|
boolean find = false;
|
|
boolean find = false;
|
|
- for (int i=0;i<textContents.size() && i <= 2; i++) {//出现在前三行
|
|
|
|
|
|
+ for (int i = 0; i < textContents.size() && i <= 2; i++) {//出现在前三行
|
|
String text = textContents.get(i);
|
|
String text = textContents.get(i);
|
|
if (text.endsWith("Word")
|
|
if (text.endsWith("Word")
|
|
|| text.endsWith("Excel")
|
|
|| text.endsWith("Excel")
|