Commit 938e9ace by 丁伟峰

前端传递的是英文值;后端予以修改

1 parent 1c065301
...@@ -151,7 +151,7 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService { ...@@ -151,7 +151,7 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService {
if (endDate.isBefore(beginDate)) { if (endDate.isBefore(beginDate)) {
return Result.failed("结束时间不能早于开始时间"); return Result.failed("结束时间不能早于开始时间");
} }
if (!reqDTO.getRepeatType().isEmpty() && !"不重复".equals(reqDTO.getRepeatType())) { if (!reqDTO.getRepeatType().isEmpty() && !"none".equals(reqDTO.getRepeatType())) {
if (reqDTO.getRepeatEndDate().isEmpty()) { if (reqDTO.getRepeatEndDate().isEmpty()) {
return Result.failed("重复的日历配置,请设定结束日期"); return Result.failed("重复的日历配置,请设定结束日期");
} }
...@@ -172,7 +172,7 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService { ...@@ -172,7 +172,7 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService {
beginTime = String.format("%s %s:00", beginTime, config.getWorkOn()); beginTime = String.format("%s %s:00", beginTime, config.getWorkOn());
endTime = String.format("%s %s:00", endTime, config.getWorkOff()); endTime = String.format("%s %s:00", endTime, config.getWorkOff());
} }
if ("不重复".equals(repeatType)) { if ("none".equals(repeatType)) {
addOneEngineerPlan(engineerCode, type, beginTime, endTime, remark); addOneEngineerPlan(engineerCode, type, beginTime, endTime, remark);
} else { } else {
LocalDate beginDate = DateUtils.localDateFromStr(beginTime); LocalDate beginDate = DateUtils.localDateFromStr(beginTime);
...@@ -190,23 +190,24 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService { ...@@ -190,23 +190,24 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService {
} }
private LocalDate getNextDate(LocalDate current, String repeatType) { private LocalDate getNextDate(LocalDate current, String repeatType) {
// none;day;week;month;3 month;6 month;year
switch (repeatType) { switch (repeatType) {
case "每天": case "day":
current = current.plusDays(1); current = current.plusDays(1);
break; break;
case "每周": case "week":
current = current.plusWeeks(1); current = current.plusWeeks(1);
break; break;
case "每月": case "month":
current = current.plusMonths(1); current = current.plusMonths(1);
break; break;
case "每3个月": case "3 month":
current = current.plusMonths(3); current = current.plusMonths(3);
break; break;
case "每6个月": case "6 month":
current = current.plusMonths(6); current = current.plusMonths(6);
break; break;
case "每年": case "year":
current = current.plusYears(1); current = current.plusYears(1);
break; break;
default: default:
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!