master:档口购买推广营销接口增加入参;
parent
0f2a9986a1
commit
e0bcade7df
|
|
@ -45,8 +45,10 @@ public class AdRoundStoreCreateVO {
|
|||
@NotBlank(message = "对象锁符号不能为空!")
|
||||
@ApiModelProperty(value = "对象锁符号", required = true)
|
||||
private String symbol;
|
||||
@NotBlank(message = "交易密码不能为空!")
|
||||
@ApiModelProperty(value = "交易密码", required = true)
|
||||
@NotNull(message = "支付方式不能为空!")
|
||||
@ApiModelProperty(value = "支付方式", required = true)
|
||||
private Integer payWay;
|
||||
@ApiModelProperty(value = "交易密码")
|
||||
private String transactionPassword;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
|
|
@ -35,6 +36,8 @@ public class AdRoundStoreCreateDTO {
|
|||
private String prodIdStr;
|
||||
@ApiModelProperty(value = "对象锁符号")
|
||||
private String symbol;
|
||||
@ApiModelProperty(value = "支付方式")
|
||||
private Integer payWay;
|
||||
@ApiModelProperty(value = "交易密码")
|
||||
private String transactionPassword;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
package com.ruoyi.xkt.enums;
|
||||
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-04-02 23:42
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum AdPayWay {
|
||||
|
||||
BALANCE(1, "余额支付"),
|
||||
ALIPAY(2, "支付宝支付"),
|
||||
|
||||
;
|
||||
|
||||
private final Integer value;
|
||||
private final String label;
|
||||
|
||||
public static AdPayWay of(Integer value) {
|
||||
for (AdPayWay e : AdPayWay.values()) {
|
||||
if (e.getValue().equals(value)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
throw new ServiceException("推广支付方式不存在!");
|
||||
}
|
||||
}
|
||||
|
|
@ -623,6 +623,13 @@ public class AdvertRoundServiceImpl implements IAdvertRoundService {
|
|||
if (!SecurityUtils.isAdmin() && !SecurityUtils.isStoreManagerOrSub(createDTO.getStoreId())) {
|
||||
throw new ServiceException("当前用户非档口管理者或子账号,无权限操作!", HttpStatus.ERROR);
|
||||
}
|
||||
//校验推广支付方式是否存在
|
||||
AdPayWay.of(createDTO.getPayWay());
|
||||
// 校验使用余额情况下,密码是否正确
|
||||
if (Objects.equals(createDTO.getPayWay(), AdPayWay.BALANCE.getValue())
|
||||
&& !assetService.checkTransactionPassword(createDTO.getStoreId(), createDTO.getTransactionPassword())) {
|
||||
throw new ServiceException("支付密码错误!请重新输入", HttpStatus.ERROR);
|
||||
}
|
||||
// 当前营销推广位的锁
|
||||
Object lockObj = Optional.ofNullable(advertLockMap.get(createDTO.getSymbol())).orElseThrow(() -> new ServiceException("symbol不存在!", HttpStatus.ERROR));
|
||||
synchronized (lockObj) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue