订单表新增支付积分

This commit is contained in:
朱耘稷
2020-12-21 16:57:04 +08:00
committed by xuwenbo
parent 2009d64524
commit a467f4d32f
3 changed files with 8 additions and 2 deletions

View File

@ -6,5 +6,6 @@
ALTER TABLE yx_store_product ADD COLUMN is_integral tinyint(1) ZEROFILL NULL DEFAULT 0 COMMENT '是开启积分兑换' AFTER is_del;
ALTER TABLE yx_store_product_attr_value ADD COLUMN integral INT(10) DEFAULT 0 COMMENT '需要多少积分兑换' AFTER seckill_price;
ALTER TABLE yx_store_order ADD COLUMN `pay_integral` decimal(8, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '支付积分';

View File

@ -11,6 +11,7 @@ import co.yixiang.domain.BaseDomain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -236,6 +237,8 @@ public class YxStoreOrder extends BaseDomain {
private Integer isSystemDel;
@ApiModelProperty(value = "实际支付积分")
private BigDecimal payIntegral;
public void copy(YxStoreOrder source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));

View File

@ -1442,8 +1442,10 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
if(PayTypeEnum.WEIXIN.getValue().equals(order.getPayType())){
statusDTO.set_payType("微信支付");
}else{
}else if(PayTypeEnum.YUE.getValue().equals(order.getPayType())){
statusDTO.set_payType("余额支付");
}else{
statusDTO.set_payType("积分兑换");
}
order.set_status(statusDTO);
@ -1598,7 +1600,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
userService.decIntegral(uid,orderInfo.getPayIntegral().doubleValue());
//支付成功后处理
this.paySuccess(orderInfo.getOrderId(),PayTypeEnum.YUE.getValue());
this.paySuccess(orderInfo.getOrderId(),PayTypeEnum.INTEGRAL.getValue());
}