fix(face): 修复人脸购买逻辑判断问题

- 修改AppPuzzleController中的人脸购买判断逻辑
- 增加对景区是否购买的前置判断
- 优化FaceServiceImpl中的人脸购买状态设置逻辑
- 确保模板购买状态的准确判断
- 避免重复查询价格计算服务
This commit is contained in:
2025-12-13 23:47:29 +08:00
parent 0a3f4119d7
commit 07987835ec
2 changed files with 30 additions and 20 deletions

View File

@@ -205,6 +205,10 @@ public class AppPuzzleController {
// 设置模板ID
vo.setTemplateId(record.getTemplateId());
IsBuyRespVO isBuyScenic = orderBiz.isBuy(face.getScenicId(), face.getMemberId(), face.getId(), 5, face.getScenicId());
if (isBuyScenic.isBuy()) {
vo.setIsBuy(1);
} else {
IsBuyRespVO isBuyRespVO = orderBiz.isBuy(face.getScenicId(), face.getMemberId(), face.getId(), 5, record.getTemplateId());
if (isBuyRespVO.isBuy()) {
vo.setIsBuy(1);
@@ -227,6 +231,7 @@ public class AppPuzzleController {
vo.setFreeCount(1);
}
}
}
return vo;
}
}

View File

@@ -502,6 +502,10 @@ public class FaceServiceImpl implements FaceService {
sfpContent.setGoodsType(3);
sfpContent.setSort(0);
if (optionalRecord.isPresent()) {
IsBuyRespVO isBuyScenic = orderBiz.isBuy(face.getScenicId(), face.getMemberId(), faceId, 5, face.getScenicId());
if (isBuyScenic.isBuy()) {
sfpContent.setIsBuy(1);
} else {
IsBuyRespVO isBuyRespVO = orderBiz.isBuy(face.getScenicId(), face.getMemberId(), faceId, 5, optionalRecord.get().getTemplateId());
if (isBuyRespVO.isBuy()) {
sfpContent.setIsBuy(1);
@@ -509,6 +513,7 @@ public class FaceServiceImpl implements FaceService {
sfpContent.setIsBuy(0);
}
}
}
PriceCalculationRequest calculationRequest = new PriceCalculationRequest();
ProductItem productItem = new ProductItem();
productItem.setProductType(ProductType.PHOTO_LOG);