记得上下班打卡 | 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
254ed70b
Commit
254ed70b
authored
Mar 30, 2026
by
姜秀龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收钱 goods add
parent
6918c965
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
461 additions
and
129 deletions
+461
-129
GoblinStoreMgtGoodsSqbAddParam.java
...ice/goblin/dto/manage/GoblinStoreMgtGoodsSqbAddParam.java
+261
-0
GoblinStoreMgtGoodsSqbAddSkuParam.java
.../goblin/dto/manage/GoblinStoreMgtGoodsSqbAddSkuParam.java
+97
-0
GoblinStoreMgtGoodsSqbEditSkuParam.java
...goblin/dto/manage/GoblinStoreMgtGoodsSqbEditSkuParam.java
+84
-0
GoblinStoreMgtSqbGoodsController.java
...n/controller/manage/GoblinStoreMgtSqbGoodsController.java
+18
-87
GoblinStoreMgtSqbGoodsServiceImpl.java
...ervice/impl/manage/GoblinStoreMgtSqbGoodsServiceImpl.java
+1
-42
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinStoreMgtGoodsSqbAddParam.java
0 → 100644
View file @
254ed70b
This diff is collapsed.
Click to expand it.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinStoreMgtGoodsSqbAddSkuParam.java
0 → 100644
View file @
254ed70b
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
manage
;
import
com.liquidnet.commons.lang.constant.LnsRegex
;
import
com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.*
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.List
;
@ApiModel
(
value
=
"GoblinStoreMgtGoodsSqbAddSkuParam"
,
description
=
"商品管理:添加收钱吧商品:添加SKU入参"
)
@Data
public
class
GoblinStoreMgtGoodsSqbAddSkuParam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
7886534346305369761L
;
@ApiModelProperty
(
position
=
10
,
required
=
false
,
value
=
"单品ID[编辑时必传]"
)
private
String
skuId
;
// @ApiModelProperty(position = 11, required = false, value = "单品编码[默认为系统编码,也可手动输入商家自己的编码]")
// @Pattern(regexp = LnsRegex.Valid.ALPHABET_NUMBER_UNDER_50, message = "单品编码格式或长度有误")
// private String skuNo;
// @ApiModelProperty(position = 12, required = false, value = "单品条码")
// @Pattern(regexp = LnsRegex.Valid.ALPHABET_NUMBER_32, message = "单品条码格式或长度有误")
// private String skuBarCode;
// @ApiModelProperty(position = 13, required = false, value = "ERP商家编码")
// @Size(max = 40, message = "ERP商家编码长度限制40")
// private String skuErpCode;//-
// @ApiModelProperty(position = 14, required = false, value = "ERP托管[0-否|1-是],默认0")
// @Pattern(regexp = "\\b(0|1)\\b", message = "ERP托管参数无效")
// private String erpHosting;//-
// @ApiModelProperty(position = 15, required = false, value = "ERP仓库编号")
// @Size(max = 40, message = "ERP仓库编号长度限制40")
// private String erpWarehouseNo;//-
// @ApiModelProperty(position = 16, required = false, value = "单品默认图片的url[256]")
// @NotBlank(message = "单品图片不能为空")
// private String skuPic;
@ApiModelProperty
(
position
=
12
,
required
=
false
,
value
=
"单品规格信息"
)
// @NotNull(message = "规格信息不能为空")
// @Valid// 初始化写死['规格':'张']
private
List
<
GoblinGoodsSpecDto
>
skuSpecList
;
// @ApiModelProperty(position = 18, required = false, value = "单品销售价-原价[20,2]")
// private BigDecimal sellPrice;
@ApiModelProperty
(
position
=
19
,
required
=
true
,
value
=
"单品现价[20,2]"
)
@Digits
(
integer
=
6
,
fraction
=
2
,
message
=
"参数'单品现价'无效"
)
@DecimalMin
(
value
=
"0.01"
,
message
=
"参数'单品现价'必须为大于0"
)
private
BigDecimal
price
;
// @ApiModelProperty(position = 20, required = false, value = "单品会员价格[20,2]")
// @NotNull(message = "单品会员价格不能为空")
// @Min(value = 0, message = "单品会员价格不能小于0")
// private BigDecimal priceMember;
// @ApiModelProperty(position = 21, required = false, value = "单品的重量[20,2]")
// private BigDecimal weight;//-
@ApiModelProperty
(
position
=
20
,
required
=
true
,
value
=
"总库存"
)
@Min
(
value
=
0
,
message
=
"总库存不能小于0"
)
private
Integer
stock
;
// @ApiModelProperty(position = 21, required = false, value = "预警库存")
// private Integer warningStock;
// @ApiModelProperty(position = 22, required = false, value = "ISBN,针对CD/图书等[100]")
// private String skuIsbn;//-
// @ApiModelProperty(position = 23, required = false, value = "购买限制[0-全部用户|1-仅会员|2-指定用户]")
// @NotNull(message = "购买限制不能为空")
// private String buyFactor;
// @ApiModelProperty(position = 24, required = false, value = "购买限制人员名单[购买限制为2-指定用户时必填]")
// private String buyRoster;
@ApiModelProperty
(
position
=
25
,
required
=
false
,
value
=
"限量[0-无限制|X:限购数量]"
)
private
Integer
buyLimit
;
// @ApiModelProperty(position = 26, required = false, value = "单品有效期[yyyy-MM-dd HH:mm:ss]")
// @Pattern(regexp = LnsRegex.Valid.DATETIME_FULL, message = "单品有效期格式有误")
// private String skuValidity;
// @ApiModelProperty(position = 27, required = false, value = "自定义展示[0-默认展示|1-隐藏不可购买]")
// private String skuAppear;
/**
* ---------------------------- 收钱吧商品-代金券属性 ----------------------------
*/
@ApiModelProperty
(
position
=
28
,
required
=
true
,
value
=
"是否实名[0-否|1-是,表示该商品需要实名关联]"
,
allowableValues
=
"0,1"
,
example
=
"1"
)
@Pattern
(
regexp
=
"\\b(0|1)\\b"
,
message
=
"参数'是否实名'无效"
)
private
String
isTrueName
;
@ApiModelProperty
(
position
=
29
,
required
=
true
,
value
=
"适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]"
,
allowableValues
=
"101,102,103"
,
example
=
"101"
)
@Pattern
(
regexp
=
"\\b(101|102|103)\\b"
,
message
=
"参数'适用范围'无效"
)
private
String
useScope
;
@ApiModelProperty
(
position
=
30
,
required
=
true
,
value
=
"面值"
,
example
=
"99.00"
)
@Digits
(
integer
=
3
,
fraction
=
2
,
message
=
"参数'面值'无效"
)
@DecimalMin
(
value
=
"0.01"
,
message
=
"参数'面值'必须为大于0"
)
private
BigDecimal
valFace
;
@ApiModelProperty
(
position
=
31
,
required
=
true
,
value
=
"开始时间[yyyy-MM-dd HH:mm:ss]"
,
example
=
"2024-01-01 00:00:00"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
DATETIME_FULL
,
message
=
"开始时间格式有误"
)
@NotNull
(
message
=
"参数'开始时间'不可为空"
)
private
String
effectAt
;
@ApiModelProperty
(
position
=
32
,
required
=
true
,
value
=
"结束时间[yyyy-MM-dd HH:mm:ss]"
,
example
=
"2024-12-31 00:00:00"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
DATETIME_FULL
,
message
=
"结束时间格式有误"
)
@NotNull
(
message
=
"参数'结束时间'不可为空"
)
private
String
expireAt
;
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinStoreMgtGoodsSqbEditSkuParam.java
0 → 100644
View file @
254ed70b
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
manage
;
import
com.liquidnet.commons.lang.constant.LnsRegex
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.*
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
@ApiModel
(
value
=
"GoblinStoreMgtGoodsSqbEditSkuParam"
,
description
=
"商品管理:编辑收钱吧商品:编辑SKU入参"
)
@Data
public
class
GoblinStoreMgtGoodsSqbEditSkuParam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
8174428924922310702L
;
@ApiModelProperty
(
position
=
10
,
required
=
true
,
value
=
"店铺ID[64]"
)
@NotBlank
(
message
=
"店铺ID不能为空"
)
private
String
storeId
;
@ApiModelProperty
(
position
=
11
,
required
=
true
,
value
=
"商品ID[64]"
)
@NotNull
(
message
=
"商品ID不能为空"
)
private
String
spuId
;
@ApiModelProperty
(
position
=
12
,
required
=
true
,
value
=
"单品ID[编辑时必传]"
)
@NotNull
(
message
=
"商品SKU_ID不能为空"
)
private
String
skuId
;
@ApiModelProperty
(
position
=
13
,
required
=
true
,
value
=
"单品现价[20,2]"
)
@Digits
(
integer
=
3
,
fraction
=
2
,
message
=
"参数'单品现价'无效"
)
@DecimalMin
(
value
=
"0.01"
,
message
=
"参数'单品现价'必须为大于0"
)
private
BigDecimal
price
;
@ApiModelProperty
(
position
=
14
,
required
=
true
,
value
=
"限量[0-无限制|X:限购数量]"
)
@Min
(
value
=
0
,
message
=
"参数'限购数量'不能小于0"
)
@NotNull
(
message
=
"参数'限购数量'不可为空"
)
private
Integer
buyLimit
;
@ApiModelProperty
(
position
=
15
,
required
=
false
,
value
=
"总库存"
)
private
Integer
stock
;
@ApiModelProperty
(
position
=
16
,
required
=
false
,
value
=
"总库存"
)
private
Integer
skuStock
;
@ApiModelProperty
(
position
=
17
,
required
=
false
,
value
=
"加减库存"
)
private
Integer
operStock
;
/**
* ---------------------------- 收钱吧商品-代金券属性 ----------------------------
*/
@ApiModelProperty
(
position
=
18
,
required
=
true
,
value
=
"是否实名[0-否|1-是,表示该商品需要实名关联]"
,
example
=
"1"
)
@Pattern
(
regexp
=
"\\b(0|1)\\b"
,
message
=
"参数'是否实名'无效"
)
private
String
isTrueName
;
@ApiModelProperty
(
position
=
19
,
required
=
true
,
value
=
"适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]"
)
@Pattern
(
regexp
=
"\\b(101|102|103)\\b"
,
message
=
"参数'适用范围'无效"
)
private
String
useScope
;
@ApiModelProperty
(
position
=
20
,
required
=
true
,
value
=
"面值"
,
example
=
"99.00"
)
@Digits
(
integer
=
3
,
fraction
=
2
,
message
=
"参数'面值'无效"
)
@DecimalMin
(
value
=
"0.01"
,
message
=
"参数'面值'必须为大于0"
)
private
BigDecimal
valFace
;
@ApiModelProperty
(
position
=
21
,
required
=
true
,
value
=
"结束时间[yyyy-MM-dd HH:mm:ss]"
,
example
=
"2024-01-01 00:00:00"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
DATETIME_FULL
,
message
=
"开始时间格式有误"
)
@NotNull
(
message
=
"参数'开始时间'不可为空"
)
private
String
effectAt
;
@ApiModelProperty
(
position
=
22
,
required
=
true
,
value
=
"结束时间[yyyy-MM-dd HH:mm:ss]"
,
example
=
"2024-12-31 00:00:00"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
DATETIME_FULL
,
message
=
"结束时间格式有误"
)
@NotNull
(
message
=
"参数'结束时间'不可为空"
)
private
String
expireAt
;
public
GoblinGoodsSkuInfoVo
initEditGoodsSkuInfoVo
()
{
GoblinGoodsSkuInfoVo
goodsSkuInfoVo
=
GoblinGoodsSkuInfoVo
.
getNew
();
goodsSkuInfoVo
.
setSkuType
(
2
);
goodsSkuInfoVo
.
setSkuId
(
this
.
getSkuId
());
goodsSkuInfoVo
.
setPrice
(
this
.
getPrice
());
goodsSkuInfoVo
.
setPriceMember
(
this
.
getPrice
());
goodsSkuInfoVo
.
setBuyLimit
(
this
.
getBuyLimit
());
goodsSkuInfoVo
.
setStock
(
this
.
getStock
());
goodsSkuInfoVo
.
setSkuStock
(
this
.
getSkuStock
());
goodsSkuInfoVo
.
setIsTrueName
(
Integer
.
valueOf
(
this
.
getIsTrueName
()));
goodsSkuInfoVo
.
setUseScope
(
Integer
.
valueOf
(
this
.
getUseScope
()));
goodsSkuInfoVo
.
setValFace
(
this
.
getValFace
());
goodsSkuInfoVo
.
setEffectAt
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
parse
(
this
.
getEffectAt
()));
goodsSkuInfoVo
.
setExpireAt
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
parse
(
this
.
getExpireAt
()));
return
goodsSkuInfoVo
;
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtSqbGoodsController.java
View file @
254ed70b
...
...
@@ -12,6 +12,7 @@ import com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsSqbAddParam;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsSqbAddSkuParam
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsSqbEditSkuParam
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.param.shouqianba.response.data.MallProductsQueryData
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtExtraService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtSqbGoodsService
;
import
com.liquidnet.service.goblin.util.GoblinMongoUtils
;
...
...
@@ -35,7 +36,7 @@ import java.util.Objects;
/**
* 收钱吧商品管理
*/
@ApiSupport
(
order
=
1
49005
)
@ApiSupport
(
order
=
1
)
@Api
(
tags
=
"收钱吧商品管理"
)
@Slf4j
@Validated
...
...
@@ -55,98 +56,28 @@ public class GoblinStoreMgtSqbGoodsController {
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"SPU添加-收钱吧商品"
)
@PostMapping
(
"add"
)
public
ResponseDto
<
Object
>
add
(
@Valid
@RequestBody
GoblinStoreMgtGoodsSqbAddParam
mgtGoodsSqbAddParam
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
(),
storeId
=
mgtGoodsSqbAddParam
.
getStoreId
();
public
ResponseDto
<
Object
>
add
(
@RequestParam
(
"storeId"
)
String
storeId
,
@RequestBody
@Validated
List
<
GoblinSqbPerfGoodsVo
>
items
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
if
(!
goblinRedisUtils
.
hasStoreId
(
currentUid
,
storeId
))
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"收钱吧商品管理:
SPU添加:[GoblinStoreMgtGoodsSqbAddParam={}]"
,
JsonUtils
.
toJson
(
mgtGoodsSqbAddParam
));
log
.
debug
(
"收钱吧商品管理:
添加:[items={}]"
,
JsonUtils
.
toJson
(
items
));
}
for
(
GoblinSqbPerfGoodsVo
sqbGoods
:
items
)
{
GoblinStoreMgtGoodsSqbAddParam
mgtGoodsSqbAddParamNew
=
new
GoblinStoreMgtGoodsSqbAddParam
();
GoblinGoodsInfoVo
goodsInfoVo
=
mgtGoodsSqbAddParamNew
.
initGoodsInfoVo
(
storeId
,
sqbGoods
,
currentUid
,
LocalDateTime
.
now
());
GoblinStoreMgtGoodsSqbAddSkuParam
skuParam
=
mgtGoodsSqbAddParam
.
getSkuParam
();
if
(
Objects
.
isNull
(
skuParam
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149006"
));
}
if
(
Objects
.
isNull
(
skuParam
.
getEffectAt
())
||
Objects
.
isNull
(
skuParam
.
getExpireAt
()))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149025"
));
}
LocalDateTime
effectAt
=
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
parse
(
skuParam
.
getEffectAt
());
LocalDateTime
expireAt
=
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
parse
(
skuParam
.
getExpireAt
());
if
(
effectAt
.
isAfter
(
expireAt
)
||
expireAt
.
isBefore
(
LocalDateTime
.
now
()))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149026"
));
}
if
(
CollectionUtils
.
isEmpty
(
mgtGoodsSqbAddParam
.
getImageList
()))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品图片不能为空"
);
}
String
cateFid
=
mgtGoodsSqbAddParam
.
getCateFid
(),
cateSid
=
mgtGoodsSqbAddParam
.
getCateSid
(),
cateTid
=
mgtGoodsSqbAddParam
.
getCateTid
();
List
<
GoblinSelfGoodsCategoryVo
>
selfGoodsCategoryVos
=
goblinStoreMgtExtraService
.
listCategoryVo
();
if
(
selfGoodsCategoryVos
.
stream
().
noneMatch
(
r
->
r
.
getCateId
().
equals
(
cateFid
)
&&
r
.
getGrade
().
equals
(
"1"
)))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品一级分类无效"
);
}
if
(
StringUtils
.
isNotBlank
(
cateSid
)
&&
selfGoodsCategoryVos
.
stream
().
noneMatch
(
r
->
r
.
getCateId
().
equals
(
cateSid
)
&&
r
.
getGrade
().
equals
(
"2"
)))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品二级分类无效"
);
}
if
(
StringUtils
.
isNotBlank
(
cateTid
)
&&
selfGoodsCategoryVos
.
stream
().
noneMatch
(
r
->
r
.
getCateId
().
equals
(
cateTid
)
&&
r
.
getGrade
().
equals
(
"3"
)))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品三级分类无效"
);
}
if
(
goblinMongoUtils
.
countMgtGoodsInfoVo
(
mgtGoodsSqbAddParam
.
getName
())
>
0
)
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149007"
));
}
if
(
mgtGoodsSqbAddParam
.
getShelvesHandle
().
equals
(
"3"
)
&&
null
==
mgtGoodsSqbAddParam
.
getShelvesTime
())
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"预约上架时间未指定"
);
}
GoblinGoodsInfoVo
goodsInfoVo
=
mgtGoodsSqbAddParam
.
initGoodsInfoVo
(
currentUid
,
LocalDateTime
.
now
());
ArrayList
<
GoblinGoodsSpecVo
>
goodsSpecVoList
=
ObjectUtil
.
getGoblinGoodsSpecVoArrayList
();
List
<
GoblinGoodsSkuInfoVo
>
goodsSkuInfoVoList
=
ObjectUtil
.
getGoblinGoodsSkuInfoVoArrayList
();
mgtGoodsSqbAddParam
.
initGoodsSkuInfoVo
(
goodsInfoVo
,
goodsSkuInfoVoList
,
goodsSpecVoList
);
List
<
String
>
goodsTagIdList
=
mgtGoodsSqbAddParam
.
getTagList
(),
goodsExtagIdList
=
mgtGoodsSqbAddParam
.
getExtagList
(),
goodsArtagIdList
=
mgtGoodsSqbAddParam
.
getArtagList
();
if
(!
CollectionUtils
.
isEmpty
(
goodsTagIdList
))
{
List
<
GoblinSelfTagVo
>
selfGoodsTagVos
=
goblinRedisUtils
.
getSelfTagVos
();
List
<
GoblinGoodsTagVo
>
goodsTagVoList
=
ObjectUtil
.
getGoblinGoodsTagVoArrayList
();
for
(
int
i
=
0
;
i
<
goodsTagIdList
.
size
();
i
++)
for
(
GoblinSelfTagVo
r
:
selfGoodsTagVos
)
if
(
r
.
getTagId
().
equals
(
goodsTagIdList
.
get
(
i
))
&&
r
.
getTagBelong
().
equals
(
"0"
))
{
goodsTagVoList
.
add
(
GoblinGoodsTagVo
.
getNew
().
copy
(
r
).
setSort
(
i
));
break
;
}
goodsInfoVo
.
setTagVoList
(
goodsTagVoList
);
}
if
(!
CollectionUtils
.
isEmpty
(
goodsExtagIdList
))
{
List
<
GoblinSelfTagVo
>
selfExtagVos
=
goblinRedisUtils
.
getSelfExtagVos
();
List
<
GoblinGoodsExtagVo
>
goodsExtagVoList
=
ObjectUtil
.
getGoblinGoodsExtagVoArrayList
();
for
(
int
i
=
0
;
i
<
goodsExtagIdList
.
size
();
i
++)
for
(
GoblinSelfTagVo
r
:
selfExtagVos
)
if
(
r
.
getTagId
().
equals
(
goodsExtagIdList
.
get
(
i
))
&&
r
.
getTagBelong
().
equals
(
"1"
)
&&
!
r
.
getTagType
().
equals
(
"5"
))
{
goodsExtagVoList
.
add
(
GoblinGoodsExtagVo
.
getNew
().
copy
(
r
).
setSort
(
i
));
break
;
}
goodsInfoVo
.
setExtagVoList
(
goodsExtagVoList
);
}
if
(!
CollectionUtils
.
isEmpty
(
goodsArtagIdList
))
{
List
<
GoblinSelfTagVo
>
selfExtagVos
=
goblinRedisUtils
.
getSelfExtagVos
();
List
<
GoblinGoodsExtagVo
>
goodsArtagVoList
=
ObjectUtil
.
getGoblinGoodsExtagVoArrayList
();
for
(
int
i
=
0
;
i
<
goodsArtagIdList
.
size
();
i
++)
for
(
GoblinSelfTagVo
r
:
selfExtagVos
)
if
(
r
.
getTagId
().
equals
(
goodsArtagIdList
.
get
(
i
))
&&
r
.
getTagBelong
().
equals
(
"1"
))
{
goodsArtagVoList
.
add
(
GoblinGoodsExtagVo
.
getNew
().
copy
(
r
).
setSort
(
i
));
break
;
}
goodsInfoVo
.
setArtagVoList
(
goodsArtagVoList
);
}
ArrayList
<
GoblinGoodsSpecVo
>
goodsSpecVoList
=
ObjectUtil
.
getGoblinGoodsSpecVoArrayList
();
List
<
GoblinGoodsSkuInfoVo
>
goodsSkuInfoVoList
=
ObjectUtil
.
getGoblinGoodsSkuInfoVoArrayList
();
mgtGoodsSqbAddParamNew
.
initGoodsSkuInfoVo
(
goodsInfoVo
,
goodsSkuInfoVoList
,
goodsSpecVoList
,
sqbGoods
);
List
<
String
>
ssidList
=
mgtGoodsSqbAddParam
.
getSsidList
();
if
(!
CollectionUtils
.
isEmpty
(
ssidList
))
{
goodsInfoVo
.
setServiceSupportVoList
(
goblinMongoUtils
.
getServiceSupportVos
(
ssidList
));
goodsInfoVo
.
setTagVoList
(
new
ArrayList
<>());
goodsInfoVo
.
setExtagVoList
(
new
ArrayList
<>());
goodsInfoVo
.
setArtagVoList
(
new
ArrayList
<>());
goodsInfoVo
.
setServiceSupportVoList
(
new
ArrayList
<>());
goblinstoreMgtSqbGoodsService
.
sqbGoodsAdd
(
goodsInfoVo
,
goodsSkuInfoVoList
);
}
goblinstoreMgtSqbGoodsService
.
sqbGoodsAdd
(
goodsInfoVo
,
goodsSkuInfoVoList
);
return
ResponseDto
.
success
(
goodsInfoVo
.
getSpuId
());
return
ResponseDto
.
success
();
}
@ApiOperationSupport
(
order
=
2
)
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtSqbGoodsServiceImpl.java
View file @
254ed70b
...
...
@@ -44,10 +44,6 @@ public class GoblinStoreMgtSqbGoodsServiceImpl implements IGoblinStoreMgtSqbGood
goblinMongoUtils
.
setGoodsInfoVo
(
goodsInfoVo
);
goblinMongoUtils
.
setGoodsSkuInfoVos
(
goodsSkuInfoVoList
);
if
(
goodsInfoVo
.
getShelvesHandle
().
equals
(
"2"
))
{
goblinRedisUtils
.
deleteKeyForSelectGoods
();
// 精选商品:商品上架、下架、删除 调用的方法
}
String
createdBy
=
goodsInfoVo
.
getCreatedBy
();
LocalDateTime
createdAt
=
goodsInfoVo
.
getCreatedAt
();
String
spuId
=
goodsInfoVo
.
getSpuId
();
...
...
@@ -83,9 +79,6 @@ public class GoblinStoreMgtSqbGoodsServiceImpl implements IGoblinStoreMgtSqbGood
}
}
LinkedList
<
Object
[]>
initGoodsSkuCouponObjs
=
CollectionUtil
.
linkedListObjectArr
();
// 券类商品信息
LinkedList
<
Object
[]>
initCandyCouponObjs
=
CollectionUtil
.
linkedListObjectArr
();
// 券信息
LinkedList
<
Object
[]>
initCandyCouponRuleObjs
=
CollectionUtil
.
linkedListObjectArr
();
// 券规则信息
int
skuSize
=
goodsSkuInfoVoList
.
size
();
for
(
int
i
=
0
;
i
<
skuSize
;
i
++)
{
GoblinGoodsSkuInfoVo
skuInfoVo
=
goodsSkuInfoVoList
.
get
(
i
);
...
...
@@ -109,40 +102,10 @@ public class GoblinStoreMgtSqbGoodsServiceImpl implements IGoblinStoreMgtSqbGood
skuInfoVo
.
getSkuAppear
(),
skuInfoVo
.
getShelvesAt
(),
createdBy
,
createdAt
,
skuInfoVo
.
getLogisticsTemplate
()
});
if
(
2
==
goodsInfoVo
.
getSpuType
())
{
// 券类商品为一个SPU对应一个SKU
initGoodsSkuCouponObjs
.
add
(
new
Object
[]
{
skuId
,
skuInfoVo
.
getBusiType
(),
skuInfoVo
.
getCouType
(),
skuInfoVo
.
getUseScope
(),
skuInfoVo
.
getValFace
(),
skuInfoVo
.
getIsTrueName
(),
skuInfoVo
.
getValidity
(),
skuInfoVo
.
getEffectAt
(),
skuInfoVo
.
getExpireAt
()
});
initCandyCouponObjs
.
add
(
new
Object
[]
{
skuId
,
goodsInfoVo
.
getName
(),
goodsInfoVo
.
getIntro
(),
skuInfoVo
.
getBusiType
(),
skuInfoVo
.
getCouType
(),
skuInfoVo
.
getValFace
(),
skuInfoVo
.
getValidity
(),
skuInfoVo
.
getIsTrueName
(),
skuInfoVo
.
getEffectAt
(),
skuInfoVo
.
getExpireAt
(),
createdBy
,
createdAt
});
String
busiName
=
"%s"
;
switch
(
skuInfoVo
.
getUseScope
())
{
// 适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]
case
101
:
// 音乐节
busiName
=
String
.
format
(
busiName
,
"草莓、M_DSK、五百里音乐节"
);
// 按杨要求文案'音乐节'改'草莓、M_DSK、五百里音乐节'
break
;
case
102
:
// 小型演出(LiveHouse演出)
busiName
=
String
.
format
(
busiName
,
"小型演出(LiveHouse演出)系列"
);
break
;
case
103
:
// 巡演
busiName
=
String
.
format
(
busiName
,
"巡演 系列"
);
break
;
}
initCandyCouponRuleObjs
.
add
(
new
Object
[]
{
IDGenerator
.
nextTimeId2
(),
skuId
,
skuInfoVo
.
getUseScope
(),
busiName
,
""
});
}
skuInfoVo
.
getSkuSpecList
().
forEach
(
skuSpecDto
->
initGoodsSkuSpecValueObjs
.
add
(
new
Object
[]
{
spuId
,
skuId
,
skuSpecDto
.
getSpecName
(),
skuSpecDto
.
getSpecVname
()
}));
if
(
skuInfoVo
.
getBuyFactor
().
equals
(
"2"
)
&&
StringUtils
.
isNotBlank
(
buyRoster
)
&&
buyRoster
.
startsWith
(
"http"
))
{
queueUtils
.
sendMsgByRedisXls
(
buyRoster
,
"1"
,
skuId
);
}
}
LinkedList
<
String
>
toMqSqls
=
CollectionUtil
.
linkedListString
();
...
...
@@ -164,9 +127,6 @@ public class GoblinStoreMgtSqbGoodsServiceImpl implements IGoblinStoreMgtSqbGood
goodsInfoVo
.
getShelvesAt
(),
createdBy
,
createdAt
,
goodsInfoVo
.
getLogisticsTemplate
()
});
toMqSqls
.
add
(
SqlMapping
.
get
(
"goblin_goods_sku.insert_for_coupon"
));
toMqSqls
.
add
(
SqlMapping
.
get
(
"goblin_goods_sku_coupon.insert"
));
toMqSqls
.
add
(
SqlMapping
.
get
(
"candy_coupon.goods_insert"
));
toMqSqls
.
add
(
SqlMapping
.
get
(
"candy_coupon_rule.goods_insert"
));
toMqSqls
.
add
(
SqlMapping
.
get
(
"goblin_goods_image.insert_byreplace"
));
LinkedList
<
Object
[]>
initGoodsImageObjs
=
CollectionUtil
.
linkedListObjectArr
();
if
(
CollectionUtils
.
isEmpty
(
goodsInfoVo
.
getImageList
()))
{
...
...
@@ -215,8 +175,7 @@ public class GoblinStoreMgtSqbGoodsServiceImpl implements IGoblinStoreMgtSqbGood
toMqSqls
.
add
(
SqlMapping
.
get
(
"goblin_goods_category_spec.insert_byreplace"
));
// 分类关联规格信息
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
SQL_GOODS
.
getKey
(),
SqlMapping
.
gets
(
toMqSqls
,
initGoodsObjs
,
initGoodsSkuObjs
,
initGoodsSkuCouponObjs
,
initCandyCouponObjs
,
initCandyCouponRuleObjs
,
SqlMapping
.
gets
(
toMqSqls
,
initGoodsObjs
,
initGoodsSkuObjs
,
initGoodsImageObjs
,
initGoodsTagObjs
,
initGoodsArTagObjs
,
initGoodsServiceSupportObjs
,
initGoodsSpecObjs
,
initGoodsSpecValueObjs
,
initGoodsSpuSpecValueObjs
,
initGoodsSkuSpecValueObjs
,
...
...
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