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:
@@ -298,19 +298,8 @@ public class OrderServiceImpl implements OrderService {
|
||||
goods.setUrl(videoMapperById.getVideoUrl());
|
||||
goods.setGoodsType(0);
|
||||
goods.setTemplateCoverUrl(template.getCoverUrl());
|
||||
long deviceCount;
|
||||
if (task.getTaskParams() == null) {
|
||||
deviceCount = 1;
|
||||
} else {
|
||||
Map<String, Object> paramJson = JacksonUtil.parseObject(task.getTaskParams(), Map.class);
|
||||
List<String> templatePlaceholder = templateRepository.getTemplatePlaceholder(task.getTemplateId());
|
||||
deviceCount = paramJson.keySet().stream()
|
||||
.filter(StringUtils::isNumeric)
|
||||
.filter(templatePlaceholder::contains)
|
||||
.count();
|
||||
}
|
||||
goods.setCreateTime(videoTaskRepository.getTaskShotDate(task.getId()));
|
||||
goods.setParts(Math.toIntExact(deviceCount));
|
||||
goods.setParts(videoTaskRepository.getTaskDeviceCount(task.getId()));
|
||||
goodsList.add(goods);
|
||||
item.setShootingTime(videoTaskRepository.getTaskShotDate(videoMapperById.getTaskId()));
|
||||
item.setVideoUrl(videoMapperById.getVideoUrl());
|
||||
|
||||
Reference in New Issue
Block a user