记得上下班打卡 | 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
f36012c9
Commit
f36012c9
authored
Feb 28, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~MONGO.SQL;
parent
d0ff9b36
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
21 deletions
+49
-21
GoblinStoreCouponBasicVo.java
...idnet/service/goblin/dto/vo/GoblinStoreCouponBasicVo.java
+0
-2
mongo_db_ddl.sql
...oblin/liquidnet-service-goblin-impl/docu/mongo_db_ddl.sql
+39
-8
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+10
-11
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinStoreCouponBasicVo.java
View file @
f36012c9
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/docu/mongo_db_ddl.sql
View file @
f36012c9
use
dev_ln_scene
;
#
创建集合
//
==================================================
创建集合
db
.
createCollection
(
"GoblinSelfGoodsCategoryVo"
);
db
.
createCollection
(
"GoblinStoreGoodsCategoryVo"
);
db
.
createCollection
(
"GoblinMgtCategorySpecVo"
);
db
.
createCollection
(
"GoblinSelfTagVo"
);
db
.
createCollection
(
"GoblinServiceSupportVo"
);
db
.
createCollection
(
"GoblinStoreNoticeVo"
);
db
.
createCollection
(
"GoblinStoreConfigVo"
);
db
.
createCollection
(
"GoblinStoreInfoVo"
);
db
.
createCollection
(
"GoblinGoodsInfoVo"
);
db
.
createCollection
(
"GoblinGoodsSkuInfoVo"
);
db
.
createCollection
(
"GoblinStoreCouponBasicVo"
);
db
.
createCollection
(
"GoblinUserCouponVo"
);
#
创建索引
db
.
GoblinStoreInfoVo
.
createIndex
(
{
storeId
:
"hashed"
}
);
#
创建分片
//
==================================================
创建分片
sh
.
enableSharding
(
"dev_ln_scene"
);
sh
.
shardCollection
(
"dev_ln_scene.GoblinSelfGoodsCategoryVo"
,
{
"cateId"
:
"hashed"
}
);
sh
.
shardCollection
(
"dev_ln_scene.GoblinStoreGoodsCategoryVo"
,
{
"cateId"
:
"hashed"
}
);
sh
.
shardCollection
(
"dev_ln_scene.GoblinMgtCategorySpecVo"
,
{
"cateId"
:
"hashed"
}
);
sh
.
shardCollection
(
"dev_ln_scene.GoblinSelfTagVo"
,
{
"tagId"
:
"hashed"
}
);
sh
.
shardCollection
(
"dev_ln_scene.GoblinServiceSupportVo"
,
{
"ssid"
:
"hashed"
}
);
sh
.
shardCollection
(
"dev_ln_scene.GoblinStoreNoticeVo"
,
{
"noticeId"
:
"hashed"
}
);
sh
.
shardCollection
(
"dev_ln_scene.GoblinStoreConfigVo"
,
{
"storeId"
:
"hashed"
}
);
sh
.
shardCollection
(
"dev_ln_scene.GoblinStoreInfoVo"
,
{
"storeId"
:
"hashed"
}
);
sh
.
shardCollection
(
"dev_ln_scene.GoblinGoodsInfoVo"
,
{
"spuId"
:
"hashed"
}
);
sh
.
shardCollection
(
"dev_ln_scene.GoblinGoodsSkuInfoVo"
,
{
"skuId"
:
"hashed"
}
);
sh
.
shardCollection
(
"dev_ln_scene.GoblinStoreCouponBasicVo"
,
{
"storeCouponId"
:
"hashed"
}
);
sh
.
shardCollection
(
"dev_ln_scene.GoblinUserCouponVo"
,
{
"ucouponId"
:
"hashed"
}
);
//
==================================================
创建索引
db
.
GoblinStoreGoodsCategoryVo
.
createIndex
(
{
storeId
:
"hashed"
}
);
db
.
GoblinMgtCategorySpecVo
.
createIndex
(
{
cateId
:
"hashed"
}
);
db
.
GoblinSelfTagVo
.
createIndex
(
{
tagBelong
:
"hashed"
}
);
db
.
GoblinServiceSupportVo
.
createIndex
(
{
ssid
:
"hashed"
}
);
db
.
GoblinStoreNoticeVo
.
createIndex
(
{
storeId
:
"hashed"
}
);
db
.
GoblinStoreConfigVo
.
createIndex
(
{
storeId
:
"hashed"
}
);
db
.
GoblinStoreInfoVo
.
createIndex
(
{
storeId
:
"hashed"
}
);
db
.
GoblinGoodsInfoVo
.
createIndex
(
{
spuId
:
"hashed"
}
);
db
.
GoblinGoodsInfoVo
.
createIndex
(
{
storeId
:
"hashed"
}
);
db
.
GoblinGoodsInfoVo
.
createIndex
(
{
spuNo
:
"hashed"
}
);
db
.
GoblinGoodsSkuInfoVo
.
createIndex
(
{
skuId
:
"hashed"
}
);
db
.
GoblinGoodsSkuInfoVo
.
createIndex
(
{
storeId
:
"hashed"
}
);
db
.
GoblinStoreCouponBasicVo
.
createIndex
(
{
storeCouponId
:
"hashed"
}
);
db
.
GoblinUserCouponVo
.
createIndex
(
{
uid
:
"hashed"
}
);
\ No newline at end of file
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
f36012c9
...
...
@@ -271,8 +271,7 @@ public class GoblinMongoUtils {
public
boolean
updateStoreInfoVo
(
GoblinStoreInfoVo
vo
)
{
return
mongoTemplate
.
getCollection
(
GoblinStoreInfoVo
.
class
.
getSimpleName
())
.
updateOne
(
Query
.
query
(
Criteria
.
where
(
"storeId"
).
is
(
vo
.
getStoreId
())).
getQueryObject
(),
.
updateOne
(
Query
.
query
(
Criteria
.
where
(
"storeId"
).
is
(
vo
.
getStoreId
())).
getQueryObject
(),
ObjectUtil
.
cloneBasicDBObject
().
append
(
"$set"
,
mongoConverter
.
convertToMongoType
(
vo
))
).
getModifiedCount
()
>
0
;
}
...
...
@@ -416,15 +415,6 @@ public class GoblinMongoUtils {
:
vos
.
stream
().
map
(
GoblinGoodsInfoVo:
:
getSpuId
).
collect
(
Collectors
.
toList
());
}
// SKU信息
public
List
<
String
>
getMgtGoodsSkuIds
(
String
storeId
,
List
<
String
>
spuIdList
)
{
Query
query
=
Query
.
query
(
Criteria
.
where
(
"storeId"
).
is
(
storeId
).
and
(
"delFlg"
).
is
(
"0"
).
and
(
"spuId"
).
in
(
spuIdList
.
toArray
()));
query
.
fields
().
include
(
"skuId"
);
List
<
GoblinGoodsSkuInfoVo
>
vos
=
mongoTemplate
.
find
(
query
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
return
CollectionUtils
.
isEmpty
(
vos
)
?
CollectionUtil
.
arrayListString
()
:
vos
.
stream
().
map
(
GoblinGoodsSkuInfoVo:
:
getSkuId
).
collect
(
Collectors
.
toList
());
}
// SPU信息
public
GoblinGoodsInfoVo
getGoodsInfoVo
(
String
spuId
)
{
// return mongoTemplate.findOne(Query.query(Criteria.where("spuId").is(spuId).and("delFlg").is("0").and("shelvesStatus").is("3")),
...
...
@@ -551,6 +541,15 @@ public class GoblinMongoUtils {
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
}
// SKU信息
public
List
<
String
>
getMgtGoodsSkuIds
(
String
storeId
,
List
<
String
>
spuIdList
)
{
Query
query
=
Query
.
query
(
Criteria
.
where
(
"storeId"
).
is
(
storeId
).
and
(
"delFlg"
).
is
(
"0"
).
and
(
"spuId"
).
in
(
spuIdList
.
toArray
()));
query
.
fields
().
include
(
"skuId"
);
List
<
GoblinGoodsSkuInfoVo
>
vos
=
mongoTemplate
.
find
(
query
,
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
return
CollectionUtils
.
isEmpty
(
vos
)
?
CollectionUtil
.
arrayListString
()
:
vos
.
stream
().
map
(
GoblinGoodsSkuInfoVo:
:
getSkuId
).
collect
(
Collectors
.
toList
());
}
// SKU信息
// public GoblinGoodsSkuInfoVo getMgtGoodsSkuInfoVo(String skuId) {
// return mongoTemplate.findOne(Query.query(Criteria.where("skuId").is(skuId).and("delFlg").is("0")),
...
...
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