记得上下班打卡 | 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
e40361af
Commit
e40361af
authored
May 23, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加 创建 分批购活动 名称效验
parent
aaea548e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
16 deletions
+27
-16
GoblinListServiceImpl.java
...ice/goblin/service/impl/manage/GoblinListServiceImpl.java
+4
-0
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+23
-16
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 @
e40361af
...
@@ -115,6 +115,10 @@ public class GoblinListServiceImpl implements IGoblinListService {
...
@@ -115,6 +115,10 @@ public class GoblinListServiceImpl implements IGoblinListService {
if
(
param
.
getItemParams
().
size
()
>
1
)
{
if
(
param
.
getItemParams
().
size
()
>
1
)
{
return
ResponseDto
.
failure
(
"只能配置一个sku"
);
return
ResponseDto
.
failure
(
"只能配置一个sku"
);
}
}
//判断重名
if
(
mongoUtils
.
hasGoblinListDetailsVoByName
(
param
.
getName
())){
return
ResponseDto
.
failure
(
"活动名称重复"
);
}
String
skuId
=
param
.
getItemParams
().
get
(
0
).
getSkuId
();
String
skuId
=
param
.
getItemParams
().
get
(
0
).
getSkuId
();
GoblinGoodsSkuInfoVo
skuInfoVo
=
redisUtils
.
getGoodsSkuInfoVo
(
skuId
);
GoblinGoodsSkuInfoVo
skuInfoVo
=
redisUtils
.
getGoodsSkuInfoVo
(
skuId
);
LocalDateTime
st
=
LocalDateTime
.
parse
(
param
.
getTimeStart
(),
DTF_YMD_HMS
);
LocalDateTime
st
=
LocalDateTime
.
parse
(
param
.
getTimeStart
(),
DTF_YMD_HMS
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
e40361af
...
@@ -62,14 +62,14 @@ public class GoblinMongoUtils {
...
@@ -62,14 +62,14 @@ public class GoblinMongoUtils {
HashMap
<
String
,
Object
>
info
=
CollectionUtil
.
mapStringObject
();
HashMap
<
String
,
Object
>
info
=
CollectionUtil
.
mapStringObject
();
Pageable
pageable
=
PageRequest
.
of
(
goblinGoodsAnticipateValueParam
.
getPageNum
()
-
1
,
20
,
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"createdDate"
));
Pageable
pageable
=
PageRequest
.
of
(
goblinGoodsAnticipateValueParam
.
getPageNum
()
-
1
,
20
,
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"createdDate"
));
Criteria
criteria
=
Criteria
.
where
(
"delTag"
).
is
(
0
).
and
(
"uid"
).
is
(
uid
);
Criteria
criteria
=
Criteria
.
where
(
"delTag"
).
is
(
0
).
and
(
"uid"
).
is
(
uid
);
if
(
goblinGoodsAnticipateValueParam
.
getType
()
!=
null
)
{
if
(
goblinGoodsAnticipateValueParam
.
getType
()
!=
null
)
{
if
(
goblinGoodsAnticipateValueParam
.
getType
()
==
1
)
{
if
(
goblinGoodsAnticipateValueParam
.
getType
()
==
1
)
{
//预约提醒
//预约提醒
criteria
=
criteria
.
and
(
"type"
).
is
(
goblinGoodsAnticipateValueParam
.
getType
());
criteria
=
criteria
.
and
(
"type"
).
is
(
goblinGoodsAnticipateValueParam
.
getType
());
}
else
if
(
goblinGoodsAnticipateValueParam
.
getType
()==
2
)
{
}
else
if
(
goblinGoodsAnticipateValueParam
.
getType
()
==
2
)
{
//预约购买
//预约购买
criteria
=
criteria
.
and
(
"type"
).
is
(
2
).
and
(
"peopleType"
).
is
(
0
);
criteria
=
criteria
.
and
(
"type"
).
is
(
2
).
and
(
"peopleType"
).
is
(
0
);
}
else
if
(
goblinGoodsAnticipateValueParam
.
getType
()==
3
)
{
}
else
if
(
goblinGoodsAnticipateValueParam
.
getType
()
==
3
)
{
//预约助力
//预约助力
criteria
=
criteria
.
and
(
"type"
).
is
(
2
).
and
(
"peopleType"
).
gt
(
0
);
criteria
=
criteria
.
and
(
"type"
).
is
(
2
).
and
(
"peopleType"
).
gt
(
0
);
}
}
...
@@ -207,14 +207,14 @@ public class GoblinMongoUtils {
...
@@ -207,14 +207,14 @@ public class GoblinMongoUtils {
/**
/**
* 存入用户创建分享 不需要mongodb存储
* 存入用户创建分享 不需要mongodb存储
*/
*/
public
void
setGoblinGoodsAnticipateShareVo
(
GoblinGoodsAnticipateShareVo
goblinGoodsAnticipateShareVo
){
public
void
setGoblinGoodsAnticipateShareVo
(
GoblinGoodsAnticipateShareVo
goblinGoodsAnticipateShareVo
)
{
mongoTemplate
.
insert
(
goblinGoodsAnticipateShareVo
,
GoblinGoodsAnticipateShareVo
.
class
.
getSimpleName
());
mongoTemplate
.
insert
(
goblinGoodsAnticipateShareVo
,
GoblinGoodsAnticipateShareVo
.
class
.
getSimpleName
());
}
}
/**
/**
* 根据创建id查询分享信息
* 根据创建id查询分享信息
*/
*/
public
GoblinGoodsAnticipateShareVo
getShareVoBySid
(
String
sid
){
public
GoblinGoodsAnticipateShareVo
getShareVoBySid
(
String
sid
)
{
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"sid"
).
is
(
sid
)),
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"sid"
).
is
(
sid
)),
GoblinGoodsAnticipateShareVo
.
class
,
GoblinGoodsAnticipateShareVo
.
class
.
getSimpleName
());
GoblinGoodsAnticipateShareVo
.
class
,
GoblinGoodsAnticipateShareVo
.
class
.
getSimpleName
());
}
}
...
@@ -222,17 +222,18 @@ public class GoblinMongoUtils {
...
@@ -222,17 +222,18 @@ public class GoblinMongoUtils {
/**
/**
* 分享id和助力人id 查询助力信息 不存mongodb
* 分享id和助力人id 查询助力信息 不存mongodb
*/
*/
public
GoblinGoodsAnticipateHelpVo
getHelpVo
(
String
sid
,
String
uid
)
{
public
GoblinGoodsAnticipateHelpVo
getHelpVo
(
String
sid
,
String
uid
)
{
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"sid"
).
is
(
sid
).
and
(
"helpUid"
).
is
(
uid
)),
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"sid"
).
is
(
sid
).
and
(
"helpUid"
).
is
(
uid
)),
GoblinGoodsAnticipateHelpVo
.
class
,
GoblinGoodsAnticipateHelpVo
.
class
.
getSimpleName
());
GoblinGoodsAnticipateHelpVo
.
class
,
GoblinGoodsAnticipateHelpVo
.
class
.
getSimpleName
());
}
}
/**
/**
* 助力vo 之后删去不需要储存
* 助力vo 之后删去不需要储存
*
* @param goodsAnticipateHelpVo
* @param goodsAnticipateHelpVo
*/
*/
public
void
setHelpVo
(
GoblinGoodsAnticipateHelpVo
goodsAnticipateHelpVo
){
public
void
setHelpVo
(
GoblinGoodsAnticipateHelpVo
goodsAnticipateHelpVo
)
{
mongoTemplate
.
insert
(
goodsAnticipateHelpVo
,
GoblinGoodsAnticipateHelpVo
.
class
.
getSimpleName
());
mongoTemplate
.
insert
(
goodsAnticipateHelpVo
,
GoblinGoodsAnticipateHelpVo
.
class
.
getSimpleName
());
}
}
/* ---------------------------------------- 平台分类数据源 ---------------------------------------- */
/* ---------------------------------------- 平台分类数据源 ---------------------------------------- */
...
@@ -1171,7 +1172,7 @@ public class GoblinMongoUtils {
...
@@ -1171,7 +1172,7 @@ public class GoblinMongoUtils {
if
(
spuName
!=
null
)
{
if
(
spuName
!=
null
)
{
Query
q1
=
Query
.
query
(
Criteria
.
where
(
"name"
).
regex
(
".*"
+
spuName
+
".*"
));
Query
q1
=
Query
.
query
(
Criteria
.
where
(
"name"
).
regex
(
".*"
+
spuName
+
".*"
));
q1
.
fields
().
include
(
"spuId"
);
q1
.
fields
().
include
(
"spuId"
);
List
<
String
>
spuIds
=
mongoTemplate
.
find
(
q1
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
()).
stream
().
map
(
GoblinGoodsInfoVo:
:
getSpuId
).
collect
(
Collectors
.
toList
());
List
<
String
>
spuIds
=
mongoTemplate
.
find
(
q1
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
()).
stream
().
map
(
GoblinGoodsInfoVo:
:
getSpuId
).
collect
(
Collectors
.
toList
());
criteriaCount
=
criteriaCount
.
and
(
"spuId"
).
in
(
spuIds
);
criteriaCount
=
criteriaCount
.
and
(
"spuId"
).
in
(
spuIds
);
}
}
//查询总数量
//查询总数量
...
@@ -1620,9 +1621,9 @@ public class GoblinMongoUtils {
...
@@ -1620,9 +1621,9 @@ public class GoblinMongoUtils {
criteria
.
and
(
"name"
).
regex
(
pattern
);
criteria
.
and
(
"name"
).
regex
(
pattern
);
}
}
if
(
StringUtils
.
isNotBlank
(
filterParam
.
getShelvesStatus
()))
{
if
(
StringUtils
.
isNotBlank
(
filterParam
.
getShelvesStatus
()))
{
if
(
"4"
.
equals
(
filterParam
.
getShelvesStatus
())){
if
(
"4"
.
equals
(
filterParam
.
getShelvesStatus
()))
{
criteria
.
and
(
"shelvesStatus"
).
is
(
"3"
).
and
(
"saleStartTime"
).
gte
(
now
());
criteria
.
and
(
"shelvesStatus"
).
is
(
"3"
).
and
(
"saleStartTime"
).
gte
(
now
());
}
else
{
}
else
{
criteria
.
and
(
"shelvesStatus"
).
is
(
filterParam
.
getShelvesStatus
());
criteria
.
and
(
"shelvesStatus"
).
is
(
filterParam
.
getShelvesStatus
());
}
}
}
}
...
@@ -1650,10 +1651,10 @@ public class GoblinMongoUtils {
...
@@ -1650,10 +1651,10 @@ public class GoblinMongoUtils {
continue
;
continue
;
}
}
GoblinGoodsSkuInfoVo
itemVo
=
redisUtils
.
getGoodsSkuInfoVo
(
skuIdItem
);
GoblinGoodsSkuInfoVo
itemVo
=
redisUtils
.
getGoodsSkuInfoVo
(
skuIdItem
);
if
(
"4"
.
equals
(
filterParam
.
getShelvesStatus
()))
{
if
(
"4"
.
equals
(
filterParam
.
getShelvesStatus
()))
{
stock
+=
redisUtils
.
getSkuAllStatusStockStatus4
(
itemVo
);
stock
+=
redisUtils
.
getSkuAllStatusStockStatus4
(
itemVo
);
}
else
{
}
else
{
stock
+=
redisUtils
.
getSkuAllStatusStock
(
itemVo
,
null
);
stock
+=
redisUtils
.
getSkuAllStatusStock
(
itemVo
,
null
);
}
}
}
}
mgtGoodsSkuListVo
.
setSurplusStock
(
stock
);
mgtGoodsSkuListVo
.
setSurplusStock
(
stock
);
...
@@ -1697,6 +1698,12 @@ public class GoblinMongoUtils {
...
@@ -1697,6 +1698,12 @@ public class GoblinMongoUtils {
mongoTemplate
.
insert
(
vo
,
GoblinListDetailsVo
.
class
.
getSimpleName
());
mongoTemplate
.
insert
(
vo
,
GoblinListDetailsVo
.
class
.
getSimpleName
());
}
}
public
Boolean
hasGoblinListDetailsVoByName
(
String
name
)
{
Criteria
criteria
=
Criteria
.
where
(
"name"
).
is
(
name
);
Query
query
=
Query
.
query
(
criteria
);
return
mongoTemplate
.
exists
(
query
,
GoblinListDetailsVo
.
class
,
GoblinListDetailsVo
.
class
.
getSimpleName
());
}
public
void
removeGoblinListDetailsVo
(
String
listId
)
{
public
void
removeGoblinListDetailsVo
(
String
listId
)
{
mongoTemplate
.
remove
(
Query
.
query
(
Criteria
.
where
(
"listId"
).
is
(
listId
)),
GoblinListDetailsVo
.
class
.
getSimpleName
());
mongoTemplate
.
remove
(
Query
.
query
(
Criteria
.
where
(
"listId"
).
is
(
listId
)),
GoblinListDetailsVo
.
class
.
getSimpleName
());
}
}
...
...
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