Jelajahi Sumber

一周从周日开始

licailing 4 tahun lalu
induk
melakukan
2e59d30f72

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

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

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

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