Browse Source

每日工作时间

Reiskuchen 5 years ago
parent
commit
2ea532550f

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
 import java.io.FileOutputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.IOException;
 import java.sql.Timestamp;
 import java.sql.Timestamp;
+import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
@@ -170,7 +171,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     .eq("action_type", 0))) {
                     .eq("action_type", 0))) {
                 totalWorkingTime += timeCalculation.getDuration();
                 totalWorkingTime += timeCalculation.getDuration();
             }
             }
-            resultMap.put("time", totalWorkingTime);
+            resultMap.put("time", new DecimalFormat("#.00").format(totalWorkingTime / 3600));
             resultMap.put("project", projectMapper.selectList(new QueryWrapper<Project>()
             resultMap.put("project", projectMapper.selectList(new QueryWrapper<Project>()
                     .eq("company_id", userMapper.selectById(userId).getCompanyId())));
                     .eq("company_id", userMapper.selectById(userId).getCompanyId())));
             httpRespMsg.data = resultMap;
             httpRespMsg.data = resultMap;

+ 0 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ScreenshotServiceImpl.java

@@ -457,11 +457,8 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
                     .last("LIMIT 1"));
                     .last("LIMIT 1"));
             //单独记录当前的时间以便使用
             //单独记录当前的时间以便使用
             LocalTime currentTime = screenshot.getIndate().toLocalTime();
             LocalTime currentTime = screenshot.getIndate().toLocalTime();
-            log.info("开始处理图片");
-            log.info("上一条记录latestRecord: " + latestRecord);
             if (latestRecord != null) {
             if (latestRecord != null) {
                 //首先对比类型
                 //首先对比类型
-                log.info("类型是否相同: " + latestRecord.getActionType().equals(screenshot.getPicType()));
                 if (latestRecord.getActionType().equals(screenshot.getPicType())) {
                 if (latestRecord.getActionType().equals(screenshot.getPicType())) {
                     //如果有记录的话 准备计算上次结束和新的开始的时间差
                     //如果有记录的话 准备计算上次结束和新的开始的时间差
                     LocalTime estimatedTime = latestRecord.getEndTime();
                     LocalTime estimatedTime = latestRecord.getEndTime();
@@ -469,14 +466,12 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
                             + (currentTime.getMinute() - estimatedTime.getMinute()) * 60
                             + (currentTime.getMinute() - estimatedTime.getMinute()) * 60
                             + (currentTime.getSecond() - estimatedTime.getSecond()));
                             + (currentTime.getSecond() - estimatedTime.getSecond()));
                     //断层不大于600秒的话
                     //断层不大于600秒的话
-                    log.info("间隔时间durationSecond: " + durationSecond + " 结果" + (durationSecond <= DETECTION_INTERVAL));
                     if (durationSecond <= DETECTION_INTERVAL) {
                     if (durationSecond <= DETECTION_INTERVAL) {
                         //确认连续 将状态改为连续
                         //确认连续 将状态改为连续
                         isConsecutive = true;
                         isConsecutive = true;
                     }
                     }
                 }
                 }
             }
             }
-            log.info("连续状态: " + isConsecutive);
             if (isConsecutive) {
             if (isConsecutive) {
                 //如果是连续的话那就准备修改上一条记录的最后时间和持续时间
                 //如果是连续的话那就准备修改上一条记录的最后时间和持续时间
                 LocalTime startTime = latestRecord.getStartTime();
                 LocalTime startTime = latestRecord.getStartTime();