Commit 36a3fcc5 by 丁伟峰

修订完善

1 parent 40ed9bc5
...@@ -83,19 +83,13 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService { ...@@ -83,19 +83,13 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService {
for (LocalDate date : datesInRange) { for (LocalDate date : datesInRange) {
String sDate = LocalDateTimeUtil.format(date, PATTERN_DATE); String sDate = LocalDateTimeUtil.format(date, PATTERN_DATE);
EngineerCalendarDTO.Calendar calander = null; EngineerCalendarDTO.Calendar calander = null;
if (!configs.containsKey(sDate)) {
calander = getEmptyCalendar(teamIds.get(0), sDate); calander = getEmptyCalendar(teamIds.get(0), sDate);
} else { if (configs.containsKey(sDate)) {
calander = new EngineerCalendarDTO.Calendar();
calander.setDate(sDate);
int week = LocalDate.parse(sDate).getDayOfWeek().getValue();
calander.setWeek(Week.of(week).toChinese("周"));
List<EngineerCalendarDTO.Content> contents = new ArrayList<>(); List<EngineerCalendarDTO.Content> contents = new ArrayList<>();
// 有配置 // 有配置
for (CapacityEngineerCalendarEntity e : configs.get(sDate)) { for (CapacityEngineerCalendarEntity e : configs.get(sDate)) {
EngineerCalendarDTO.Content content = new EngineerCalendarDTO.Content(); EngineerCalendarDTO.Content content = new EngineerCalendarDTO.Content();
content.setType("rest"); content.setType("leave");
content.setTitle(e.getType()); content.setTitle(e.getType());
content.setValue(getCalendarDuration(e.getStartTime(), e.getEndTime())); content.setValue(getCalendarDuration(e.getStartTime(), e.getEndTime()));
contents.add(content); contents.add(content);
...@@ -135,6 +129,7 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService { ...@@ -135,6 +129,7 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService {
EngineerCalendarDTO.Calendar calendar = new EngineerCalendarDTO.Calendar(); EngineerCalendarDTO.Calendar calendar = new EngineerCalendarDTO.Calendar();
calendar.setDate(date); calendar.setDate(date);
int week = LocalDate.parse(date).getDayOfWeek().getValue(); int week = LocalDate.parse(date).getDayOfWeek().getValue();
calendar.setWeek(Week.of(week).toChinese("周"));
EngineerCalendarDTO.Content content = new EngineerCalendarDTO.Content(); EngineerCalendarDTO.Content content = new EngineerCalendarDTO.Content();
List<String> workdays = Arrays.asList(e.getWorkdays().split(",")); List<String> workdays = Arrays.asList(e.getWorkdays().split(","));
if (workdays.contains(String.valueOf(week))) { if (workdays.contains(String.valueOf(week))) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!