Переглянути джерело

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

sunyadv 5 роки тому
батько
коміт
3d81ddd57c

+ 15 - 11
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ScreenshotServiceImpl.java

@@ -122,7 +122,7 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
 
     @Override
     public HttpRespMsg saveAndProcessImage(ScreenshotVO screenshotvo) {
-        System.out.println("uid==="+screenshotvo.getUid());
+        System.out.println("uid===" + screenshotvo.getUid());
         String filePath = UploadFileToFileNameUtil.uploadFile(screenshotvo.getFile(), path);
         Screenshot screenshot = new Screenshot();
         BeanUtils.copyProperties(screenshotvo, screenshot);
@@ -454,15 +454,18 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
             //单独记录当前的时间以便使用
             LocalTime currentTime = screenshot.getIndate().toLocalTime();
             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) {
@@ -530,12 +533,13 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
 
     /**
      * 判断是否是看文档, 具体类型为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++) {//出现在前三行
+        for (int i = 0; i < textContents.size() && i <= 2; i++) {//出现在前三行
             String text = textContents.get(i);
             if (text.endsWith("Word")
                     || text.endsWith("Excel")