You've already forked FrameTour-BE
refactor(biz): 重构Vlog 视频价格计算逻辑
All checks were successful
ZhenTu-BE/pipeline/head This commit looks good
All checks were successful
ZhenTu-BE/pipeline/head This commit looks good
- 移除 OrderBiz 中的固定价格设置,改为调用价格计算服务 - 删除 PriceBiz 中未使用的 IOnePricePurchaseService 注入 - 优化 AppOrderV2Controller 中的产品数量设置逻辑 - 新增 VideoTaskRepository 中的 getTaskDeviceCount 方法,用于获取任务设备数量 - 调整 GoodsServiceImpl 和 OrderServiceImpl 中的相关代码,使用新的设备数量获取方法
This commit is contained in:
@@ -117,13 +117,18 @@ public class OrderBiz {
|
||||
if (template == null) {
|
||||
return priceObj;
|
||||
}
|
||||
priceObj.setPrice(template.getPrice());
|
||||
BigDecimal slashPrice = template.getSlashPrice();
|
||||
if (slashPrice == null) {
|
||||
priceObj.setSlashPrice(priceObj.getPrice());
|
||||
} else {
|
||||
priceObj.setSlashPrice(slashPrice);
|
||||
}
|
||||
PriceCalculationRequest vlogCalculationRequest = new PriceCalculationRequest();
|
||||
ProductItem vlogProductItem = new ProductItem();
|
||||
vlogProductItem.setProductType(ProductType.VLOG_VIDEO);
|
||||
vlogProductItem.setProductId(template.getId().toString());
|
||||
vlogProductItem.setQuantity(videoTaskRepository.getTaskDeviceCount(video.getTaskId()));
|
||||
vlogProductItem.setScenicId(scenic.getId().toString());
|
||||
vlogCalculationRequest.setProducts(Collections.singletonList(vlogProductItem));
|
||||
vlogCalculationRequest.setFaceId(priceObj.getFaceId());
|
||||
PriceCalculationResult vlogCalculationResult = iPriceCalculationService.calculatePrice(vlogCalculationRequest);
|
||||
priceObj.setPrice(vlogCalculationResult.getFinalAmount());
|
||||
priceObj.setSlashPrice(vlogCalculationResult.getOriginalAmount());
|
||||
priceObj.setFaceId(goodsId);
|
||||
priceObj.setScenicId(video.getScenicId());
|
||||
break;
|
||||
case 1: // source
|
||||
|
@@ -39,8 +39,6 @@ public class PriceBiz {
|
||||
private FaceRepository faceRepository;
|
||||
@Autowired
|
||||
private CouponBiz couponBiz;
|
||||
@Autowired
|
||||
private IOnePricePurchaseService onePricePurchaseService;
|
||||
|
||||
public List<GoodsListRespVO> listGoodsByScenic(Long scenicId) {
|
||||
List<GoodsListRespVO> goodsList = new ArrayList<>();
|
||||
|
Reference in New Issue
Block a user