项目初始化

This commit is contained in:
2026-03-27 18:02:57 +08:00
parent 82dfec137a
commit 8792372fe0
3 changed files with 46 additions and 15 deletions

View File

@@ -24,10 +24,11 @@ public class SysWorkbenchController {
@RequestMapping(value = "getNoteInfo")
@ResponseBody
public List<NoteInfo> getNoteInfo() {
public List<NoteInfo> getNoteInfo(MyNotes myNotes) {
List<NoteInfo> noteInfos = new ArrayList<>();
myNotes.setCreateTime_gte(DateUtils.getFirstDayOfCurrentYear());
List<DictData> dictDataList = DictUtils.getDictList("note_type");
List<MyNotes> myNotesList = myNotesService.findList(new MyNotes());
List<MyNotes> myNotesList = myNotesService.findList(myNotes);
Map<String, Long> totalMap = myNotesList.stream()
.collect(Collectors.groupingBy(MyNotes::getType, Collectors.counting()));
Map<String, Long> ustatusMap = myNotesList.stream()
@@ -46,6 +47,7 @@ public class SysWorkbenchController {
@RequestMapping(value = "getNoteChart")
@ResponseBody
public List<ChartDataItem> getNoteChart(MyNotes myNotes) {
myNotes.setCreateTime_gte(DateUtils.getFirstDayOfCurrentYear());
List<MyNotes> myNotesList = myNotesService.findList(myNotes);
Map<String, ChartDataItem> chartDataMap = myNotesList.stream()
.collect(Collectors.groupingBy(

View File

@@ -68,4 +68,9 @@ public class DateUtils {
public static LocalDate dateToLocalDate(Date date) {
return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
}
public static Date getFirstDayOfCurrentYear() {
LocalDate firstDayOfYear = LocalDate.now().withDayOfYear(1);
return Date.from(firstDayOfYear.atStartOfDay(ZoneId.systemDefault()).toInstant());
}
}