Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a8f52547
authored
Oct 31, 2023
by
刘鑫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop-16542' into 'develop'
日历日程冲突提示信息修订 See merge request !354
2 parents
0e671a45
b491f47e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
project-order/src/main/java/com/dituhui/pea/order/common/jackson/DateTimeUtil.java
project-order/src/main/java/com/dituhui/pea/order/common/jackson/DateUtil.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerCalendarServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/common/jackson/DateTimeUtil.java
View file @
a8f5254
...
...
@@ -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
*/
...
...
project-order/src/main/java/com/dituhui/pea/order/common/jackson/DateUtil.java
View file @
a8f5254
...
...
@@ -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"
;
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerCalendarServiceImpl.java
View file @
a8f5254
...
...
@@ -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
));
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment