积分设置相关优化
This commit is contained in:
parent
5051fc7b0b
commit
a65f0ad384
@ -103,14 +103,18 @@ public class MemberPointExecute implements MemberRegisterEvent, GoodsCommentComp
|
||||
}
|
||||
case COMPLETED: {
|
||||
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
||||
//根据订单编号获取订单数据,如果订单促销类型不为空,并且订单促销类型为积分订单 则直接返回
|
||||
if (StringUtils.isNotEmpty(order.getOrderPromotionType()) && order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINTS.name())) {
|
||||
//如果是积分订单 则直接返回
|
||||
if (StringUtils.isNotEmpty(order.getOrderPromotionType())
|
||||
&& order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINTS.name())) {
|
||||
return;
|
||||
}
|
||||
//获取积分设置
|
||||
PointSetting pointSetting = getPointSetting();
|
||||
if (pointSetting.getConsumer() == 0) {
|
||||
return;
|
||||
}
|
||||
//计算赠送积分数量
|
||||
Double point = CurrencyUtil.mul(pointSetting.getMoney(), order.getFlowPrice(), 0);
|
||||
Double point = CurrencyUtil.mul(pointSetting.getConsumer(), order.getFlowPrice(), 0);
|
||||
//赠送会员积分
|
||||
memberService.updateMemberPoint(point.longValue(), PointTypeEnum.INCREASE.name(), order.getMemberId(), "会员下单,赠送积分" + point + "分");
|
||||
break;
|
||||
|
@ -20,7 +20,10 @@ public class PointSetting implements Serializable {
|
||||
@ApiModelProperty(value = "注册")
|
||||
private Integer register;
|
||||
|
||||
@ApiModelProperty(value = "1元等级*积分")
|
||||
@ApiModelProperty(value = "消费1元赠送多少积分")
|
||||
private Integer consumer;
|
||||
|
||||
@ApiModelProperty(value = "积分付款X积分=1元")
|
||||
private Integer money;
|
||||
|
||||
@ApiModelProperty(value = "每日签到积分")
|
||||
@ -32,5 +35,38 @@ public class PointSetting implements Serializable {
|
||||
@ApiModelProperty(value = "积分具体设置")
|
||||
private List<PointSettingItem> pointSettingItems = new ArrayList<>();
|
||||
|
||||
public Integer getRegister() {
|
||||
if (register == null || register < 0) {
|
||||
return 0;
|
||||
}
|
||||
return register;
|
||||
}
|
||||
|
||||
public Integer getMoney() {
|
||||
if (money == null || money < 0) {
|
||||
return 0;
|
||||
}
|
||||
return money;
|
||||
}
|
||||
|
||||
public Integer getConsumer() {
|
||||
if (consumer == null || consumer < 0) {
|
||||
return 0;
|
||||
}
|
||||
return consumer;
|
||||
}
|
||||
|
||||
public Integer getSignIn() {
|
||||
if (signIn == null || signIn < 0) {
|
||||
return 0;
|
||||
}
|
||||
return signIn;
|
||||
}
|
||||
|
||||
public Integer getComment() {
|
||||
if (comment == null || comment < 0) {
|
||||
return 0;
|
||||
}
|
||||
return comment;
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,17 @@ public class PointSettingItem implements Comparable<PointSettingItem> {
|
||||
@ApiModelProperty(value = "赠送积分")
|
||||
private Integer point;
|
||||
|
||||
public Integer getPoint() {
|
||||
if (point != null || point < 0) {
|
||||
return 0;
|
||||
}
|
||||
return point;
|
||||
}
|
||||
|
||||
public void setPoint(Integer point) {
|
||||
this.point = point;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(PointSettingItem pointSettingItem) {
|
||||
return this.day - pointSettingItem.getDay();
|
||||
|
Loading…
x
Reference in New Issue
Block a user