소스 검색

1、修复节假日接口异常导致无法排课

Joburgess 5 년 전
부모
커밋
d5c87da32b
1개의 변경된 파일15개의 추가작업 그리고 3개의 파일을 삭제
  1. 15 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

+ 15 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -22,8 +22,11 @@ import com.ym.mec.jiari.JiaRiFeignService;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+import feign.codec.DecodeException;
 import org.apache.commons.collections.ListUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -87,6 +90,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	@Autowired
 	private MusicGroupService musicGroupService;
 
+	private final Logger LOGGER = LoggerFactory
+			.getLogger(this.getClass());
+
 	@Override
 	public BaseDAO<Long, CourseSchedule> getDAO() {
 		return courseScheduleDao;
@@ -1030,9 +1036,15 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
 		Map<String, Integer> holidayDays = new HashMap<>();
 		Map<Integer, Map<String, Integer>> holiday = new HashMap<>();;
-		if (vipGroupCourseAdjustInfo.isHoliday()) {
-			holiday = jiaRiFeignService.query(calendar.get(Calendar.YEAR));
-			holidayDays = holiday.get(calendar.get(Calendar.YEAR));
+		try {
+			if (vipGroupCourseAdjustInfo.isHoliday()) {
+				holiday = jiaRiFeignService.query(calendar.get(Calendar.YEAR));
+				holidayDays = holiday.get(calendar.get(Calendar.YEAR));
+			}
+		} catch (DecodeException e) {
+			LOGGER.error("节假日解析错误");
+		}finally {
+			vipGroupCourseAdjustInfo.setHoliday(false);
 		}
 
 		List<CourseSchedule> courseSchedules=new ArrayList<>();