积分金额问题

This commit is contained in:
2025-11-07 16:24:18 +08:00
parent 0ae32af791
commit afb54aa740
3 changed files with 4 additions and 3 deletions

View File

@@ -36,7 +36,7 @@ public class UMemberPointsController {
*/
@GetMapping("pointsBasicSetting")
public CzgResult<PointsBasicSettingDTO> getPointsBasicSetting() {
Long shopId = StpKit.USER.getShopId(0L);
Long shopId = StpKit.USER.getShopId();
PointsBasicSetting entity = pointsBasicSettingService.getById(shopId);
PointsBasicSettingDTO data = BeanUtil.copyProperties(entity, PointsBasicSettingDTO.class);
return CzgResult.success(data);

View File

@@ -97,7 +97,7 @@ public class MemberPointsServiceImpl extends ServiceImpl<MemberPointsMapper, Mem
@Override
public OrderDeductionPointsDTO getMemberUsablePoints(Long shopUserId, BigDecimal orderAmount) {
MemberPoints entity = initMemberPoints(shopUserId);
Long shopId = entity.getSourceShopId();
Long shopId = entity.getMainShopId();
Integer accountPoints = entity.getAccountPoints();
OrderDeductionPointsDTO dto = new OrderDeductionPointsDTO();
dto.setAccountPoints(accountPoints);

View File

@@ -363,7 +363,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
param.getPointsDiscountAmount().compareTo(BigDecimal.ZERO) > 0);
}
// 积分校验
PointsBasicSetting pointSetting = pointsBasicService.getById(shopId);
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
PointsBasicSetting pointSetting = pointsBasicService.getById(mainShopId);
boolean usePointsDeduction = param.getPointsNum() > 0 || param.getPointsDiscountAmount().compareTo(BigDecimal.ZERO) > 0;
if (usePointsDeduction) {
if (pointSetting == null || !pointSetting.getEnableDeduction().equals(1)) {