|
@@ -3,6 +3,7 @@ package com.management.platform.service.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.management.platform.constant.Constant;
|
|
|
import com.management.platform.constant.Parameter;
|
|
|
import com.management.platform.entity.PicContentKeywords;
|
|
@@ -25,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
+import java.time.LocalDate;
|
|
|
import java.time.LocalTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.HashSet;
|
|
@@ -79,6 +81,18 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
|
|
|
+ //根据用户id分页获取当天的截图
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg getTodayScreenshotListByUser(Integer userId, Integer pageIndex, Integer pageSize) {
|
|
|
+ HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
+ httpRespMsg.data = screenshotMapper.selectPage(new Page<>(pageIndex, pageSize),
|
|
|
+ new QueryWrapper<Screenshot>()
|
|
|
+ .eq("date_str", LocalDate.now())
|
|
|
+ .eq("uid", userId)
|
|
|
+ .orderByDesc("indate"));
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public HttpRespMsg saveAndProcessImage(ScreenshotVO screenshotvo) {
|
|
|
String filePath = UploadFileToFileNameUtil.uploadFile(screenshotvo.getFile(), path);
|
|
@@ -199,6 +213,7 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
|
|
|
.setDuration((double) DETECTION_INTERVAL / 3600);
|
|
|
timeCalculationMapper.insert(timeCalculation);
|
|
|
}
|
|
|
+ /*之后可能还需要处理跨越一天的情况*/
|
|
|
} catch (NullPointerException e) {
|
|
|
//凡是有空指针说明缺少用户id或者时间数据
|
|
|
log.info("=====工作时长统计失败 缺少用户或时间数据=====");
|