소스 검색

Merge branch 'dev' of http://git.izouma.com/xiongzhu/raex_back into dev

panhui 4 년 전
부모
커밋
c6ac3b2866
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 2
      src/main/java/com/izouma/nineth/service/StatisticService.java
  2. 1 1
      src/main/java/com/izouma/nineth/web/StatisticController.java

+ 4 - 2
src/main/java/com/izouma/nineth/service/StatisticService.java

@@ -85,11 +85,13 @@ public class StatisticService {
     /*
     按月
      */
-    public Long userTrendV2(String yearMonth) {
+    public Map<String, Long> userTrendV2(String yearMonth) {
+        Map<String, Long> map = new HashMap<>();
         YearMonth month = YearMonth.parse(yearMonth);
         LocalDateTime end = month.atEndOfMonth().atTime(LocalTime.MAX);
         LocalDateTime start = month.atDay(1).atStartOfDay();
-        return userRepo.countByCreatedAtBetween(start, end);
+        map.put(yearMonth, userRepo.countByCreatedAtBetween(start, end));
+        return map;
     }
 
     public Map<String, Map<String, Long>> orderNumTrend(int day, Long userId) {

+ 1 - 1
src/main/java/com/izouma/nineth/web/StatisticController.java

@@ -43,7 +43,7 @@ public class StatisticController {
     @GetMapping("/userTrendV2")
     @Cacheable(value = "userTrendV2", key = "#yearMonth")
     @PreAuthorize("hasAnyRole('ADMIN','ORDERINFO')")
-    public Long userTrendV2(String yearMonth) {
+    public Map<String, Long> userTrendV2(String yearMonth) {
         return statisticService.userTrendV2(yearMonth);
     }