|
@@ -188,15 +188,19 @@ public class TaskService implements TaskServiceInterface {
|
|
|
task.setNeedReview(dto.getNeedReview() != null ? dto.getNeedReview() : 1);
|
|
task.setNeedReview(dto.getNeedReview() != null ? dto.getNeedReview() : 1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- task.setReviewByCategory(dto.getReviewByCategory() != null ? dto.getReviewByCategory() : 0);
|
|
|
|
|
|
|
+task.setReviewByCategory(dto.getReviewByCategory() != null ? dto.getReviewByCategory() : 0);
|
|
|
task.setStatus("pending");
|
|
task.setStatus("pending");
|
|
|
task.setCreatedAt(new Date());
|
|
task.setCreatedAt(new Date());
|
|
|
task.setUpdatedAt(new Date());
|
|
task.setUpdatedAt(new Date());
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 五维维度
|
|
|
|
|
+ task.setDimensionCode(dto.getDimensionCode());
|
|
|
|
|
+ task.setDimensionWeights(dto.getDimensionWeights());
|
|
|
|
|
+
|
|
|
return task;
|
|
return task;
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- public List<Task> getTodayTasks(Long childId) {
|
|
|
|
|
|
|
+public List<Task> getTodayTasks(Long childId, String dimensionCode) {
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
calendar.set(Calendar.MINUTE, 0);
|
|
calendar.set(Calendar.MINUTE, 0);
|
|
@@ -207,13 +211,22 @@ public class TaskService implements TaskServiceInterface {
|
|
|
calendar.add(Calendar.DAY_OF_MONTH, 1);
|
|
calendar.add(Calendar.DAY_OF_MONTH, 1);
|
|
|
Date endOfDay = calendar.getTime();
|
|
Date endOfDay = calendar.getTime();
|
|
|
|
|
|
|
|
-return taskMapper.selectList(new LambdaQueryWrapper<Task>()
|
|
|
|
|
-.eq(Task::getChildId, childId)
|
|
|
|
|
-.ge(Task::getDeadline, startOfDay)
|
|
|
|
|
-.lt(Task::getDeadline, endOfDay)
|
|
|
|
|
-.in(Task::getStatus, Arrays.asList("pending", "completed"))
|
|
|
|
|
-.orderByAsc(Task::getDeadline));
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ LambdaQueryWrapper<Task> wrapper = new LambdaQueryWrapper<Task>()
|
|
|
|
|
+ .eq(Task::getChildId, childId)
|
|
|
|
|
+ .ge(Task::getDeadline, startOfDay)
|
|
|
|
|
+ .lt(Task::getDeadline, endOfDay)
|
|
|
|
|
+ .in(Task::getStatus, Arrays.asList("pending", "completed"))
|
|
|
|
|
+ .orderByAsc(Task::getDeadline);
|
|
|
|
|
+
|
|
|
|
|
+ if (dimensionCode != null && !dimensionCode.isEmpty()) {
|
|
|
|
|
+ wrapper.and(w -> w
|
|
|
|
|
+ .apply("COALESCE(JSON_EXTRACT(dimension_weights, '$." + dimensionCode + "'), 0) > 0")
|
|
|
|
|
+ .or().eq(Task::getDimensionCode, dimensionCode)
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return taskMapper.selectList(wrapper);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 按维度分类获取今日任务(五维页面筛选用)
|
|
* 按维度分类获取今日任务(五维页面筛选用)
|