feat: memberIn增加充值类型type
This commit is contained in:
@@ -3,6 +3,8 @@ package com.chaozhanggui.system.cashierservice.constant;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public interface TableConstant {
|
||||
String CART_SEAT_ID = "-999";
|
||||
|
||||
@@ -64,5 +66,22 @@ public interface TableConstant {
|
||||
}
|
||||
}
|
||||
|
||||
class MemberIn {
|
||||
@Getter
|
||||
public enum Type {
|
||||
NORMAL(0),
|
||||
FREE_DINE(1);
|
||||
private final Integer value;
|
||||
|
||||
Type(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public boolean equalsVals(Integer value) {
|
||||
return Objects.equals(this.value, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ public class TbMemberIn implements Serializable {
|
||||
|
||||
private Integer orderId;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
||||
@@ -1027,16 +1027,18 @@ public class PayService {
|
||||
|
||||
// 霸王餐活动充值
|
||||
BigDecimal payAmount;
|
||||
TbMemberIn memberIn = new TbMemberIn();
|
||||
if (memberInDTO.getOrderId() != null) {
|
||||
payAmount = getFreeDineOrderInfo(memberInDTO);
|
||||
|
||||
memberIn.setType(TableConstant.MemberIn.Type.FREE_DINE.getValue());
|
||||
// 会员充值
|
||||
}else {
|
||||
payAmount = memberInDTO.getAmount().setScale(2, RoundingMode.DOWN);
|
||||
memberIn.setType(TableConstant.MemberIn.Type.NORMAL.getValue());
|
||||
|
||||
}
|
||||
|
||||
|
||||
TbMemberIn memberIn = new TbMemberIn();
|
||||
memberIn.setAmount(payAmount);
|
||||
memberIn.setUserId(Integer.valueOf(tbShopUser.getUserId()));
|
||||
memberIn.setCode(tbShopUser.getCode());
|
||||
|
||||
Reference in New Issue
Block a user