|
@@ -65,7 +65,7 @@ public class TimeCalculationServiceImpl extends ServiceImpl<TimeCalculationMappe
|
|
try {
|
|
try {
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
|
|
Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
|
|
- //注意这里目前把代码为0以外的行为全部计作异常 后续可能需要修改
|
|
|
|
|
|
+ //actionCode为null时筛选6、7、8
|
|
resultMap.put("records", timeCalculationMapper
|
|
resultMap.put("records", timeCalculationMapper
|
|
.getDevianceList(new Page<>(pageIndex, pageSize), userId, actionCode, date, companyId));
|
|
.getDevianceList(new Page<>(pageIndex, pageSize), userId, actionCode, date, companyId));
|
|
//返回总数
|
|
//返回总数
|
|
@@ -93,13 +93,21 @@ public class TimeCalculationServiceImpl extends ServiceImpl<TimeCalculationMappe
|
|
map.put("phone", userMap.get("phone"));
|
|
map.put("phone", userMap.get("phone"));
|
|
//然后根据日期和用户id获取到所有的记录 然后手动累加在一起
|
|
//然后根据日期和用户id获取到所有的记录 然后手动累加在一起
|
|
Long[] timeArray = {0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L};
|
|
Long[] timeArray = {0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L};
|
|
- String[] stringArray = new String[9];
|
|
|
|
|
|
+ //编程 资料 文档 设计 美工 运营 小说 游戏 音乐
|
|
for (Map<String, Object> dataMap : timeCalculationMapper
|
|
for (Map<String, Object> dataMap : timeCalculationMapper
|
|
.getTodayStatistics((String) userMap.get("id"), date, companyId)) {
|
|
.getTodayStatistics((String) userMap.get("id"), date, companyId)) {
|
|
timeArray[(int) dataMap.get("type")] += (Long) dataMap.get("duration");
|
|
timeArray[(int) dataMap.get("type")] += (Long) dataMap.get("duration");
|
|
}
|
|
}
|
|
- for (int i = 0; i < 9; i++) {
|
|
|
|
- stringArray[i] = convertSecond(timeArray[i]);
|
|
|
|
|
|
+ Long[] resultArray = new Long[5];
|
|
|
|
+ //编程 浏览 设计 办公 娱乐
|
|
|
|
+ resultArray[0] = timeArray[0];
|
|
|
|
+ resultArray[1] = timeArray[1] + timeArray[2];
|
|
|
|
+ resultArray[2] = timeArray[3] + timeArray[4];
|
|
|
|
+ resultArray[3] = timeArray[5];
|
|
|
|
+ resultArray[4] = timeArray[6] + timeArray[7] + timeArray[8];
|
|
|
|
+ String[] stringArray = new String[5];
|
|
|
|
+ for (int i = 0; i < 5; i++) {
|
|
|
|
+ stringArray[i] = convertSecond(resultArray[i]);
|
|
}
|
|
}
|
|
map.put("statistics", stringArray);
|
|
map.put("statistics", stringArray);
|
|
//最后是数组的和
|
|
//最后是数组的和
|