记得上下班打卡 | 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
4768a889
Commit
4768a889
authored
Jan 18, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev_goblin' into dev_goblin
parents
baf9e389
9a985041
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
8 deletions
+15
-8
GoblinStoreGoodsCategoryVo.java
...net/service/goblin/dto/vo/GoblinStoreGoodsCategoryVo.java
+0
-2
GoblinStoreMgtCategoryController.java
...n/controller/manage/GoblinStoreMgtCategoryController.java
+11
-5
GoblinStoreMgtGoodsServiceImpl.java
...n/service/impl/manage/GoblinStoreMgtGoodsServiceImpl.java
+3
-0
errors.properties
...-service-goblin-impl/src/main/resources/errors.properties
+1
-1
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinStoreGoodsCategoryVo.java
View file @
4768a889
...
@@ -8,8 +8,6 @@ import lombok.Data;
...
@@ -8,8 +8,6 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.Map
;
@ApiModel
(
value
=
"GoblinStoreGoodsCategoryVo"
,
description
=
"店铺商品分类"
)
@ApiModel
(
value
=
"GoblinStoreGoodsCategoryVo"
,
description
=
"店铺商品分类"
)
@Data
@Data
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtCategoryController.java
View file @
4768a889
...
@@ -30,6 +30,7 @@ import java.time.LocalDateTime;
...
@@ -30,6 +30,7 @@ import java.time.LocalDateTime;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
@ApiSupport
(
order
=
149005
)
@ApiSupport
(
order
=
149005
)
@Api
(
tags
=
"店铺商品分类"
)
@Api
(
tags
=
"店铺商品分类"
)
...
@@ -69,21 +70,21 @@ public class GoblinStoreMgtCategoryController {
...
@@ -69,21 +70,21 @@ public class GoblinStoreMgtCategoryController {
@NotBlank
(
message
=
"平台分类不能为空"
)
@RequestParam
String
catesid
,
@NotBlank
(
message
=
"平台分类不能为空"
)
@RequestParam
String
catesid
,
// @NotBlank(message = "平台分类不能为空") @RequestParam String catetid,
// @NotBlank(message = "平台分类不能为空") @RequestParam String catetid,
@NotBlank
(
message
=
"店铺分类名称不能为空"
)
@RequestParam
String
catename
,
@NotBlank
(
message
=
"店铺分类名称不能为空"
)
@RequestParam
String
catename
,
@Min
(
value
=
0
,
message
=
"排序不能小于0"
)
@RequestParam
(
required
=
false
)
Integer
sort
)
{
@Min
(
value
=
1
,
message
=
"排序不能小于0"
)
@RequestParam
(
required
=
false
)
Integer
sort
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
if
(!
goblinRedisUtils
.
hasStoreId
(
currentUid
,
storeId
))
{
if
(!
goblinRedisUtils
.
hasStoreId
(
currentUid
,
storeId
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
}
}
List
<
GoblinSelfGoodsCategoryVo
>
selfGoodsCategoryVos
=
goblinRedisUtils
.
getSelfGoodsCategoryVos
();
List
<
GoblinSelfGoodsCategoryVo
>
selfGoodsCategoryVos
=
goblinRedisUtils
.
getSelfGoodsCategoryVos
();
if
(
CollectionUtils
.
isEmpty
(
selfGoodsCategoryVos
))
{
if
(
CollectionUtils
.
isEmpty
(
selfGoodsCategoryVos
))
{
log
.
warn
(
"店铺商品分类管理:添加:平台分类未创建[UID={},storeId={},catefid={},catesid={}
]"
,
currentUid
,
storeId
,
catefid
,
catesid
);
log
.
warn
(
"店铺商品分类管理:添加:平台分类未创建[UID={},storeId={},catefid={},catesid={}
,catename={}]"
,
currentUid
,
storeId
,
catefid
,
catesid
,
catename
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149001"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149001"
));
}
}
List
<
String
>
catePidList
=
Arrays
.
asList
(
catefid
,
catesid
);
List
<
String
>
catePidList
=
Arrays
.
asList
(
catefid
,
catesid
);
Map
<
String
,
GoblinSelfGoodsCategoryVo
>
filterMap
=
selfGoodsCategoryVos
.
stream
()
Map
<
String
,
GoblinSelfGoodsCategoryVo
>
filterMap
=
selfGoodsCategoryVos
.
stream
()
.
filter
(
r
->
catePidList
.
contains
(
r
.
getCateId
())).
collect
(
Collectors
.
toMap
(
GoblinSelfGoodsCategoryVo:
:
getCateId
,
Function
.
identity
()));
.
filter
(
r
->
catePidList
.
contains
(
r
.
getCateId
())).
collect
(
Collectors
.
toMap
(
GoblinSelfGoodsCategoryVo:
:
getCateId
,
Function
.
identity
()));
if
(
CollectionUtils
.
isEmpty
(
filterMap
)
||
filterMap
.
size
()
<
2
)
{
if
(
CollectionUtils
.
isEmpty
(
filterMap
)
||
filterMap
.
size
()
<
2
)
{
log
.
warn
(
"店铺商品分类管理:添加:平台分类ID有误[UID={},storeId={},catefid={},catesid={}
]"
,
currentUid
,
storeId
,
catefid
,
catesid
);
log
.
warn
(
"店铺商品分类管理:添加:平台分类ID有误[UID={},storeId={},catefid={},catesid={}
,catename={}]"
,
currentUid
,
storeId
,
catefid
,
catesid
,
catename
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149001"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149001"
));
}
}
ArrayList
<
GoblinStoreGoodsCategoryVo
>
addStoreGoodsCategoryVoList
=
ObjectUtil
.
getGoblinStoreGoodsCategoryVoArrayList
();
ArrayList
<
GoblinStoreGoodsCategoryVo
>
addStoreGoodsCategoryVoList
=
ObjectUtil
.
getGoblinStoreGoodsCategoryVoArrayList
();
...
@@ -99,6 +100,11 @@ public class GoblinStoreMgtCategoryController {
...
@@ -99,6 +100,11 @@ public class GoblinStoreMgtCategoryController {
addStoreGoodsCategoryVoList
.
add
(
storeGoodsCategoryVo
);
addStoreGoodsCategoryVoList
.
add
(
storeGoodsCategoryVo
);
});
});
}
else
{
// 存在则判断,是否为已存在的父级分类
}
else
{
// 存在则判断,是否为已存在的父级分类
if
(
storeGoodsCategoryVosCache
.
stream
().
anyMatch
(
r
->
r
.
getName
().
equals
(
catename
)))
{
log
.
warn
(
"店铺商品分类管理:添加:分类名称重复[UID={},storeId={},catefid={},catesid={},catename={}]"
,
currentUid
,
storeId
,
catefid
,
catesid
,
catename
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149007"
));
}
Map
<
String
,
GoblinStoreGoodsCategoryVo
>
existFilterMap
=
storeGoodsCategoryVosCache
.
stream
().
filter
(
r
->
catePidList
.
contains
(
r
.
getCateId
()))
Map
<
String
,
GoblinStoreGoodsCategoryVo
>
existFilterMap
=
storeGoodsCategoryVosCache
.
stream
().
filter
(
r
->
catePidList
.
contains
(
r
.
getCateId
()))
.
collect
(
Collectors
.
toMap
(
GoblinStoreGoodsCategoryVo:
:
getCateId
,
Function
.
identity
()));
.
collect
(
Collectors
.
toMap
(
GoblinStoreGoodsCategoryVo:
:
getCateId
,
Function
.
identity
()));
GoblinStoreGoodsCategoryVo
fStoreGoodsCategoryVo
=
existFilterMap
.
get
(
catefid
);
GoblinStoreGoodsCategoryVo
fStoreGoodsCategoryVo
=
existFilterMap
.
get
(
catefid
);
...
@@ -133,7 +139,7 @@ public class GoblinStoreMgtCategoryController {
...
@@ -133,7 +139,7 @@ public class GoblinStoreMgtCategoryController {
storeGoodsCategoryVo
.
setCreatedAt
(
now
);
storeGoodsCategoryVo
.
setCreatedAt
(
now
);
addStoreGoodsCategoryVoList
.
add
(
storeGoodsCategoryVo
);
addStoreGoodsCategoryVoList
.
add
(
storeGoodsCategoryVo
);
goblinStoreMgtCategoryService
.
add
(
currentUi
d
,
addStoreGoodsCategoryVoList
,
storeGoodsCategoryVosCache
);
goblinStoreMgtCategoryService
.
add
(
storeI
d
,
addStoreGoodsCategoryVoList
,
storeGoodsCategoryVosCache
);
return
ResponseDto
.
success
(
storeGoodsCategoryVo
.
getCateId
());
return
ResponseDto
.
success
(
storeGoodsCategoryVo
.
getCateId
());
}
}
...
@@ -150,7 +156,7 @@ public class GoblinStoreMgtCategoryController {
...
@@ -150,7 +156,7 @@ public class GoblinStoreMgtCategoryController {
public
ResponseDto
<
Object
>
edit
(
@NotBlank
(
message
=
"店铺ID不能为空"
)
@RequestParam
String
storeId
,
public
ResponseDto
<
Object
>
edit
(
@NotBlank
(
message
=
"店铺ID不能为空"
)
@RequestParam
String
storeId
,
@NotBlank
(
message
=
"店铺分类ID不能为空"
)
@RequestParam
String
cateid
,
@NotBlank
(
message
=
"店铺分类ID不能为空"
)
@RequestParam
String
cateid
,
@NotBlank
(
message
=
"店铺分类名称不能为空"
)
@RequestParam
String
catename
,
@NotBlank
(
message
=
"店铺分类名称不能为空"
)
@RequestParam
String
catename
,
@Min
(
value
=
0
,
message
=
"排序不能小于0"
)
@RequestParam
(
required
=
false
)
Integer
sort
)
{
@Min
(
value
=
1
,
message
=
"排序不能小于0"
)
@RequestParam
(
required
=
false
)
Integer
sort
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
if
(!
goblinRedisUtils
.
hasStoreId
(
currentUid
,
storeId
))
{
if
(!
goblinRedisUtils
.
hasStoreId
(
currentUid
,
storeId
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtGoodsServiceImpl.java
View file @
4768a889
...
@@ -105,6 +105,9 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
...
@@ -105,6 +105,9 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
goblinMongoUtils
.
setGoodsInfoVo
(
goodsInfoVo
);
goblinMongoUtils
.
setGoodsInfoVo
(
goodsInfoVo
);
goblinMongoUtils
.
setGoodsSkuInfoVos
(
goodsSkuInfoVoList
);
goblinMongoUtils
.
setGoodsSkuInfoVos
(
goodsSkuInfoVoList
);
// TODO: 2022/1/18 zhanggb==
goodsSkuInfoVoList
.
forEach
(
r
->
goblinRedisUtils
.
setSkuStock
(
null
,
r
.
getSkuId
(),
r
.
getSkuStock
()));
String
spuId
=
goodsInfoVo
.
getSpuId
();
String
spuId
=
goodsInfoVo
.
getSpuId
();
LinkedList
<
String
>
toMqSqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
String
>
toMqSqls
=
CollectionUtil
.
linkedListString
();
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/resources/errors.properties
View file @
4768a889
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
149004
=
149004
=
149005
=
149005
=
149006
=
添加商品失败,规格信息无效
149006
=
添加商品失败,规格信息无效
149007
=
149007
=
商品分类名称重复,请核实
149008
=
149008
=
149009
=
149009
=
149010
=
商品不存在,请核实
149010
=
商品不存在,请核实
...
...
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