Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huluobin
gogirl-miniapp-backend
Commits
3699669e
Commit
3699669e
authored
Apr 08, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预约款式时间计算
parent
e1960b74
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
ScheduleManageServiceImpl.java
...plication/order/serve/impl/ScheduleManageServiceImpl.java
+15
-10
IdleTimeQuery.java
...om/gogirl/shared/order/serve/query/qry/IdleTimeQuery.java
+3
-0
No files found.
src/main/java/com/gogirl/application/order/serve/impl/ScheduleManageServiceImpl.java
View file @
3699669e
...
...
@@ -265,7 +265,13 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
.
map
(
scheduleServe
->
{
ScheduleServeQuery
scheduleServeQuery
=
new
ScheduleServeQuery
();
BeanUtils
.
copyProperties
(
scheduleServe
,
scheduleServeQuery
);
//款式or服务时间
if
(
scheduleServe
.
getProduceId
()
==
null
)
{
scheduleServeQuery
.
setLengthTimeForEndTime
(
baseServeMapper
.
selectById
(
scheduleServe
.
getServeId
()).
getServiceDuration
());
}
else
{
scheduleServeQuery
.
setLengthTimeForEndTime
(
baseProduceMapper
.
selectById
(
scheduleServe
.
getProduceId
()).
getServiceDuration
());
}
BaseServe
baseServe
=
baseServeMapper
.
selectById
(
scheduleServe
.
getServeId
());
log
.
debug
(
"-------,{}"
,
baseServe
.
toString
());
scheduleServeQuery
.
setServePicturePath
(
baseServe
.
getPicturePath
());
...
...
@@ -276,24 +282,23 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
//预约服务
List
<
ScheduleServeQuery
>
scheduleServe
DTO
List
=
idleTimeQuery
.
getScheduleServeQueryList
();
List
<
ScheduleServeQuery
>
scheduleServe
Query
List
=
idleTimeQuery
.
getScheduleServeQueryList
();
//预约子服务
List
<
ScheduleServeQuery
>
subS
erveDTOList
=
scheduleServeDTO
List
.
stream
()
List
<
ScheduleServeQuery
>
subS
cheduleServeQueryLinkedList
=
scheduleServeQuery
List
.
stream
()
.
filter
(
scheduleServe
->
scheduleServe
.
getMainServeId
()
!=
null
)
.
collect
(
Collectors
.
toList
());
//预约主服务
Queue
<
ScheduleServeQuery
>
mainS
erveDTOList
=
scheduleServeDTO
List
.
stream
()
Queue
<
ScheduleServeQuery
>
mainS
cheduleServeQueryLinkedList
=
scheduleServeQuery
List
.
stream
()
.
filter
(
scheduleServe
->
scheduleServe
.
getMainServeId
()
==
null
)
.
collect
(
Collectors
.
toCollection
(
LinkedList:
:
new
));
//添加子服务的时间到主服务
mainServeDTOList
.
forEach
(
scheduleServeDTO
->
{
subServeDTOList
.
forEach
(
subServeDTO
->
{
if
(
subServeDTO
.
getMainServeId
().
equals
(
scheduleServeDTO
.
getServeId
()))
{
scheduleServeDTO
.
setLengthTimeForEndTime
(
scheduleServeDTO
.
getLengthTimeForEndTime
()
+
subServeDTO
.
getLengthTimeForEndTime
()
mainScheduleServeQueryLinkedList
.
forEach
(
mainScheduleServeQuery
->
{
subScheduleServeQueryLinkedList
.
forEach
(
subScheduleServeQuery
->
{
if
(
subScheduleServeQuery
.
getMainServeId
().
equals
(
mainScheduleServeQuery
.
getServeId
()))
{
mainScheduleServeQuery
.
setLengthTimeForEndTime
(
mainScheduleServeQuery
.
getLengthTimeForEndTime
()
+
subScheduleServeQuery
.
getLengthTimeForEndTime
()
);
}
});
...
...
@@ -310,7 +315,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
AtomicLong
time
=
new
AtomicLong
(
System
.
currentTimeMillis
());
//每个主服务由不同的美甲师做,setter主服务的时间period
mainS
erveDTO
List
.
forEach
(
mainServeDTO
->
{
mainS
cheduleServeQueryLinked
List
.
forEach
(
mainServeDTO
->
{
Period
period
=
new
Period
();
period
.
setStartTime
(
dateTime
);
period
.
setLength
(
mainServeDTO
.
getLengthTimeForEndTime
().
longValue
()
*
60000
);
...
...
@@ -319,7 +324,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
});
//主服务深度克隆
List
<
ScheduleServeQuery
>
cloneMainServeDTOList
=
mainS
erveDTO
List
.
stream
().
map
(
CloneUtil:
:
deepClone
).
collect
(
Collectors
.
toList
());
List
<
ScheduleServeQuery
>
cloneMainServeDTOList
=
mainS
cheduleServeQueryLinked
List
.
stream
().
map
(
CloneUtil:
:
deepClone
).
collect
(
Collectors
.
toList
());
//美甲师深度克隆
List
<
StoreTechnicianPeriod
>
cloneStoreTechnicianDTOList
=
idleTimeQuery
.
getStoreTechnicianDTOList
().
stream
().
map
(
CloneUtil:
:
deepClone
).
collect
(
Collectors
.
toList
());
...
...
src/main/java/com/gogirl/shared/order/serve/query/qry/IdleTimeQuery.java
View file @
3699669e
...
...
@@ -15,7 +15,10 @@ public class IdleTimeQuery {
List
<
Long
>
dateTimeList
;
private
Integer
id
;
private
Integer
DepartmentId
;
@ApiModelProperty
(
"预约时间"
)
private
String
scheduleDate
;
@ApiModelProperty
(
"预约"
)
private
List
<
ScheduleServeQuery
>
scheduleServeQueryList
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment