Sfoglia il codice sorgente

一周从周日开始

licailing 4 anni fa
parent
commit
2e59d30f72

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

@@ -82,7 +82,7 @@ public class StatisticService {
         int value;
         // 周
         if (type == 0) {
-            value = now.getDayOfWeek().getValue() - 1;
+            value = now.getDayOfWeek().getValue();
         } else if (type == 1) {
             value = now.getDayOfMonth() - 1;
         } else {
@@ -123,7 +123,7 @@ public class StatisticService {
         int value;
         // 周
         if (type == 0) {
-            value = now.getDayOfWeek().getValue() - 1;
+            value = now.getDayOfWeek().getValue();
         } else if (type == 1) {
             value = now.getDayOfMonth() - 1;
         } else {

+ 2 - 2
src/test/java/com/izouma/zhirongip/service/StatisticServiceTest.java

@@ -20,12 +20,12 @@ class StatisticServiceTest extends ApplicationTests {
 
     @Test
     void getDemand() {
-        System.out.println(statisticService.getDemand(2));
+        System.out.println(statisticService.getDemand(0));
     }
 
     @Test
     void getSupply() {
-        System.out.println(statisticService.getSupply(0));
+        System.out.println(statisticService.getSupply(1));
     }