记得上下班打卡 | git大法好,push需谨慎

Commit e106aec9 authored by 姜秀龙's avatar 姜秀龙

sqb 功能完善。小需求改动

parent 61c9e8cb
......@@ -23,7 +23,7 @@ public class GoblinSqbOrderParam {
@NotNull(message = "购买数量不能为空")
private Integer quantity;
@ApiModelProperty(required = true, value = "关联演出ID")
@ApiModelProperty(required = true, value = "关联演出ID(须与后台演出-商品关联一致;有换购价时按换购价计价)")
@NotBlank(message = "关联演出ID不能为空")
private String performancesId;
......
......@@ -48,9 +48,6 @@ public class GoblinGoodsSkuInfoDetailVo implements Serializable, Cloneable {
@ApiModelProperty(position = 51, value = "是否实名[0-否|1-是,表示该商品需要实名关联]")
private Integer isTrueName;
@ApiModelProperty(position = 52, value = "关联演出ID")
private String performancesId;
private static final GoblinGoodsSkuInfoDetailVo obj = new GoblinGoodsSkuInfoDetailVo();
public static GoblinGoodsSkuInfoDetailVo getNew() {
......
......@@ -8,7 +8,7 @@ import java.util.List;
public class GoblinSqbPerfListRespVo implements Serializable {
private static final long serialVersionUID = 1L;
/** 演出结束自动下架 0-否 1-是(全局配置) */
/** 演出结束后不在前台列表展示 0-否 1-是(全局配置,仅列表隐藏) */
private Integer autoOffline;
/** 关联商品列表 */
......
......@@ -6,6 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.List;
/**
* 收钱吧-演出关联商品前端展示VO
......@@ -20,4 +21,7 @@ public class GoblinSqbPerformanceGoodsInfoVo extends GoblinGoodsInfoVo {
@ApiModelProperty(value = "换购价(不设置则按正常价)")
private BigDecimal settlementPrice;
@ApiModelProperty(value = "已上架 SKU 明细(含 restStock、stockLess、canBuy 等,与商品详情接口字段一致)")
private List<GoblinGoodsSkuInfoDetailVo> goblinGoodsSkuInfoVolist;
}
......@@ -65,7 +65,7 @@ public class SqbPerformanceGoodsController extends BaseController {
@ApiOperation("批量绑定演出与商品(含换购价、演出级自动下架全局配置)")
@ApiImplicitParams({
@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,
@RequestParam(value = "autoOffline", required = false, defaultValue = "0") Integer autoOffline,
......
......@@ -39,8 +39,9 @@
<div class="auto-offline-bar">
<label>
<input type="checkbox" id="globalAutoOffline" onchange="toggleGlobalAutoOffline(this)"/>
演出结束商品自动下架
演出结束后不在前台推荐列表展示
</label>
<span class="tip">开启后仅隐藏 APP/小程序演出关联商品列表,不取消关联、不修改商品上下架</span>
</div>
<div class="table-responsive">
<table class="table table-bordered" id="linkedGoodsTable">
......
......@@ -18,7 +18,7 @@ public interface ISqbPerformanceGoodsService {
*
* @param performancesId 演出ID
* @param items 绑定项列表(仅含 SKU ID、排序、换购价)
* @param autoOffline 演出结束自动下架 0-否 1-是(全局配置
* @param autoOffline 演出结束后不在前台列表展示 0-否 1-是(全局配置,仅列表隐藏
* @return 操作结果
*/
ResponseDto<Boolean> bind(String performancesId, List<SqbPerfGoodsBindItemParam> items, Integer autoOffline);
......
......@@ -30,7 +30,7 @@ public class GoblinSqbPerformanceConfig implements Serializable {
private String performancesId;
/**
* 演出结束自动下架 0-否 1-是
* 演出结束后不在前台关联商品列表展示 0-否 1-是(仅列表隐藏,不取消关联、不修改商品上下架)
*/
private Integer autoOffline;
......
......@@ -82,6 +82,12 @@
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-service-kylin-api</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
......
......@@ -102,7 +102,7 @@ public class GoblinSqbController {
}
@GetMapping("/performance/selectGoods")
@ApiOperation("按演出ID获得已关联商品列表(pageNumber从0开始)")
@ApiOperation("按演出ID获得已关联商品列表(pageNumber从0开始);若后台开启「演出结束后不在前台列表展示」且演出已结束则返回空列表")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", required = true, dataType = "String", name = "performancesId", value = "演出ID"),
@ApiImplicitParam(paramType = "query", required = true, dataType = "int", name = "pageSize", value = "分页大小"),
......
......@@ -2,7 +2,6 @@ package com.liquidnet.service.goblin.service.impl;
import com.alibaba.fastjson.JSON;
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.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.util.*;
......@@ -14,7 +13,9 @@ import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.*;
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.mapper.GoblinSqbPerformanceConfigMapper;
import com.liquidnet.service.goblin.mapper.GoblinSqbPerformanceGoodsMapper;
import com.liquidnet.service.goblin.enums.GoblinStoreConf;
import com.liquidnet.service.goblin.service.GoblinCouponService;
......@@ -23,6 +24,7 @@ import com.liquidnet.service.goblin.util.GoblinMongoUtils;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import com.liquidnet.service.goblin.util.ObjectUtil;
import com.liquidnet.service.goblin.util.QueueUtils;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo;
import com.mongodb.BasicDBObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
......@@ -64,12 +66,19 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
GoblinCouponService goblinCouponService;
@Autowired
private GoblinSqbPerformanceGoodsMapper goblinSqbPerformanceGoodsMapper;
@Autowired
private GoblinSqbPerformanceConfigMapper goblinSqbPerformanceConfigMapper;
private static final String SELECT_GOODS_EXCLUDE_NAME = "护照专属";
private boolean isPassportExclusive(GoblinGoodsInfoVo vo) {
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
public ArrayList<GoblinFrontBannerVo> getListBanner() {
List<GoblinFrontBanner> list = goblinRedisUtils.getListBanner();
......@@ -311,20 +320,19 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
/**
* 获得商品详情
* 前台展示用:仅包含未删除且已上架的 SKU,并填充库存、限购可买数等(与 {@link #getGoodsDetail} 一致)
*/
public GoblinFrontGoodDetailVo getGoodsDetail(String spuId) {
Integer buyCount = 0;
GoblinFrontGoodDetailVo goblinFrontGoodDetailVo = GoblinFrontGoodDetailVo.getNew();
GoblinGoodsInfoVo goblinGoodsInfoVo = goblinRedisUtils.getGoodsInfoVo(spuId);
GoblinGoodsInfoDetailVo goblinGoodsInfoDetailVo = GoblinGoodsInfoDetailVo.getNew();
//skuIdList
if (null != goblinGoodsInfoVo) {
BeanUtils.copyProperties(goblinGoodsInfoVo, goblinGoodsInfoDetailVo);
goblinFrontGoodDetailVo.setGoblinGoodsInfoVo(goblinGoodsInfoDetailVo);
// int limit= getStockCount(goblinGoodsInfoVo.getStoreId());
List<String> skuIdList = goblinGoodsInfoVo.getSkuIdList();
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)) {
......@@ -332,7 +340,6 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
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);
......@@ -352,22 +359,26 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
} 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);
}
}
return list;
}
/**
* 获得商品详情
*/
public GoblinFrontGoodDetailVo getGoodsDetail(String spuId) {
GoblinFrontGoodDetailVo goblinFrontGoodDetailVo = GoblinFrontGoodDetailVo.getNew();
GoblinGoodsInfoVo goblinGoodsInfoVo = goblinRedisUtils.getGoodsInfoVo(spuId);
GoblinGoodsInfoDetailVo goblinGoodsInfoDetailVo = GoblinGoodsInfoDetailVo.getNew();
//skuIdList
if (null != goblinGoodsInfoVo) {
BeanUtils.copyProperties(goblinGoodsInfoVo, goblinGoodsInfoDetailVo);
goblinFrontGoodDetailVo.setGoblinGoodsInfoVo(goblinGoodsInfoDetailVo);
// int limit= getStockCount(goblinGoodsInfoVo.getStoreId());
ArrayList<GoblinGoodsSkuInfoDetailVo> list = buildOnShelfSkuDetailList(goblinGoodsInfoVo);
//goblinGoodsInfoVo
GoblinStoreInfoVo goblinStoreInfoVo = this.getStore(goblinGoodsInfoVo.getStoreId());
if (null != goblinStoreInfoVo) {
......@@ -823,7 +834,8 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
if (StringUtil.isNotBlank(spuids)) {
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、价格低到高
......@@ -941,7 +953,8 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
it.remove();
} else {
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();
}
}
......@@ -986,6 +999,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
if (isPassportExclusive(goblinGoodsInfoVo)) {
continue;
}
if (isSqbSpuGoods(goblinGoodsInfoVo)) {
continue;
}
goblinGoodsInfoVoArrayList.add(goblinGoodsInfoVo);
}
}
......@@ -1047,6 +1063,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
if (isPassportExclusive(goblinGoodsInfoVo)) {
continue;
}
if (isSqbSpuGoods(goblinGoodsInfoVo)) {
continue;
}
goblinGoodsInfoVoArrayList.add(goblinGoodsInfoVo);
}
}
......@@ -1112,6 +1131,25 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
int safePage = Math.max(page, 0);
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)提高性能
List<GoblinSqbPerformanceGoods> relations = goblinRedisUtils.getSqbPerformanceGoodsListCache(performancesId);
......@@ -1175,6 +1213,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
frontGoods.setSellPrice(normalPrice);
frontGoods.setPrice(normalPrice);
frontGoods.setSettlementPrice(rel.getSettlementPrice());
frontGoods.setGoblinGoodsSkuInfoVolist(buildOnShelfSkuDetailList(goodsInfoVo));
allGoods.add(frontGoods);
}
}
......
......@@ -28,9 +28,14 @@ import com.liquidnet.service.goblin.entity.GoblinSqbPerformanceGoods;
import com.liquidnet.service.goblin.mapper.GoblinBraceletOrderMapper;
import com.liquidnet.service.goblin.mapper.GoblinSqbPerformanceGoodsMapper;
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 org.springframework.beans.factory.annotation.Autowired;
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.util.CollectionUtils;
import org.springframework.util.DigestUtils;
......@@ -52,6 +57,8 @@ public class GoblinRedisUtils {
@Autowired
public RedisUtil redisUtil;
@Autowired
private MongoTemplate mongoTemplate;
@Autowired
GoblinMongoUtils goblinMongoUtils;
@Autowired
GoblinNftJobServiceImpl goblinNftJobService;
......@@ -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) {
String key = GoblinRedisConst.SQB_PERFORMANCE_GOODS.concat(performancesId);
redisUtil.set(key, relations, RedisKeyExpireConst.SQB_PERFORMANCE_GOODS_EXPIRE);
......
......@@ -67,6 +67,9 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
String performancesId = orderParam.getPerformancesId();
Integer quantity = orderParam.getQuantity();
String openId = orderParam.getOpenId();
if (StringUtil.isBlank(performancesId)) {
return ResponseDto.failure("关联演出ID不能为空");
}
if (openId == null || openId.trim().isEmpty()) {
return ResponseDto.failure("微信 openId 不能为空");
}
......@@ -86,15 +89,15 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
return ResponseDto.failure("商品与演出关联不存在");
}
boolean skuIdExists = false;
GoblinSqbPerformanceGoods matchedPerfRel = null;
for (GoblinSqbPerformanceGoods goblinSqbPerformanceGoods : performanceGoodsListCache) {
if (skuId.equals(goblinSqbPerformanceGoods.getSkuId())) {
skuIdExists = true;
matchedPerfRel = goblinSqbPerformanceGoods;
break;
}
}
if (!skuIdExists) {
if (matchedPerfRel == null) {
log.error("[收钱吧下单] 演出-商品关联不存在或已禁用,performancesId={}, skuId={}", performancesId, skuId);
return ResponseDto.failure("商品与演出关联不存在");
}
......@@ -121,6 +124,11 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
}
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);
if (sqbGoodsExt == null) {
......@@ -133,7 +141,7 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
sqbGoodsExt.getSignature(),
userId,
Collections.singletonList(buildSqbCheckOutItem(skuVo,
quantity, sqbGoodsExt.getSqbSkuId(), sqbGoodsExt.getSqbSpuId())));
quantity, sqbGoodsExt.getSqbSkuId(), sqbGoodsExt.getSqbSpuId(), unitPriceYuan)));
if (settlementData == null) {
goblinRedisUtils.incrSkuStock(null, skuId, quantity);
return ResponseDto.failure("创建结算明细失败");
......@@ -231,10 +239,10 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
storeOrderVo.setUserName("");
storeOrderVo.setUserMobile("");
BigDecimal skuPrice = skuInfo != null ? skuInfo.getPrice() : BigDecimal.ZERO;
BigDecimal skuPrice = unitPriceYuan;
BigDecimal priceTotal = skuPrice.multiply(new BigDecimal(quantity));
storeOrderVo.setPriceTotal(priceTotal);
storeOrderVo.setPriceActual(priceTotal); // 收钱吧暂无运费及优惠逻辑,实际价格等于总价
storeOrderVo.setPriceActual(priceTotal); // 演出关联换购价或 SKU 售价,无额外运费/券
storeOrderVo.setPriceRefund(BigDecimal.ZERO);
storeOrderVo.setPriceExpress(BigDecimal.ZERO);
storeOrderVo.setPriceCoupon(BigDecimal.ZERO);
......@@ -389,15 +397,40 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
* @param sqbSpuId
* @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,
Integer quantity,
String sqbSkuId,
String sqbSpuId) {
String sqbSpuId,
BigDecimal unitPriceYuan) {
// 获取商品与收钱吧商品对应的关联的skuId、spuId
SettlementCreateRequest.CheckoutItem checkoutItem = new SettlementCreateRequest.CheckoutItem();
checkoutItem.setSpuId(sqbSpuId);
checkoutItem.setSkuId(sqbSkuId);
checkoutItem.setPrice(GoblinSqbConvertUtils.yuanToFen(skuVo.getPrice()));
checkoutItem.setPrice(GoblinSqbConvertUtils.yuanToFen(unitPriceYuan));
checkoutItem.setQuantity(String.valueOf(quantity));
checkoutItem.setType((byte) 0);
checkoutItem.setTitle(skuVo.getName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment