记得上下班打卡 | 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
ff33c406
Commit
ff33c406
authored
May 08, 2026
by
姜秀龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/dev-1.6-shouqianba' into container-test
parents
a2deeba5
e106aec9
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
176 additions
and
68 deletions
+176
-68
GoblinSqbOrderParam.java
...uidnet/service/goblin/dto/manage/GoblinSqbOrderParam.java
+1
-1
GoblinGoodsSkuInfoDetailVo.java
...net/service/goblin/dto/vo/GoblinGoodsSkuInfoDetailVo.java
+0
-3
GoblinSqbPerfListRespVo.java
...uidnet/service/goblin/dto/vo/GoblinSqbPerfListRespVo.java
+1
-1
GoblinSqbPerformanceGoodsInfoVo.java
...ervice/goblin/dto/vo/GoblinSqbPerformanceGoodsInfoVo.java
+4
-0
SqbPerformanceGoodsController.java
...roller/zhengzai/goblin/SqbPerformanceGoodsController.java
+1
-1
index.html
...n/resources/templates/zhengzai/goblin/sqbGoods/index.html
+2
-1
ISqbPerformanceGoodsService.java
.../zhengzai/goblin/service/ISqbPerformanceGoodsService.java
+1
-1
GoblinSqbPerformanceConfig.java
...net/service/goblin/entity/GoblinSqbPerformanceConfig.java
+1
-1
pom.xml
...dnet-service-goblin/liquidnet-service-goblin-impl/pom.xml
+6
-0
GoblinSqbController.java
...uidnet/service/goblin/controller/GoblinSqbController.java
+1
-1
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+88
-49
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+28
-0
GoblinSqbOrderServiceImpl.java
...service/order/service/impl/GoblinSqbOrderServiceImpl.java
+42
-9
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinSqbOrderParam.java
View file @
ff33c406
...
@@ -23,7 +23,7 @@ public class GoblinSqbOrderParam {
...
@@ -23,7 +23,7 @@ public class GoblinSqbOrderParam {
@NotNull
(
message
=
"购买数量不能为空"
)
@NotNull
(
message
=
"购买数量不能为空"
)
private
Integer
quantity
;
private
Integer
quantity
;
@ApiModelProperty
(
required
=
true
,
value
=
"关联演出ID"
)
@ApiModelProperty
(
required
=
true
,
value
=
"关联演出ID
(须与后台演出-商品关联一致;有换购价时按换购价计价)
"
)
@NotBlank
(
message
=
"关联演出ID不能为空"
)
@NotBlank
(
message
=
"关联演出ID不能为空"
)
private
String
performancesId
;
private
String
performancesId
;
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinGoodsSkuInfoDetailVo.java
View file @
ff33c406
...
@@ -48,9 +48,6 @@ public class GoblinGoodsSkuInfoDetailVo implements Serializable, Cloneable {
...
@@ -48,9 +48,6 @@ public class GoblinGoodsSkuInfoDetailVo implements Serializable, Cloneable {
@ApiModelProperty
(
position
=
51
,
value
=
"是否实名[0-否|1-是,表示该商品需要实名关联]"
)
@ApiModelProperty
(
position
=
51
,
value
=
"是否实名[0-否|1-是,表示该商品需要实名关联]"
)
private
Integer
isTrueName
;
private
Integer
isTrueName
;
@ApiModelProperty
(
position
=
52
,
value
=
"关联演出ID"
)
private
String
performancesId
;
private
static
final
GoblinGoodsSkuInfoDetailVo
obj
=
new
GoblinGoodsSkuInfoDetailVo
();
private
static
final
GoblinGoodsSkuInfoDetailVo
obj
=
new
GoblinGoodsSkuInfoDetailVo
();
public
static
GoblinGoodsSkuInfoDetailVo
getNew
()
{
public
static
GoblinGoodsSkuInfoDetailVo
getNew
()
{
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinSqbPerfListRespVo.java
View file @
ff33c406
...
@@ -8,7 +8,7 @@ import java.util.List;
...
@@ -8,7 +8,7 @@ import java.util.List;
public
class
GoblinSqbPerfListRespVo
implements
Serializable
{
public
class
GoblinSqbPerfListRespVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 演出结束
自动下架 0-否 1-是(全局配置
) */
/** 演出结束
后不在前台列表展示 0-否 1-是(全局配置,仅列表隐藏
) */
private
Integer
autoOffline
;
private
Integer
autoOffline
;
/** 关联商品列表 */
/** 关联商品列表 */
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinSqbPerformanceGoodsInfoVo.java
View file @
ff33c406
...
@@ -6,6 +6,7 @@ import lombok.Data;
...
@@ -6,6 +6,7 @@ import lombok.Data;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
/**
* 收钱吧-演出关联商品前端展示VO
* 收钱吧-演出关联商品前端展示VO
...
@@ -20,4 +21,7 @@ public class GoblinSqbPerformanceGoodsInfoVo extends GoblinGoodsInfoVo {
...
@@ -20,4 +21,7 @@ public class GoblinSqbPerformanceGoodsInfoVo extends GoblinGoodsInfoVo {
@ApiModelProperty
(
value
=
"换购价(不设置则按正常价)"
)
@ApiModelProperty
(
value
=
"换购价(不设置则按正常价)"
)
private
BigDecimal
settlementPrice
;
private
BigDecimal
settlementPrice
;
@ApiModelProperty
(
value
=
"已上架 SKU 明细(含 restStock、stockLess、canBuy 等,与商品详情接口字段一致)"
)
private
List
<
GoblinGoodsSkuInfoDetailVo
>
goblinGoodsSkuInfoVolist
;
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/goblin/SqbPerformanceGoodsController.java
View file @
ff33c406
...
@@ -65,7 +65,7 @@ public class SqbPerformanceGoodsController extends BaseController {
...
@@ -65,7 +65,7 @@ public class SqbPerformanceGoodsController extends BaseController {
@ApiOperation
(
"批量绑定演出与商品(含换购价、演出级自动下架全局配置)"
)
@ApiOperation
(
"批量绑定演出与商品(含换购价、演出级自动下架全局配置)"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
required
=
true
,
dataType
=
"String"
,
name
=
"performancesId"
,
value
=
"演出ID"
),
@ApiImplicitParam
(
type
=
"query"
,
required
=
true
,
dataType
=
"String"
,
name
=
"performancesId"
,
value
=
"演出ID"
),
@ApiImplicitParam
(
type
=
"query"
,
required
=
false
,
dataType
=
"int"
,
name
=
"autoOffline"
,
value
=
"
自动下架开关 0-否 1-是
"
),
@ApiImplicitParam
(
type
=
"query"
,
required
=
false
,
dataType
=
"int"
,
name
=
"autoOffline"
,
value
=
"
演出结束后不在前台列表展示 0-否 1-是(不取消关联、不改商品上下架)
"
),
})
})
public
AjaxResult
bind
(
@RequestParam
(
"performancesId"
)
String
performancesId
,
public
AjaxResult
bind
(
@RequestParam
(
"performancesId"
)
String
performancesId
,
@RequestParam
(
value
=
"autoOffline"
,
required
=
false
,
defaultValue
=
"0"
)
Integer
autoOffline
,
@RequestParam
(
value
=
"autoOffline"
,
required
=
false
,
defaultValue
=
"0"
)
Integer
autoOffline
,
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/goblin/sqbGoods/index.html
View file @
ff33c406
...
@@ -39,8 +39,9 @@
...
@@ -39,8 +39,9 @@
<div
class=
"auto-offline-bar"
>
<div
class=
"auto-offline-bar"
>
<label>
<label>
<input
type=
"checkbox"
id=
"globalAutoOffline"
onchange=
"toggleGlobalAutoOffline(this)"
/>
<input
type=
"checkbox"
id=
"globalAutoOffline"
onchange=
"toggleGlobalAutoOffline(this)"
/>
演出结束
商品自动下架
演出结束
后不在前台推荐列表展示
</label>
</label>
<span
class=
"tip"
>
开启后仅隐藏 APP/小程序演出关联商品列表,不取消关联、不修改商品上下架
</span>
</div>
</div>
<div
class=
"table-responsive"
>
<div
class=
"table-responsive"
>
<table
class=
"table table-bordered"
id=
"linkedGoodsTable"
>
<table
class=
"table table-bordered"
id=
"linkedGoodsTable"
>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/ISqbPerformanceGoodsService.java
View file @
ff33c406
...
@@ -18,7 +18,7 @@ public interface ISqbPerformanceGoodsService {
...
@@ -18,7 +18,7 @@ public interface ISqbPerformanceGoodsService {
*
*
* @param performancesId 演出ID
* @param performancesId 演出ID
* @param items 绑定项列表(仅含 SKU ID、排序、换购价)
* @param items 绑定项列表(仅含 SKU ID、排序、换购价)
* @param autoOffline 演出结束
自动下架 0-否 1-是(全局配置
)
* @param autoOffline 演出结束
后不在前台列表展示 0-否 1-是(全局配置,仅列表隐藏
)
* @return 操作结果
* @return 操作结果
*/
*/
ResponseDto
<
Boolean
>
bind
(
String
performancesId
,
List
<
SqbPerfGoodsBindItemParam
>
items
,
Integer
autoOffline
);
ResponseDto
<
Boolean
>
bind
(
String
performancesId
,
List
<
SqbPerfGoodsBindItemParam
>
items
,
Integer
autoOffline
);
...
...
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/entity/GoblinSqbPerformanceConfig.java
View file @
ff33c406
...
@@ -30,7 +30,7 @@ public class GoblinSqbPerformanceConfig implements Serializable {
...
@@ -30,7 +30,7 @@ public class GoblinSqbPerformanceConfig implements Serializable {
private
String
performancesId
;
private
String
performancesId
;
/**
/**
* 演出结束
自动下架 0-否 1-是
* 演出结束
后不在前台关联商品列表展示 0-否 1-是(仅列表隐藏,不取消关联、不修改商品上下架)
*/
*/
private
Integer
autoOffline
;
private
Integer
autoOffline
;
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/pom.xml
View file @
ff33c406
...
@@ -82,6 +82,12 @@
...
@@ -82,6 +82,12 @@
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.liquidnet
</groupId>
<artifactId>
liquidnet-service-kylin-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<dependency>
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinSqbController.java
View file @
ff33c406
...
@@ -102,7 +102,7 @@ public class GoblinSqbController {
...
@@ -102,7 +102,7 @@ public class GoblinSqbController {
}
}
@GetMapping
(
"/performance/selectGoods"
)
@GetMapping
(
"/performance/selectGoods"
)
@ApiOperation
(
"按演出ID获得已关联商品列表(pageNumber从0开始)"
)
@ApiOperation
(
"按演出ID获得已关联商品列表(pageNumber从0开始)
;若后台开启「演出结束后不在前台列表展示」且演出已结束则返回空列表
"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
required
=
true
,
dataType
=
"String"
,
name
=
"performancesId"
,
value
=
"演出ID"
),
@ApiImplicitParam
(
paramType
=
"query"
,
required
=
true
,
dataType
=
"String"
,
name
=
"performancesId"
,
value
=
"演出ID"
),
@ApiImplicitParam
(
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
,
name
=
"pageSize"
,
value
=
"分页大小"
),
@ApiImplicitParam
(
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
,
name
=
"pageSize"
,
value
=
"分页大小"
),
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
ff33c406
...
@@ -2,7 +2,6 @@ package com.liquidnet.service.goblin.service.impl;
...
@@ -2,7 +2,6 @@ package com.liquidnet.service.goblin.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.commons.lang.util.*
;
import
com.liquidnet.commons.lang.util.*
;
...
@@ -14,7 +13,9 @@ import com.liquidnet.service.goblin.constant.GoblinRedisConst;
...
@@ -14,7 +13,9 @@ import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.entity.*
;
import
com.liquidnet.service.goblin.entity.*
;
import
com.liquidnet.service.goblin.entity.GoblinSqbPerformanceConfig
;
import
com.liquidnet.service.goblin.entity.GoblinSqbPerformanceGoods
;
import
com.liquidnet.service.goblin.entity.GoblinSqbPerformanceGoods
;
import
com.liquidnet.service.goblin.mapper.GoblinSqbPerformanceConfigMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinSqbPerformanceGoodsMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinSqbPerformanceGoodsMapper
;
import
com.liquidnet.service.goblin.enums.GoblinStoreConf
;
import
com.liquidnet.service.goblin.enums.GoblinStoreConf
;
import
com.liquidnet.service.goblin.service.GoblinCouponService
;
import
com.liquidnet.service.goblin.service.GoblinCouponService
;
...
@@ -23,6 +24,7 @@ import com.liquidnet.service.goblin.util.GoblinMongoUtils;
...
@@ -23,6 +24,7 @@ import com.liquidnet.service.goblin.util.GoblinMongoUtils;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.ObjectUtil
;
import
com.liquidnet.service.goblin.util.ObjectUtil
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo
;
import
com.mongodb.BasicDBObject
;
import
com.mongodb.BasicDBObject
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -64,12 +66,19 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -64,12 +66,19 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
GoblinCouponService
goblinCouponService
;
GoblinCouponService
goblinCouponService
;
@Autowired
@Autowired
private
GoblinSqbPerformanceGoodsMapper
goblinSqbPerformanceGoodsMapper
;
private
GoblinSqbPerformanceGoodsMapper
goblinSqbPerformanceGoodsMapper
;
@Autowired
private
GoblinSqbPerformanceConfigMapper
goblinSqbPerformanceConfigMapper
;
private
static
final
String
SELECT_GOODS_EXCLUDE_NAME
=
"护照专属"
;
private
static
final
String
SELECT_GOODS_EXCLUDE_NAME
=
"护照专属"
;
private
boolean
isPassportExclusive
(
GoblinGoodsInfoVo
vo
)
{
private
boolean
isPassportExclusive
(
GoblinGoodsInfoVo
vo
)
{
return
null
!=
vo
&&
StringUtil
.
isNotBlank
(
vo
.
getName
())
&&
vo
.
getName
().
contains
(
SELECT_GOODS_EXCLUDE_NAME
);
return
null
!=
vo
&&
StringUtil
.
isNotBlank
(
vo
.
getName
())
&&
vo
.
getName
().
contains
(
SELECT_GOODS_EXCLUDE_NAME
);
}
}
/** 收钱吧演出关联商品(与后台约定 spuType=33),精选列表不展示 */
private
boolean
isSqbSpuGoods
(
GoblinGoodsInfoVo
vo
)
{
return
vo
!=
null
&&
vo
.
getSpuType
()
==
33
;
}
@Override
@Override
public
ArrayList
<
GoblinFrontBannerVo
>
getListBanner
()
{
public
ArrayList
<
GoblinFrontBannerVo
>
getListBanner
()
{
List
<
GoblinFrontBanner
>
list
=
goblinRedisUtils
.
getListBanner
();
List
<
GoblinFrontBanner
>
list
=
goblinRedisUtils
.
getListBanner
();
...
@@ -310,11 +319,57 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -310,11 +319,57 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
}
}
}
/**
* 前台展示用:仅包含未删除且已上架的 SKU,并填充库存、限购可买数等(与 {@link #getGoodsDetail} 一致)
*/
private
ArrayList
<
GoblinGoodsSkuInfoDetailVo
>
buildOnShelfSkuDetailList
(
GoblinGoodsInfoVo
goblinGoodsInfoVo
)
{
ArrayList
<
GoblinGoodsSkuInfoDetailVo
>
list
=
ObjectUtil
.
goblinGoodsSkuInfoDetailVos
();
if
(
goblinGoodsInfoVo
==
null
)
{
return
list
;
}
String
spuId
=
goblinGoodsInfoVo
.
getSpuId
();
List
<
String
>
skuIdList
=
goblinGoodsInfoVo
.
getSkuIdList
();
if
(
CollectionUtils
.
isEmpty
(
skuIdList
))
{
return
list
;
}
Integer
buyCount
=
0
;
for
(
String
sku
:
skuIdList
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
if
(
StringUtils
.
isNotBlank
(
userId
))
{
buyCount
=
goblinRedisUtils
.
getSkuCountByUid
(
userId
,
sku
);
}
GoblinGoodsSkuInfoVo
goblinGoodsSkuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
sku
);
if
(
null
!=
goblinGoodsSkuInfoVo
&&
goblinGoodsSkuInfoVo
.
getDelFlg
().
equals
(
"0"
)
&&
goblinGoodsSkuInfoVo
.
getShelvesStatus
().
equals
(
"3"
))
{
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
spuId
);
int
stock
=
goblinRedisUtils
.
getSkuStock
(
pre
,
goblinGoodsSkuInfoVo
.
getSkuId
());
log
.
debug
(
"skuId:{},库存数量{}"
,
goblinGoodsSkuInfoVo
.
getSkuId
(),
stock
);
GoblinGoodsSkuInfoDetailVo
goblinGoodsSkuInfoDetailVo
=
GoblinGoodsSkuInfoDetailVo
.
getNew
();
BeanUtils
.
copyProperties
(
goblinGoodsSkuInfoVo
,
goblinGoodsSkuInfoDetailVo
);
fillSkuPicIfBlank
(
goblinGoodsSkuInfoDetailVo
,
goblinGoodsInfoVo
);
if
(
0
!=
goblinGoodsSkuInfoDetailVo
.
getBuyLimit
())
{
if
(
null
==
buyCount
)
{
buyCount
=
0
;
}
goblinGoodsSkuInfoDetailVo
.
setCanBuy
(
goblinGoodsSkuInfoDetailVo
.
getBuyLimit
()
-
buyCount
);
}
else
{
goblinGoodsSkuInfoDetailVo
.
setCanBuy
(-
9999
);
}
if
(
stock
<=
0
)
{
goblinGoodsSkuInfoDetailVo
.
setStockLess
(
true
);
}
else
{
goblinGoodsSkuInfoDetailVo
.
setStockLess
(
false
);
}
goblinGoodsSkuInfoDetailVo
.
setRestStock
(
stock
);
list
.
add
(
goblinGoodsSkuInfoDetailVo
);
}
}
return
list
;
}
/**
/**
* 获得商品详情
* 获得商品详情
*/
*/
public
GoblinFrontGoodDetailVo
getGoodsDetail
(
String
spuId
)
{
public
GoblinFrontGoodDetailVo
getGoodsDetail
(
String
spuId
)
{
Integer
buyCount
=
0
;
GoblinFrontGoodDetailVo
goblinFrontGoodDetailVo
=
GoblinFrontGoodDetailVo
.
getNew
();
GoblinFrontGoodDetailVo
goblinFrontGoodDetailVo
=
GoblinFrontGoodDetailVo
.
getNew
();
GoblinGoodsInfoVo
goblinGoodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
spuId
);
GoblinGoodsInfoVo
goblinGoodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
spuId
);
GoblinGoodsInfoDetailVo
goblinGoodsInfoDetailVo
=
GoblinGoodsInfoDetailVo
.
getNew
();
GoblinGoodsInfoDetailVo
goblinGoodsInfoDetailVo
=
GoblinGoodsInfoDetailVo
.
getNew
();
...
@@ -323,51 +378,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -323,51 +378,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
BeanUtils
.
copyProperties
(
goblinGoodsInfoVo
,
goblinGoodsInfoDetailVo
);
BeanUtils
.
copyProperties
(
goblinGoodsInfoVo
,
goblinGoodsInfoDetailVo
);
goblinFrontGoodDetailVo
.
setGoblinGoodsInfoVo
(
goblinGoodsInfoDetailVo
);
goblinFrontGoodDetailVo
.
setGoblinGoodsInfoVo
(
goblinGoodsInfoDetailVo
);
// int limit= getStockCount(goblinGoodsInfoVo.getStoreId());
// int limit= getStockCount(goblinGoodsInfoVo.getStoreId());
List
<
String
>
skuIdList
=
goblinGoodsInfoVo
.
getSkuIdList
();
ArrayList
<
GoblinGoodsSkuInfoDetailVo
>
list
=
buildOnShelfSkuDetailList
(
goblinGoodsInfoVo
);
ArrayList
<
GoblinGoodsSkuInfoDetailVo
>
list
=
ObjectUtil
.
goblinGoodsSkuInfoDetailVos
();
for
(
String
sku
:
skuIdList
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
if
(
StringUtils
.
isNotBlank
(
userId
))
{
buyCount
=
goblinRedisUtils
.
getSkuCountByUid
(
userId
,
sku
);
}
GoblinGoodsSkuInfoVo
goblinGoodsSkuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
sku
);
if
(
null
!=
goblinGoodsSkuInfoVo
&&
goblinGoodsSkuInfoVo
.
getDelFlg
().
equals
(
"0"
)
&&
goblinGoodsSkuInfoVo
.
getShelvesStatus
().
equals
(
"3"
))
{
//获取 sku 库存数量
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
spuId
);
int
stock
=
goblinRedisUtils
.
getSkuStock
(
pre
,
goblinGoodsSkuInfoVo
.
getSkuId
());
log
.
debug
(
"skuId:{},库存数量{}"
,
goblinGoodsSkuInfoVo
.
getSkuId
(),
stock
);
GoblinGoodsSkuInfoDetailVo
goblinGoodsSkuInfoDetailVo
=
GoblinGoodsSkuInfoDetailVo
.
getNew
();
BeanUtils
.
copyProperties
(
goblinGoodsSkuInfoVo
,
goblinGoodsSkuInfoDetailVo
);
fillSkuPicIfBlank
(
goblinGoodsSkuInfoDetailVo
,
goblinGoodsInfoVo
);
if
(
0
!=
goblinGoodsSkuInfoDetailVo
.
getBuyLimit
())
{
if
(
null
==
buyCount
)
{
buyCount
=
0
;
}
goblinGoodsSkuInfoDetailVo
.
setCanBuy
(
goblinGoodsSkuInfoDetailVo
.
getBuyLimit
()
-
buyCount
);
}
else
{
goblinGoodsSkuInfoDetailVo
.
setCanBuy
(-
9999
);
}
if
(
stock
<=
0
)
{
goblinGoodsSkuInfoDetailVo
.
setStockLess
(
true
);
}
else
{
goblinGoodsSkuInfoDetailVo
.
setStockLess
(
false
);
}
if
(
goblinGoodsInfoVo
.
getSpuType
()
==
33
)
{
// 是关联收钱吧商品
LambdaQueryWrapper
<
GoblinSqbPerformanceGoods
>
queryWrapper
=
new
QueryWrapper
<
GoblinSqbPerformanceGoods
>()
.
lambda
()
.
eq
(
GoblinSqbPerformanceGoods:
:
getSpuId
,
spuId
)
.
eq
(
GoblinSqbPerformanceGoods:
:
getSkuId
,
sku
)
.
eq
(
GoblinSqbPerformanceGoods:
:
getStatus
,
1
);
GoblinSqbPerformanceGoods
goods
=
goblinSqbPerformanceGoodsMapper
.
selectOne
(
queryWrapper
);
if
(
goods
!=
null
)
{
goblinGoodsSkuInfoDetailVo
.
setPerformancesId
(
goods
.
getPerformancesId
());
}
}
goblinGoodsSkuInfoDetailVo
.
setRestStock
(
stock
);
list
.
add
(
goblinGoodsSkuInfoDetailVo
);
}
}
//goblinGoodsInfoVo
//goblinGoodsInfoVo
GoblinStoreInfoVo
goblinStoreInfoVo
=
this
.
getStore
(
goblinGoodsInfoVo
.
getStoreId
());
GoblinStoreInfoVo
goblinStoreInfoVo
=
this
.
getStore
(
goblinGoodsInfoVo
.
getStoreId
());
if
(
null
!=
goblinStoreInfoVo
)
{
if
(
null
!=
goblinStoreInfoVo
)
{
...
@@ -823,7 +834,8 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -823,7 +834,8 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
if
(
StringUtil
.
isNotBlank
(
spuids
))
{
if
(
StringUtil
.
isNotBlank
(
spuids
))
{
query
.
addCriteria
(
Criteria
.
where
(
"spuId"
).
nin
(
spuids
.
split
(
","
)));
query
.
addCriteria
(
Criteria
.
where
(
"spuId"
).
nin
(
spuids
.
split
(
","
)));
}
}
query
.
addCriteria
(
Criteria
.
where
(
"delFlg"
).
is
(
"0"
).
and
(
"shelvesStatus"
).
is
(
"3"
).
and
(
"spuAppear"
).
is
(
"0"
).
and
(
"marketId"
).
is
(
null
).
and
(
"cateFid"
).
nin
(
"22196120924543"
,
"22196122839313"
).
and
(
"name"
).
not
().
regex
(
Pattern
.
compile
(
SELECT_GOODS_EXCLUDE_NAME
)));
query
.
addCriteria
(
Criteria
.
where
(
"delFlg"
).
is
(
"0"
).
and
(
"shelvesStatus"
).
is
(
"3"
).
and
(
"spuAppear"
).
is
(
"0"
).
and
(
"marketId"
).
is
(
null
)
.
and
(
"spuType"
).
ne
(
33
).
and
(
"cateFid"
).
nin
(
"22196120924543"
,
"22196122839313"
).
and
(
"name"
).
not
().
regex
(
Pattern
.
compile
(
SELECT_GOODS_EXCLUDE_NAME
)));
//redis里面获取排序规则 1、上架时间2、销量3、价格高到低4、价格低到高
//redis里面获取排序规则 1、上架时间2、销量3、价格高到低4、价格低到高
...
@@ -941,7 +953,8 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -941,7 +953,8 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
it
.
remove
();
it
.
remove
();
}
else
{
}
else
{
GoblinGoodsInfoVo
goblinGoodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
goblinFrontSelectGoods
.
getSpuId
());
GoblinGoodsInfoVo
goblinGoodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
goblinFrontSelectGoods
.
getSpuId
());
if
(
null
==
goblinGoodsInfoVo
||
StringUtil
.
isNotBlank
(
goblinGoodsInfoVo
.
getMarketId
())
||
isPassportExclusive
(
goblinGoodsInfoVo
))
{
if
(
null
==
goblinGoodsInfoVo
||
StringUtil
.
isNotBlank
(
goblinGoodsInfoVo
.
getMarketId
())
||
isPassportExclusive
(
goblinGoodsInfoVo
)
||
isSqbSpuGoods
(
goblinGoodsInfoVo
))
{
it
.
remove
();
it
.
remove
();
}
}
}
}
...
@@ -986,6 +999,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -986,6 +999,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
if
(
isPassportExclusive
(
goblinGoodsInfoVo
))
{
if
(
isPassportExclusive
(
goblinGoodsInfoVo
))
{
continue
;
continue
;
}
}
if
(
isSqbSpuGoods
(
goblinGoodsInfoVo
))
{
continue
;
}
goblinGoodsInfoVoArrayList
.
add
(
goblinGoodsInfoVo
);
goblinGoodsInfoVoArrayList
.
add
(
goblinGoodsInfoVo
);
}
}
}
}
...
@@ -1047,6 +1063,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -1047,6 +1063,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
if
(
isPassportExclusive
(
goblinGoodsInfoVo
))
{
if
(
isPassportExclusive
(
goblinGoodsInfoVo
))
{
continue
;
continue
;
}
}
if
(
isSqbSpuGoods
(
goblinGoodsInfoVo
))
{
continue
;
}
goblinGoodsInfoVoArrayList
.
add
(
goblinGoodsInfoVo
);
goblinGoodsInfoVoArrayList
.
add
(
goblinGoodsInfoVo
);
}
}
}
}
...
@@ -1112,6 +1131,25 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -1112,6 +1131,25 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
int
safePage
=
Math
.
max
(
page
,
0
);
int
safePage
=
Math
.
max
(
page
,
0
);
int
safePageSize
=
pageSize
<=
0
?
40
:
Math
.
min
(
pageSize
,
100
);
int
safePageSize
=
pageSize
<=
0
?
40
:
Math
.
min
(
pageSize
,
100
);
// 演出结束且后台开启「演出结束自动下架」时,前台列表不返回商品(仅展示控制,不取消关联、不修改商品上下架)
GoblinSqbPerformanceConfig
sqbPerfCfg
=
goblinSqbPerformanceConfigMapper
.
selectById
(
performancesId
.
trim
());
boolean
hideListWhenPerformanceEnded
=
sqbPerfCfg
!=
null
&&
sqbPerfCfg
.
getAutoOffline
()
!=
null
&&
sqbPerfCfg
.
getAutoOffline
()
==
1
;
if
(
hideListWhenPerformanceEnded
)
{
KylinPerformanceVo
perfVo
=
goblinRedisUtils
.
getPerformanceVo
(
performancesId
);
if
(
perfVo
!=
null
&&
StringUtil
.
isNotBlank
(
perfVo
.
getTimeEnd
()))
{
try
{
String
nowTimeStr
=
DateUtil
.
getNowTime
();
if
(
1
==
DateUtil
.
compareStrDay
(
nowTimeStr
,
perfVo
.
getTimeEnd
()))
{
respVo
.
setCount
(
0
);
respVo
.
setGoblinGoodsInfoVoList
(
ObjectUtil
.
goblinGoodsInfoVoArrayList
());
return
respVo
;
}
}
catch
(
Exception
e
)
{
log
.
warn
(
"演出结束时间比较异常 performancesId={}, timeEnd={}"
,
performancesId
,
perfVo
.
getTimeEnd
(),
e
);
}
}
}
// 1. 尝试从 Redis 缓存获取全量已关联商品关系(Raw Relations)提高性能
// 1. 尝试从 Redis 缓存获取全量已关联商品关系(Raw Relations)提高性能
List
<
GoblinSqbPerformanceGoods
>
relations
=
goblinRedisUtils
.
getSqbPerformanceGoodsListCache
(
performancesId
);
List
<
GoblinSqbPerformanceGoods
>
relations
=
goblinRedisUtils
.
getSqbPerformanceGoodsListCache
(
performancesId
);
...
@@ -1175,6 +1213,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -1175,6 +1213,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
frontGoods
.
setSellPrice
(
normalPrice
);
frontGoods
.
setSellPrice
(
normalPrice
);
frontGoods
.
setPrice
(
normalPrice
);
frontGoods
.
setPrice
(
normalPrice
);
frontGoods
.
setSettlementPrice
(
rel
.
getSettlementPrice
());
frontGoods
.
setSettlementPrice
(
rel
.
getSettlementPrice
());
frontGoods
.
setGoblinGoodsSkuInfoVolist
(
buildOnShelfSkuDetailList
(
goodsInfoVo
));
allGoods
.
add
(
frontGoods
);
allGoods
.
add
(
frontGoods
);
}
}
}
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
ff33c406
...
@@ -28,9 +28,14 @@ import com.liquidnet.service.goblin.entity.GoblinSqbPerformanceGoods;
...
@@ -28,9 +28,14 @@ import com.liquidnet.service.goblin.entity.GoblinSqbPerformanceGoods;
import
com.liquidnet.service.goblin.mapper.GoblinBraceletOrderMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinBraceletOrderMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinSqbPerformanceGoodsMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinSqbPerformanceGoodsMapper
;
import
com.liquidnet.service.goblin.service.impl.inner.GoblinNftJobServiceImpl
;
import
com.liquidnet.service.goblin.service.impl.inner.GoblinNftJobServiceImpl
;
import
com.liquidnet.service.kylin.constant.KylinRedisConst
;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
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.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.util.DigestUtils
;
...
@@ -52,6 +57,8 @@ public class GoblinRedisUtils {
...
@@ -52,6 +57,8 @@ public class GoblinRedisUtils {
@Autowired
@Autowired
public
RedisUtil
redisUtil
;
public
RedisUtil
redisUtil
;
@Autowired
@Autowired
private
MongoTemplate
mongoTemplate
;
@Autowired
GoblinMongoUtils
goblinMongoUtils
;
GoblinMongoUtils
goblinMongoUtils
;
@Autowired
@Autowired
GoblinNftJobServiceImpl
goblinNftJobService
;
GoblinNftJobServiceImpl
goblinNftJobService
;
...
@@ -3064,6 +3071,27 @@ public class GoblinRedisUtils {
...
@@ -3064,6 +3071,27 @@ public class GoblinRedisUtils {
/* --------------------------------收钱吧相关--------------------------------- */
/* --------------------------------收钱吧相关--------------------------------- */
/**
* 根据演出 id 获取演出详情(与 order 模块 {@code com.liquidnet.service.order.utils.DataUtils#getPerformanceVo} 逻辑一致)
*/
public
KylinPerformanceVo
getPerformanceVo
(
String
performanceId
)
{
if
(!
StringUtils
.
hasText
(
performanceId
))
{
return
null
;
}
String
id
=
performanceId
.
trim
();
Object
obj
=
redisUtil
.
get
(
KylinRedisConst
.
PERFORMANCES
+
id
);
if
(
obj
!=
null
)
{
return
(
KylinPerformanceVo
)
obj
;
}
KylinPerformanceVo
performanceData
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"performancesId"
).
is
(
id
)),
KylinPerformanceVo
.
class
,
KylinPerformanceVo
.
class
.
getSimpleName
());
redisUtil
.
set
(
KylinRedisConst
.
PERFORMANCES
+
id
,
performanceData
);
return
performanceData
;
}
public
void
setSqbPerformanceGoodsListCache
(
String
performancesId
,
List
<
GoblinSqbPerformanceGoods
>
relations
)
{
public
void
setSqbPerformanceGoodsListCache
(
String
performancesId
,
List
<
GoblinSqbPerformanceGoods
>
relations
)
{
String
key
=
GoblinRedisConst
.
SQB_PERFORMANCE_GOODS
.
concat
(
performancesId
);
String
key
=
GoblinRedisConst
.
SQB_PERFORMANCE_GOODS
.
concat
(
performancesId
);
redisUtil
.
set
(
key
,
relations
,
RedisKeyExpireConst
.
SQB_PERFORMANCE_GOODS_EXPIRE
);
redisUtil
.
set
(
key
,
relations
,
RedisKeyExpireConst
.
SQB_PERFORMANCE_GOODS_EXPIRE
);
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/GoblinSqbOrderServiceImpl.java
View file @
ff33c406
...
@@ -67,6 +67,9 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
...
@@ -67,6 +67,9 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
String
performancesId
=
orderParam
.
getPerformancesId
();
String
performancesId
=
orderParam
.
getPerformancesId
();
Integer
quantity
=
orderParam
.
getQuantity
();
Integer
quantity
=
orderParam
.
getQuantity
();
String
openId
=
orderParam
.
getOpenId
();
String
openId
=
orderParam
.
getOpenId
();
if
(
StringUtil
.
isBlank
(
performancesId
))
{
return
ResponseDto
.
failure
(
"关联演出ID不能为空"
);
}
if
(
openId
==
null
||
openId
.
trim
().
isEmpty
())
{
if
(
openId
==
null
||
openId
.
trim
().
isEmpty
())
{
return
ResponseDto
.
failure
(
"微信 openId 不能为空"
);
return
ResponseDto
.
failure
(
"微信 openId 不能为空"
);
}
}
...
@@ -86,15 +89,15 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
...
@@ -86,15 +89,15 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
return
ResponseDto
.
failure
(
"商品与演出关联不存在"
);
return
ResponseDto
.
failure
(
"商品与演出关联不存在"
);
}
}
boolean
skuIdExists
=
false
;
GoblinSqbPerformanceGoods
matchedPerfRel
=
null
;
for
(
GoblinSqbPerformanceGoods
goblinSqbPerformanceGoods
:
performanceGoodsListCache
)
{
for
(
GoblinSqbPerformanceGoods
goblinSqbPerformanceGoods
:
performanceGoodsListCache
)
{
if
(
skuId
.
equals
(
goblinSqbPerformanceGoods
.
getSkuId
()))
{
if
(
skuId
.
equals
(
goblinSqbPerformanceGoods
.
getSkuId
()))
{
skuIdExists
=
true
;
matchedPerfRel
=
goblinSqbPerformanceGoods
;
break
;
}
}
}
}
if
(
!
skuIdExists
)
{
if
(
matchedPerfRel
==
null
)
{
log
.
error
(
"[收钱吧下单] 演出-商品关联不存在或已禁用,performancesId={}, skuId={}"
,
performancesId
,
skuId
);
log
.
error
(
"[收钱吧下单] 演出-商品关联不存在或已禁用,performancesId={}, skuId={}"
,
performancesId
,
skuId
);
return
ResponseDto
.
failure
(
"商品与演出关联不存在"
);
return
ResponseDto
.
failure
(
"商品与演出关联不存在"
);
}
}
...
@@ -121,6 +124,11 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
...
@@ -121,6 +124,11 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
}
}
log
.
info
(
"[收钱吧下单] 扣减库存成功,skuId={}, 剩余库存={}"
,
skuId
,
remaining
);
log
.
info
(
"[收钱吧下单] 扣减库存成功,skuId={}, 剩余库存={}"
,
skuId
,
remaining
);
BigDecimal
unitPriceYuan
=
resolveSqbUnitPriceYuan
(
skuVo
,
matchedPerfRel
);
log
.
info
(
"[收钱吧下单] 单价(元) performancesId={}, skuId={}, settlementPrice={}, 实际计价={}"
,
performancesId
,
skuId
,
matchedPerfRel
!=
null
?
matchedPerfRel
.
getSettlementPrice
()
:
null
,
unitPriceYuan
);
// 获取该商品对应的商城的编号和密码
// 获取该商品对应的商城的编号和密码
GoblinSqbGoodsExtVo
sqbGoodsExt
=
goblinSqbRedisUtils
.
getSqbGoodsExt
(
spuId
,
skuId
);
GoblinSqbGoodsExtVo
sqbGoodsExt
=
goblinSqbRedisUtils
.
getSqbGoodsExt
(
spuId
,
skuId
);
if
(
sqbGoodsExt
==
null
)
{
if
(
sqbGoodsExt
==
null
)
{
...
@@ -133,7 +141,7 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
...
@@ -133,7 +141,7 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
sqbGoodsExt
.
getSignature
(),
sqbGoodsExt
.
getSignature
(),
userId
,
userId
,
Collections
.
singletonList
(
buildSqbCheckOutItem
(
skuVo
,
Collections
.
singletonList
(
buildSqbCheckOutItem
(
skuVo
,
quantity
,
sqbGoodsExt
.
getSqbSkuId
(),
sqbGoodsExt
.
getSqbSpuId
())));
quantity
,
sqbGoodsExt
.
getSqbSkuId
(),
sqbGoodsExt
.
getSqbSpuId
()
,
unitPriceYuan
)));
if
(
settlementData
==
null
)
{
if
(
settlementData
==
null
)
{
goblinRedisUtils
.
incrSkuStock
(
null
,
skuId
,
quantity
);
goblinRedisUtils
.
incrSkuStock
(
null
,
skuId
,
quantity
);
return
ResponseDto
.
failure
(
"创建结算明细失败"
);
return
ResponseDto
.
failure
(
"创建结算明细失败"
);
...
@@ -231,10 +239,10 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
...
@@ -231,10 +239,10 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
storeOrderVo
.
setUserName
(
""
);
storeOrderVo
.
setUserName
(
""
);
storeOrderVo
.
setUserMobile
(
""
);
storeOrderVo
.
setUserMobile
(
""
);
BigDecimal
skuPrice
=
skuInfo
!=
null
?
skuInfo
.
getPrice
()
:
BigDecimal
.
ZERO
;
BigDecimal
skuPrice
=
unitPriceYuan
;
BigDecimal
priceTotal
=
skuPrice
.
multiply
(
new
BigDecimal
(
quantity
));
BigDecimal
priceTotal
=
skuPrice
.
multiply
(
new
BigDecimal
(
quantity
));
storeOrderVo
.
setPriceTotal
(
priceTotal
);
storeOrderVo
.
setPriceTotal
(
priceTotal
);
storeOrderVo
.
setPriceActual
(
priceTotal
);
//
收钱吧暂无运费及优惠逻辑,实际价格等于总价
storeOrderVo
.
setPriceActual
(
priceTotal
);
//
演出关联换购价或 SKU 售价,无额外运费/券
storeOrderVo
.
setPriceRefund
(
BigDecimal
.
ZERO
);
storeOrderVo
.
setPriceRefund
(
BigDecimal
.
ZERO
);
storeOrderVo
.
setPriceExpress
(
BigDecimal
.
ZERO
);
storeOrderVo
.
setPriceExpress
(
BigDecimal
.
ZERO
);
storeOrderVo
.
setPriceCoupon
(
BigDecimal
.
ZERO
);
storeOrderVo
.
setPriceCoupon
(
BigDecimal
.
ZERO
);
...
@@ -389,15 +397,40 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
...
@@ -389,15 +397,40 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
* @param sqbSpuId
* @param sqbSpuId
* @return
* @return
*/
*/
/**
* 演出入口下单:后台为该 SKU 配置了换购价且大于 0 时用换购价(元),否则用 SKU 销售价,再否则现价;换购价高于售价时按售价避免多收。
*/
private
BigDecimal
resolveSqbUnitPriceYuan
(
GoblinGoodsSkuInfoVo
skuVo
,
GoblinSqbPerformanceGoods
perfRel
)
{
if
(
skuVo
==
null
)
{
return
BigDecimal
.
ZERO
;
}
BigDecimal
base
=
skuVo
.
getSellPrice
()
!=
null
?
skuVo
.
getSellPrice
()
:
skuVo
.
getPrice
();
if
(
base
==
null
)
{
base
=
BigDecimal
.
ZERO
;
}
if
(
perfRel
==
null
||
perfRel
.
getSettlementPrice
()
==
null
)
{
return
base
;
}
BigDecimal
sp
=
perfRel
.
getSettlementPrice
();
if
(
sp
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
return
base
;
}
if
(
sp
.
compareTo
(
base
)
>
0
)
{
return
base
;
}
return
sp
;
}
private
SettlementCreateRequest
.
CheckoutItem
buildSqbCheckOutItem
(
GoblinGoodsSkuInfoVo
skuVo
,
private
SettlementCreateRequest
.
CheckoutItem
buildSqbCheckOutItem
(
GoblinGoodsSkuInfoVo
skuVo
,
Integer
quantity
,
Integer
quantity
,
String
sqbSkuId
,
String
sqbSkuId
,
String
sqbSpuId
)
{
String
sqbSpuId
,
BigDecimal
unitPriceYuan
)
{
// 获取商品与收钱吧商品对应的关联的skuId、spuId
// 获取商品与收钱吧商品对应的关联的skuId、spuId
SettlementCreateRequest
.
CheckoutItem
checkoutItem
=
new
SettlementCreateRequest
.
CheckoutItem
();
SettlementCreateRequest
.
CheckoutItem
checkoutItem
=
new
SettlementCreateRequest
.
CheckoutItem
();
checkoutItem
.
setSpuId
(
sqbSpuId
);
checkoutItem
.
setSpuId
(
sqbSpuId
);
checkoutItem
.
setSkuId
(
sqbSkuId
);
checkoutItem
.
setSkuId
(
sqbSkuId
);
checkoutItem
.
setPrice
(
GoblinSqbConvertUtils
.
yuanToFen
(
skuVo
.
getPrice
()
));
checkoutItem
.
setPrice
(
GoblinSqbConvertUtils
.
yuanToFen
(
unitPriceYuan
));
checkoutItem
.
setQuantity
(
String
.
valueOf
(
quantity
));
checkoutItem
.
setQuantity
(
String
.
valueOf
(
quantity
));
checkoutItem
.
setType
((
byte
)
0
);
checkoutItem
.
setType
((
byte
)
0
);
checkoutItem
.
setTitle
(
skuVo
.
getName
());
checkoutItem
.
setTitle
(
skuVo
.
getName
());
...
...
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