Browse Source

bug修复

wangb 3 tuần trước cách đây
mục cha
commit
f07de6baa7

+ 3 - 4
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/singleanalysis/SingleAnalysisService.java

@@ -1584,9 +1584,11 @@ public class SingleAnalysisService {
 
     public SingleAnalysisVo SingleAnalysisTurbineinfoday(String wtId, String year, String month, SingleAnalysisVo byzb) {
         LocalDate now = LocalDate.now();
+        String date = year + "-" + month;
         int yearCurrent = now.getYear();
         int monthCurrent = now.getMonthValue();
         int dayOfMonth = now.getDayOfMonth();
+
         if (now.getDayOfMonth() == 1) {
             if (now.getMonthValue() == 1) {
                 yearCurrent = yearCurrent - 1;
@@ -1595,15 +1597,12 @@ public class SingleAnalysisService {
                 monthCurrent = monthCurrent - 1;
             }
             dayOfMonth = YearMonth.of(yearCurrent, monthCurrent).lengthOfMonth();
-        }
 
-        String date = year + "-" + month;
-        if (Integer.parseInt(year) != yearCurrent || Integer.parseInt(month) != monthCurrent) {
             String monCurrent;
             if (monthCurrent < 10) {
                 monCurrent = "0" + monthCurrent;
                 date = yearCurrent + "-" + monCurrent;
-            }else {
+            } else {
                 date = yearCurrent + "-" + monthCurrent;
             }
         }