Commit a8f52547 by 刘鑫

Merge branch 'develop-16542' into 'develop'

日历日程冲突提示信息修订

See merge request !354
2 parents 0e671a45 b491f47e
......@@ -25,6 +25,11 @@ public class DateTimeUtil {
* yyyy-MM-dd HH:mm:ss
*/
public static final DateTimeFormatter DATETIME_FORMAT = DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME);
/**
* yyyy-MM-dd HH:mm
*/
public static final DateTimeFormatter DATETIME_FORMAT_NON_SECONDS = DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME_NON_SECONDS);
/**
* 日期格式 yyyy-MM-dd
*/
......
......@@ -36,6 +36,10 @@ public class DateUtil {
*/
public static final String PATTERN_DATETIME = "yyyy-MM-dd HH:mm:ss";
/**
* yyyy-MM-dd HH:mm
*/
public static final String PATTERN_DATETIME_NON_SECONDS = "yyyy-MM-dd HH:mm";
/**
* 日期 yyyy-MM-dd格式
*/
public static final String PATTERN_DATE = "yyyy-MM-dd";
......
......@@ -274,7 +274,9 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService {
LocalDateTime startTime = DateUtils.localDateTimeFromStr(beginTime);
LocalDateTime endTime1 = DateUtils.localDateTimeFromStr(endTime);
if (checkTimesHasOverlap(endDate, engineerCode, startTime, endTime1)) {
throw new BusinessException("工程师" + engineerCode + "存在交叉的日期日历" + DateTimeUtil.formatDate(endDate));
throw new BusinessException("工号为" + engineerCode + "的工程师在"
+ DateTimeUtil.DATETIME_FORMAT_NON_SECONDS.format(startTime) + "到"
+ DateTimeUtil.DATETIME_FORMAT_NON_SECONDS.format(endTime1) + "区间已有日程安排");
}
// 设定的是同一天,简单处理
CapacityEngineerCalendarEntity e = new CapacityEngineerCalendarEntity();
......@@ -325,7 +327,9 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService {
}
//校验是否有当天时间段的记录
if (checkTimesHasOverlap(current, engineerCode, e.getStartTime(), e.getEndTime())) {
throw new BusinessException("工程师" + engineerCode + "存在交叉的日期日历" + DateTimeUtil.formatDate(current));
throw new BusinessException("工号为" + engineerCode + "的工程师在"
+ DateTimeUtil.DATETIME_FORMAT_NON_SECONDS.format(e.getStartTime()) + "到"
+ DateTimeUtil.DATETIME_FORMAT_NON_SECONDS.format(e.getStartTime()) + "区间已有日程安排");
}
e.setWorkday(DateUtils.formatDate(current));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!