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

Commit 1dd3253b authored by wangyifan's avatar wangyifan

Merge branch 'dev-1.6-shouqianba' into container-dev-1.6-shouqianba

parents fee42a10 b9e6db04
......@@ -21,16 +21,20 @@ import java.util.List;
public class GoblinFrontGoodDetailVo implements Serializable {
//spu
GoblinGoodsInfoDetailVo goblinGoodsInfoVo;
//sku
List<GoblinGoodsSkuInfoDetailVo> goblinGoodsSkuInfoVolist;
@ApiModelProperty(value = "商铺名称")
String storeName;
@ApiModelProperty(value = "商品可参与券类型")
ArrayList<String> getSpuType;
@ApiModelProperty(value = "条码识别到的SKUID列表", notes = "仅当条码识别时有效")
private List<String> hitSkuIdList;
private static final long serialVersionUID = 1L;
private static final GoblinFrontGoodDetailVo obj = new GoblinFrontGoodDetailVo();
......
......@@ -48,6 +48,9 @@ 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() {
......
......@@ -2,6 +2,7 @@ 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.*;
......@@ -335,6 +336,18 @@ 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);
}
......
......@@ -3,6 +3,7 @@ package com.liquidnet.service.goblin.service.impl;
import com.liquidnet.common.third.sqb.biz.SqbBiz;
import com.liquidnet.common.third.sqb.param.request.CommonRequest;
import com.liquidnet.common.third.sqb.param.request.CouponQueryRequest;
import com.liquidnet.common.third.sqb.param.request.CouponRefundRequest;
import com.liquidnet.common.third.sqb.param.response.data.CouponQueryData;
import com.liquidnet.common.third.sqb.param.response.data.CouponRefundData;
import com.liquidnet.commons.lang.util.IDGenerator;
......@@ -114,12 +115,26 @@ public class GoblinSqbServiceImpl implements IGoblinSqbService {
goblinSqbRedisUtils.setSqbOrder(orderId, orderVo);
syncOrderStatus(orderId, 4);
GoblinStoreOrderVo goblinStoreOrderVo = goblinRedisUtils.getGoblinOrder(orderId);
if (null == goblinStoreOrderVo) {
log.error("[收钱吧] 现场商品退款失败, orderId: {}, userId: {}", orderId, userId);
return ResponseDto.failure("退款失败");
}
List<GoblinOrderSkuVo> orderSkuVos = new ArrayList<>();
for (String skuVoId : goblinStoreOrderVo.getOrderSkuVoIds()) {
GoblinOrderSkuVo goblinOrderSkuVo = goblinRedisUtils.getGoblinOrderSkuVo(skuVoId);
if (null != goblinOrderSkuVo) {
orderSkuVos.add(goblinOrderSkuVo);
}
}
try {
CouponRefundData refundData = sqbBiz.refundCoupon(orderVo.getSqbOrderSn(),
orderVo.getSqbOrderSignature(),
orderVo.getAmount(),
(byte) 2, // 2-按金额退款
new ArrayList<>(), // TODO 需要构建退款商品
buildRefundItem(orderSkuVos), // 需要构建退款商品
reason,
buildRequestId(IDGenerator.nextSnowId())
);
......@@ -155,6 +170,28 @@ public class GoblinSqbServiceImpl implements IGoblinSqbService {
}
}
private List<CouponRefundRequest.RefundItem> buildRefundItem(List<GoblinOrderSkuVo> orderSkuVos) {
List<CouponRefundRequest.RefundItem> refundItems = new ArrayList<>();
for (GoblinOrderSkuVo orderSkuVo : orderSkuVos) {
GoblinSqbGoodsExtVo sqbGoodsExt = goblinSqbRedisUtils.getSqbGoodsExt(orderSkuVo.getSpuId(), orderSkuVo.getSkuId());
if (sqbGoodsExt == null) {
log.error("[buildRefundItem] 收钱吧扩展参数为空, spuId: {}, skuId: {}", orderSkuVo.getSpuId(), orderSkuVo.getSkuId());
continue;
}
CouponRefundRequest.RefundItem item = new CouponRefundRequest.RefundItem();
item.setSpuId(sqbGoodsExt.getSqbSpuId());
item.setSkuId(sqbGoodsExt.getSqbSkuId());
item.setTitle(orderSkuVo.getSkuName());
item.setImg(orderSkuVo.getSkuImage());
item.setQuantity(String.valueOf(orderSkuVo.getNum()));
item.setType((byte) 0);
refundItems.add(item);
}
return refundItems;
}
// ================================ 同步核销状态 ================================
@Override
......
......@@ -109,4 +109,21 @@ public class GoblinSqbRedisUtils {
String redisKey = GoblinRedisConst.SQB_GOBLIN_GOODS_EXT_KEY.concat(spuId).concat(":").concat(skuId);
redisUtil.set(redisKey, sqbGoodsExtVo);
}
/**
* 获取正在商品获取收钱吧相关信息缓存
*
* @param spuId
* @param skuId
* @return
*/
public GoblinSqbGoodsExtVo getSqbGoodsExt(String spuId, String skuId) {
String redisKey = GoblinRedisConst.SQB_GOBLIN_GOODS_EXT_KEY.concat(spuId).concat(":").concat(skuId);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return null;
} else {
return (GoblinSqbGoodsExtVo) obj;
}
}
}
......@@ -185,6 +185,7 @@ public class GoblinSqbOrderServiceImpl implements IGoblinSqbOrderService {
Map<String, Object> channelExt = new HashMap<>();
channelExt.put("sub_appid", "wx4732efeaa2b08086");
// 创建微信预支付订单
CreateWechatPrepayOrderData prepayData = sqbBiz.createWechatPrepayOrder(sqbAcquiringSn,
sqbAcquiringSign,
userId,
......
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