记得上下班打卡 | 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
db7f5fe3
Commit
db7f5fe3
authored
Jun 30, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
混合售后台接口提交
parent
916cd8f5
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
759 additions
and
57 deletions
+759
-57
GoblinRedisConst.java
...m/liquidnet/service/goblin/constant/GoblinRedisConst.java
+9
-0
GoblinMixDetailsItemVo.java
...quidnet/service/goblin/dto/vo/GoblinMixDetailsItemVo.java
+17
-3
GoblinMixDetailsVo.java
...m/liquidnet/service/goblin/dto/vo/GoblinMixDetailsVo.java
+49
-17
GoblinMixManageListVo.java
...iquidnet/service/goblin/dto/vo/GoblinMixManageListVo.java
+2
-0
GoblinMixDetailsItemParam.java
...idnet/service/goblin/param/GoblinMixDetailsItemParam.java
+38
-0
GoblinMixDetailsParam.java
...liquidnet/service/goblin/param/GoblinMixDetailsParam.java
+61
-0
GoblinMixUpdateParam.java
.../liquidnet/service/goblin/param/GoblinMixUpdateParam.java
+34
-0
IGoblinMixService.java
...dnet/service/goblin/service/manage/IGoblinMixService.java
+6
-3
GoblinMix.java
...n/java/com/liquidnet/service/goblin/entity/GoblinMix.java
+4
-12
GoblinMixDetails.java
...com/liquidnet/service/goblin/entity/GoblinMixDetails.java
+6
-1
db_goblin_mix.sql
...blin/liquidnet-service-goblin-impl/docu/db_goblin_mix.sql
+9
-9
GoblinMixController.java
...service/goblin/controller/manage/GoblinMixController.java
+87
-0
GoblinMixServiceImpl.java
...vice/goblin/service/impl/manage/GoblinMixServiceImpl.java
+265
-8
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+31
-1
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+121
-1
ObjectUtil.java
...in/java/com/liquidnet/service/goblin/util/ObjectUtil.java
+12
-1
sqlmap.properties
...-service-goblin-impl/src/main/resources/sqlmap.properties
+8
-1
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/constant/GoblinRedisConst.java
View file @
db7f5fe3
...
...
@@ -322,6 +322,15 @@ public class GoblinRedisConst {
public
static
final
String
OPEN_NFT_TEC
=
PREFIX
.
concat
(
"open:nft:tec:"
);
//$key+$uid 是否开启技术数字藏品特效
/**
* 组合销售REDIS
*/
public
static
final
String
GOBLIN_MIX_DETAILS
=
PREFIX
.
concat
(
"mix:"
);
//$key+$mixId
public
static
final
String
GOBLIN_MIX_RELATION_BOX
=
PREFIX
.
concat
(
"mix:relation:box"
);
//库存关系 $key:$skuId:$listId
public
static
final
String
GOBLIN_MIX_NFT_LIST
=
PREFIX
.
concat
(
"mix:nft"
);
//nft 混合售列表
public
static
final
String
GOBLIN_MIX_SKU_LIST
=
PREFIX
.
concat
(
"mix:goods"
);
//nft 混合售列表
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinMixDetailsItemVo.java
View file @
db7f5fe3
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.service.goblin.param.GoblinMixDetailsItemParam
;
import
com.liquidnet.service.goblin.param.GoblinMixDetailsParam
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -14,13 +17,14 @@ public class GoblinMixDetailsItemVo implements Serializable, Cloneable {
private
String
skuId
;
@ApiModelProperty
(
value
=
"sku名称"
)
private
String
skuName
;
@ApiModelProperty
(
value
=
"商品类型[1-商城|2-数字藏品]"
)
private
String
position
;
@ApiModelProperty
(
value
=
"sku原价"
)
private
BigDecimal
skuPrice
;
@ApiModelProperty
(
value
=
"总库存"
)
private
Integer
stock
;
@ApiModelProperty
(
value
=
"可配置库存"
)
private
Integer
surplusStock
;
@ApiModelProperty
(
value
=
"组合价格"
)
private
BigDecimal
price
;
@ApiModelProperty
(
value
=
"苹果价格"
)
...
...
@@ -29,8 +33,6 @@ public class GoblinMixDetailsItemVo implements Serializable, Cloneable {
private
String
productId
;
@ApiModelProperty
(
value
=
"组合件数[数字藏品不能大于1]"
)
private
Integer
count
;
@ApiModelProperty
(
value
=
"是否支持退款[0-否|1-是]"
)
private
Integer
canRefund
;
private
static
final
GoblinMixDetailsItemVo
obj
=
new
GoblinMixDetailsItemVo
();
...
...
@@ -42,4 +44,16 @@ public class GoblinMixDetailsItemVo implements Serializable, Cloneable {
}
return
new
GoblinMixDetailsItemVo
();
}
public
GoblinMixDetailsItemVo
copyByInsert
(
GoblinMixDetailsItemParam
source
)
{
if
(
null
==
source
)
return
this
;
this
.
setSpuId
(
DateUtil
.
getNowTime
());
this
.
setSkuId
(
source
.
getSkuId
());
this
.
setPrice
(
source
.
getPrice
());
this
.
setPriceV
(
source
.
getPriceV
());
this
.
setProductId
(
source
.
getProductId
());
this
.
setCount
(
source
.
getCount
());
this
.
setPosition
(
source
.
getPosition
());
return
this
;
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinMixDetailsVo.java
View file @
db7f5fe3
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.goblin.param.GoblinMixDetailsParam
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Data
...
...
@@ -12,7 +16,8 @@ import java.util.List;
public
class
GoblinMixDetailsVo
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
position
=
0
,
value
=
"活动id"
)
private
String
mixId
;
@ApiModelProperty
(
position
=
0
,
value
=
"用户id"
)
private
String
userId
;
@ApiModelProperty
(
position
=
1
,
value
=
"活动名称"
)
private
String
name
;
@ApiModelProperty
(
position
=
2
,
value
=
"开始时间"
)
...
...
@@ -20,15 +25,11 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
@ApiModelProperty
(
position
=
3
,
value
=
"结束时间"
)
private
String
timeEnd
;
@ApiModelProperty
(
position
=
4
,
value
=
"展示位置[1-商城|2-数字藏品]"
)
private
String
showPosition
;
private
Integer
showPosition
;
@ApiModelProperty
(
position
=
5
,
value
=
"组合名称"
)
private
String
sellName
;
@ApiModelProperty
(
position
=
6
,
value
=
"平台一级分类"
)
private
String
cateFName
;
@ApiModelProperty
(
position
=
7
,
value
=
"平台二级分类"
)
private
String
cateSName
;
@ApiModelProperty
(
position
=
8
,
value
=
"平台三级分类"
)
private
String
cateTNAME
;
@ApiModelProperty
(
position
=
6
,
value
=
"快递价格"
)
private
BigDecimal
expressPrice
;
@ApiModelProperty
(
position
=
9
,
value
=
"商品简介/购买须知"
)
private
String
intro
;
@ApiModelProperty
(
position
=
10
,
value
=
"封面图片地址"
)
...
...
@@ -37,25 +38,28 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
private
String
video
;
@ApiModelProperty
(
position
=
12
,
value
=
"商品详情/藏品详情"
)
private
String
details
;
@ApiModelProperty
(
position
=
13
,
value
=
"展示文件类型[1-图片|2-视频"
)
private
String
watchType
;
@ApiModelProperty
(
position
=
14
,
value
=
"
数字藏品
图片地址"
)
@ApiModelProperty
(
position
=
13
,
value
=
"展示文件类型[1-图片|2-视频
]
"
)
private
Integer
watchType
;
@ApiModelProperty
(
position
=
14
,
value
=
"
详情
图片地址"
)
private
String
detailUrl
;
@ApiModelProperty
(
position
=
14
,
value
=
"设置库存"
)
private
String
stock
;
private
Integer
stock
;
@ApiModelProperty
(
position
=
15
,
value
=
"锁定库存"
)
private
String
stockLock
;
private
Integer
stockLock
;
@ApiModelProperty
(
position
=
16
,
value
=
"是否锁定[0-否|1-是]"
)
private
String
isLock
;
private
Integer
isLock
;
@ApiModelProperty
(
position
=
17
,
value
=
"限购数量[0-无限]"
)
private
String
limit
;
private
Integer
limit
;
@ApiModelProperty
(
position
=
18
,
value
=
"白名单类型[0-会员|1-指定用户|2-全部用户]"
)
private
String
whiteType
;
private
Integer
whiteType
;
@ApiModelProperty
(
position
=
19
,
value
=
"白名单xls地址"
)
private
String
whiteUrl
;
@ApiModelProperty
(
position
=
20
,
value
=
"配置详情"
)
private
List
<
GoblinMixDetailsItemVo
>
item
;
@ApiModelProperty
(
position
=
21
,
value
=
"创建时间"
)
private
String
createdAt
;
@ApiModelProperty
(
position
=
22
,
value
=
"状态[6-活动中|7-停用|9-等待开始|10-活动结束]"
)
private
Integer
status
;
private
static
final
GoblinMixDetailsVo
obj
=
new
GoblinMixDetailsVo
();
...
...
@@ -66,4 +70,32 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
return
new
GoblinMixDetailsVo
();
}
}
public
GoblinMixDetailsVo
copyByInsert
(
String
mixId
,
GoblinMixDetailsParam
source
,
List
<
GoblinMixDetailsItemVo
>
itemList
,
String
uid
)
{
if
(
null
==
source
)
return
this
;
this
.
setMixId
(
mixId
);
this
.
setUserId
(
uid
);
this
.
setName
(
source
.
getName
());
this
.
setTimeStart
(
source
.
getTimeStart
());
this
.
setTimeEnd
(
source
.
getTimeEnd
());
this
.
setShowPosition
(
source
.
getShowPosition
());
this
.
setSellName
(
source
.
getSellName
());
this
.
setExpressPrice
(
BigDecimal
.
ZERO
);
//TODO 0.5需求
this
.
setIntro
(
source
.
getIntro
());
this
.
setCoverPic
(
source
.
getCoverPic
());
this
.
setVideo
(
source
.
getVideo
());
this
.
setDetails
(
source
.
getDetails
());
this
.
setWatchType
(
source
.
getWatchType
());
this
.
setDetailUrl
(
source
.
getDetailUrl
());
this
.
setStock
(
source
.
getStock
());
this
.
setStockLock
(
source
.
getStockLock
());
this
.
setIsLock
(
0
);
this
.
setLimit
(
source
.
getLimit
());
this
.
setWhiteType
(
source
.
getWhiteType
());
this
.
setWhiteUrl
(
source
.
getWhiteUrl
());
this
.
setItem
(
itemList
);
this
.
setCreatedAt
(
DateUtil
.
getNowTime
());
this
.
setStatus
(
6
);
return
this
;
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinMixManageListVo.java
View file @
db7f5fe3
...
...
@@ -21,6 +21,8 @@ public class GoblinMixManageListVo implements Serializable, Cloneable {
private
String
timeEnd
;
@ApiModelProperty
(
position
=
5
,
value
=
"活动创建时间"
)
private
String
createddAt
;
@ApiModelProperty
(
position
=
6
,
value
=
"剩余库存"
)
private
Integer
restStock
;
private
static
final
GoblinMixManageListVo
obj
=
new
GoblinMixManageListVo
();
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/GoblinMixDetailsItemParam.java
0 → 100644
View file @
db7f5fe3
package
com
.
liquidnet
.
service
.
goblin
.
param
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
@Data
public
class
GoblinMixDetailsItemParam
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
value
=
"spuId"
)
private
String
spuId
;
@ApiModelProperty
(
value
=
"skuId"
)
private
String
skuId
;
@ApiModelProperty
(
value
=
"skuName"
)
private
String
skuName
;
@ApiModelProperty
(
value
=
"商品类型[1-商城|2-数字藏品]"
)
private
String
position
;
@ApiModelProperty
(
value
=
"组合价格"
)
private
BigDecimal
price
;
@ApiModelProperty
(
value
=
"苹果价格"
)
private
BigDecimal
priceV
;
@ApiModelProperty
(
value
=
"苹果价格id"
)
private
String
productId
;
@ApiModelProperty
(
value
=
"组合件数[数字藏品不能大于1]"
)
private
Integer
count
;
private
static
final
GoblinMixDetailsItemParam
obj
=
new
GoblinMixDetailsItemParam
();
public
static
GoblinMixDetailsItemParam
getNew
()
{
try
{
return
(
GoblinMixDetailsItemParam
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
e
.
printStackTrace
();
}
return
new
GoblinMixDetailsItemParam
();
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/GoblinMixDetailsParam.java
0 → 100644
View file @
db7f5fe3
package
com
.
liquidnet
.
service
.
goblin
.
param
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMixDetailsItemVo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
@EqualsAndHashCode
public
class
GoblinMixDetailsParam
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
position
=
1
,
value
=
"活动名称"
)
private
String
name
;
@ApiModelProperty
(
position
=
2
,
value
=
"开始时间"
)
private
String
timeStart
;
@ApiModelProperty
(
position
=
3
,
value
=
"结束时间"
)
private
String
timeEnd
;
@ApiModelProperty
(
position
=
4
,
value
=
"展示位置[1-商城|2-数字藏品]"
)
private
Integer
showPosition
;
@ApiModelProperty
(
position
=
5
,
value
=
"组合名称"
)
private
String
sellName
;
@ApiModelProperty
(
position
=
9
,
value
=
"商品简介/购买须知"
)
private
String
intro
;
@ApiModelProperty
(
position
=
10
,
value
=
"封面图片地址"
)
private
String
coverPic
;
@ApiModelProperty
(
position
=
11
,
value
=
"商品视频地址/数字昌平视频地址"
)
private
String
video
;
@ApiModelProperty
(
position
=
12
,
value
=
"商品详情/藏品详情"
)
private
String
details
;
@ApiModelProperty
(
position
=
13
,
value
=
"展示文件类型[1-图片|2-视频]"
)
private
Integer
watchType
;
@ApiModelProperty
(
position
=
14
,
value
=
"详情图片地址"
)
private
String
detailUrl
;
@ApiModelProperty
(
position
=
14
,
value
=
"设置库存"
)
private
Integer
stock
;
@ApiModelProperty
(
position
=
15
,
value
=
"锁定库存"
)
private
Integer
stockLock
;
@ApiModelProperty
(
position
=
16
,
value
=
"是否锁定[0-否|1-是]"
)
private
String
isLock
;
@ApiModelProperty
(
position
=
17
,
value
=
"限购数量[0-无限]"
)
private
Integer
limit
;
@ApiModelProperty
(
position
=
18
,
value
=
"白名单类型[0-会员|1-指定用户|2-全部用户]"
)
private
Integer
whiteType
;
@ApiModelProperty
(
position
=
19
,
value
=
"白名单xls地址"
)
private
String
whiteUrl
;
@ApiModelProperty
(
position
=
20
,
value
=
"配置详情"
)
private
List
<
GoblinMixDetailsItemParam
>
item
;
private
static
final
GoblinMixDetailsParam
obj
=
new
GoblinMixDetailsParam
();
public
static
GoblinMixDetailsParam
getNew
()
{
try
{
return
(
GoblinMixDetailsParam
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinMixDetailsParam
();
}
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/GoblinMixUpdateParam.java
0 → 100644
View file @
db7f5fe3
package
com
.
liquidnet
.
service
.
goblin
.
param
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
@EqualsAndHashCode
public
class
GoblinMixUpdateParam
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
position
=
0
,
value
=
"活动id"
)
private
String
mixId
;
@ApiModelProperty
(
position
=
4
,
value
=
"展示位置[1-商城|2-数字藏品]"
)
private
Integer
showPosition
;
@ApiModelProperty
(
position
=
17
,
value
=
"限购数量[0-无限]"
)
private
Integer
limit
;
@ApiModelProperty
(
position
=
18
,
value
=
"白名单类型[0-会员|1-指定用户|2-全部用户]"
)
private
Integer
whiteType
;
@ApiModelProperty
(
position
=
19
,
value
=
"白名单xls地址"
)
private
String
whiteUrl
;
private
static
final
GoblinMixUpdateParam
obj
=
new
GoblinMixUpdateParam
();
public
static
GoblinMixUpdateParam
getNew
()
{
try
{
return
(
GoblinMixUpdateParam
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinMixUpdateParam
();
}
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/manage/IGoblinMixService.java
View file @
db7f5fe3
package
com
.
liquidnet
.
service
.
goblin
.
service
.
manage
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMixDetailsVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMixManageListVo
;
import
com.liquidnet.service.goblin.param.GoblinMixDetailsParam
;
import
com.liquidnet.service.goblin.param.GoblinMixUpdateParam
;
/**
* <p>
...
...
@@ -14,13 +17,13 @@ import com.liquidnet.service.goblin.dto.vo.GoblinMixManageListVo;
*/
public
interface
IGoblinMixService
{
ResponseDto
<
GoblinMixManageListVo
>
mixList
(
String
mixName
,
Integer
status
,
String
st
,
String
et
);
ResponseDto
<
PageInfo
<
GoblinMixManageListVo
>>
mixList
(
String
mixName
,
Integer
page
);
ResponseDto
<
GoblinMixDetailsVo
>
mixDetails
(
String
mixId
);
ResponseDto
<
Boolean
>
mixInsert
(
);
ResponseDto
<
String
>
mixInsert
(
GoblinMixDetailsParam
param
);
ResponseDto
<
Boolean
>
mixUpdate
();
ResponseDto
<
Boolean
>
mixUpdate
(
GoblinMixUpdateParam
param
);
ResponseDto
<
Boolean
>
mixLine
(
String
mixId
,
Integer
status
);
}
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/entity/GoblinMix.java
View file @
db7f5fe3
...
...
@@ -2,6 +2,8 @@ package com.liquidnet.service.goblin.entity;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
lombok.Data
;
...
...
@@ -65,19 +67,9 @@ public class GoblinMix implements Serializable {
private
String
sellName
;
/**
* 平台一级分类id
*/
private
String
cateFid
;
/**
* 平台二级分类id
*/
private
String
cateSid
;
/**
* 平台三级分类id
* 快递价格
*/
private
String
cateTid
;
private
BigDecimal
expressPrice
;
/**
* 商品简介/购买须知
...
...
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/entity/GoblinMixDetails.java
View file @
db7f5fe3
...
...
@@ -38,7 +38,12 @@ public class GoblinMixDetails implements Serializable {
/**
* 售卖商品id
*/
private
String
sellId
;
private
String
spuId
;
/**
* 售卖商品id
*/
private
String
skuId
;
/**
* 单品现价
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/docu/db_goblin_mix.sql
View file @
db7f5fe3
...
...
@@ -10,20 +10,20 @@ CREATE TABLE `goblin_mix`
`status`
int
DEFAULT
0
COMMENT
'状态[6-启用|7-停用]'
,
`show_position`
int
DEFAULT
0
COMMENT
'展示位置[1-商城|2-数字藏品]'
,
`sell_name`
varchar
(
64
)
DEFAULT
''
COMMENT
'售卖名称'
,
`cate_fid`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'平台一级分类id'
,
`cate_sid`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'平台二级分类id'
,
`cate_tid`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'平台三级分类id'
,
#
`cate_fid`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'平台一级分类id'
,
#
`cate_sid`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'平台二级分类id'
,
#
`cate_tid`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'平台三级分类id'
,
`intro`
varchar
(
512
)
DEFAULT
NULL
COMMENT
'商品简介/购买须知'
,
`watch_type`
char
(
1
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
COMMENT
'展示文件类型[1-图片|2-视频|3-模型]'
,
`cover_pic`
varchar
(
256
)
DEFAULT
NULL
COMMENT
'封面图片地址'
,
`video`
varchar
(
256
)
DEFAULT
NULL
COMMENT
'商品视频地址/数字昌平视频地址'
,
`details`
text
COMMENT
'商品详情/藏品详情'
,
`watch_type`
char
(
1
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
COMMENT
'展示文件类型[1-图片|2-视频|3-模型]'
,
`detail_url`
varchar
(
256
)
DEFAULT
NULL
COMMENT
'数字藏品图片地址'
,
`details`
text
COMMENT
'商品详情/藏品详情'
,
`stock`
int
DEFAULT
0
COMMENT
'库存'
,
`stock_lock`
int
DEFAULT
0
COMMENT
'锁定库存'
,
'is_lock'
int
DEFAULT
0
COMMENT
'是否锁定库存[0-否|1-是]'
,
'limit'
int
DEFAULT
0
COMMENT
'限购数量[0-不限购]'
,
`is_lock`
int
DEFAULT
0
COMMENT
'是否锁定库存[0-否|1-是]'
,
`limit`
int
DEFAULT
0
COMMENT
'限购数量[0-不限购]'
,
`white_type`
int
DEFAULT
1
COMMENT
'白名单类型[0-会员|1-指定用户|2-全部用户]'
,
`white_url`
varchar
(
512
)
DEFAULT
''
COMMENT
'白名单xls地址'
,
...
...
@@ -46,10 +46,10 @@ CREATE TABLE `goblin_mix_details`
`mix_id`
varchar
(
64
)
DEFAULT
''
COMMENT
'混合id'
,
`position`
int
DEFAULT
0
COMMENT
'商品类型[1-商城|2-数字藏品]'
,
`sell_id`
varchar
(
64
)
DEFAULT
''
COMMENT
'售卖商品id'
,
`price`
DECIMAL
(
64
)
DEFAULT
''
COMMENT
'单品现价'
,
`price`
DECIMAL
(
20
,
2
)
DEFAULT
0
.
00
COMMENT
'单品现价'
,
`price_v`
decimal
(
20
,
2
)
DEFAULT
0
.
00
COMMENT
'苹果商品价格'
,
`product_id`
varchar
(
64
)
DEFAULT
''
COMMENT
'苹果商品价格ID'
,
`count`
int
DEFAULT
0
COMMENT
'数量[数字藏品默认为1]'
,
`can_refund`
int
DEFAULT
0
COMMENT
'是否支持退款[0-否|1-是]'
,
`del_tag`
int
DEFAULT
0
COMMENT
'是否删除[0-否|1-是]'
,
`comment`
varchar
(
255
)
DEFAULT
''
COMMENT
'补充字段'
,
`created_at`
datetime
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinMixController.java
0 → 100644
View file @
db7f5fe3
package
com
.
liquidnet
.
service
.
goblin
.
controller
.
manage
;
import
com.github.pagehelper.PageInfo
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.github.xiaoymin.knife4j.annotations.ApiSupport
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinListDetailsVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinListVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMixDetailsVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMixManageListVo
;
import
com.liquidnet.service.goblin.param.GoblinListCreateParam
;
import
com.liquidnet.service.goblin.param.GoblinListUpdateParam
;
import
com.liquidnet.service.goblin.param.GoblinMixDetailsParam
;
import
com.liquidnet.service.goblin.param.GoblinMixUpdateParam
;
import
com.liquidnet.service.goblin.service.manage.IGoblinListService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinMixService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.constraints.NotBlank
;
/**
* 正在下单活动管理
*/
@ApiSupport
(
order
=
149201
)
@Slf4j
@RestController
@Api
(
tags
=
"活动-混合售"
)
@RequestMapping
(
"store/mix"
)
public
class
GoblinMixController
{
@Autowired
IGoblinMixService
goblinMixService
;
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"name"
,
value
=
"活动名称"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Integer"
,
name
=
"page"
,
value
=
"页数"
),
})
@GetMapping
(
"list"
)
public
ResponseDto
<
PageInfo
<
GoblinMixManageListVo
>>
list
(
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
Integer
page
)
{
return
goblinMixService
.
mixList
(
name
,
page
);
}
@ApiOperation
(
value
=
"详情"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mixId"
,
value
=
"名单id"
),
})
@GetMapping
(
"details"
)
public
ResponseDto
<
GoblinMixDetailsVo
>
details
(
@NotBlank
(
message
=
"集合ID不能为空"
)
@RequestParam
String
mixId
)
{
return
goblinMixService
.
mixDetails
(
mixId
);
}
@ApiOperation
(
value
=
"创建"
)
@PostMapping
(
"create"
)
public
ResponseDto
<
String
>
create
(
@RequestBody
GoblinMixDetailsParam
param
)
{
return
goblinMixService
.
mixInsert
(
param
);
}
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"修改"
)
@PutMapping
(
"change"
)
public
ResponseDto
<
Boolean
>
update
(
@RequestBody
GoblinMixUpdateParam
param
)
{
return
goblinMixService
.
mixUpdate
(
param
);
}
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"修改上线状态"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mixId"
,
value
=
"活动id"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"status"
,
value
=
"状态[6-上线|7-下线]"
),
})
@PostMapping
(
"status"
)
public
ResponseDto
<
Boolean
>
update
(
@NotBlank
(
message
=
"活动ID不能为空"
)
@RequestParam
String
mixId
,
@NotBlank
(
message
=
"状态不能为空"
)
@RequestParam
Integer
status
)
{
return
goblinMixService
.
mixLine
(
mixId
,
status
);
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinMixServiceImpl.java
View file @
db7f5fe3
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
.
manage
;
import
com.alibaba.fastjson.JSON
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.param.GoblinMixDetailsItemParam
;
import
com.liquidnet.service.goblin.param.GoblinMixDetailsParam
;
import
com.liquidnet.service.goblin.param.GoblinMixUpdateParam
;
import
com.liquidnet.service.goblin.service.manage.IGoblinMixService
;
import
com.liquidnet.service.goblin.util.*
;
import
io.github.classgraph.json.JSONUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
liquidnet
.
commons
.
lang
.
util
.
DateUtil
.
DTF_YMD_HMS
;
/**
* <p>
* 商城-名单表 服务实现类
...
...
@@ -31,27 +52,263 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
@Override
public
ResponseDto
<
GoblinMixManageListVo
>
mixList
(
String
mixName
,
Integer
status
,
String
st
,
String
et
)
{
return
null
;
public
ResponseDto
<
PageInfo
<
GoblinMixManageListVo
>>
mixList
(
String
mixName
,
Integer
page
)
{
PageInfo
<
GoblinMixManageListVo
>
pageResult
;
HashMap
<
String
,
Object
>
map
=
mongoUtils
.
getGoblinMixListVo
(
mixName
,
CurrentUtil
.
getCurrentUid
(),
page
);
List
<
GoblinMixDetailsVo
>
detailsVoList
=
(
List
<
GoblinMixDetailsVo
>)
map
.
get
(
"data"
);
List
<
GoblinMixManageListVo
>
voList
=
ObjectUtil
.
goblinMixManageListVo
();
for
(
GoblinMixDetailsVo
item
:
detailsVoList
)
{
GoblinMixManageListVo
vo
=
GoblinMixManageListVo
.
getNew
();
vo
.
setMixId
(
item
.
getMixId
());
vo
.
setName
(
item
.
getName
());
vo
.
setTimeEnd
(
item
.
getTimeEnd
());
vo
.
setTimeStart
(
item
.
getTimeStart
());
vo
.
setCreateddAt
(
item
.
getCreatedAt
());
LocalDateTime
st
=
LocalDateTime
.
parse
(
item
.
getTimeStart
(),
DTF_YMD_HMS
);
LocalDateTime
et
=
LocalDateTime
.
parse
(
item
.
getTimeEnd
(),
DTF_YMD_HMS
);
LocalDateTime
nt
=
LocalDateTime
.
now
();
if
(
item
.
getStatus
()
==
7
)
{
vo
.
setStatus
(
7
);
}
else
{
if
(
nt
.
isAfter
(
et
))
{
vo
.
setStatus
(
10
);
}
else
if
(
nt
.
isBefore
(
st
))
{
vo
.
setStatus
(
9
);
}
else
{
vo
.
setStatus
(
6
);
}
}
int
stock
=
0
;
for
(
GoblinMixDetailsItemVo
itemVo
:
item
.
getItem
())
{
GoblinGoodsSkuInfoVo
skuInfoVo
=
redisUtils
.
getGoodsSkuInfoVo
(
itemVo
.
getSkuId
());
if
(
skuInfoVo
.
getUnbox
().
equals
(
1
))
{
List
<
String
>
skuIds
=
redisUtils
.
getGoblinMixRelationBox
(
itemVo
.
getSkuId
(),
item
.
getMixId
());
for
(
String
skuId
:
skuIds
)
{
stock
+=
redisUtils
.
getSkuStock
(
item
.
getMixId
(),
skuId
);
}
}
else
{
stock
+=
redisUtils
.
getSkuStock
(
item
.
getMixId
(),
itemVo
.
getSkuId
());
}
}
vo
.
setRestStock
(
stock
);
voList
.
add
(
vo
);
}
pageResult
=
new
PageInfo
(
voList
);
pageResult
.
setTotal
((
Long
)
map
.
get
(
"total"
));
return
ResponseDto
.
success
(
pageResult
);
}
@Override
public
ResponseDto
<
GoblinMixDetailsVo
>
mixDetails
(
String
mixId
)
{
return
null
;
String
uid
=
CurrentUtil
.
getCurrentUid
();
GoblinMixDetailsVo
vo
=
redisUtils
.
getMixDetails
(
mixId
);
if
(!
vo
.
getUserId
().
equals
(
uid
))
{
return
ResponseDto
.
failure
(
"身份异常"
);
}
for
(
GoblinMixDetailsItemVo
item
:
vo
.
getItem
())
{
GoblinGoodsSkuInfoVo
skuInfoVo
=
redisUtils
.
getGoodsSkuInfoVo
(
item
.
getSkuId
());
item
.
setSkuName
(
skuInfoVo
.
getName
());
item
.
setSkuPrice
(
skuInfoVo
.
getPrice
());
item
.
setStock
(
skuInfoVo
.
getSkuStock
());
item
.
setSurplusStock
(
redisUtils
.
getSkuStock
(
mixId
,
item
.
getSkuId
()));
}
return
ResponseDto
.
success
(
vo
);
}
@Override
public
ResponseDto
<
Boolean
>
mixInsert
()
{
return
null
;
public
ResponseDto
<
String
>
mixInsert
(
GoblinMixDetailsParam
param
)
{
String
mixId
=
IDGenerator
.
nextTimeId2
();
String
uid
=
CurrentUtil
.
getCurrentUid
();
List
<
GoblinMixDetailsItemVo
>
itemList
=
ObjectUtil
.
goblinMixDetailsItemVo
();
List
<
GoblinMixDetailsItemParam
>
itemParams
=
param
.
getItem
();
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
sqls
.
add
(
SqlMapping
.
get
(
"goblin_mix_insert"
));
sqls
.
add
(
SqlMapping
.
get
(
"goblin_mix_details_insert"
));
LinkedList
<
Object
[]>
goblinMix
=
CollectionUtil
.
linkedListObjectArr
();
LinkedList
<
Object
[]>
goblinMixDetails
=
CollectionUtil
.
linkedListObjectArr
();
if
(
param
.
getWhiteType
()
==
1
&&
(
null
==
param
.
getWhiteUrl
()
||
""
.
equals
(
param
.
getWhiteUrl
())))
{
return
ResponseDto
.
failure
(
"未上床指定文件"
);
}
//校验库存
List
<
String
>
errorNameList
=
initStock
(
itemParams
,
mixId
,
param
.
getStock
());
if
(
errorNameList
.
size
()
>
0
)
{
return
ResponseDto
.
failure
(
JSON
.
toJSONString
(
errorNameList
));
}
//处理vo
for
(
GoblinMixDetailsItemParam
itemParam
:
itemParams
)
{
GoblinMixDetailsItemVo
itemVo
=
GoblinMixDetailsItemVo
.
getNew
().
copyByInsert
(
itemParam
);
itemList
.
add
(
itemVo
);
goblinMixDetails
.
add
(
new
Object
[]{
mixId
,
itemVo
.
getPosition
(),
itemVo
.
getSpuId
(),
itemVo
.
getSkuId
(),
itemVo
.
getPrice
(),
itemVo
.
getPriceV
(),
itemVo
.
getProductId
(),
itemVo
.
getCount
(),
LocalDateTime
.
now
()
});
//白名单
if
(
param
.
getWhiteType
()
==
1
)
{
queueUtils
.
sendMsgByRedisXls
(
mixId
,
param
.
getWhiteUrl
(),
""
,
"3"
,
itemVo
.
getSkuId
());
}
}
GoblinMixDetailsVo
vo
=
GoblinMixDetailsVo
.
getNew
().
copyByInsert
(
mixId
,
param
,
itemList
,
uid
);
goblinMix
.
add
(
new
Object
[]{
mixId
,
uid
,
vo
.
getName
(),
vo
.
getTimeStart
(),
vo
.
getTimeEnd
(),
6
,
vo
.
getShowPosition
(),
vo
.
getSellName
(),
vo
.
getExpressPrice
(),
vo
.
getIntro
(),
vo
.
getWatchType
(),
vo
.
getCoverPic
(),
vo
.
getVideo
(),
vo
.
getDetailUrl
(),
vo
.
getDetails
(),
vo
.
getStock
(),
vo
.
getStockLock
(),
vo
.
getIsLock
(),
vo
.
getLimit
(),
vo
.
getWhiteType
(),
vo
.
getWhiteUrl
(),
LocalDateTime
.
now
()
});
//设置redis
redisUtils
.
setMixDetails
(
mixId
,
vo
);
redisList
(
vo
.
getShowPosition
(),
vo
.
getMixId
(),
vo
.
getStatus
());
//设置mongo
mongoUtils
.
setGoblinMixDetailsVo
(
vo
);
//设置mysql
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_STORE_MARKET
.
getKey
(),
SqlMapping
.
gets
(
sqls
,
goblinMix
,
goblinMixDetails
));
return
ResponseDto
.
success
();
}
@Override
public
ResponseDto
<
Boolean
>
mixUpdate
()
{
return
null
;
public
ResponseDto
<
Boolean
>
mixUpdate
(
GoblinMixUpdateParam
param
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
GoblinMixDetailsVo
vo
=
redisUtils
.
getMixDetails
(
param
.
getMixId
());
if
(!
vo
.
getUserId
().
equals
(
uid
))
{
return
ResponseDto
.
failure
(
"身份异常"
);
}
if
(
param
.
getWhiteType
()
==
1
&&
(
null
==
param
.
getWhiteUrl
()
||
""
.
equals
(
param
.
getWhiteUrl
())))
{
return
ResponseDto
.
failure
(
"未上床指定文件"
);
}
for
(
GoblinMixDetailsItemVo
itemVo
:
vo
.
getItem
())
{
//白名单
if
(
param
.
getWhiteType
()
==
1
)
{
queueUtils
.
sendMsgByRedisXls
(
param
.
getMixId
(),
param
.
getWhiteUrl
(),
vo
.
getWhiteUrl
(),
"3"
,
itemVo
.
getSkuId
());
}
}
vo
.
setShowPosition
(
param
.
getShowPosition
());
vo
.
setLimit
(
param
.
getLimit
());
vo
.
setWhiteType
(
param
.
getWhiteType
());
vo
.
setWhiteUrl
(
param
.
getWhiteUrl
());
//redis
redisUtils
.
setMixDetails
(
param
.
getMixId
(),
vo
);
//mongo
mongoUtils
.
changeGoblinMixDetailsVo
(
vo
);
//sql入库
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_STORE_MARKET
.
getKey
(),
SqlMapping
.
get
(
"goblin_mix_update"
,
vo
.
getShowPosition
(),
vo
.
getLimit
(),
vo
.
getWhiteType
(),
vo
.
getWhiteUrl
(),
LocalDateTime
.
now
(),
param
.
getMixId
()));
return
ResponseDto
.
success
();
}
@Override
public
ResponseDto
<
Boolean
>
mixLine
(
String
mixId
,
Integer
status
)
{
return
null
;
String
uid
=
CurrentUtil
.
getCurrentUid
();
GoblinMixDetailsVo
vo
=
redisUtils
.
getMixDetails
(
mixId
);
if
(!
vo
.
getUserId
().
equals
(
uid
))
{
return
ResponseDto
.
failure
(
"身份异常"
);
}
vo
.
setStatus
(
status
);
//redis
redisUtils
.
setMixDetails
(
mixId
,
vo
);
redisList
(
vo
.
getShowPosition
(),
mixId
,
vo
.
getStatus
());
//mongo
mongoUtils
.
changeGoblinMixDetailsVo
(
vo
);
//sql入库
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_STORE_MARKET
.
getKey
(),
SqlMapping
.
get
(
"goblin_mix_status_update"
,
status
,
LocalDateTime
.
now
(),
mixId
));
return
ResponseDto
.
success
();
}
//库存管理
private
List
<
String
>
initStock
(
List
<
GoblinMixDetailsItemParam
>
data
,
String
mixId
,
int
stock
)
{
List
<
String
>
errorNameList
=
CollectionUtil
.
linkedListString
();
//库存异常的 sku名称
List
<
String
>
sucSkuId
=
CollectionUtil
.
linkedListString
();
//库存成功的skuId
for
(
GoblinMixDetailsItemParam
item
:
data
)
{
String
skuId
=
item
.
getSkuId
();
GoblinGoodsSkuInfoVo
skuInfoVo
=
redisUtils
.
getGoodsSkuInfoVo
(
skuId
);
if
(
skuInfoVo
.
getSkuType
()
==
1
&&
"1"
.
equals
(
skuInfoVo
.
getUnbox
()))
{
//盲盒
HashMap
<
String
,
BigDecimal
>
map
=
CollectionUtil
.
mapStringBigDecimal
();
GoblinGoodsInfoVo
spuInfoVo
=
redisUtils
.
getGoodsInfoVo
(
item
.
getSpuId
());
// 是否存在概率为空
boolean
isHit
=
false
;
BigDecimal
hitRatioCount
=
new
BigDecimal
(
0
);
for
(
String
itemSkuId
:
spuInfoVo
.
getSkuIdList
())
{
GoblinGoodsSkuInfoVo
skuItemVo
=
redisUtils
.
getGoodsSkuInfoVo
(
itemSkuId
);
if
(
skuItemVo
.
getUnbox
().
equals
(
"1"
))
{
continue
;
}
//是否购买
if
(!
skuItemVo
.
getSkuCanbuy
().
equals
(
"1"
))
{
continue
;
}
if
(
nftBoxUtils
.
getSkuAllStatusShow
(
skuItemVo
)
&&
nftBoxUtils
.
getSkuAllStatusStock
(
skuItemVo
)
>
0
)
{
if
(
skuItemVo
.
getHitRatio
()
==
null
)
{
isHit
=
true
;
}
else
{
hitRatioCount
=
hitRatioCount
.
add
(
skuItemVo
.
getHitRatio
());
}
map
.
put
(
skuItemVo
.
getSkuId
(),
skuItemVo
.
getHitRatio
());
}
}
if
(
isHit
&&
hitRatioCount
.
doubleValue
()
<
100.00
&&
map
.
size
()
>
0
)
{
nftBoxUtils
.
arrangeHitRatioMap
(
map
,
hitRatioCount
);
}
Map
<
String
,
Integer
>
skuMap
=
nftBoxUtils
.
getSkuHitRatio
(
stock
,
map
);
for
(
String
key
:
skuMap
.
keySet
())
{
Integer
stockNum
=
skuMap
.
get
(
key
);
//库存
int
skuStock
=
redisUtils
.
decrSkuStock
(
null
,
key
,
stockNum
);
log
.
info
(
"盲盒库存 SKUID = "
+
key
+
" 数量 = "
+
stockNum
);
if
(
skuStock
<
0
)
{
redisUtils
.
incrSkuStock
(
null
,
key
,
stockNum
);
errorNameList
.
add
(
"盲盒"
+
item
.
getSkuName
());
}
else
{
redisUtils
.
setSkuStock
(
mixId
,
key
,
stockNum
);
redisUtils
.
addGoblinMixRelationBox
(
skuId
,
mixId
,
key
);
sucSkuId
.
add
(
key
);
}
}
}
else
{
//库存
int
skuStock
=
redisUtils
.
decrSkuStock
(
null
,
skuId
,
stock
);
if
(
skuStock
<
0
)
{
redisUtils
.
incrSkuStock
(
null
,
skuId
,
stock
);
errorNameList
.
add
(
item
.
getSkuName
());
}
else
{
redisUtils
.
setSkuStock
(
mixId
,
skuId
,
stock
);
sucSkuId
.
add
(
skuId
);
}
}
//普通商品
}
if
(
errorNameList
.
size
()
>
0
)
{
for
(
String
skuId
:
sucSkuId
)
{
redisUtils
.
decrSkuStock
(
mixId
,
skuId
,
stock
);
redisUtils
.
incrSkuStock
(
null
,
skuId
,
stock
);
}
}
return
errorNameList
;
}
//列表
private
boolean
redisList
(
Integer
showPosition
,
String
mixId
,
Integer
status
)
{
if
(
showPosition
==
1
)
{
//商品
if
(
status
==
6
)
{
redisUtils
.
addGoblinMixSkuList
(
mixId
);
}
else
if
(
status
==
7
)
{
redisUtils
.
removeGoblinMixSkuList
(
mixId
);
}
}
else
if
(
showPosition
==
2
)
{
//nft
if
(
status
==
6
)
{
redisUtils
.
addGoblinMixNftList
(
mixId
);
}
else
if
(
status
==
7
)
{
redisUtils
.
removeGoblinMixNftList
(
mixId
);
}
}
return
true
;
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
db7f5fe3
...
...
@@ -1661,7 +1661,7 @@ public class GoblinMongoUtils {
}
else
if
(
filterParam
.
getType
().
equals
(
1
))
{
restStock
+=
redisUtils
.
getSkuAllStatusStockType1
(
itemVo
);
}
stock
+=
redisUtils
.
getSkuTotalStockShelvesStatus3
(
itemVo
);
stock
+=
redisUtils
.
getSkuTotalStockShelvesStatus3
(
itemVo
);
}
mgtGoodsSkuListVo
.
setSurplusStock
(
restStock
);
mgtGoodsSkuListVo
.
setSkuStock
(
stock
);
...
...
@@ -1741,6 +1741,36 @@ public class GoblinMongoUtils {
return
map
;
}
// 添加 混合售 数据
public
GoblinMixDetailsVo
setGoblinMixDetailsVo
(
GoblinMixDetailsVo
vo
)
{
return
mongoTemplate
.
insert
(
vo
,
GoblinMixDetailsVo
.
class
.
getSimpleName
());
}
//修改 混合售 数据
public
Boolean
changeGoblinMixDetailsVo
(
GoblinMixDetailsVo
vo
)
{
return
mongoTemplate
.
getCollection
(
GoblinMixDetailsVo
.
class
.
getSimpleName
())
.
updateOne
(
Query
.
query
(
Criteria
.
where
(
"mixId"
).
is
(
vo
.
getMixId
())).
getQueryObject
(),
ObjectUtil
.
cloneBasicDBObject
().
append
(
"$set"
,
mongoConverter
.
convertToMongoType
(
vo
))
).
getModifiedCount
()
>
0
;
}
public
HashMap
<
String
,
Object
>
getGoblinMixListVo
(
String
name
,
String
uid
,
Integer
pageNum
)
{
int
pageSize
=
20
;
Criteria
criteria
=
Criteria
.
where
(
"uid"
).
is
(
uid
);
if
(
name
!=
null
&&
!
name
.
equals
(
""
))
{
criteria
=
criteria
.
and
(
"name"
).
regex
(
"^.*"
+
name
+
".*$"
);
}
Query
query
=
Query
.
query
(
criteria
);
long
total
=
mongoTemplate
.
count
(
query
,
GoblinMixDetailsVo
.
class
,
GoblinMixDetailsVo
.
class
.
getSimpleName
());
query
.
with
(
PageRequest
.
of
(
pageNum
-
1
,
pageSize
)).
with
(
Sort
.
by
(
Sort
.
Order
.
desc
(
"createdAt"
)));
List
<
GoblinMixDetailsVo
>
list
=
mongoTemplate
.
find
(
query
,
GoblinMixDetailsVo
.
class
,
GoblinMixDetailsVo
.
class
.
getSimpleName
());
HashMap
<
String
,
Object
>
map
=
CollectionUtil
.
mapStringObject
();
map
.
put
(
"data"
,
list
);
map
.
put
(
"total"
,
total
);
return
map
;
}
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
db7f5fe3
...
...
@@ -2128,7 +2128,7 @@ public class GoblinRedisUtils {
// 外面只有盲盒才能请求进来 里面只有不是分批购才判断盲盒里藏品的开售时间
if
(
null
==
listId
)
{
// if (LocalDateTime.now().isAfter(info.getSaleStartTime())) {
return
getSkuStock
(
listId
,
info
.
getSkuId
());
return
getSkuStock
(
listId
,
info
.
getSkuId
());
// } else {
// return 0;
// }
...
...
@@ -2367,6 +2367,126 @@ public class GoblinRedisUtils {
return
o
.
equals
(
idName
.
concat
(
","
).
concat
(
mobile
))
?
1
:
0
;
}
// 设置 组合售数据
public
void
setMixDetails
(
String
mixId
,
GoblinMixDetailsVo
vo
)
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_DETAILS
.
concat
(
mixId
);
redisUtil
.
set
(
rdk
,
vo
);
}
// 获取 组合售数据
public
GoblinMixDetailsVo
getMixDetails
(
String
mixId
)
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_DETAILS
.
concat
(
mixId
);
Object
obj
=
redisUtil
.
get
(
rdk
);
if
(
obj
==
null
)
{
return
GoblinMixDetailsVo
.
getNew
();
}
else
{
return
(
GoblinMixDetailsVo
)
obj
;
}
}
/**
* 设置 盲盒skuId 关联 的skuId
*/
public
void
addGoblinMixRelationBox
(
String
skuId
,
String
mixId
,
String
relationSkuId
)
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_RELATION_BOX
.
concat
(
skuId
).
concat
(
":"
+
mixId
);
ArrayList
<
String
>
list
=
getGoblinListRelationBox
(
skuId
,
mixId
);
list
.
add
(
relationSkuId
);
redisUtil
.
set
(
rdk
,
list
);
}
/**
* 删除 盲盒skuId 关联 的skuId
*/
public
void
removeGoblinMixRelationBox
(
String
skuId
,
String
mixId
,
String
relationSkuId
)
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_RELATION_BOX
.
concat
(
skuId
).
concat
(
":"
+
mixId
);
ArrayList
<
String
>
list
=
getGoblinListRelationBox
(
skuId
,
mixId
);
for
(
String
item
:
list
)
{
if
(
item
.
equals
(
relationSkuId
))
{
list
.
remove
(
item
);
}
}
redisUtil
.
set
(
rdk
,
list
);
}
/**
* 获取 盲盒skuId 关联 的skuId
*/
public
ArrayList
<
String
>
getGoblinMixRelationBox
(
String
skuId
,
String
mixId
)
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_RELATION_BOX
.
concat
(
skuId
).
concat
(
":"
+
mixId
);
Object
obj
=
redisUtil
.
get
(
rdk
);
if
(
obj
==
null
)
{
return
CollectionUtil
.
arrayListString
();
}
else
{
return
(
ArrayList
<
String
>)
obj
;
}
}
// 设置 组合售 nft列表
public
void
setGoblinMixNftList
(
String
mixId
)
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_NFT_LIST
;
redisUtil
.
set
(
rdk
,
mixId
);
}
// 获取 组合售 nft列表
public
List
<
String
>
getGoblinMixNftList
()
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_NFT_LIST
;
Object
obj
=
redisUtil
.
get
(
rdk
);
if
(
obj
==
null
)
{
return
CollectionUtil
.
linkedListString
();
}
else
{
return
(
List
<
String
>)
obj
;
}
}
public
void
addGoblinMixNftList
(
String
mixId
)
{
List
<
String
>
mixIds
=
getGoblinMixNftList
();
mixIds
.
add
(
mixId
);
setGoblinMixNftList
(
mixId
);
}
public
void
removeGoblinMixNftList
(
String
mixId
)
{
List
<
String
>
mixIds
=
getGoblinMixNftList
();
for
(
String
item
:
mixIds
)
{
if
(
item
.
equals
(
mixId
))
{
mixIds
.
remove
(
mixId
);
}
}
setGoblinMixNftList
(
mixId
);
}
// 设置 组合售 sku列表
public
void
setGoblinMixSkuList
(
String
mixId
)
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_SKU_LIST
;
redisUtil
.
set
(
rdk
,
mixId
);
}
// 获取 组合售 sku列表
public
List
<
String
>
getGoblinMixSkuList
()
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_SKU_LIST
;
Object
obj
=
redisUtil
.
get
(
rdk
);
if
(
obj
==
null
)
{
return
CollectionUtil
.
linkedListString
();
}
else
{
return
(
List
<
String
>)
obj
;
}
}
public
void
addGoblinMixSkuList
(
String
mixId
)
{
List
<
String
>
mixIds
=
getGoblinMixSkuList
();
mixIds
.
add
(
mixId
);
setGoblinMixSkuList
(
mixId
);
}
public
void
removeGoblinMixSkuList
(
String
mixId
)
{
List
<
String
>
mixIds
=
getGoblinMixSkuList
();
for
(
String
item
:
mixIds
)
{
if
(
item
.
equals
(
mixId
))
{
mixIds
.
remove
(
mixId
);
}
}
setGoblinMixSkuList
(
mixId
);
}
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/ObjectUtil.java
View file @
db7f5fe3
...
...
@@ -95,11 +95,22 @@ public class ObjectUtil {
private
static
final
ArrayList
<
GoblinListCollectVo
>
goblinListCollectVo
=
new
ArrayList
<>();
private
static
final
BasicDBObject
basicDBObject
=
new
BasicDBObject
();
private
static
final
ArrayList
<
WriteModel
<
Document
>>
writeModelDocumentArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinMixDetailsItemVo
>
goblinMixDetailsItemVo
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinMixManageListVo
>
goblinMixManageListVo
=
new
ArrayList
<>();
public
static
ArrayList
<
GoblinListVo
>
getGoblinListVo
()
{
return
(
ArrayList
<
GoblinListVo
>)
goblinListVo
.
clone
();
}
public
static
ArrayList
<
GoblinMixManageListVo
>
goblinMixManageListVo
()
{
return
(
ArrayList
<
GoblinMixManageListVo
>)
goblinMixManageListVo
.
clone
();
}
public
static
ArrayList
<
GoblinMixDetailsItemVo
>
goblinMixDetailsItemVo
()
{
return
(
ArrayList
<
GoblinMixDetailsItemVo
>)
goblinMixDetailsItemVo
.
clone
();
}
public
static
ArrayList
<
GoblinListCollectVo
>
getGoblinListCollectVo
()
{
return
(
ArrayList
<
GoblinListCollectVo
>)
goblinListCollectVo
.
clone
();
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/resources/sqlmap.properties
View file @
db7f5fe3
...
...
@@ -157,4 +157,11 @@ adam_user_busi_acct.add=INSERT INTO adam_user_busi_acct (`uid`, busi, uuid, `wor
goblin_list_insert
=
INSERT INTO goblin_list (`list_id`,`uid`,`name`,`white_type`,`white_url`,`time_start`,`time_end`,`tag_type`,`black_url`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?)
goblin_list_detail_insert
=
INSERT INTO goblin_list_details (`list_id`,`spu_id`,`sku_id`,`created_at`,`sku_stock`,`price_v`,`product_id`,`price`) VALUES (?,?,?,?,?,?,?,?)
goblin_list_update
=
UPDATE goblin_list SET white_url = ? ,white_type = ? , black_url = ? , updated_at = ? WHERE list_id = ?
goblin_list_remove
=
UPDATE goblin_list set del_tag = 1 , updated_at = ? WHERE list_id = ?
\ No newline at end of file
goblin_list_remove
=
UPDATE goblin_list set del_tag = 1 , updated_at = ? WHERE list_id = ?
#---- 混合售卖 ----
goblin_mix_insert
=
INSERT INTO goblin_mix (`mix_id`,`uid`,`name`,`time_start`,`time_end`,`status`,`show_position`,`sell_name`,`express_price`,`intro`,`watch_type`,`cover_pic`,`video`,`detail_url`,`details`,`stock`,`stock_lock`,`is_lock`,`limit`,`white_type`,`white_url`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,)
goblin_mix_details_insert
=
INSERT INTO goblin_mix_details (`mix_id`,`position`,`spu_id`,`sku_id`,`price`,`price_v`,`product_id`,`count`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?)
goblin_mix_status_update
=
UPDATE goblin_mix_details SET status = ? updated_at = ? WHERE mix_id = ?
goblin_mix_update
=
UPDATE goblin_mix_details SET show_position = ? , limit=?,white_type=?,white_url=? updated_at = ? WHERE mix_id = ?
\ No newline at end of file
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