Просмотр исходного кода

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 5 лет назад
Родитель
Сommit
29feba88b6
1 измененных файлов с 18 добавлено и 3 удалено
  1. 18 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

+ 18 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1104,14 +1104,19 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         int times = 0;
         int times = 0;
 
 
         Map<String, Integer> holidayDays = new HashMap<>();
         Map<String, Integer> holidayDays = new HashMap<>();
+        Map<Integer, Map<String, Integer>> holiday = new HashMap<>();
         if (classGroup4MixDto.getHoliday()) {
         if (classGroup4MixDto.getHoliday()) {
-            Map<Integer, Map<String, Integer>> holiday = jiaRiFeignService.query(now.getYear());
+            holiday = jiaRiFeignService.query(now.getYear());
             holidayDays = holiday.get(now.getYear());
             holidayDays = holiday.get(now.getYear());
         }
         }
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
 
 
         WhileNode:
         WhileNode:
         while (true) {
         while (true) {
+            if(classGroup4MixDto.getHoliday() && !holiday.containsKey(now.getYear())){
+                holiday = jiaRiFeignService.query(now.getYear());
+                holidayDays = holiday.get(now.getYear());
+            }
             if (classGroup4MixDto.getHoliday() && holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MM-dd")))) {
             if (classGroup4MixDto.getHoliday() && holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MM-dd")))) {
                 now = now.plusDays(1);
                 now = now.plusDays(1);
                 continue;
                 continue;
@@ -1311,14 +1316,19 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
 
         int times = 0;
         int times = 0;
         Map<String, Integer> holidayDays = new HashMap<>();
         Map<String, Integer> holidayDays = new HashMap<>();
+        Map<Integer, Map<String, Integer>> holiday = new HashMap<>();
         if (classGroup4MixDto.getHoliday()) {
         if (classGroup4MixDto.getHoliday()) {
-            Map<Integer, Map<String, Integer>> holiday = jiaRiFeignService.query(now.getYear());
+            holiday = jiaRiFeignService.query(now.getYear());
             holidayDays = holiday.get(now.getYear());
             holidayDays = holiday.get(now.getYear());
         }
         }
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
 
 
         WhileNode:
         WhileNode:
         while (true) {
         while (true) {
+            if(classGroup4MixDto.getHoliday() && !holiday.containsKey(now.getYear())){
+                holiday = jiaRiFeignService.query(now.getYear());
+                holidayDays = holiday.get(now.getYear());
+            }
             if (classGroup4MixDto.getHoliday() && holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MM-dd")))) {
             if (classGroup4MixDto.getHoliday() && holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MM-dd")))) {
                 now = now.plusDays(1);
                 now = now.plusDays(1);
                 continue;
                 continue;
@@ -1538,14 +1548,19 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         BigDecimal expectPrice = new BigDecimal("0");
         BigDecimal expectPrice = new BigDecimal("0");
         int times = 0;
         int times = 0;
         Map<String, Integer> holidayDays = new HashMap<>();
         Map<String, Integer> holidayDays = new HashMap<>();
+        Map<Integer, Map<String, Integer>> holiday = new HashMap<>();
         if (classGroup4MixDto.getHoliday()) {
         if (classGroup4MixDto.getHoliday()) {
-            Map<Integer, Map<String, Integer>> holiday = jiaRiFeignService.query(now.getYear());
+            holiday = jiaRiFeignService.query(now.getYear());
             holidayDays = holiday.get(now.getYear());
             holidayDays = holiday.get(now.getYear());
         }
         }
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
 
 
         WhileNode:
         WhileNode:
         while (true) {
         while (true) {
+            if(classGroup4MixDto.getHoliday() && !holiday.containsKey(now.getYear())){
+                holiday = jiaRiFeignService.query(now.getYear());
+                holidayDays = holiday.get(now.getYear());
+            }
             if (classGroup4MixDto.getHoliday() && holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MM-dd")))) {
             if (classGroup4MixDto.getHoliday() && holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MM-dd")))) {
                 now = now.plusDays(1);
                 now = now.plusDays(1);
                 continue;
                 continue;