记得上下班打卡 | 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
45fd51a0
Commit
45fd51a0
authored
Jan 05, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~API;
parent
58a122bd
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
158 additions
and
62 deletions
+158
-62
GoblinRedisConst.java
...m/liquidnet/service/goblin/constant/GoblinRedisConst.java
+2
-2
GoblinStoreMgtGoodsActionParam.java
...ice/goblin/dto/manage/GoblinStoreMgtGoodsActionParam.java
+4
-0
GoblinStoreMgtGoodsAddParam.java
...ervice/goblin/dto/manage/GoblinStoreMgtGoodsAddParam.java
+9
-7
GoblinStoreMgtGoodsAddSkuParam.java
...ice/goblin/dto/manage/GoblinStoreMgtGoodsAddSkuParam.java
+2
-2
GoblinStoreMgtGoodsEditSkuParam.java
...ce/goblin/dto/manage/GoblinStoreMgtGoodsEditSkuParam.java
+4
-2
GoblinStoreMgtGoodsListVo.java
...rvice/goblin/dto/manage/vo/GoblinStoreMgtGoodsListVo.java
+16
-14
GoblinGoodsInfoVo.java
...om/liquidnet/service/goblin/dto/vo/GoblinGoodsInfoVo.java
+1
-1
GoblinGoodsSkuInfoVo.java
...liquidnet/service/goblin/dto/vo/GoblinGoodsSkuInfoVo.java
+2
-2
IGoblinstoreMgtGoodsService.java
...ce/goblin/service/manage/IGoblinstoreMgtGoodsService.java
+6
-4
GoblinGoods.java
...java/com/liquidnet/service/goblin/entity/GoblinGoods.java
+1
-1
GoblinGoodsSku.java
...a/com/liquidnet/service/goblin/entity/GoblinGoodsSku.java
+2
-2
db_ln_goblin_initialdata.sql
...net-service-goblin-impl/docu/db_ln_goblin_initialdata.sql
+3
-3
GoblinStoreMgtCertificationController.java
...troller/manage/GoblinStoreMgtCertificationController.java
+5
-1
GoblinStoreMgtGoodsController.java
...blin/controller/manage/GoblinStoreMgtGoodsController.java
+50
-5
GoblinStoreMgtGoodsServiceImpl.java
...n/service/impl/manage/GoblinStoreMgtGoodsServiceImpl.java
+12
-4
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+8
-0
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+31
-12
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/constant/GoblinRedisConst.java
View file @
45fd51a0
...
...
@@ -5,9 +5,9 @@ public class GoblinRedisConst {
/* ----------------------------------------------------------------- */
/**
* 认证中店铺UID关系缓存
* {goblin:
tmp_uid_store:${uid}, store_id
}
* {goblin:
basic:ustore:${uid}, List<store_id>
}
*/
public
static
final
String
TMP_UID_STORE
=
PREFIX
.
concat
(
"tmp_uid_
store:"
);
public
static
final
String
BASIC_USTORE
=
PREFIX
.
concat
(
"basic:u
store:"
);
/**
* 店铺信息
* {goblin:basic:store:${store_id}, com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo}
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinStoreMgtGoodsActionParam.java
View file @
45fd51a0
...
...
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.Pattern
;
import
java.io.Serializable
;
import
java.util.List
;
...
...
@@ -12,6 +13,9 @@ import java.util.List;
@Data
public
class
GoblinStoreMgtGoodsActionParam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
6564996671833040261L
;
@ApiModelProperty
(
position
=
10
,
required
=
true
,
value
=
"店铺ID[64]"
)
@NotBlank
(
message
=
"店铺ID不能为空"
)
private
String
storeId
;
@ApiModelProperty
(
position
=
11
,
required
=
true
,
value
=
"操作类型[ONSHELVES-上架|UNSHELVE-下架|REMOVE-删除]"
)
@Pattern
(
regexp
=
"\\b(ONSHELVES|UNSHELVE|REMOVE)\\b"
,
message
=
"操作类型无效"
)
private
String
action
;
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinStoreMgtGoodsAddParam.java
View file @
45fd51a0
...
...
@@ -15,6 +15,7 @@ import lombok.Data;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.util.CollectionUtils
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Pattern
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
...
...
@@ -25,10 +26,11 @@ import java.util.List;
@Data
public
class
GoblinStoreMgtGoodsAddParam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5101611616626164702L
;
@ApiModelProperty
(
position
=
10
,
required
=
false
,
value
=
"商品ID[编辑时必传]"
)
private
String
spuId
;
@ApiModelProperty
(
position
=
11
,
required
=
true
,
value
=
"店铺ID"
)
@ApiModelProperty
(
position
=
10
,
required
=
true
,
value
=
"店铺ID"
)
@NotNull
(
message
=
"店铺ID不能为空"
)
private
String
storeId
;
@ApiModelProperty
(
position
=
11
,
required
=
false
,
value
=
"商品ID[编辑时必传]"
)
private
String
spuId
;
/**
* ---------------------------- 基本信息 ----------------------------
...
...
@@ -38,7 +40,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable {
private
String
name
;
@ApiModelProperty
(
position
=
13
,
required
=
false
,
value
=
"商品名称[128]"
)
private
String
subtitle
;
@ApiModelProperty
(
position
=
14
,
required
=
false
,
value
=
"商品销售价[20,2]"
)
@ApiModelProperty
(
position
=
14
,
required
=
false
,
value
=
"商品销售价
-原价
[20,2]"
)
private
BigDecimal
sellPrice
;
@ApiModelProperty
(
position
=
15
,
required
=
true
,
value
=
"商品一级分类ID[30]"
)
...
...
@@ -125,7 +127,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable {
vo
.
setSpuId
(
this
.
getSpuId
());
}
if
(
StringUtils
.
isBlank
(
this
.
getSpuNo
()))
{
vo
.
setSpuNo
(
IDGenerator
.
nextTimeId2
());
vo
.
setSpuNo
(
vo
.
getSpuId
());
}
else
{
vo
.
setSpuNo
(
this
.
getSpuNo
());
}
...
...
@@ -173,7 +175,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable {
*
* @return GoblinGoodsInfoVo
*/
public
GoblinGoodsInfoVo
initEditGoods
Sku
InfoVo
()
{
public
GoblinGoodsInfoVo
initEditGoodsInfoVo
()
{
GoblinGoodsInfoVo
vo
=
GoblinGoodsInfoVo
.
getNew
();
vo
.
setStoreId
(
this
.
getStoreId
());
vo
.
setSpuId
(
this
.
getSpuId
());
...
...
@@ -223,7 +225,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable {
vo
.
setSkuId
(
skuId
);
}
vo
.
setSpuId
(
goodsInfoVo
.
getSpuId
());
//
vo.setSkuNo(goodsInfoVo.getSpuNo().concat("-").concat(String.valueOf(i)));
vo
.
setSkuNo
(
goodsInfoVo
.
getSpuNo
().
concat
(
"-"
).
concat
(
String
.
valueOf
(
i
)));
vo
.
setName
(
goodsInfoVo
.
getName
());
vo
.
setSubtitle
(
goodsInfoVo
.
getSubtitle
());
vo
.
setSkuPic
(
addSkuParam
.
getSkuPic
());
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinStoreMgtGoodsAddSkuParam.java
View file @
45fd51a0
...
...
@@ -21,9 +21,9 @@ public class GoblinStoreMgtGoodsAddSkuParam implements Serializable {
private
String
skuPic
;
@ApiModelProperty
(
position
=
12
,
required
=
true
,
value
=
"单品规格信息"
)
private
List
<
GoblinGoodsSpecDto
>
skuSpecList
;
@ApiModelProperty
(
position
=
13
,
required
=
false
,
value
=
"单品销售价[20,2]"
)
@ApiModelProperty
(
position
=
13
,
required
=
false
,
value
=
"单品销售价
-原价
[20,2]"
)
private
BigDecimal
sellPrice
;
@ApiModelProperty
(
position
=
14
,
required
=
true
,
value
=
"单品
价格
[20,2]"
)
@ApiModelProperty
(
position
=
14
,
required
=
true
,
value
=
"单品
现价
[20,2]"
)
private
BigDecimal
price
;
@ApiModelProperty
(
position
=
15
,
required
=
true
,
value
=
"单品会员价格[20,2]"
)
private
BigDecimal
priceMember
;
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinStoreMgtGoodsEditSkuParam.java
View file @
45fd51a0
...
...
@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.Pattern
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
...
...
@@ -18,6 +19,7 @@ import java.util.List;
public
class
GoblinStoreMgtGoodsEditSkuParam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
6657596593310537491L
;
@ApiModelProperty
(
position
=
10
,
required
=
true
,
value
=
"店铺ID[64]"
)
@NotBlank
(
message
=
"店铺ID不能为空"
)
private
String
storeId
;
@ApiModelProperty
(
position
=
11
,
required
=
false
,
value
=
"单品ID[编辑时必传]"
)
private
String
skuId
;
...
...
@@ -25,9 +27,9 @@ public class GoblinStoreMgtGoodsEditSkuParam implements Serializable {
private
String
skuPic
;
@ApiModelProperty
(
position
=
13
,
required
=
true
,
value
=
"单品规格信息"
)
private
List
<
GoblinGoodsSpecDto
>
skuSpecList
;
@ApiModelProperty
(
position
=
14
,
required
=
false
,
value
=
"单品销售价[20,2]"
)
@ApiModelProperty
(
position
=
14
,
required
=
false
,
value
=
"单品销售价
-原价
[20,2]"
)
private
BigDecimal
sellPrice
;
@ApiModelProperty
(
position
=
15
,
required
=
true
,
value
=
"单品
价格
[20,2]"
)
@ApiModelProperty
(
position
=
15
,
required
=
true
,
value
=
"单品
现价
[20,2]"
)
private
BigDecimal
price
;
@ApiModelProperty
(
position
=
16
,
required
=
true
,
value
=
"单品会员价格[20,2]"
)
private
BigDecimal
priceMember
;
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/vo/GoblinStoreMgtGoodsListVo.java
View file @
45fd51a0
...
...
@@ -11,33 +11,35 @@ import java.math.BigDecimal;
@Data
public
class
GoblinStoreMgtGoodsListVo
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
5926827517337445529L
;
@ApiModelProperty
(
position
=
10
,
value
=
"商品ID"
)
@ApiModelProperty
(
position
=
10
,
value
=
"店铺ID[64]"
)
private
String
storeId
;
@ApiModelProperty
(
position
=
11
,
value
=
"商品ID[64]"
)
private
String
spuId
;
@ApiModelProperty
(
position
=
1
1
,
value
=
"商品编码
"
)
@ApiModelProperty
(
position
=
1
2
,
value
=
"商品编码[45]
"
)
private
String
spuNo
;
@ApiModelProperty
(
position
=
1
2
,
value
=
"封面图片地址
"
)
@ApiModelProperty
(
position
=
1
3
,
value
=
"封面图片地址[256]
"
)
private
String
coverPic
;
@ApiModelProperty
(
position
=
1
3
,
value
=
"商品名称
"
)
@ApiModelProperty
(
position
=
1
4
,
value
=
"商品名称[100]
"
)
private
String
name
;
@ApiModelProperty
(
position
=
1
4
,
value
=
"商品一级分类ID[30]"
)
@ApiModelProperty
(
position
=
1
5
,
value
=
"商品一级分类ID[30]"
)
private
String
cateFid
;
@ApiModelProperty
(
position
=
1
5
,
value
=
"商品二级分类ID[30]"
)
@ApiModelProperty
(
position
=
1
6
,
value
=
"商品二级分类ID[30]"
)
private
String
cateSid
;
@ApiModelProperty
(
position
=
1
6
,
value
=
"商品三级分类ID[30]"
)
@ApiModelProperty
(
position
=
1
7
,
value
=
"商品三级分类ID[30]"
)
private
String
cateTid
;
@ApiModelProperty
(
position
=
1
7
,
value
=
"价格区间MIN"
)
@ApiModelProperty
(
position
=
1
8
,
value
=
"价格区间MIN"
)
private
BigDecimal
priceGe
;
@ApiModelProperty
(
position
=
1
8
,
value
=
"价格区间MAX"
)
@ApiModelProperty
(
position
=
1
9
,
value
=
"价格区间MAX"
)
private
BigDecimal
priceLe
;
@ApiModelProperty
(
position
=
19
,
value
=
"审核状态[0-编辑中|1-审核中|2-审核不通过|3-审核通过]"
)
@ApiModelProperty
(
position
=
20
,
value
=
"审核状态[0-编辑中|1-审核中|2-审核不通过|3-审核通过]"
)
private
String
status
;
@ApiModelProperty
(
position
=
2
0
,
value
=
"审核拒绝原因"
)
@ApiModelProperty
(
position
=
2
1
,
value
=
"审核拒绝原因"
)
private
String
reason
;
@ApiModelProperty
(
position
=
2
1
,
value
=
"商品上架状态[0-待上架|1-下架|2-违规|3-上架]"
)
@ApiModelProperty
(
position
=
2
2
,
value
=
"商品上架状态[0-待上架|1-下架|2-违规|3-上架]"
)
private
String
shelvesStatus
;
@ApiModelProperty
(
position
=
2
2
,
value
=
"总库存"
)
@ApiModelProperty
(
position
=
2
3
,
value
=
"总库存"
)
private
Integer
totalStock
;
@ApiModelProperty
(
position
=
2
3
,
value
=
"剩余库存"
)
@ApiModelProperty
(
position
=
2
4
,
value
=
"剩余库存"
)
private
Integer
surplusStock
;
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinGoodsInfoVo.java
View file @
45fd51a0
...
...
@@ -27,7 +27,7 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable {
private
String
name
;
@ApiModelProperty
(
position
=
14
,
value
=
"商品副标题[128]"
)
private
String
subtitle
;
@ApiModelProperty
(
position
=
15
,
value
=
"销售价[20,2]"
)
@ApiModelProperty
(
position
=
15
,
value
=
"销售价
-原价
[20,2]"
)
private
BigDecimal
sellPrice
;
@ApiModelProperty
(
position
=
16
,
value
=
"价格区间MIN[20,2]"
)
private
BigDecimal
priceGe
;
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinGoodsSkuInfoVo.java
View file @
45fd51a0
...
...
@@ -39,9 +39,9 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable {
private
Integer
skuStock
;
@ApiModelProperty
(
position
=
19
,
value
=
"预警库存"
)
private
Integer
warningStock
;
@ApiModelProperty
(
position
=
20
,
value
=
"单品销售价[20,2]"
)
@ApiModelProperty
(
position
=
20
,
value
=
"单品销售价
-原价
[20,2]"
)
private
BigDecimal
sellPrice
;
@ApiModelProperty
(
position
=
21
,
value
=
"单品
价格
[20,2]"
)
@ApiModelProperty
(
position
=
21
,
value
=
"单品
现价
[20,2]"
)
private
BigDecimal
price
;
@ApiModelProperty
(
position
=
22
,
value
=
"单品会员价格[20,2]"
)
private
BigDecimal
priceMember
;
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/manage/IGoblinstoreMgtGoodsService.java
View file @
45fd51a0
...
...
@@ -24,10 +24,11 @@ public interface IGoblinstoreMgtGoodsService {
/**
* 商品管理:SPU详情
*
* @param spuId 商品ID
* @param storeId 店铺ID
* @param spuId 商品ID
* @return GoblinStoreMgtGoodsInfoVo
*/
GoblinStoreMgtGoodsInfoVo
goodsInfo
(
String
spuId
);
GoblinStoreMgtGoodsInfoVo
goodsInfo
(
String
s
toreId
,
String
s
puId
);
/**
* 商品管理:商品编辑:SPU编辑
...
...
@@ -55,10 +56,11 @@ public interface IGoblinstoreMgtGoodsService {
/**
* 商品管理:商品编辑:SKU删除
*
* @param skuId 单品ID
* @param storeId 店铺ID
* @param skuId 单品ID
* @return boolean
*/
boolean
goodsEditSkuDel
(
String
skuId
);
boolean
goodsEditSkuDel
(
String
s
toreId
,
String
s
kuId
);
/**
* 商品管理:商品编辑:SKU批改
...
...
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/entity/GoblinGoods.java
View file @
45fd51a0
...
...
@@ -49,7 +49,7 @@ public class GoblinGoods implements Serializable {
private
String
subtitle
;
/**
* 销售价
* 销售价
-原价
*/
private
BigDecimal
sellPrice
;
...
...
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/entity/GoblinGoodsSku.java
View file @
45fd51a0
...
...
@@ -43,7 +43,7 @@ public class GoblinGoodsSku implements Serializable {
private
String
subtitle
;
/**
* 单品销售价
* 单品销售价
-原价
*/
private
BigDecimal
sellPrice
;
...
...
@@ -73,7 +73,7 @@ public class GoblinGoodsSku implements Serializable {
private
Integer
warningStock
;
/**
* 单品
价格
* 单品
现价
*/
private
BigDecimal
price
;
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/docu/db_ln_goblin_initialdata.sql
View file @
45fd51a0
...
...
@@ -252,7 +252,7 @@ create table goblin_goods
name
varchar
(
100
)
not
null
comment
'商品名称'
,
subtitle
varchar
(
128
)
null
comment
'商品副标题'
,
sell_price
decimal
(
20
,
2
)
null
comment
'销售价'
,
sell_price
decimal
(
20
,
2
)
null
comment
'销售价
-原价
'
,
price_ge
decimal
(
20
,
2
)
null
comment
'价格区间MIN'
,
price_le
decimal
(
20
,
2
)
null
comment
'价格区间MAX'
,
intro
varchar
(
256
)
null
comment
'商品简介'
,
...
...
@@ -303,14 +303,14 @@ create table goblin_goods_sku
sku_no
varchar
(
45
)
not
null
comment
'单品的编号'
,
name
varchar
(
100
)
not
null
comment
'单品的名称'
,
subtitle
varchar
(
128
)
null
comment
'单品的副标题'
,
sell_price
decimal
(
20
,
2
)
null
comment
'单品销售价'
,
sell_price
decimal
(
20
,
2
)
null
comment
'单品销售价
-原价
'
,
sku_pic
varchar
(
256
)
null
comment
'单品默认图片的url'
,
sku_isbn
varchar
(
50
)
null
comment
'ISBN,针对CD/图书等'
,
stock
int
not
null
comment
'总库存'
,
sku_stock
int
not
null
comment
'单品库存'
,
warning_stock
int
null
comment
'预警库存'
,
price
decimal
(
20
,
2
)
not
null
comment
'单品
价格
'
,
price
decimal
(
20
,
2
)
not
null
comment
'单品
现价
'
,
price_member
decimal
(
20
,
2
)
not
null
comment
'单品会员价格'
,
weight
decimal
(
20
,
2
)
not
null
comment
'单品的重量'
,
buy_factor
char
default
'0'
comment
'购买限制[0-全部用户|1-仅会员|2-指定用户]'
,
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtCertificationController.java
View file @
45fd51a0
...
...
@@ -4,6 +4,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import
com.github.xiaoymin.knife4j.annotations.ApiSupport
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.ErrorMapping
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtCertificationParam
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtCompleteParam
;
...
...
@@ -78,10 +79,13 @@ public class GoblinStoreMgtCertificationController {
@ApiOperation
(
value
=
"店铺认证编辑中:删除店铺"
)
@PostMapping
(
"cancel"
)
public
ResponseDto
<
Object
>
certificationCancel
(
String
storeId
)
{
if
(!
goblinRedisUtils
.
hasStoreId
(
CurrentUtil
.
getCurrentUid
(),
storeId
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
}
GoblinStoreInfoVo
storeInfoVo
=
goblinRedisUtils
.
getStoreInfoVo
(
storeId
);
if
(
null
!=
storeInfoVo
)
{
if
(
goblinMongoUtils
.
delStoreInfoVo
(
storeId
))
{
goblinRedisUtils
.
delStoreId
ByUid
(
CurrentUtil
.
getCurrentUid
()
);
goblinRedisUtils
.
delStoreId
(
CurrentUtil
.
getCurrentUid
(),
storeId
);
goblinRedisUtils
.
delStoreInfoVo
(
storeId
);
}
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtGoodsController.java
View file @
45fd51a0
...
...
@@ -2,6 +2,8 @@ package com.liquidnet.service.goblin.controller.manage;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.github.xiaoymin.knife4j.annotations.ApiSupport
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.ErrorMapping
;
import
com.liquidnet.service.base.PagedResult
;
...
...
@@ -23,11 +25,13 @@ import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotBlank
;
import
java.util.List
;
@ApiSupport
(
order
=
149003
)
@Api
(
tags
=
"商品管理"
)
...
...
@@ -45,9 +49,19 @@ public class GoblinStoreMgtGoodsController {
@ApiOperation
(
value
=
"SPU列表"
)
@PostMapping
(
"list"
)
public
ResponseDto
<
PagedResult
<
GoblinStoreMgtGoodsListVo
>>
list
(
@Valid
@RequestBody
GoblinStoreMgtGoodsFilterParam
storeMgtGoodsFilterParam
)
{
List
<
String
>
storeIds
=
goblinRedisUtils
.
getStoreIds
(
CurrentUtil
.
getCurrentUid
());
boolean
storeIdIsBlank
=
StringUtils
.
isBlank
(
storeMgtGoodsFilterParam
.
getStoreId
());
if
(
CollectionUtils
.
isEmpty
(
storeIds
)
||
(
!
storeIdIsBlank
&&
!
goblinRedisUtils
.
hasStoreId
(
CurrentUtil
.
getCurrentUid
(),
storeMgtGoodsFilterParam
.
getStoreId
())
))
{
return
ResponseDto
.
success
();
}
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"商品管理:SPU列表:[GoblinStoreMgtGoodsFilterParam={}]"
,
JsonUtils
.
toJson
(
storeMgtGoodsFilterParam
));
}
if
(
storeIdIsBlank
)
{
storeMgtGoodsFilterParam
.
setStoreId
(
storeIds
.
get
(
0
));
}
return
ResponseDto
.
success
(
goblinstoreMgtGoodsService
.
goodsList
(
storeMgtGoodsFilterParam
));
}
...
...
@@ -55,9 +69,20 @@ public class GoblinStoreMgtGoodsController {
@ApiOperation
(
value
=
"SPU导出"
)
@PostMapping
(
"export"
)
public
void
export
(
@Valid
@RequestBody
GoblinStoreMgtGoodsFilterParam
storeMgtGoodsFilterParam
)
{
List
<
String
>
storeIds
=
goblinRedisUtils
.
getStoreIds
(
CurrentUtil
.
getCurrentUid
());
boolean
storeIdIsBlank
=
StringUtils
.
isBlank
(
storeMgtGoodsFilterParam
.
getStoreId
());
if
(
CollectionUtils
.
isEmpty
(
storeIds
)
||
(
!
storeIdIsBlank
&&
!
goblinRedisUtils
.
hasStoreId
(
CurrentUtil
.
getCurrentUid
(),
storeMgtGoodsFilterParam
.
getStoreId
())
))
{
return
;
}
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"商品管理:SPU导出:[GoblinStoreMgtGoodsFilterParam={}]"
,
JsonUtils
.
toJson
(
storeMgtGoodsFilterParam
));
}
if
(
storeIdIsBlank
)
{
storeMgtGoodsFilterParam
.
setStoreId
(
storeIds
.
get
(
0
));
}
log
.
info
(
"商品管理:SPU导出..."
);
// TODO: 2021/12/28 zhanggb
}
...
...
@@ -66,6 +91,9 @@ public class GoblinStoreMgtGoodsController {
@ApiOperation
(
value
=
"SPU管理"
)
@PostMapping
(
"operate"
)
public
ResponseDto
<
Object
>
action
(
@Valid
@RequestBody
GoblinStoreMgtGoodsActionParam
storeMgtGoodsActionParam
)
{
if
(!
goblinRedisUtils
.
hasStoreId
(
CurrentUtil
.
getCurrentUid
(),
storeMgtGoodsActionParam
.
getStoreId
()))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
}
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"商品管理:管理SPU:[GoblinStoreMgtGoodsActionParam={}]"
,
JsonUtils
.
toJson
(
storeMgtGoodsActionParam
));
}
...
...
@@ -92,6 +120,9 @@ public class GoblinStoreMgtGoodsController {
@ApiOperation
(
value
=
"SPU添加"
)
@PutMapping
(
"add"
)
public
ResponseDto
<
Object
>
add
(
@Valid
@RequestBody
GoblinStoreMgtGoodsAddParam
storeMgtGoodsAddParam
)
{
if
(!
goblinRedisUtils
.
hasStoreId
(
CurrentUtil
.
getCurrentUid
(),
storeMgtGoodsAddParam
.
getStoreId
()))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
}
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"商品管理:添加SPU:[GoblinStoreMgtGoodsAddParam={}]"
,
JsonUtils
.
toJson
(
storeMgtGoodsAddParam
));
}
...
...
@@ -102,21 +133,26 @@ public class GoblinStoreMgtGoodsController {
@ApiOperationSupport
(
order
=
5
)
@ApiOperation
(
value
=
"SPU详情"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"storeId"
,
value
=
"店铺ID"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"spuId"
,
value
=
"商品ID"
),
})
@GetMapping
(
"info"
)
public
ResponseDto
<
GoblinStoreMgtGoodsInfoVo
>
info
(
String
spuId
)
{
public
ResponseDto
<
GoblinStoreMgtGoodsInfoVo
>
info
(
@NotBlank
(
message
=
"店铺ID不能为空"
)
@RequestParam
String
storeId
,
@NotBlank
(
message
=
"商品ID不能为空"
)
@RequestParam
String
spuId
)
{
if
(!
goblinRedisUtils
.
hasStoreId
(
CurrentUtil
.
getCurrentUid
(),
storeId
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
}
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"商品管理:SPU详情:[spuId={}]"
,
spuId
);
}
return
ResponseDto
.
success
(
goblinstoreMgtGoodsService
.
goodsInfo
(
spuId
));
return
ResponseDto
.
success
(
goblinstoreMgtGoodsService
.
goodsInfo
(
s
toreId
,
s
puId
));
}
@ApiOperationSupport
(
order
=
6
)
@ApiOperation
(
value
=
"商品编辑:SPU编辑"
,
notes
=
"只修改商品信息,不包含规格相关信息"
)
@PostMapping
(
"edit_spu"
)
public
ResponseDto
<
Object
>
editSpu
(
@Valid
@RequestBody
GoblinStoreMgtGoodsAddParam
storeMgtGoodsAddParam
)
{
if
(
StringUtils
.
isBlank
(
storeMgtGoodsAddParam
.
getStoreId
()))
{
if
(
!
goblinRedisUtils
.
hasStoreId
(
CurrentUtil
.
getCurrentUid
(),
storeMgtGoodsAddParam
.
getStoreId
()))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
}
if
(
StringUtils
.
isBlank
(
storeMgtGoodsAddParam
.
getSpuId
())
||
null
==
goblinRedisUtils
.
getGoodsInfoVo
(
storeMgtGoodsAddParam
.
getSpuId
()))
{
...
...
@@ -132,7 +168,7 @@ public class GoblinStoreMgtGoodsController {
@ApiOperation
(
value
=
"商品编辑:SKU编辑"
,
notes
=
"只修改单品信息,不包含商品信息"
)
@PostMapping
(
"edit_sku"
)
public
ResponseDto
<
Object
>
editSku
(
@Valid
@RequestBody
GoblinStoreMgtGoodsEditSkuParam
storeMgtGoodsEditSkuParam
)
{
if
(
StringUtils
.
isBlank
(
storeMgtGoodsEditSkuParam
.
getStoreId
()))
{
if
(
!
goblinRedisUtils
.
hasStoreId
(
CurrentUtil
.
getCurrentUid
(),
storeMgtGoodsEditSkuParam
.
getStoreId
()))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
}
GoblinGoodsSkuInfoVo
goodsSkuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
storeMgtGoodsEditSkuParam
.
getSkuId
());
...
...
@@ -188,6 +224,9 @@ public class GoblinStoreMgtGoodsController {
@ApiOperation
(
value
=
"商品编辑:SKU添加"
)
@PutMapping
(
"edit_sku/add"
)
public
ResponseDto
<
Object
>
editSkuAdd
(
@Valid
@RequestBody
GoblinStoreMgtGoodsEditSkuParam
storeMgtGoodsEditSkuParam
)
{
if
(!
goblinRedisUtils
.
hasStoreId
(
CurrentUtil
.
getCurrentUid
(),
storeMgtGoodsEditSkuParam
.
getStoreId
()))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
}
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"商品管理:商品编辑:编辑SKU:[GoblinStoreMgtGoodsEditSkuParam={}]"
,
JsonUtils
.
toJson
(
storeMgtGoodsEditSkuParam
));
}
...
...
@@ -205,7 +244,10 @@ public class GoblinStoreMgtGoodsController {
@PostMapping
(
"edit_sku/del"
)
public
ResponseDto
<
Object
>
editSkuDel
(
@NotBlank
(
message
=
"店铺ID不能为空"
)
String
storeId
,
@NotBlank
(
message
=
"单品ID不能为空"
)
String
skuId
)
{
return
ResponseDto
.
success
(
goblinstoreMgtGoodsService
.
goodsEditSkuDel
(
skuId
));
if
(!
goblinRedisUtils
.
hasStoreId
(
CurrentUtil
.
getCurrentUid
(),
storeId
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
}
return
ResponseDto
.
success
(
goblinstoreMgtGoodsService
.
goodsEditSkuDel
(
storeId
,
skuId
));
}
@ApiOperationSupport
(
order
=
10
)
...
...
@@ -221,6 +263,9 @@ public class GoblinStoreMgtGoodsController {
@NotBlank
(
message
=
"商品ID不能为空"
)
String
spuId
,
@NotBlank
(
message
=
"批量修改属性不能为空"
)
String
batField
,
@NotBlank
(
message
=
"批量修改属性值不能为空"
)
String
batFieldVal
)
{
if
(!
goblinRedisUtils
.
hasStoreId
(
CurrentUtil
.
getCurrentUid
(),
storeId
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
}
return
ResponseDto
.
success
(
goblinstoreMgtGoodsService
.
goodsEditSkuBat
(
spuId
,
batField
,
batFieldVal
));
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtGoodsServiceImpl.java
View file @
45fd51a0
...
...
@@ -3,7 +3,6 @@ package com.liquidnet.service.goblin.service.impl.manage;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsActionParam
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsAddParam
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsEditSkuParam
;
...
...
@@ -97,7 +96,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
}
@Override
public
GoblinStoreMgtGoodsInfoVo
goodsInfo
(
String
spuId
)
{
public
GoblinStoreMgtGoodsInfoVo
goodsInfo
(
String
s
toreId
,
String
s
puId
)
{
GoblinStoreMgtGoodsInfoVo
vo
=
GoblinStoreMgtGoodsInfoVo
.
getNew
();
GoblinGoodsInfoVo
goodsInfoVo
=
goblinRedisUtils
.
getMgtGoodsInfoVo
(
spuId
);
if
(
null
!=
goodsInfoVo
)
{
...
...
@@ -114,8 +113,17 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
@Override
public
boolean
goodsEditSpu
(
GoblinStoreMgtGoodsAddParam
storeMgtGoodsAddParam
)
{
GoblinGoodsInfoVo
editGoodsSkuInfoVo
=
storeMgtGoodsAddParam
.
initEditGoods
Sku
InfoVo
();
GoblinGoodsInfoVo
editGoodsSkuInfoVo
=
storeMgtGoodsAddParam
.
initEditGoodsInfoVo
();
if
(
goblinMongoUtils
.
updateGoodsInfoVo
(
editGoodsSkuInfoVo
))
{
GoblinGoodsSkuInfoVo
updateSkuInfoVo
=
GoblinGoodsSkuInfoVo
.
getNew
();
updateSkuInfoVo
.
setSpuId
(
editGoodsSkuInfoVo
.
getSpuId
());
updateSkuInfoVo
.
setSkuNo
(
editGoodsSkuInfoVo
.
getSpuNo
());
updateSkuInfoVo
.
setName
(
editGoodsSkuInfoVo
.
getName
());
updateSkuInfoVo
.
setSubtitle
(
editGoodsSkuInfoVo
.
getSubtitle
());
updateSkuInfoVo
.
setVirtualFlg
(
editGoodsSkuInfoVo
.
getVirtualFlg
());
updateSkuInfoVo
.
setLogisticsTemplate
(
editGoodsSkuInfoVo
.
getLogisticsTemplate
());
goblinMongoUtils
.
updateGoodsSkuInfoVoBySpuId
(
updateSkuInfoVo
);
// TODO: 2022/1/5 zhanggb redis+sql
return
true
;
...
...
@@ -140,7 +148,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
}
@Override
public
boolean
goodsEditSkuDel
(
String
skuId
)
{
public
boolean
goodsEditSkuDel
(
String
s
toreId
,
String
s
kuId
)
{
// TODO: 2022/1/5 zhanggb
return
false
;
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
45fd51a0
...
...
@@ -217,6 +217,14 @@ public class GoblinMongoUtils {
).
getModifiedCount
()
>
0
;
}
public
boolean
updateGoodsSkuInfoVoBySpuId
(
GoblinGoodsSkuInfoVo
vo
)
{
return
mongoTemplate
.
getCollection
(
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
())
.
updateOne
(
Query
.
query
(
Criteria
.
where
(
"spuId"
).
is
(
vo
.
getSpuId
())).
getQueryObject
(),
ObjectUtil
.
cloneBasicDBObject
().
append
(
"$set"
,
mongoConverter
.
convertToMongoType
(
vo
))
).
getModifiedCount
()
>
0
;
}
/* ---------------------------------------- ---------------------------------------- */
/**
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
45fd51a0
package
com
.
liquidnet
.
service
.
goblin
.
util
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.util.
Date
Util
;
import
com.liquidnet.commons.lang.util.
Collection
Util
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
@Component
...
...
@@ -64,20 +64,39 @@ public class GoblinRedisUtils {
/* ---------------------------------------- 店铺数据源 ---------------------------------------- */
private
boolean
setStoreId
ByUid
(
String
uid
,
String
storeId
)
{
return
redisUtil
.
set
(
GoblinRedisConst
.
TMP_UID_STORE
.
concat
(
uid
),
storeId
);
private
boolean
setStoreId
s
(
String
uid
,
List
<
String
>
storeIds
)
{
return
redisUtil
.
set
(
GoblinRedisConst
.
BASIC_USTORE
.
concat
(
uid
),
storeIds
);
}
public
void
delStoreId
ByUid
(
String
uid
)
{
redisUtil
.
del
(
GoblinRedisConst
.
TMP_UID_
STORE
.
concat
(
uid
));
public
void
delStoreId
s
(
String
uid
)
{
redisUtil
.
del
(
GoblinRedisConst
.
BASIC_U
STORE
.
concat
(
uid
));
}
private
String
getStoreIdByUid
(
String
uid
)
{
return
(
String
)
redisUtil
.
get
(
GoblinRedisConst
.
TMP_UID_STORE
.
concat
(
uid
));
public
void
delStoreId
(
String
uid
,
String
storeId
)
{
List
<
String
>
storeIds
=
this
.
getStoreIds
(
uid
);
if
(!
CollectionUtils
.
isEmpty
(
storeIds
))
{
storeIds
.
removeIf
(
r
->
r
.
equals
(
storeId
));
this
.
setStoreIds
(
uid
,
storeIds
);
}
}
public
List
<
String
>
getStoreIds
(
String
uid
)
{
// return (List<String>) redisUtil.get(GoblinRedisConst.BASIC_USTORE.concat(uid));
return
Arrays
.
asList
(
"1"
);
// TODO: 2022/1/5 zhanggb
}
public
boolean
hasStoreId
(
String
uid
,
String
storeId
)
{
List
<
String
>
list
=
this
.
getStoreIds
(
uid
);
return
!
CollectionUtils
.
isEmpty
(
list
)
&&
list
.
contains
(
storeId
);
}
public
boolean
setStoreInfoVo
(
GoblinStoreInfoVo
vo
)
{
this
.
setStoreIdByUid
(
vo
.
getUid
(),
vo
.
getStoreId
());
List
<
String
>
storeIds
=
this
.
getStoreIds
(
vo
.
getUid
());
if
(
CollectionUtils
.
isEmpty
(
storeIds
))
{
storeIds
=
CollectionUtil
.
arrayListString
();
}
storeIds
.
add
(
vo
.
getStoreId
());
this
.
setStoreIds
(
vo
.
getUid
(),
storeIds
);
return
redisUtil
.
set
(
GoblinRedisConst
.
BASIC_STORE
.
concat
(
vo
.
getStoreId
()),
vo
);
}
...
...
@@ -95,8 +114,8 @@ public class GoblinRedisUtils {
}
public
GoblinStoreInfoVo
getStoreInfoVoByUid
(
String
uid
)
{
String
storeId
=
this
.
getStoreIdByUid
(
uid
);
return
null
==
storeId
?
goblinMongoUtils
.
getStoreInfoVoByUid
(
uid
)
:
this
.
getStoreInfoVo
(
storeId
);
List
<
String
>
storeIds
=
this
.
getStoreIds
(
uid
);
return
CollectionUtils
.
isEmpty
(
storeIds
)
?
goblinMongoUtils
.
getStoreInfoVoByUid
(
uid
)
:
this
.
getStoreInfoVo
(
storeIds
.
get
(
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