|
|
|
|
@ -1,8 +1,6 @@
|
|
|
|
|
package com.biutag.outeradmin.util; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.biutag.outeradmin.domain.Holiday; |
|
|
|
|
import com.biutag.outeradmin.model.vo.HolidayVo; |
|
|
|
|
import com.biutag.outeradmin.entity.Holiday; |
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
|
|
|
|
|
|
import java.io.BufferedReader; |
|
|
|
|
@ -60,17 +58,17 @@ public class HolidayUtil {
|
|
|
|
|
Holiday holiday = new Holiday(); |
|
|
|
|
DayOfWeek week = endDate.getDayOfWeek(); |
|
|
|
|
if(week == DayOfWeek.SATURDAY ) { |
|
|
|
|
holiday.setHoliday_flag("Y"); |
|
|
|
|
holiday.setHolidayFlag("Y"); |
|
|
|
|
holiday.setDate(endDate.format(formatter)); |
|
|
|
|
holiday.setDetail("周六"); |
|
|
|
|
allDateDayList.add(holiday); |
|
|
|
|
}else if(week == DayOfWeek.SUNDAY){ |
|
|
|
|
holiday.setHoliday_flag("Y"); |
|
|
|
|
holiday.setHolidayFlag("Y"); |
|
|
|
|
holiday.setDate(endDate.format(formatter)); |
|
|
|
|
holiday.setDetail("周日"); |
|
|
|
|
allDateDayList.add(holiday); |
|
|
|
|
}else{ |
|
|
|
|
holiday.setHoliday_flag("N"); |
|
|
|
|
holiday.setHolidayFlag("N"); |
|
|
|
|
holiday.setDate(endDate.format(formatter)); |
|
|
|
|
allDateDayList.add(holiday); |
|
|
|
|
} |
|
|
|
|
@ -94,10 +92,10 @@ public class HolidayUtil {
|
|
|
|
|
holiday.setDate(dateTime); |
|
|
|
|
if(value1.get("name").toString().contains("补班")){ |
|
|
|
|
holiday.setDetail("正常上班"); |
|
|
|
|
holiday.setHoliday_flag("N"); |
|
|
|
|
holiday.setHolidayFlag("N"); |
|
|
|
|
}else { |
|
|
|
|
holiday.setDetail(value1.get("name").toString()); |
|
|
|
|
holiday.setHoliday_flag("Y"); |
|
|
|
|
holiday.setHolidayFlag("Y"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for(int i = 0;i<allDateDayList.size();i++){ |
|
|
|
|
@ -130,33 +128,33 @@ public class HolidayUtil {
|
|
|
|
|
return allDateDayList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static Map<String,List<HolidayVo>> HolidayHandle(List<Holiday> list){ |
|
|
|
|
Map<String,List<HolidayVo>> map = new HashMap<String,List<HolidayVo>>(); |
|
|
|
|
for(Holiday holiday : list){ |
|
|
|
|
HolidayVo holidayVo = new HolidayVo(); |
|
|
|
|
|
|
|
|
|
if (holiday.getDetail()==null){ |
|
|
|
|
continue; |
|
|
|
|
}else if(holiday.getDetail().contains("初")||holiday.getDetail().contains("元旦")||holiday.getDetail().contains("节")||holiday.getDetail().contains("周")){ |
|
|
|
|
holidayVo.setContent(holiday.getDetail()); |
|
|
|
|
}else if(holiday.getDetail().contains("正常上班")){ |
|
|
|
|
holidayVo.setContent(holiday.getDetail()); |
|
|
|
|
} |
|
|
|
|
String mouth = holiday.getDate().substring(5,7); |
|
|
|
|
holidayVo.setWorkingday(holiday.getDate().substring(8,10)); |
|
|
|
|
|
|
|
|
|
if (map.containsKey("mouth"+mouth)){ |
|
|
|
|
List<HolidayVo> listofmap = map.get("mouth"+mouth); |
|
|
|
|
listofmap.add(holidayVo); |
|
|
|
|
}else { |
|
|
|
|
List<HolidayVo> listHolidayVo = new ArrayList<>(); |
|
|
|
|
listHolidayVo.add(holidayVo); |
|
|
|
|
map.put("mouth"+mouth,listHolidayVo); |
|
|
|
|
} |
|
|
|
|
System.out.println(holidayVo); |
|
|
|
|
} |
|
|
|
|
return map; |
|
|
|
|
} |
|
|
|
|
// public static Map<String,List<HolidayVo>> HolidayHandle(List<Holiday> list){
|
|
|
|
|
// Map<String,List<HolidayVo>> map = new HashMap<String,List<HolidayVo>>();
|
|
|
|
|
// for(Holiday holiday : list){
|
|
|
|
|
// HolidayVo holidayVo = new HolidayVo();
|
|
|
|
|
//
|
|
|
|
|
// if (holiday.getDetail()==null){
|
|
|
|
|
// continue;
|
|
|
|
|
// }else if(holiday.getDetail().contains("初")||holiday.getDetail().contains("元旦")||holiday.getDetail().contains("节")||holiday.getDetail().contains("周")){
|
|
|
|
|
// holidayVo.setContent(holiday.getDetail());
|
|
|
|
|
// }else if(holiday.getDetail().contains("正常上班")){
|
|
|
|
|
// holidayVo.setContent(holiday.getDetail());
|
|
|
|
|
// }
|
|
|
|
|
// String mouth = holiday.getDate().substring(5,7);
|
|
|
|
|
// holidayVo.setWorkingday(holiday.getDate().substring(8,10));
|
|
|
|
|
//
|
|
|
|
|
// if (map.containsKey("mouth"+mouth)){
|
|
|
|
|
// List<HolidayVo> listofmap = map.get("mouth"+mouth);
|
|
|
|
|
// listofmap.add(holidayVo);
|
|
|
|
|
// }else {
|
|
|
|
|
// List<HolidayVo> listHolidayVo = new ArrayList<>();
|
|
|
|
|
// listHolidayVo.add(holidayVo);
|
|
|
|
|
// map.put("mouth"+mouth,listHolidayVo);
|
|
|
|
|
// }
|
|
|
|
|
// System.out.println(holidayVo);
|
|
|
|
|
// }
|
|
|
|
|
// return map;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|