Reiskuchen il y a 5 ans
Parent
commit
3a0f6fd6ea

+ 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")

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml

@@ -14,7 +14,7 @@ spring:
       location: C:/upload/
   datasource:
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://118.190.47.230:3306/man2?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+    url: jdbc:mysql://118.190.47.230:3306/man_hour_manager?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
     username: root
     password: p011430seya1026
     hikari: