记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
ef21fc64
Commit
ef21fc64
authored
May 18, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 分批购时间配置
parent
ffeb4a04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
8 deletions
+27
-8
GoblinListServiceImpl.java
...ice/goblin/service/impl/manage/GoblinListServiceImpl.java
+27
-8
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinListServiceImpl.java
View file @
ef21fc64
...
@@ -129,16 +129,21 @@ public class GoblinListServiceImpl implements IGoblinListService {
...
@@ -129,16 +129,21 @@ public class GoblinListServiceImpl implements IGoblinListService {
return
ResponseDto
.
failure
(
"结束时间不能晚于商品开售时间"
);
return
ResponseDto
.
failure
(
"结束时间不能晚于商品开售时间"
);
}
}
collectVos
=
redisUtils
.
getGoblinListCollect
(
skuId
);
collectVos
=
redisUtils
.
getGoblinListCollect
(
skuId
);
boolean
isSame
=
judgeTime
(
st
,
et
,
collectVos
);
if
(
isSame
){
return
ResponseDto
.
failure
(
"sku时间不能重合"
);
}
for
(
GoblinListCollectVo
collectItem
:
collectVos
)
{
for
(
GoblinListCollectVo
collectItem
:
collectVos
)
{
if
(
collectItem
.
getTimeEnd
()
!=
null
)
{
if
(
collectItem
.
getTimeEnd
()
!=
null
)
{
if
((
st
.
isAfter
(
collectItem
.
getTimeStart
()
.
minusSeconds
(
1
))
&&
st
.
isBefore
(
collectItem
.
getTimeEnd
().
plusSeconds
(
1
)))
||
if
((
st
.
isAfter
(
collectItem
.
getTimeStart
()
)
&&
st
.
isBefore
(
collectItem
.
getTimeEnd
(
)))
||
(
et
.
isAfter
(
collectItem
.
getTimeStart
()
.
plusSeconds
(
1
))
&&
et
.
isBefore
(
collectItem
.
getTimeEnd
().
minusSeconds
(
1
)))
||
(
et
.
isAfter
(
collectItem
.
getTimeStart
()
)
&&
et
.
isBefore
(
collectItem
.
getTimeEnd
(
)))
||
(
st
.
isBefore
(
collectItem
.
getTimeStart
()
.
minusSeconds
(
1
))
&&
et
.
isAfter
(
collectItem
.
getTimeEnd
().
minusSeconds
(
1
)))
(
st
.
isBefore
(
collectItem
.
getTimeStart
()
)
&&
et
.
isAfter
(
collectItem
.
getTimeEnd
(
)))
)
{
//开始时间不能在其他时间段内/结束间不能在其他时间段内/开始结束时间不能包含其他时间段
)
{
//开始时间不能在其他时间段内/结束间不能在其他时间段内/开始结束时间不能包含其他时间段
return
ResponseDto
.
failure
(
"sku时间不能重合"
);
return
ResponseDto
.
failure
(
"sku时间不能重合"
);
}
}
}
else
{
}
else
{
if
(
st
.
isBefore
(
collectItem
.
getTimeStart
()
.
minusSeconds
(
1
))
&&
et
.
isAfter
(
collectItem
.
getTimeStart
().
plusSeconds
(
1
)))
{
if
(
st
.
isBefore
(
collectItem
.
getTimeStart
()
)
&&
et
.
isAfter
(
collectItem
.
getTimeStart
(
)))
{
return
ResponseDto
.
failure
(
"sku时间不能重合"
);
//开始结束时间不能包含只有开始时间的时间段
return
ResponseDto
.
failure
(
"sku时间不能重合"
);
//开始结束时间不能包含只有开始时间的时间段
}
}
}
}
...
@@ -154,7 +159,6 @@ public class GoblinListServiceImpl implements IGoblinListService {
...
@@ -154,7 +159,6 @@ public class GoblinListServiceImpl implements IGoblinListService {
return
ResponseDto
.
failure
(
"sku时间不能重合"
);
return
ResponseDto
.
failure
(
"sku时间不能重合"
);
}
}
}
else
{
}
else
{
}
}
}
}
}
}
...
@@ -263,13 +267,13 @@ public class GoblinListServiceImpl implements IGoblinListService {
...
@@ -263,13 +267,13 @@ public class GoblinListServiceImpl implements IGoblinListService {
queueUtils
.
sendMsgByRedisXls
(
vo
.
getListId
(),
param
.
getBlackUrl
(),
blackUrl
,
"4"
,
item
.
getSkuId
());
queueUtils
.
sendMsgByRedisXls
(
vo
.
getListId
(),
param
.
getBlackUrl
(),
blackUrl
,
"4"
,
item
.
getSkuId
());
}
}
List
<
GoblinListCollectVo
>
collectVos
=
redisUtils
.
getGoblinListCollect
(
vo
.
getItemVo
().
get
(
0
).
getSkuId
());
List
<
GoblinListCollectVo
>
collectVos
=
redisUtils
.
getGoblinListCollect
(
vo
.
getItemVo
().
get
(
0
).
getSkuId
());
for
(
GoblinListCollectVo
itemVo
:
collectVos
)
{
for
(
GoblinListCollectVo
itemVo
:
collectVos
)
{
if
(
itemVo
.
getListId
().
equals
(
param
.
getListId
()))
{
if
(
itemVo
.
getListId
().
equals
(
param
.
getListId
()))
{
itemVo
.
setWhiteType
(
vo
.
getWhiteType
());
itemVo
.
setWhiteType
(
vo
.
getWhiteType
());
break
;
break
;
}
}
}
}
redisUtils
.
setGoblinListCollect
(
vo
.
getItemVo
().
get
(
0
).
getSkuId
(),
collectVos
);
redisUtils
.
setGoblinListCollect
(
vo
.
getItemVo
().
get
(
0
).
getSkuId
(),
collectVos
);
redisUtils
.
setGoblinListDetailsVo
(
vo
);
redisUtils
.
setGoblinListDetailsVo
(
vo
);
mongoUtils
.
changeGoblinListDetailsVo
(
vo
);
mongoUtils
.
changeGoblinListDetailsVo
(
vo
);
//sql入库
//sql入库
...
@@ -306,4 +310,19 @@ public class GoblinListServiceImpl implements IGoblinListService {
...
@@ -306,4 +310,19 @@ public class GoblinListServiceImpl implements IGoblinListService {
SqlMapping
.
get
(
"goblin_list_remove"
,
now
,
listId
));
SqlMapping
.
get
(
"goblin_list_remove"
,
now
,
listId
));
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
}
}
private
boolean
judgeTime
(
LocalDateTime
st
,
LocalDateTime
et
,
List
<
GoblinListCollectVo
>
collects
)
{
for
(
GoblinListCollectVo
collectItem
:
collects
)
{
if
(
st
.
compareTo
(
collectItem
.
getTimeStart
())
==
0
)
{
return
true
;
}
else
if
(
et
!=
null
&&
et
.
compareTo
(
collectItem
.
getTimeStart
())
==
0
)
{
return
true
;
}
else
if
(
collectItem
.
getTimeEnd
()
!=
null
&&
st
.
compareTo
(
collectItem
.
getTimeEnd
())
==
0
)
{
return
true
;
}
else
if
(
collectItem
.
getTimeEnd
()
!=
null
&&
et
!=
null
&&
et
.
compareTo
(
collectItem
.
getTimeEnd
())
==
0
)
{
return
true
;
}
}
return
false
;
}
}
}
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