Commit 272ef148 authored by wlx@33.cn's avatar wlx@33.cn

提测盲盒

parent 87522e40
......@@ -49,4 +49,6 @@ public class OrderDetailVO {
private Integer type;
@ApiModelProperty("预售商品信息")
private PreSale preSale;
@ApiModelProperty(value = "(销售方式)1.普通 4.盲盒")
private Integer salesType;
}
......@@ -236,16 +236,6 @@ public class GoodsController {
}
public static void main(String[] args) {
List<String> list = new ArrayList<>();
list.add("key");
list.add("111");
String str = StringUtils.join("\',\'", list);
String str2 = "(\'" + str + "\')";
System.out.println(str2);
}
/* @ApiOperation(value = "商品评论 参数:goodsId")
@PostMapping("/without/getComment")
public ResponseVO<Comment> getComment(@RequestBody JSONObject data,@RequestBody PageVo pageVo){
......
......@@ -39,4 +39,7 @@ public class SaleHotVo {
@ApiModelProperty(value = "商品发行量总量")
private Integer circulationCount;
@ApiModelProperty(value = "(销售方式)1.普通 4.盲盒")
private Integer salesType;
}
......@@ -16,8 +16,6 @@ import java.util.Map;
*/
public interface IGoodSkuPropService extends IService<GoodSkuProp> {
List<Map<String, Object>> getSkuPropListBySkuId (String skuId, boolean hideSku);
List<Map<String, Object>> getSkuPropListBySkuId (String skuId);
List<GoodSkuProp> getList(String string);
......
......@@ -44,7 +44,7 @@ public class GoodSkuPropServiceImpl extends ServiceImpl<GoodSkuPropMapper, GoodS
}
@Override
public List<Map<String, Object>> getSkuPropListBySkuId(String skuId, boolean hideSku) {
public List<Map<String, Object>> getSkuPropListBySkuId(String skuId) {
List<Map<String, Object>> skuProp = goodRedis.getSkuProp(skuId);
if (skuProp != null) {
return skuProp;
......@@ -59,14 +59,7 @@ public class GoodSkuPropServiceImpl extends ServiceImpl<GoodSkuPropMapper, GoodS
for (GoodSkuProp prop : list) {
Map<String, Object> map = new HashMap<>();
map.put("name", prop.getPropKey());
/**
* 待支付的盲盒订单需要隐藏规格信息
*/
if (hideSku){
map.put("value", GoodMainConst.DEFAULT_PROP_VALUE);
}else{
map.put("value", prop.getPropVal());
}
map.put("value", prop.getPropVal());
skuProp.add(map);
}
goodRedis.setSkuProp(skuId, skuProp);
......@@ -75,12 +68,6 @@ public class GoodSkuPropServiceImpl extends ServiceImpl<GoodSkuPropMapper, GoodS
}
@Override
public List<Map<String, Object>> getSkuPropListBySkuId(String skuId) {
return getSkuPropListBySkuId(skuId, false);
}
@Override
public List<GoodSkuProp> getList(String string) {
QueryWrapper<GoodSkuProp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("sku_id", string);
......
......@@ -185,8 +185,13 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
*/
boolean hideSku = orderVO.getOrderState() == OrderStateEnum.ORDER_STATE_TO_PAY.getState() &&
goodSpu.getSalesType() == GoodSpuSalesTypeEnum.BLIND_BOX.getType();
List<Map<String, Object>> skuPropListMap = skuPropService.getSkuPropListBySkuId(skuId, hideSku);
vo.setPropList(skuPropListMap);
if(hideSku){
vo.setSkuId(null);
}else{
List<Map<String, Object>> skuPropListMap = skuPropService.getSkuPropListBySkuId(skuId);
vo.setPropList(skuPropListMap);
}
vo.setSalesType(goodSpu.getSalesType());
orders.add(vo);
}
orderVO.setOrders(orders);
......@@ -1395,29 +1400,35 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
}
/**
* 3.计算本次下单可享受的促销优惠:优惠券+促销活动
* (一幕沒有优惠券和促销活动)
* 3.计算本次下单可享受的促销优惠:优惠券+促销活动(一幕沒有优惠券和促销活动)
*/
List<OrderSkuVo> orderSkuVoList = new ArrayList<>();
OrderSkuVo orderSkuVo = new OrderSkuVo();
orderSkuVo.setSkuId(skuVo.getSkuId());
orderSkuVo.setNum(orderDetail.getNumber());
BigDecimal promotionDiscountAmount = sumPromotionDiscount(skuVo, orderSkuVoList, type, oid);
BigDecimal promotionDiscountAmount = BigDecimal.ZERO;
// BigDecimal promotionDiscountAmount = sumPromotionDiscount(skuVo, orderSkuVoList, type, oid);
/**
* 优惠券
*/
BigDecimal couponDiscountAmount = sumCouponDiscount(uid, type, orderVo.getGoodsIdCouponIdList(), orderSkuVoList, skuVo.getMerchantId(), oid);
BigDecimal couponDiscountAmount = BigDecimal.ZERO;
// BigDecimal couponDiscountAmount = sumCouponDiscount(uid, type, orderVo.getGoodsIdCouponIdList(), orderSkuVoList, skuVo.getMerchantId(), oid);
/**
* (一幕沒有积分抵扣)
* 4.最终支付时,扣除用于抵扣的积分并生成积分抵扣记录
*/
String payId = OrderUtil.getPayId();
BigDecimal skuAmount = skuVo.getBlindBoxprice().multiply(GoodMainConst.BLIND_BOX_ORDER_SKU_NUM_BIGDECIMAL);
BigDecimal discountAmount = promotionDiscountAmount.add(couponDiscountAmount);
BigDecimal payableAmount = BigDecimal.ZERO;
payableAmount = payableAmount.add(skuAmount).add(postFee).subtract(discountAmount)
.compareTo(BigDecimal.ZERO) == CommonConst.BIEDICIMAL_LEFT_LESS ? BigDecimal.ZERO : payableAmount;
BigDecimal integralDeductionNum = saveIntegralRecord(payableAmount, orderVo, uid, payId);
payableAmount = payableAmount.add(skuAmount).add(postFee).subtract(discountAmount);
payableAmount = payableAmount.compareTo(BigDecimal.ZERO) == CommonConst.BIEDICIMAL_LEFT_LESS ? BigDecimal.ZERO : payableAmount;
BigDecimal integralDeductionNum = BigDecimal.ZERO;
// BigDecimal integralDeductionNum = saveIntegralRecord(payableAmount, orderVo, uid, payId);
/**
* 5.生成支付单order_pay和订单order_info
......
......@@ -19,6 +19,6 @@ import java.util.List;
*/
public interface FootMapper extends BaseMapper<Foot> {
@Select("select b.merchant_id,b.goods_id,b.type,b.name,b.thumb,b.default_price,a.update_time from user_foot a left join goods_spu b on a.goods_id = b.goods_id where a.uid = #{uid} and a.is_delete = 0 order by a.update_time desc limit #{start},#{size}")
@Select("select b.merchant_id,b.goods_id,b.type,b.name,b.thumb,b.default_price,a.update_time,b.sales_type from user_foot a left join goods_spu b on a.goods_id = b.goods_id where a.uid = #{uid} and a.is_delete = 0 order by a.update_time desc limit #{start},#{size}")
List<FootGoodsVo> getGoods(@Param("uid") String uid, @Param("start") int start, @Param("size") Integer size);
}
......@@ -26,4 +26,7 @@ public class FootGoodsVo {
private Integer type;
private Long updateTime;
@ApiModelProperty(value = "(销售方式)1.普通 4.盲盒")
private Integer salesType;
}
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