记得上下班打卡 | 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
7f08098c
Commit
7f08098c
authored
Jun 30, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交 混合售列表 定时任务 方法
parent
db7f5fe3
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
482 additions
and
5 deletions
+482
-5
GoblinRedisConst.java
...m/liquidnet/service/goblin/constant/GoblinRedisConst.java
+5
-0
GoblinMixAppDetailsVo.java
...iquidnet/service/goblin/dto/vo/GoblinMixAppDetailsVo.java
+56
-0
GoblinMixAppListVo.java
...m/liquidnet/service/goblin/dto/vo/GoblinMixAppListVo.java
+43
-0
GoblinMixDetailsItemVo.java
...quidnet/service/goblin/dto/vo/GoblinMixDetailsItemVo.java
+1
-0
GoblinMixDetailsVo.java
...m/liquidnet/service/goblin/dto/vo/GoblinMixDetailsVo.java
+7
-1
GoblinMixManageListVo.java
...iquidnet/service/goblin/dto/vo/GoblinMixManageListVo.java
+1
-1
GoblinMixDetailsItemParam.java
...idnet/service/goblin/param/GoblinMixDetailsItemParam.java
+2
-0
IGoblinMixAppService.java
...t/service/goblin/service/manage/IGoblinMixAppService.java
+29
-0
db_goblin_mix.sql
...blin/liquidnet-service-goblin-impl/docu/db_goblin_mix.sql
+3
-1
GoblinMixAppController.java
...net/service/goblin/controller/GoblinMixAppController.java
+52
-0
GoblinNftJobController.java
...rvice/goblin/controller/Inner/GoblinNftJobController.java
+9
-0
GoblinMixAppServiceImpl.java
.../service/goblin/service/impl/GoblinMixAppServiceImpl.java
+58
-0
GoblinJobServiceImpl.java
...rvice/goblin/service/impl/inner/GoblinJobServiceImpl.java
+117
-0
GoblinMixServiceImpl.java
...vice/goblin/service/impl/manage/GoblinMixServiceImpl.java
+6
-2
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+87
-0
ObjectUtil.java
...in/java/com/liquidnet/service/goblin/util/ObjectUtil.java
+6
-0
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/constant/GoblinRedisConst.java
View file @
7f08098c
...
@@ -330,6 +330,11 @@ public class GoblinRedisConst {
...
@@ -330,6 +330,11 @@ public class GoblinRedisConst {
public
static
final
String
GOBLIN_MIX_NFT_LIST
=
PREFIX
.
concat
(
"mix:nft"
);
//nft 混合售列表
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 混合售列表
public
static
final
String
GOBLIN_MIX_SKU_LIST
=
PREFIX
.
concat
(
"mix:goods"
);
//nft 混合售列表
public
static
final
String
GOBLIN_MIX_NFT_STOCK_LIST
=
PREFIX
.
concat
(
"mix:nft:stock"
);
//nft 混合售售罄列表
public
static
final
String
GOBLIN_MIX_NFT_START_LIST
=
PREFIX
.
concat
(
"mix:nft:start"
);
//nft 混合售开始列表
public
static
final
String
GOBLIN_MIX_SKU_STOCK_LIST
=
PREFIX
.
concat
(
"mix:goods:stock"
);
//sku 混合售售罄列表
public
static
final
String
GOBLIN_MIX_SKU_START_LIST
=
PREFIX
.
concat
(
"mix:goods:start"
);
//sku 混合售开始列表
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinMixAppDetailsVo.java
0 → 100644
View file @
7f08098c
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
com.liquidnet.commons.lang.util.DateUtil
;
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
@EqualsAndHashCode
public
class
GoblinMixAppDetailsVo
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
position
=
0
,
value
=
"活动id"
)
private
String
mixId
;
@ApiModelProperty
(
position
=
1
,
value
=
"活动名称"
)
private
String
name
;
@ApiModelProperty
(
position
=
2
,
value
=
"开始时间"
)
private
String
timeStart
;
@ApiModelProperty
(
position
=
3
,
value
=
"结束时间"
)
private
String
timeEnd
;
@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
=
17
,
value
=
"限购数量[0-无限]"
)
private
Integer
limit
;
@ApiModelProperty
(
position
=
18
,
value
=
"白名单类型[0-会员|1-指定用户|2-全部用户]"
)
private
Integer
whiteType
;
@ApiModelProperty
(
position
=
20
,
value
=
"配置详情"
)
private
List
<
GoblinMixDetailsItemVo
>
item
;
@ApiModelProperty
(
position
=
22
,
value
=
"状态[6-活动中|7-停用|9-等待开始|10-活动结束]"
)
private
Integer
status
;
private
static
final
GoblinMixAppDetailsVo
obj
=
new
GoblinMixAppDetailsVo
();
public
static
GoblinMixAppDetailsVo
getNew
()
{
try
{
return
(
GoblinMixAppDetailsVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinMixAppDetailsVo
();
}
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinMixAppListVo.java
0 → 100644
View file @
7f08098c
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
@Data
@EqualsAndHashCode
public
class
GoblinMixAppListVo
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
position
=
0
,
value
=
"活动id"
)
private
String
mixId
;
@ApiModelProperty
(
position
=
1
,
value
=
"活动名称"
)
private
String
name
;
@ApiModelProperty
(
position
=
2
,
value
=
"活动名称"
)
private
String
sellName
;
@ApiModelProperty
(
position
=
3
,
value
=
"封面图片地址"
)
private
String
coverPic
;
@ApiModelProperty
(
position
=
4
,
value
=
"状态[6-活动中|7-停用|9-等待开始|10-活动结束]"
)
private
Integer
status
;
@ApiModelProperty
(
position
=
5
,
value
=
"开始时间"
)
private
String
timeStart
;
@ApiModelProperty
(
position
=
6
,
value
=
"结束时间"
)
private
String
timeEnd
;
@ApiModelProperty
(
position
=
7
,
value
=
"销售价格"
)
private
BigDecimal
sellPrice
;
@ApiModelProperty
(
position
=
8
,
value
=
"原价"
)
private
BigDecimal
price
;
@ApiModelProperty
(
position
=
9
,
value
=
"活动创建时间"
)
private
String
createdAt
;
private
static
final
GoblinMixAppListVo
obj
=
new
GoblinMixAppListVo
();
public
static
GoblinMixAppListVo
getNew
()
{
try
{
return
(
GoblinMixAppListVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinMixAppListVo
();
}
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinMixDetailsItemVo.java
View file @
7f08098c
...
@@ -49,6 +49,7 @@ public class GoblinMixDetailsItemVo implements Serializable, Cloneable {
...
@@ -49,6 +49,7 @@ public class GoblinMixDetailsItemVo implements Serializable, Cloneable {
if
(
null
==
source
)
return
this
;
if
(
null
==
source
)
return
this
;
this
.
setSpuId
(
DateUtil
.
getNowTime
());
this
.
setSpuId
(
DateUtil
.
getNowTime
());
this
.
setSkuId
(
source
.
getSkuId
());
this
.
setSkuId
(
source
.
getSkuId
());
this
.
setSkuPrice
(
source
.
getSkuPrice
());
this
.
setPrice
(
source
.
getPrice
());
this
.
setPrice
(
source
.
getPrice
());
this
.
setPriceV
(
source
.
getPriceV
());
this
.
setPriceV
(
source
.
getPriceV
());
this
.
setProductId
(
source
.
getProductId
());
this
.
setProductId
(
source
.
getProductId
());
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinMixDetailsVo.java
View file @
7f08098c
...
@@ -60,6 +60,10 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
...
@@ -60,6 +60,10 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
private
String
createdAt
;
private
String
createdAt
;
@ApiModelProperty
(
position
=
22
,
value
=
"状态[6-活动中|7-停用|9-等待开始|10-活动结束]"
)
@ApiModelProperty
(
position
=
22
,
value
=
"状态[6-活动中|7-停用|9-等待开始|10-活动结束]"
)
private
Integer
status
;
private
Integer
status
;
@ApiModelProperty
(
position
=
23
,
value
=
"销售价格"
)
private
BigDecimal
sellPrice
;
@ApiModelProperty
(
position
=
23
,
value
=
"原价"
)
private
BigDecimal
price
;
private
static
final
GoblinMixDetailsVo
obj
=
new
GoblinMixDetailsVo
();
private
static
final
GoblinMixDetailsVo
obj
=
new
GoblinMixDetailsVo
();
...
@@ -71,7 +75,7 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
...
@@ -71,7 +75,7 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
}
}
}
}
public
GoblinMixDetailsVo
copyByInsert
(
String
mixId
,
GoblinMixDetailsParam
source
,
List
<
GoblinMixDetailsItemVo
>
itemList
,
String
uid
)
{
public
GoblinMixDetailsVo
copyByInsert
(
String
mixId
,
GoblinMixDetailsParam
source
,
List
<
GoblinMixDetailsItemVo
>
itemList
,
String
uid
,
BigDecimal
sellPrice
,
BigDecimal
price
)
{
if
(
null
==
source
)
return
this
;
if
(
null
==
source
)
return
this
;
this
.
setMixId
(
mixId
);
this
.
setMixId
(
mixId
);
this
.
setUserId
(
uid
);
this
.
setUserId
(
uid
);
...
@@ -96,6 +100,8 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
...
@@ -96,6 +100,8 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
this
.
setItem
(
itemList
);
this
.
setItem
(
itemList
);
this
.
setCreatedAt
(
DateUtil
.
getNowTime
());
this
.
setCreatedAt
(
DateUtil
.
getNowTime
());
this
.
setStatus
(
6
);
this
.
setStatus
(
6
);
this
.
setSellPrice
(
sellPrice
);
this
.
setPrice
(
price
);
return
this
;
return
this
;
}
}
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinMixManageListVo.java
View file @
7f08098c
...
@@ -20,7 +20,7 @@ public class GoblinMixManageListVo implements Serializable, Cloneable {
...
@@ -20,7 +20,7 @@ public class GoblinMixManageListVo implements Serializable, Cloneable {
@ApiModelProperty
(
position
=
4
,
value
=
"活动结束时间"
)
@ApiModelProperty
(
position
=
4
,
value
=
"活动结束时间"
)
private
String
timeEnd
;
private
String
timeEnd
;
@ApiModelProperty
(
position
=
5
,
value
=
"活动创建时间"
)
@ApiModelProperty
(
position
=
5
,
value
=
"活动创建时间"
)
private
String
created
d
At
;
private
String
createdAt
;
@ApiModelProperty
(
position
=
6
,
value
=
"剩余库存"
)
@ApiModelProperty
(
position
=
6
,
value
=
"剩余库存"
)
private
Integer
restStock
;
private
Integer
restStock
;
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/GoblinMixDetailsItemParam.java
View file @
7f08098c
...
@@ -16,6 +16,8 @@ public class GoblinMixDetailsItemParam implements Serializable, Cloneable {
...
@@ -16,6 +16,8 @@ public class GoblinMixDetailsItemParam implements Serializable, Cloneable {
private
String
skuName
;
private
String
skuName
;
@ApiModelProperty
(
value
=
"商品类型[1-商城|2-数字藏品]"
)
@ApiModelProperty
(
value
=
"商品类型[1-商城|2-数字藏品]"
)
private
String
position
;
private
String
position
;
@ApiModelProperty
(
value
=
"原价"
)
private
BigDecimal
skuPrice
;
@ApiModelProperty
(
value
=
"组合价格"
)
@ApiModelProperty
(
value
=
"组合价格"
)
private
BigDecimal
price
;
private
BigDecimal
price
;
@ApiModelProperty
(
value
=
"苹果价格"
)
@ApiModelProperty
(
value
=
"苹果价格"
)
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/manage/IGoblinMixAppService.java
0 → 100644
View file @
7f08098c
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.GoblinMixAppDetailsVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMixAppListVo
;
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
;
import
java.util.List
;
/**
* <p>
* 商城-搭售活动 服务类
* </p>
*
* @author liquidnet
* @since 2022-06-30
*/
public
interface
IGoblinMixAppService
{
// 根据开始时间倒叙 并且 活动开始
ResponseDto
<
List
<
GoblinMixAppListVo
>>
mixList
();
// 根据开始时间倒叙 并且 活动开始
ResponseDto
<
GoblinMixAppDetailsVo
>
mixDetails
(
String
mixId
);
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/docu/db_goblin_mix.sql
View file @
7f08098c
...
@@ -10,6 +10,7 @@ CREATE TABLE `goblin_mix`
...
@@ -10,6 +10,7 @@ CREATE TABLE `goblin_mix`
`status`
int
DEFAULT
0
COMMENT
'状态[6-启用|7-停用]'
,
`status`
int
DEFAULT
0
COMMENT
'状态[6-启用|7-停用]'
,
`show_position`
int
DEFAULT
0
COMMENT
'展示位置[1-商城|2-数字藏品]'
,
`show_position`
int
DEFAULT
0
COMMENT
'展示位置[1-商城|2-数字藏品]'
,
`sell_name`
varchar
(
64
)
DEFAULT
''
COMMENT
'售卖名称'
,
`sell_name`
varchar
(
64
)
DEFAULT
''
COMMENT
'售卖名称'
,
`express_price`
decimal
(
20
,
2
)
DEFAULT
0
.
00
COMMENT
'快递价格'
,
#
`cate_fid`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'平台一级分类id'
,
#
`cate_fid`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'平台一级分类id'
,
#
`cate_sid`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'平台二级分类id'
,
#
`cate_sid`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'平台二级分类id'
,
#
`cate_tid`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'平台三级分类id'
,
#
`cate_tid`
varchar
(
30
)
DEFAULT
NULL
COMMENT
'平台三级分类id'
,
...
@@ -45,7 +46,8 @@ CREATE TABLE `goblin_mix_details`
...
@@ -45,7 +46,8 @@ CREATE TABLE `goblin_mix_details`
`mid`
bigint
UNSIGNED
NOT
NULL
AUTO_INCREMENT
,
`mid`
bigint
UNSIGNED
NOT
NULL
AUTO_INCREMENT
,
`mix_id`
varchar
(
64
)
DEFAULT
''
COMMENT
'混合id'
,
`mix_id`
varchar
(
64
)
DEFAULT
''
COMMENT
'混合id'
,
`position`
int
DEFAULT
0
COMMENT
'商品类型[1-商城|2-数字藏品]'
,
`position`
int
DEFAULT
0
COMMENT
'商品类型[1-商城|2-数字藏品]'
,
`sell_id`
varchar
(
64
)
DEFAULT
''
COMMENT
'售卖商品id'
,
`spu_id`
varchar
(
64
)
DEFAULT
''
COMMENT
'spuId'
,
`sku_id`
varchar
(
64
)
DEFAULT
''
COMMENT
'skuId'
,
`price`
DECIMAL
(
20
,
2
)
DEFAULT
0
.
00
COMMENT
'单品现价'
,
`price`
DECIMAL
(
20
,
2
)
DEFAULT
0
.
00
COMMENT
'单品现价'
,
`price_v`
decimal
(
20
,
2
)
DEFAULT
0
.
00
COMMENT
'苹果商品价格'
,
`price_v`
decimal
(
20
,
2
)
DEFAULT
0
.
00
COMMENT
'苹果商品价格'
,
`product_id`
varchar
(
64
)
DEFAULT
''
COMMENT
'苹果商品价格ID'
,
`product_id`
varchar
(
64
)
DEFAULT
''
COMMENT
'苹果商品价格ID'
,
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinMixAppController.java
0 → 100644
View file @
7f08098c
package
com
.
liquidnet
.
service
.
goblin
.
controller
;
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.GoblinMixAppListVo
;
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
;
import
com.liquidnet.service.goblin.service.manage.IGoblinMixAppService
;
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
;
import
java.util.List
;
/**
* 正在下单活动管理
*/
@ApiSupport
(
order
=
149201
)
@Slf4j
@RestController
@Api
(
tags
=
"活动-混合售"
)
@RequestMapping
(
"app/mix"
)
public
class
GoblinMixAppController
{
@Autowired
IGoblinMixAppService
goblinMixAppService
;
@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
<
List
<
GoblinMixAppListVo
>>
list
(
// @RequestParam(value = "name", required = false) String name,
// @RequestParam Integer page
)
{
return
goblinMixAppService
.
mixList
();
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/Inner/GoblinNftJobController.java
View file @
7f08098c
package
com
.
liquidnet
.
service
.
goblin
.
controller
.
Inner
;
package
com
.
liquidnet
.
service
.
goblin
.
controller
.
Inner
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.service.impl.inner.GoblinJobServiceImpl
;
import
com.liquidnet.service.goblin.service.impl.inner.GoblinNftJobServiceImpl
;
import
com.liquidnet.service.goblin.service.impl.inner.GoblinNftJobServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -20,6 +21,8 @@ public class GoblinNftJobController {
...
@@ -20,6 +21,8 @@ public class GoblinNftJobController {
@Autowired
@Autowired
GoblinNftJobServiceImpl
goblinNftJobService
;
GoblinNftJobServiceImpl
goblinNftJobService
;
@Autowired
GoblinJobServiceImpl
goblinJobService
;
@GetMapping
(
"goodsList"
)
@GetMapping
(
"goodsList"
)
@ApiOperation
(
"NFT商品列表JOB"
)
@ApiOperation
(
"NFT商品列表JOB"
)
...
@@ -33,4 +36,10 @@ public class GoblinNftJobController {
...
@@ -33,4 +36,10 @@ public class GoblinNftJobController {
return
goblinNftJobService
.
goblinNftListStock
();
return
goblinNftJobService
.
goblinNftListStock
();
}
}
@GetMapping
(
"mixList"
)
@ApiOperation
(
"Mix商品列表JOB"
)
public
ResponseDto
<
Boolean
>
getMixList
()
{
return
goblinJobService
.
mixList
();
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinMixAppServiceImpl.java
0 → 100644
View file @
7f08098c
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
;
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.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.IGoblinMixAppService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinMixService
;
import
com.liquidnet.service.goblin.util.*
;
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>
* 商城-名单表 服务实现类
* </p>
*
* @author liquidnet
* @since 2022-04-29
*/
@Service
@Slf4j
public
class
GoblinMixAppServiceImpl
implements
IGoblinMixAppService
{
@Autowired
GoblinRedisUtils
redisUtils
;
@Autowired
GoblinMongoUtils
mongoUtils
;
@Override
public
ResponseDto
<
List
<
GoblinMixAppListVo
>>
mixList
()
{
return
null
;
}
@Override
public
ResponseDto
<
GoblinMixAppDetailsVo
>
mixDetails
(
String
mixId
)
{
return
null
;
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/inner/GoblinJobServiceImpl.java
0 → 100644
View file @
7f08098c
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
.
inner
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.service.GoblinCouponService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinGoodsAnticipateMgService
;
import
com.liquidnet.service.goblin.util.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
static
com
.
liquidnet
.
commons
.
lang
.
util
.
DateUtil
.
DTF_YMD_HMS
;
@Service
@Slf4j
public
class
GoblinJobServiceImpl
{
@Autowired
private
GoblinRedisUtils
goblinRedisUtils
;
@Autowired
MongoTemplate
mongoTemplate
;
@Autowired
QueueUtils
queueUtils
;
@Autowired
GoblinMongoUtils
mongoUtils
;
/**
* 在售的 已开售时间倒序
* 预约的 正序
* 售罄的 正序
*
* @return
*/
public
ResponseDto
<
Boolean
>
mixList
()
{
List
<
String
>
ntfList
=
goblinRedisUtils
.
getGoblinMixNftList
();
List
<
String
>
skuList
=
goblinRedisUtils
.
getGoblinMixSkuList
();
List
<
GoblinMixDetailsVo
>
nftDetailsList
=
ObjectUtil
.
goblinMixDetailsVo
();
List
<
GoblinMixDetailsVo
>
skuDetailsList
=
ObjectUtil
.
goblinMixDetailsVo
();
for
(
String
mixId
:
ntfList
)
{
GoblinMixDetailsVo
vo
=
goblinRedisUtils
.
getMixDetails
(
mixId
);
nftDetailsList
.
add
(
vo
);
}
for
(
String
mixId
:
skuList
)
{
GoblinMixDetailsVo
vo
=
goblinRedisUtils
.
getMixDetails
(
mixId
);
skuDetailsList
.
add
(
vo
);
}
//排序
nftDetailsList
=
nftDetailsList
.
stream
().
sorted
(
Comparator
.
comparing
(
GoblinMixDetailsVo:
:
getTimeStart
)).
collect
(
Collectors
.
toList
());
skuDetailsList
=
skuDetailsList
.
stream
().
sorted
(
Comparator
.
comparing
(
GoblinMixDetailsVo:
:
getTimeStart
)).
collect
(
Collectors
.
toList
());
LocalDateTime
nt
=
LocalDateTime
.
now
();
//筛选 活动中 和 活动中且售罄的
for
(
GoblinMixDetailsVo
item
:
nftDetailsList
)
{
LocalDateTime
st
=
LocalDateTime
.
parse
(
item
.
getTimeStart
(),
DTF_YMD_HMS
);
LocalDateTime
et
=
LocalDateTime
.
parse
(
item
.
getTimeEnd
(),
DTF_YMD_HMS
);
if
(
nt
.
isAfter
(
st
)
&&
nt
.
isBefore
(
et
))
{
//活动中
int
stock
=
0
;
for
(
GoblinMixDetailsItemVo
itemVo
:
item
.
getItem
())
{
GoblinGoodsSkuInfoVo
skuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
itemVo
.
getSkuId
());
if
(
skuInfoVo
.
getUnbox
().
equals
(
"1"
))
{
List
<
String
>
relationIds
=
goblinRedisUtils
.
getGoblinMixRelationBox
(
itemVo
.
getSkuId
(),
item
.
getMixId
());
for
(
String
skuId
:
relationIds
)
{
stock
+=
goblinRedisUtils
.
getSkuStock
(
item
.
getMixId
(),
skuId
);
}
}
else
{
stock
+=
goblinRedisUtils
.
getSkuStock
(
item
.
getMixId
(),
itemVo
.
getSkuId
());
}
}
if
(
stock
==
0
)
{
//活动中 且 售罄
goblinRedisUtils
.
addGoblinMixNftStockList
(
item
.
getMixId
());
}
else
{
//活动中 未售罄
goblinRedisUtils
.
addGoblinMixNftStartList
(
item
.
getMixId
());
}
}
}
for
(
GoblinMixDetailsVo
item
:
skuDetailsList
)
{
LocalDateTime
st
=
LocalDateTime
.
parse
(
item
.
getTimeStart
(),
DTF_YMD_HMS
);
LocalDateTime
et
=
LocalDateTime
.
parse
(
item
.
getTimeEnd
(),
DTF_YMD_HMS
);
if
(
nt
.
isAfter
(
st
)
&&
nt
.
isBefore
(
et
))
{
//活动中
int
stock
=
0
;
for
(
GoblinMixDetailsItemVo
itemVo
:
item
.
getItem
())
{
GoblinGoodsSkuInfoVo
skuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
itemVo
.
getSkuId
());
if
(
skuInfoVo
.
getUnbox
().
equals
(
"1"
))
{
List
<
String
>
relationIds
=
goblinRedisUtils
.
getGoblinMixRelationBox
(
itemVo
.
getSkuId
(),
item
.
getMixId
());
for
(
String
skuId
:
relationIds
)
{
stock
+=
goblinRedisUtils
.
getSkuStock
(
item
.
getMixId
(),
skuId
);
}
}
else
{
stock
+=
goblinRedisUtils
.
getSkuStock
(
item
.
getMixId
(),
itemVo
.
getSkuId
());
}
}
if
(
stock
==
0
)
{
//活动中 且 售罄
goblinRedisUtils
.
addGoblinMixSkuStockList
(
item
.
getMixId
());
}
else
{
//活动中 未售罄
goblinRedisUtils
.
addGoblinMixSkuStartList
(
item
.
getMixId
());
}
}
}
return
ResponseDto
.
success
();
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinMixServiceImpl.java
View file @
7f08098c
...
@@ -63,7 +63,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
...
@@ -63,7 +63,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
vo
.
setName
(
item
.
getName
());
vo
.
setName
(
item
.
getName
());
vo
.
setTimeEnd
(
item
.
getTimeEnd
());
vo
.
setTimeEnd
(
item
.
getTimeEnd
());
vo
.
setTimeStart
(
item
.
getTimeStart
());
vo
.
setTimeStart
(
item
.
getTimeStart
());
vo
.
setCreated
d
At
(
item
.
getCreatedAt
());
vo
.
setCreatedAt
(
item
.
getCreatedAt
());
LocalDateTime
st
=
LocalDateTime
.
parse
(
item
.
getTimeStart
(),
DTF_YMD_HMS
);
LocalDateTime
st
=
LocalDateTime
.
parse
(
item
.
getTimeStart
(),
DTF_YMD_HMS
);
LocalDateTime
et
=
LocalDateTime
.
parse
(
item
.
getTimeEnd
(),
DTF_YMD_HMS
);
LocalDateTime
et
=
LocalDateTime
.
parse
(
item
.
getTimeEnd
(),
DTF_YMD_HMS
);
...
@@ -140,9 +140,13 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
...
@@ -140,9 +140,13 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
}
}
//处理vo
//处理vo
BigDecimal
price
=
BigDecimal
.
ZERO
;
BigDecimal
sellPrice
=
BigDecimal
.
ZERO
;
for
(
GoblinMixDetailsItemParam
itemParam
:
itemParams
)
{
for
(
GoblinMixDetailsItemParam
itemParam
:
itemParams
)
{
GoblinMixDetailsItemVo
itemVo
=
GoblinMixDetailsItemVo
.
getNew
().
copyByInsert
(
itemParam
);
GoblinMixDetailsItemVo
itemVo
=
GoblinMixDetailsItemVo
.
getNew
().
copyByInsert
(
itemParam
);
itemList
.
add
(
itemVo
);
itemList
.
add
(
itemVo
);
sellPrice
.
add
(
itemVo
.
getPrice
());
price
.
add
(
itemVo
.
getSkuPrice
());
goblinMixDetails
.
add
(
new
Object
[]{
goblinMixDetails
.
add
(
new
Object
[]{
mixId
,
itemVo
.
getPosition
(),
itemVo
.
getSpuId
(),
itemVo
.
getSkuId
(),
itemVo
.
getPrice
(),
itemVo
.
getPriceV
(),
mixId
,
itemVo
.
getPosition
(),
itemVo
.
getSpuId
(),
itemVo
.
getSkuId
(),
itemVo
.
getPrice
(),
itemVo
.
getPriceV
(),
itemVo
.
getProductId
(),
itemVo
.
getCount
(),
LocalDateTime
.
now
()
itemVo
.
getProductId
(),
itemVo
.
getCount
(),
LocalDateTime
.
now
()
...
@@ -152,7 +156,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
...
@@ -152,7 +156,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
queueUtils
.
sendMsgByRedisXls
(
mixId
,
param
.
getWhiteUrl
(),
""
,
"3"
,
itemVo
.
getSkuId
());
queueUtils
.
sendMsgByRedisXls
(
mixId
,
param
.
getWhiteUrl
(),
""
,
"3"
,
itemVo
.
getSkuId
());
}
}
}
}
GoblinMixDetailsVo
vo
=
GoblinMixDetailsVo
.
getNew
().
copyByInsert
(
mixId
,
param
,
itemList
,
uid
);
GoblinMixDetailsVo
vo
=
GoblinMixDetailsVo
.
getNew
().
copyByInsert
(
mixId
,
param
,
itemList
,
uid
,
sellPrice
,
price
);
goblinMix
.
add
(
new
Object
[]{
goblinMix
.
add
(
new
Object
[]{
mixId
,
uid
,
vo
.
getName
(),
vo
.
getTimeStart
(),
vo
.
getTimeEnd
(),
6
,
vo
.
getShowPosition
(),
mixId
,
uid
,
vo
.
getName
(),
vo
.
getTimeStart
(),
vo
.
getTimeEnd
(),
6
,
vo
.
getShowPosition
(),
vo
.
getSellName
(),
vo
.
getExpressPrice
(),
vo
.
getIntro
(),
vo
.
getWatchType
(),
vo
.
getCoverPic
(),
vo
.
getSellName
(),
vo
.
getExpressPrice
(),
vo
.
getIntro
(),
vo
.
getWatchType
(),
vo
.
getCoverPic
(),
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
7f08098c
...
@@ -2487,6 +2487,93 @@ public class GoblinRedisUtils {
...
@@ -2487,6 +2487,93 @@ public class GoblinRedisUtils {
setGoblinMixSkuList
(
mixId
);
setGoblinMixSkuList
(
mixId
);
}
}
// 设置 组合售 sku列表
public
void
setGoblinMixNftStockList
(
String
mixId
)
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_NFT_STOCK_LIST
;
redisUtil
.
set
(
rdk
,
mixId
);
}
// 设置 组合售 sku列表
public
void
setGoblinMixNftStartList
(
String
mixId
)
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_NFT_START_LIST
;
redisUtil
.
set
(
rdk
,
mixId
);
}
// 设置 组合售 sku列表
public
void
setGoblinMixSkuStockList
(
String
mixId
)
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_SKU_STOCK_LIST
;
redisUtil
.
set
(
rdk
,
mixId
);
}
// 设置 组合售 sku列表
public
void
setGoblinMixSkuStartList
(
String
mixId
)
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_SKU_START_LIST
;
redisUtil
.
set
(
rdk
,
mixId
);
}
public
List
<
String
>
getGoblinMixNftStockList
()
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_NFT_STOCK_LIST
;
Object
obj
=
redisUtil
.
get
(
rdk
);
if
(
obj
==
null
)
{
return
CollectionUtil
.
linkedListString
();
}
else
{
return
(
List
<
String
>)
obj
;
}
}
public
List
<
String
>
getGoblinMixNftStartList
()
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_NFT_START_LIST
;
Object
obj
=
redisUtil
.
get
(
rdk
);
if
(
obj
==
null
)
{
return
CollectionUtil
.
linkedListString
();
}
else
{
return
(
List
<
String
>)
obj
;
}
}
public
List
<
String
>
getGoblinMixSkuStockList
()
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_SKU_STOCK_LIST
;
Object
obj
=
redisUtil
.
get
(
rdk
);
if
(
obj
==
null
)
{
return
CollectionUtil
.
linkedListString
();
}
else
{
return
(
List
<
String
>)
obj
;
}
}
public
List
<
String
>
getGoblinMixSkuStartList
()
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_SKU_START_LIST
;
Object
obj
=
redisUtil
.
get
(
rdk
);
if
(
obj
==
null
)
{
return
CollectionUtil
.
linkedListString
();
}
else
{
return
(
List
<
String
>)
obj
;
}
}
public
void
addGoblinMixNftStockList
(
String
mixId
)
{
List
<
String
>
mixIds
=
getGoblinMixNftStockList
();
mixIds
.
add
(
mixId
);
setGoblinMixSkuList
(
mixId
);
}
public
void
addGoblinMixNftStartList
(
String
mixId
)
{
List
<
String
>
mixIds
=
getGoblinMixNftStartList
();
mixIds
.
add
(
mixId
);
setGoblinMixSkuList
(
mixId
);
}
public
void
addGoblinMixSkuStockList
(
String
mixId
)
{
List
<
String
>
mixIds
=
getGoblinMixSkuStockList
();
mixIds
.
add
(
mixId
);
setGoblinMixSkuList
(
mixId
);
}
public
void
addGoblinMixSkuStartList
(
String
mixId
)
{
List
<
String
>
mixIds
=
getGoblinMixSkuStartList
();
mixIds
.
add
(
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 @
7f08098c
...
@@ -97,6 +97,12 @@ public class ObjectUtil {
...
@@ -97,6 +97,12 @@ public class ObjectUtil {
private
static
final
ArrayList
<
WriteModel
<
Document
>>
writeModelDocumentArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
WriteModel
<
Document
>>
writeModelDocumentArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinMixDetailsItemVo
>
goblinMixDetailsItemVo
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinMixDetailsItemVo
>
goblinMixDetailsItemVo
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinMixManageListVo
>
goblinMixManageListVo
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinMixManageListVo
>
goblinMixManageListVo
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinMixDetailsVo
>
goblinMixDetailsVo
=
new
ArrayList
<>();
public
static
ArrayList
<
GoblinMixDetailsVo
>
goblinMixDetailsVo
()
{
return
(
ArrayList
<
GoblinMixDetailsVo
>)
goblinMixDetailsVo
.
clone
();
}
public
static
ArrayList
<
GoblinListVo
>
getGoblinListVo
()
{
public
static
ArrayList
<
GoblinListVo
>
getGoblinListVo
()
{
...
...
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