积分兑换后端开启。及积分支付
todo 下单选择类型,是积分计算积分。确认收货,不返积分,不计算佣金
This commit is contained in:
@ -240,6 +240,10 @@ public class OrderSupplyService {
|
|||||||
storeOrderService.yuePay(orderId,uid);
|
storeOrderService.yuePay(orderId,uid);
|
||||||
map.put("payMsg","余额支付成功");
|
map.put("payMsg","余额支付成功");
|
||||||
return map;
|
return map;
|
||||||
|
case INTEGRAL:
|
||||||
|
storeOrderService.integralPay(orderId,uid);
|
||||||
|
map.put("payMsg","积分兑换成功");
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
map.put("payMsg","订单生成失败");
|
map.put("payMsg","订单生成失败");
|
||||||
|
@ -7,7 +7,7 @@ spring:
|
|||||||
master:
|
master:
|
||||||
url: jdbc:mysql://localhost:3306/yshopb2c?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
|
url: jdbc:mysql://localhost:3306/yshopb2c?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
|
||||||
username: root
|
username: root
|
||||||
password: root
|
password: 123456
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
@ -20,7 +20,8 @@ public enum PayTypeEnum {
|
|||||||
|
|
||||||
ALI("alipay","支付宝支付"),
|
ALI("alipay","支付宝支付"),
|
||||||
WEIXIN("weixin","微信支付"),
|
WEIXIN("weixin","微信支付"),
|
||||||
YUE("yue","余额支付");
|
YUE("yue","余额支付"),
|
||||||
|
INTEGRAL("integral","积分兑换");
|
||||||
|
|
||||||
|
|
||||||
private String value;
|
private String value;
|
||||||
|
@ -250,6 +250,9 @@ public class OrderUtil {
|
|||||||
case "yue":
|
case "yue":
|
||||||
payTypeName = "余额支付";
|
payTypeName = "余额支付";
|
||||||
break;
|
break;
|
||||||
|
case "integral":
|
||||||
|
payTypeName = "积分兑换";
|
||||||
|
break;
|
||||||
case "offline":
|
case "offline":
|
||||||
payTypeName = "线下支付";
|
payTypeName = "线下支付";
|
||||||
break;
|
break;
|
||||||
|
@ -194,6 +194,12 @@ public interface YxStoreOrderService extends BaseService<YxStoreOrder>{
|
|||||||
*/
|
*/
|
||||||
void yuePay(String orderId,Long uid);
|
void yuePay(String orderId,Long uid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分兑换
|
||||||
|
* @param orderId 订单号
|
||||||
|
* @param uid 用户id
|
||||||
|
*/
|
||||||
|
void integralPay(String orderId,Long uid);
|
||||||
|
|
||||||
|
|
||||||
String aliPay(String orderId) throws Exception;
|
String aliPay(String orderId) throws Exception;
|
||||||
|
@ -1572,7 +1572,34 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分兑换
|
||||||
|
* @param orderId 订单号
|
||||||
|
* @param uid 用户id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void integralPay(String orderId, Long uid) {
|
||||||
|
YxStoreOrderQueryVo orderInfo = getOrderInfo(orderId,uid);
|
||||||
|
if(ObjectUtil.isNull(orderInfo)) {
|
||||||
|
throw new YshopException("订单不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(OrderInfoEnum.PAY_STATUS_1.getValue().equals(orderInfo.getPaid())) {
|
||||||
|
throw new YshopException("该订单已支付");
|
||||||
|
}
|
||||||
|
|
||||||
|
YxUserQueryVo userInfo = userService.getYxUserById(uid);
|
||||||
|
|
||||||
|
if(userInfo.getIntegral().compareTo(orderInfo.getPayIntegral()) < 0){
|
||||||
|
throw new YshopException("积分不足");
|
||||||
|
}
|
||||||
|
|
||||||
|
//扣除积分
|
||||||
|
userService.decIntegral(uid,orderInfo.getPayIntegral().doubleValue());
|
||||||
|
|
||||||
|
//支付成功后处理
|
||||||
|
this.paySuccess(orderInfo.getOrderId(),PayTypeEnum.YUE.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -71,6 +71,9 @@ public class YxStoreOrderQueryVo implements Serializable {
|
|||||||
@ApiModelProperty(value = "实际支付金额")
|
@ApiModelProperty(value = "实际支付金额")
|
||||||
private BigDecimal payPrice;
|
private BigDecimal payPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "实际支付积分")
|
||||||
|
private BigDecimal payIntegral;
|
||||||
|
|
||||||
@ApiModelProperty(value = "支付邮费")
|
@ApiModelProperty(value = "支付邮费")
|
||||||
private BigDecimal payPostage;
|
private BigDecimal payPostage;
|
||||||
|
|
||||||
|
@ -232,6 +232,9 @@ public class YxStoreProduct extends BaseDomain {
|
|||||||
@ApiModelProperty(value = "是否单独分佣")
|
@ApiModelProperty(value = "是否单独分佣")
|
||||||
private Integer isSub;
|
private Integer isSub;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否开启积分兑换")
|
||||||
|
private Integer isIntegral;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private YxStoreCategory storeCategory;
|
private YxStoreCategory storeCategory;
|
||||||
|
|
||||||
|
@ -122,6 +122,10 @@ public class YxStoreProductAttrValue implements Serializable {
|
|||||||
@ApiModelProperty(value = "二级返佣")
|
@ApiModelProperty(value = "二级返佣")
|
||||||
private BigDecimal brokerageTwo;
|
private BigDecimal brokerageTwo;
|
||||||
|
|
||||||
|
/** 所需多少积分兑换商品 */
|
||||||
|
@ApiModelProperty(value = "所需多少积分兑换商品")
|
||||||
|
private Integer integral;
|
||||||
|
|
||||||
|
|
||||||
public void copy(YxStoreProductAttrValue source){
|
public void copy(YxStoreProductAttrValue source){
|
||||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||||
|
@ -122,6 +122,10 @@ public class ProductDto
|
|||||||
@JsonProperty("is_sub")
|
@JsonProperty("is_sub")
|
||||||
private Integer isSub;
|
private Integer isSub;
|
||||||
|
|
||||||
|
/** 是否开启啊积分兑换 */
|
||||||
|
@JsonProperty("is_integral")
|
||||||
|
private Integer isIntegral;
|
||||||
|
|
||||||
/** 虚拟销量 */
|
/** 虚拟销量 */
|
||||||
private Long ficti;
|
private Long ficti;
|
||||||
|
|
||||||
|
@ -44,6 +44,8 @@ public class ProductFormatDto {
|
|||||||
|
|
||||||
private Integer stock = 0;
|
private Integer stock = 0;
|
||||||
|
|
||||||
|
private Integer integral = 0;
|
||||||
|
|
||||||
private String pic = "";
|
private String pic = "";
|
||||||
|
|
||||||
private String value1 = "";
|
private String value1 = "";
|
||||||
|
@ -125,6 +125,10 @@ public class StoreProductDto
|
|||||||
@JsonProperty("is_sub")
|
@JsonProperty("is_sub")
|
||||||
private Integer isSub;
|
private Integer isSub;
|
||||||
|
|
||||||
|
/** 是否开启啊积分兑换 */
|
||||||
|
@JsonProperty("is_integral")
|
||||||
|
private Integer isIntegral;
|
||||||
|
|
||||||
/** 虚拟销量 */
|
/** 虚拟销量 */
|
||||||
private Long ficti;
|
private Long ficti;
|
||||||
|
|
||||||
|
@ -112,6 +112,7 @@ public class YxStoreProductAttrServiceImpl extends BaseServiceImpl<StoreProductA
|
|||||||
.brokerage(BigDecimal.valueOf(productFormatDto.getBrokerage()))
|
.brokerage(BigDecimal.valueOf(productFormatDto.getBrokerage()))
|
||||||
.brokerageTwo(BigDecimal.valueOf(productFormatDto.getBrokerageTwo()))
|
.brokerageTwo(BigDecimal.valueOf(productFormatDto.getBrokerageTwo()))
|
||||||
.stock(productFormatDto.getStock())
|
.stock(productFormatDto.getStock())
|
||||||
|
.integral(productFormatDto.getIntegral())
|
||||||
.pinkPrice(BigDecimal.valueOf(productFormatDto.getPinkPrice()==null?0:productFormatDto.getPinkPrice()))
|
.pinkPrice(BigDecimal.valueOf(productFormatDto.getPinkPrice()==null?0:productFormatDto.getPinkPrice()))
|
||||||
.seckillPrice(BigDecimal.valueOf(productFormatDto.getSeckillPrice()==null?0:productFormatDto.getSeckillPrice()))
|
.seckillPrice(BigDecimal.valueOf(productFormatDto.getSeckillPrice()==null?0:productFormatDto.getSeckillPrice()))
|
||||||
.pinkStock(productFormatDto.getPinkStock()==null?0:productFormatDto.getPinkStock())
|
.pinkStock(productFormatDto.getPinkStock()==null?0:productFormatDto.getPinkStock())
|
||||||
|
@ -235,6 +235,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(YxStoreProduct::getIsShow, CommonEnum.SHOW_STATUS_1.getValue());
|
wrapper.eq(YxStoreProduct::getIsShow, CommonEnum.SHOW_STATUS_1.getValue());
|
||||||
wrapper.eq(YxStoreProduct::getIsDel, CommonEnum.DEL_STATUS_0.getValue());
|
wrapper.eq(YxStoreProduct::getIsDel, CommonEnum.DEL_STATUS_0.getValue());
|
||||||
|
// wrapper.eq(YxStoreProduct::getIsIntegral, CommonEnum.SHOW_STATUS_1.getValue());
|
||||||
|
|
||||||
//多字段模糊查询分类搜索
|
//多字段模糊查询分类搜索
|
||||||
if (StrUtil.isNotBlank(productQueryParam.getSid()) &&
|
if (StrUtil.isNotBlank(productQueryParam.getSid()) &&
|
||||||
@ -411,6 +412,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
|
|
||||||
LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue())
|
wrapper.eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue())
|
||||||
|
// .eq(YxStoreProduct::getIsIntegral,CommonEnum.SHOW_STATUS_1.getValue())
|
||||||
.orderByDesc(YxStoreProduct::getSort);
|
.orderByDesc(YxStoreProduct::getSort);
|
||||||
|
|
||||||
// order
|
// order
|
||||||
@ -679,6 +681,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
valueMap.put("seckill_price", 0);
|
valueMap.put("seckill_price", 0);
|
||||||
valueMap.put("pink_stock", 0);
|
valueMap.put("pink_stock", 0);
|
||||||
valueMap.put("seckill_stock", 0);
|
valueMap.put("seckill_stock", 0);
|
||||||
|
valueMap.put("integral", 0);
|
||||||
if (id > 0) {
|
if (id > 0) {
|
||||||
YxStoreProductAttrValue storeProductAttrValue = yxStoreProductAttrValueService
|
YxStoreProductAttrValue storeProductAttrValue = yxStoreProductAttrValueService
|
||||||
.getOne(Wrappers.<YxStoreProductAttrValue>lambdaQuery()
|
.getOne(Wrappers.<YxStoreProductAttrValue>lambdaQuery()
|
||||||
@ -699,6 +702,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
valueMap.put("seckill_price", storeProductAttrValue.getSeckillPrice());
|
valueMap.put("seckill_price", storeProductAttrValue.getSeckillPrice());
|
||||||
valueMap.put("pink_stock", storeProductAttrValue.getPinkStock());
|
valueMap.put("pink_stock", storeProductAttrValue.getPinkStock());
|
||||||
valueMap.put("seckill_stock", storeProductAttrValue.getSeckillStock());
|
valueMap.put("seckill_stock", storeProductAttrValue.getSeckillStock());
|
||||||
|
valueMap.put("integral", storeProductAttrValue.getIntegral());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -830,6 +834,13 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
headerMap.put("slot", "volume");
|
headerMap.put("slot", "volume");
|
||||||
headerMap.put("align", align);
|
headerMap.put("align", align);
|
||||||
headerMap.put("minWidth", 140);
|
headerMap.put("minWidth", 140);
|
||||||
|
headerMapList.add(ObjectUtil.clone(headerMap));
|
||||||
|
|
||||||
|
headerMap.put("title", "所需兑换积分");
|
||||||
|
headerMap.put("slot", "integral");
|
||||||
|
headerMap.put("align", align);
|
||||||
|
headerMap.put("minWidth", 140);
|
||||||
|
headerMapList.add(ObjectUtil.clone(headerMap));
|
||||||
|
|
||||||
if (isActivity) {
|
if (isActivity) {
|
||||||
headerMap.put("title", "拼团价");
|
headerMap.put("title", "拼团价");
|
||||||
|
@ -149,5 +149,8 @@ public class YxStoreProductQueryVo implements Serializable {
|
|||||||
@ApiModelProperty(value = "规格 0单 1多 ")
|
@ApiModelProperty(value = "规格 0单 1多 ")
|
||||||
private Integer specType;
|
private Integer specType;
|
||||||
|
|
||||||
|
/** 是否开启积分兑换*/
|
||||||
|
@ApiModelProperty(value = "是否开启积分兑换")
|
||||||
|
private Integer isIntegral;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user