You've already forked FrameTour-BE
优惠券、通知加参数
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
package com.ycwl.basic.biz;
|
||||
|
||||
import com.ycwl.basic.model.mobile.order.IsBuyBatchRespVO;
|
||||
import com.ycwl.basic.model.mobile.order.IsBuyRespVO;
|
||||
import com.ycwl.basic.model.pc.coupon.entity.CouponEntity;
|
||||
import com.ycwl.basic.model.pc.couponRecord.resp.CouponRecordQueryResp;
|
||||
import com.ycwl.basic.model.pc.face.entity.FaceEntity;
|
||||
import com.ycwl.basic.model.pc.order.entity.OrderEntity;
|
||||
import com.ycwl.basic.model.pc.price.entity.PriceConfigEntity;
|
||||
@@ -34,6 +35,8 @@ public class PriceBiz {
|
||||
private OrderBiz orderBiz;
|
||||
@Autowired
|
||||
private FaceRepository faceRepository;
|
||||
@Autowired
|
||||
private CouponBiz couponBiz;
|
||||
|
||||
public List<GoodsListRespVO> listGoodsByScenic(Long scenicId) {
|
||||
List<GoodsListRespVO> goodsList = new ArrayList<>();
|
||||
@@ -96,6 +99,30 @@ public class PriceBiz {
|
||||
return respVO;
|
||||
}
|
||||
}
|
||||
switch (type) {
|
||||
case 0: // 单个定价
|
||||
CouponRecordQueryResp recordQueryResp = couponBiz.queryUserCouponRecord(scenicId, userId, faceId, goodsIds);
|
||||
if (recordQueryResp.isUsable()) {
|
||||
respVO.setCouponId(recordQueryResp.getCouponId());
|
||||
respVO.setCouponRecordId(recordQueryResp.getId());
|
||||
CouponEntity coupon = recordQueryResp.getCoupon();
|
||||
if (coupon != null) {
|
||||
respVO.setCouponPrice(coupon.calculateDiscountPrice(priceConfig.getPrice()));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case -1:
|
||||
CouponRecordQueryResp oneCouponRecordQueryResp = couponBiz.queryUserCouponRecord(scenicId, userId, faceId, "-1");
|
||||
if (oneCouponRecordQueryResp.isUsable()) {
|
||||
respVO.setCouponId(oneCouponRecordQueryResp.getCouponId());
|
||||
respVO.setCouponRecordId(oneCouponRecordQueryResp.getId());
|
||||
CouponEntity coupon = oneCouponRecordQueryResp.getCoupon();
|
||||
if (coupon != null) {
|
||||
respVO.setCouponPrice(coupon.calculateDiscountPrice(priceConfig.getPrice()));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
respVO.setConfigId(priceConfig.getId());
|
||||
respVO.setGoodsIds(goodsIds);
|
||||
respVO.setType(type);
|
||||
|
Reference in New Issue
Block a user