兑换码优化
This commit is contained in:
@@ -22,21 +22,12 @@ public class MkRedemptionDTO implements Serializable {
|
|||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
|
||||||
* recharge充值码 coupon券兑换码
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "类型不为空")
|
|
||||||
private String type;
|
|
||||||
/**
|
/**
|
||||||
* 券码
|
* 券码
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "券码不为空")
|
@NotBlank(message = "券码不为空")
|
||||||
private String code;
|
private String code;
|
||||||
/**
|
|
||||||
* 门店id
|
|
||||||
*/
|
|
||||||
@NotNull(message = "门店不为空")
|
|
||||||
private Long shopId;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -285,12 +285,14 @@ public class MkRedemptionConfigServiceImpl extends ServiceImpl<MkCouponRedemptio
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void exchange(long userId, MkRedemptionDTO dto) {
|
public void exchange(long userId, MkRedemptionDTO dto) {
|
||||||
Long mainShopId = shopInfoService.getMainIdByShopId(dto.getShopId());
|
|
||||||
enableConfigService.checkEnable(mainShopId, dto.getShopId(), TableValueConstant.EnableConfig.Type.RECHARGE_REDEMPTION, true);
|
|
||||||
ShopUser shopUserInfo = shopUserService.getShopUserInfo(dto.getShopId(), userId);
|
|
||||||
|
|
||||||
MkRedemptionCode redemptionCode = codeService.getOne(new QueryWrapper().eq(MkRedemptionCode::getMainShopId, mainShopId).eq(MkRedemptionCode::getCode, dto.getCode()));
|
MkRedemptionCode redemptionCode = codeService.getOne(new QueryWrapper().eq(MkRedemptionCode::getCode, dto.getCode()));
|
||||||
AssertUtil.isNull(redemptionCode, "兑换码不存在");
|
AssertUtil.isNull(redemptionCode, "兑换码不存在");
|
||||||
|
Long mainShopId = redemptionCode.getMainShopId();
|
||||||
|
enableConfigService.checkEnable(mainShopId, mainShopId, TableValueConstant.EnableConfig.Type.RECHARGE_REDEMPTION, true);
|
||||||
|
ShopUser shopUserInfo = shopUserService.getShopUserInfo(mainShopId, userId);
|
||||||
|
|
||||||
|
|
||||||
AssertUtil.isTrue(redemptionCode.getStatus() != 0, "兑换码不存在");
|
AssertUtil.isTrue(redemptionCode.getStatus() != 0, "兑换码不存在");
|
||||||
|
|
||||||
MkRedemptionConfigVO config = detail(mainShopId, redemptionCode.getId());
|
MkRedemptionConfigVO config = detail(mainShopId, redemptionCode.getId());
|
||||||
|
|||||||
Reference in New Issue
Block a user