소스 검색

提高班,增加跳过节假日

周箭河 5 년 전
부모
커밋
5bf36112eb
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;