判断是否是周末或者节假日
```
//判断是否是周末或者节假日
private boolean checkDate(String realityEnterPortTime) throws Exception {
boolean result = false;
//是否是周末
DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Date bdate = format1.parse(realityEnterPortTime);
Calendar cal = Calendar.getInstance();
cal.setTime(bdate);
if(cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY){
result = true;
} else{
result = false;
}
//是否是节假日
ConfigHolidayInfoPage holidayPage = new ConfigHolidayInfoPage();
holidayPage.setRealityEnterPortTime(new SimpleDateFormat("yyyy-MM-dd").format(bdate));
List<ConfigHolidayInfo> dataList = configHolidayInfoService.queryByList(holidayPage);
if(dataList.size() > 0) {
result = true;
} else{
result = false;
}
return result;
}
如有不当,欢迎指正

浙公网安备 33010602011771号