记得上下班打卡 | 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
5a012d1f
Commit
5a012d1f
authored
Mar 05, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 添加 正在下单mongo
parent
40dc8e4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
GoblinZhengzaiServiceImpl.java
...goblin/service/impl/manage/GoblinZhengzaiServiceImpl.java
+4
-2
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+9
-6
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinZhengzaiServiceImpl.java
View file @
5a012d1f
...
@@ -179,8 +179,6 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
...
@@ -179,8 +179,6 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
}
}
}
}
String
marketSkuId
=
item
.
getSkuId
().
concat
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
()).
concat
(
IDGenerator
.
marketGoodId
(
params
.
getSelfMarketId
()));
String
marketSkuId
=
item
.
getSkuId
().
concat
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
()).
concat
(
IDGenerator
.
marketGoodId
(
params
.
getSelfMarketId
()));
redisUtils
.
setSkuStock
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
(),
marketSkuId
,
item
.
getStockMarketing
());
redisUtils
.
addSkuRe
(
item
.
getSkuId
(),
marketSkuId
);
skuVo
.
setSpuId
(
marketSpuId
);
skuVo
.
setSpuId
(
marketSpuId
);
skuVo
.
setSkuId
(
marketSkuId
);
skuVo
.
setSkuId
(
marketSkuId
);
skuVo
.
setPrice
(
bean
.
getPriceMarketing
());
skuVo
.
setPrice
(
bean
.
getPriceMarketing
());
...
@@ -189,11 +187,14 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
...
@@ -189,11 +187,14 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
skuVo
.
setBuyLimit
(
bean
.
getBuyLimit
());
skuVo
.
setBuyLimit
(
bean
.
getBuyLimit
());
skuVo
.
setBuyRoster
(
bean
.
getBuyRoster
());
skuVo
.
setBuyRoster
(
bean
.
getBuyRoster
());
skuVo
.
setBuyFactor
(
bean
.
getBuyFactor
().
toString
());
skuVo
.
setBuyFactor
(
bean
.
getBuyFactor
().
toString
());
skuVo
.
setDelFlg
(
"0"
);
skuVo
.
setMarketId
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
().
concat
(
params
.
getSelfMarketId
()));
skuVo
.
setMarketId
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
().
concat
(
params
.
getSelfMarketId
()));
skuVo
.
setCreatedAt
(
LocalDateTime
.
now
());
skuVo
.
setCreatedAt
(
LocalDateTime
.
now
());
mongoUtils
.
upsertGoodsSkuInfoVo
(
skuVo
);
mongoUtils
.
upsertGoodsSkuInfoVo
(
skuVo
);
//redis
//redis
redisUtils
.
setGoodsSkuInfoVo
(
skuVo
);
redisUtils
.
setGoodsSkuInfoVo
(
skuVo
);
redisUtils
.
setSkuStock
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
(),
marketSkuId
,
item
.
getStockMarketing
());
redisUtils
.
addSkuRe
(
item
.
getSkuId
(),
marketSkuId
);
//mysql
//mysql
sqlsData
.
add
(
new
Object
[]{
zhengzaiId
,
bean
.
getSelfMarketId
(),
bean
.
getSpuId
(),
bean
.
getSkuId
(),
bean
.
getStoreId
(),
bean
.
getPriceMarketing
(),
sqlsData
.
add
(
new
Object
[]{
zhengzaiId
,
bean
.
getSelfMarketId
(),
bean
.
getSpuId
(),
bean
.
getSkuId
(),
bean
.
getStoreId
(),
bean
.
getPriceMarketing
(),
bean
.
getStockMarketing
(),
bean
.
getBuyFactor
(),
bean
.
getBuyRoster
(),
bean
.
getBuyLimit
(),
bean
.
getDelFlag
(),
bean
.
getCreatedAt
()});
bean
.
getStockMarketing
(),
bean
.
getBuyFactor
(),
bean
.
getBuyRoster
(),
bean
.
getBuyLimit
(),
bean
.
getDelFlag
(),
bean
.
getCreatedAt
()});
...
@@ -216,6 +217,7 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
...
@@ -216,6 +217,7 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
spuVo
.
setSpecMode
(
"2"
);
spuVo
.
setSpecMode
(
"2"
);
spuVo
.
setPriceLe
(
priceList
.
get
(
priceList
.
size
()
-
1
));
spuVo
.
setPriceLe
(
priceList
.
get
(
priceList
.
size
()
-
1
));
spuVo
.
setMarketId
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
().
concat
(
params
.
getSelfMarketId
()));
spuVo
.
setMarketId
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
().
concat
(
params
.
getSelfMarketId
()));
spuVo
.
setDelFlg
(
"0"
);
mongoUtils
.
upsertGoodsInfoVo
(
spuVo
);
mongoUtils
.
upsertGoodsInfoVo
(
spuVo
);
//redis
//redis
redisUtils
.
setGoodsInfoVo
(
spuVo
);
redisUtils
.
setGoodsInfoVo
(
spuVo
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
5a012d1f
...
@@ -511,10 +511,12 @@ public class GoblinMongoUtils {
...
@@ -511,10 +511,12 @@ public class GoblinMongoUtils {
return
mongoTemplate
.
insert
(
vo
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
return
mongoTemplate
.
insert
(
vo
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
}
}
public
void
upsertGoodsSkuInfoVo
(
GoblinGoodsSkuInfoVo
vo
)
{
public
UpdateResult
upsertGoodsSkuInfoVo
(
GoblinGoodsSkuInfoVo
vo
)
{
Document
document
=
(
Document
)
mongoConverter
.
convertToMongoType
(
vo
);
Document
document
=
(
Document
)
mongoConverter
.
convertToMongoType
(
vo
);
Update
update
=
Update
.
fromDocument
(
document
);
Update
update
=
Update
.
fromDocument
(
document
);
mongoTemplate
.
upsert
(
Query
.
query
(
Criteria
.
where
(
"storeId"
).
is
(
vo
.
getStoreId
()).
and
(
"skuId"
).
is
(
vo
.
getSkuId
())),
update
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
Query
query
=
Query
.
query
(
Criteria
.
where
(
"storeId"
).
is
(
vo
.
getStoreId
()).
and
(
"skuId"
).
is
(
vo
.
getSkuId
()));
UpdateResult
result
=
mongoTemplate
.
upsert
(
query
,
update
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
return
result
;
}
}
// SKU信息
// SKU信息
...
@@ -555,6 +557,7 @@ public class GoblinMongoUtils {
...
@@ -555,6 +557,7 @@ public class GoblinMongoUtils {
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"skuId"
).
is
(
skuId
)),
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"skuId"
).
is
(
skuId
)),
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
}
}
public
List
<
GoblinGoodsSkuInfoVo
>
getGoodsSkuInfoVos
(
List
<
String
>
skuIds
)
{
public
List
<
GoblinGoodsSkuInfoVo
>
getGoodsSkuInfoVos
(
List
<
String
>
skuIds
)
{
return
mongoTemplate
.
find
(
Query
.
query
(
Criteria
.
where
(
"skuId"
).
in
(
skuIds
)),
return
mongoTemplate
.
find
(
Query
.
query
(
Criteria
.
where
(
"skuId"
).
in
(
skuIds
)),
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
...
@@ -839,7 +842,7 @@ public class GoblinMongoUtils {
...
@@ -839,7 +842,7 @@ public class GoblinMongoUtils {
//查询销量
//查询销量
int
size
=
20
;
int
size
=
20
;
int
skipCount
=
((
page
-
1
)
*
size
);
int
skipCount
=
((
page
-
1
)
*
size
);
int
finalCount
=
skipCount
+
size
;
int
finalCount
=
skipCount
+
size
;
List
<
GoblinGoodsInfoVo
>
spuIdAndName
=
null
;
List
<
GoblinGoodsInfoVo
>
spuIdAndName
=
null
;
Criteria
criteria
=
Criteria
.
where
(
"status"
).
in
(
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_11
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_22
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_28
.
getValue
()).
and
(
"storeId"
).
is
(
storeId
);
Criteria
criteria
=
Criteria
.
where
(
"status"
).
in
(
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_11
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_22
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_28
.
getValue
()).
and
(
"storeId"
).
is
(
storeId
);
if
(
spuName
!=
null
)
{
if
(
spuName
!=
null
)
{
...
@@ -858,8 +861,8 @@ public class GoblinMongoUtils {
...
@@ -858,8 +861,8 @@ public class GoblinMongoUtils {
List
<
GoblinOrderLogVo
>
countList
=
mongoTemplate
.
find
(
countQuery
,
GoblinOrderLogVo
.
class
,
GoblinOrderLogVo
.
class
.
getSimpleName
());
List
<
GoblinOrderLogVo
>
countList
=
mongoTemplate
.
find
(
countQuery
,
GoblinOrderLogVo
.
class
,
GoblinOrderLogVo
.
class
.
getSimpleName
());
List
<
String
>
spuIdList
=
countList
.
stream
().
map
(
GoblinOrderLogVo:
:
getSpuId
).
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
spuIdList
=
countList
.
stream
().
map
(
GoblinOrderLogVo:
:
getSpuId
).
distinct
().
collect
(
Collectors
.
toList
());
long
total
=
spuIdList
.
size
();
long
total
=
spuIdList
.
size
();
if
(
finalCount
>
total
)
{
if
(
finalCount
>
total
)
{
finalCount
=
(
int
)
total
;
finalCount
=
(
int
)
total
;
}
}
criteria
=
criteria
.
and
(
"spuId"
).
in
(
spuIdList
.
subList
(
skipCount
,
finalCount
));
criteria
=
criteria
.
and
(
"spuId"
).
in
(
spuIdList
.
subList
(
skipCount
,
finalCount
));
//查询聚合数据
//查询聚合数据
...
@@ -906,7 +909,7 @@ public class GoblinMongoUtils {
...
@@ -906,7 +909,7 @@ public class GoblinMongoUtils {
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_25
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_26
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_25
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_26
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_27
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_28
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_27
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_28
.
getValue
(),
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_29
.
getValue
()
GoblinStatusConst
.
Status
.
ORDER_LOG_STATUS_29
.
getValue
()
).
and
(
"spuId"
).
is
(
spuId
);
).
and
(
"spuId"
).
is
(
spuId
);
if
(
st
!=
null
&&
et
!=
null
)
{
if
(
st
!=
null
&&
et
!=
null
)
{
criteria
=
criteria
.
and
(
"createdAt"
).
gte
(
st
).
lt
(
et
);
criteria
=
criteria
.
and
(
"createdAt"
).
gte
(
st
).
lt
(
et
);
}
}
...
...
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