|
|
@ -13,7 +13,6 @@ import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.text.Format; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.Calendar; |
|
|
@ -66,7 +65,7 @@ public class ShowApiServiceImpl implements ShowApiService { |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (ParseException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
logger.error("method exception", e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -103,7 +102,7 @@ public class ShowApiServiceImpl implements ShowApiService { |
|
|
|
logger.info("无需更新"); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
logger.error("method exception", e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -119,7 +118,7 @@ public class ShowApiServiceImpl implements ShowApiService { |
|
|
|
calenderDao.updateHoliday(holidayDetail); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
logger.error("method exception", e); |
|
|
|
throw new RenException("根据年份查询当年的节假日列表API【https://route.showapi.com/894-4】查询异常"); |
|
|
|
} |
|
|
|
} |
|
|
@ -130,11 +129,12 @@ public class ShowApiServiceImpl implements ShowApiService { |
|
|
|
try { |
|
|
|
dayDetailResultDTO = ShowApiUtil.queryHolidayV2020(currentDate); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
logger.error("queryHolidayV2020 exception", e); |
|
|
|
return; |
|
|
|
} |
|
|
|
List<CalenderEntity> list = calenderDao.selectByDay(currentDate); |
|
|
|
if(null!=list&&list.size()>0){ |
|
|
|
if (null != dayDetailResultDTO && 0 == dayDetailResultDTO.getRet_code()) { |
|
|
|
if (0 == dayDetailResultDTO.getRet_code()) { |
|
|
|
for (CalenderEntity calenderEntity : list) { |
|
|
|
calenderEntity.setRetCode(dayDetailResultDTO.getRet_code()); |
|
|
|
calenderEntity.setWeekday(dayDetailResultDTO.getWeekDay()); |
|
|
@ -169,7 +169,6 @@ public class ShowApiServiceImpl implements ShowApiService { |
|
|
|
calenderEntity.setQueryDate(queryDate); |
|
|
|
} catch (ParseException e) { |
|
|
|
logger.error("QUERY_DATE 赋值 错误"); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
calenderEntity.setRetCode(dayDetailResultDTO.getRet_code()); |
|
|
|
calenderEntity.setWeekday(dayDetailResultDTO.getWeekDay()); |
|
|
@ -217,7 +216,7 @@ public class ShowApiServiceImpl implements ShowApiService { |
|
|
|
date = dateFormat.parse(datetime); |
|
|
|
cal.setTime(date); |
|
|
|
} catch (ParseException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
logger.error("method exception", e); |
|
|
|
} |
|
|
|
int w = cal.get(Calendar.DAY_OF_WEEK) - 1; |
|
|
|
return weekDays[w]; |
|
|
@ -238,7 +237,7 @@ public class ShowApiServiceImpl implements ShowApiService { |
|
|
|
date = dateFormat.parse(datetime); |
|
|
|
cal.setTime(date); |
|
|
|
} catch (ParseException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
logger.error("method exception", e); |
|
|
|
} |
|
|
|
int w = cal.get(Calendar.DAY_OF_WEEK) - 1; |
|
|
|
return weekDays[w]; |
|
|
@ -259,7 +258,7 @@ public class ShowApiServiceImpl implements ShowApiService { |
|
|
|
date = dateFormat.parse(datetime); |
|
|
|
cal.setTime(date); |
|
|
|
} catch (ParseException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
logger.error("method exception", e); |
|
|
|
} |
|
|
|
int w = cal.get(Calendar.DAY_OF_WEEK) - 1; |
|
|
|
return weekDays[w]; |
|
|
|