You've already forked FrameTour-BE
refactor(order): 移除优惠券相关业务逻辑
- 删除 CouponBiz 类及其所有方法调用 - 移除 OrderBiz 中对优惠券使用的处理逻辑 - 清理 PriceBiz 中与优惠券查询相关的代码 - 移除 GoodsServiceImpl 中的优惠券查询功能 - 删除 OrderServiceImpl 中创建订单时的优惠券计算逻辑 - 移除多个类中对 CouponBiz 的依赖注入 - 清理与优惠券记录和折扣价格计算相关的冗余代码
This commit is contained in:
@@ -17,6 +17,7 @@ import com.ycwl.basic.puzzle.entity.PuzzleTemplateEntity;
|
||||
import com.ycwl.basic.puzzle.mapper.PuzzleTemplateMapper;
|
||||
import com.ycwl.basic.repository.FaceRepository;
|
||||
import com.ycwl.basic.repository.MemberRelationRepository;
|
||||
import com.ycwl.basic.repository.OrderRepository;
|
||||
import com.ycwl.basic.repository.PriceRepository;
|
||||
import com.ycwl.basic.repository.ScenicRepository;
|
||||
import com.ycwl.basic.repository.TemplateRepository;
|
||||
@@ -45,16 +46,13 @@ public class PriceBiz {
|
||||
@Autowired
|
||||
private FaceRepository faceRepository;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private FaceService faceService;
|
||||
@Autowired
|
||||
private CouponBiz couponBiz;
|
||||
@Autowired
|
||||
private MemberRelationRepository memberRelationRepository;
|
||||
@Autowired
|
||||
private PuzzleTemplateMapper puzzleTemplateMapper;
|
||||
@Autowired
|
||||
private IProductTypeCapabilityManagementService productTypeCapabilityManagementService;
|
||||
@Autowired
|
||||
private OrderRepository orderRepository;
|
||||
|
||||
public List<GoodsListRespVO> listGoodsByScenic(Long scenicId) {
|
||||
List<GoodsListRespVO> goodsList = new ArrayList<>();
|
||||
@@ -231,30 +229,6 @@ 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);
|
||||
@@ -283,7 +257,7 @@ public class PriceBiz {
|
||||
allContentsPurchased = false;
|
||||
break;
|
||||
}
|
||||
boolean hasPurchasedTemplate = orderBiz.checkUserBuyFaceItem(userId, faceId, -1, videoEntities.getFirst().getVideoId());
|
||||
boolean hasPurchasedTemplate = orderRepository.checkUserBuyFaceItem(userId, faceId, -1, videoEntities.getFirst().getVideoId());
|
||||
if (!hasPurchasedTemplate) {
|
||||
allContentsPurchased = false;
|
||||
break;
|
||||
@@ -295,7 +269,7 @@ public class PriceBiz {
|
||||
if (scenicConfig != null) {
|
||||
// 检查录像集
|
||||
if (!Boolean.TRUE.equals(scenicConfig.getDisableSourceVideo())) {
|
||||
boolean hasPurchasedRecording = orderBiz.checkUserBuyFaceItem(userId, faceId, 1, faceId);
|
||||
boolean hasPurchasedRecording = orderRepository.checkUserBuyFaceItem(userId, faceId, 1, faceId);
|
||||
if (!hasPurchasedRecording) {
|
||||
allContentsPurchased = false;
|
||||
}
|
||||
@@ -303,7 +277,7 @@ public class PriceBiz {
|
||||
|
||||
// 检查照片集
|
||||
if (allContentsPurchased && !Boolean.TRUE.equals(scenicConfig.getDisableSourceImage())) {
|
||||
boolean hasPurchasedPhoto = orderBiz.checkUserBuyFaceItem(userId, faceId, 2, faceId);
|
||||
boolean hasPurchasedPhoto = orderRepository.checkUserBuyFaceItem(userId, faceId, 2, faceId);
|
||||
if (!hasPurchasedPhoto) {
|
||||
allContentsPurchased = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user