修改我的钱包bug
This commit is contained in:
@@ -85,7 +85,11 @@ public class PmsProductServiceImpl implements PmsProductService {
|
|||||||
log.info("c"+String.valueOf(product.getProductCategoryId()));
|
log.info("c"+String.valueOf(product.getProductCategoryId()));
|
||||||
log.info("d"+String.valueOf(product.getProductAttributeCategoryId()));
|
log.info("d"+String.valueOf(product.getProductAttributeCategoryId()));
|
||||||
product.setOriginalPrice(productParam.getPrice());
|
product.setOriginalPrice(productParam.getPrice());
|
||||||
|
|
||||||
productMapper.insertAll(product);
|
productMapper.insertAll(product);
|
||||||
|
productParam.getSkuStockList().forEach(item->{
|
||||||
|
item.setPrice(product.getPrice());
|
||||||
|
});
|
||||||
//根据促销类型设置价格:、阶梯价格、满减价格
|
//根据促销类型设置价格:、阶梯价格、满减价格
|
||||||
Long productId = product.getId();
|
Long productId = product.getId();
|
||||||
//会员价格
|
//会员价格
|
||||||
|
|||||||
@@ -109,10 +109,10 @@
|
|||||||
SELECT LAST_INSERT_ID()
|
SELECT LAST_INSERT_ID()
|
||||||
</selectKey>
|
</selectKey>
|
||||||
insert into ums_member_account_transaction (member_id, order_id, revenue_amount,
|
insert into ums_member_account_transaction (member_id, order_id, revenue_amount,
|
||||||
transaction_state, remarks, commission_ratio, transfer_payment_time, revenue_points)
|
transaction_state, remarks, commission_ratio, transfer_payment_time, revenue_points, flow_type)
|
||||||
values (#{memberId,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, #{revenueAmount,jdbcType=DECIMAL},
|
values (#{memberId,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, #{revenueAmount,jdbcType=DECIMAL},
|
||||||
#{transactionState,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, #{commissionRatio,jdbcType=INTEGER},
|
#{transactionState,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, #{commissionRatio,jdbcType=INTEGER},
|
||||||
#{transferPaymentTime,jdbcType=TIMESTAMP}, #{revenuePoints,jdbcType=INTEGER})
|
#{transferPaymentTime,jdbcType=TIMESTAMP}, #{revenuePoints,jdbcType=INTEGER}, #{flowType,jdbcType=INTEGER})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="com.buy507.mall.model.UmsMemberAccountTransaction">
|
<insert id="insertSelective" parameterType="com.buy507.mall.model.UmsMemberAccountTransaction">
|
||||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
|
|
||||||
<!-- 微信小程序支付 -->
|
<!-- 微信小程序支付 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>1.3.2</version>
|
<version>1.3.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|||||||
@@ -119,6 +119,17 @@ public class OrderResult {
|
|||||||
@ApiModelProperty(value = "积分兑换专区")
|
@ApiModelProperty(value = "积分兑换专区")
|
||||||
private Integer intergrationExchange;
|
private Integer intergrationExchange;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "订单类型")
|
||||||
|
private Integer orderType;
|
||||||
|
|
||||||
|
public Integer getOrderType() {
|
||||||
|
return orderType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderType(Integer orderType) {
|
||||||
|
this.orderType = orderType;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getIntergrationExchange() {
|
public Integer getIntergrationExchange() {
|
||||||
return intergrationExchange;
|
return intergrationExchange;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -377,7 +377,8 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
orderResult.setNote(order.getNote());
|
orderResult.setNote(order.getNote());
|
||||||
orderResult.setDeliveryCompany(order.getDeliveryCompany());
|
orderResult.setDeliveryCompany(order.getDeliveryCompany());
|
||||||
orderResult.setDeliverySn(order.getDeliverySn());
|
orderResult.setDeliverySn(order.getDeliverySn());
|
||||||
orderResult.setPaymentTime(order.getPaymentTime());
|
orderResult.setOrderType(order.getOrderType());
|
||||||
|
orderResult.setPaymentTime(new Date());
|
||||||
|
|
||||||
// 获取商品信息,判断是否是积分专区商品
|
// 获取商品信息,判断是否是积分专区商品
|
||||||
PmsProduct product = productMapper.getProductByOrderSn(order.getOrderSn());
|
PmsProduct product = productMapper.getProductByOrderSn(order.getOrderSn());
|
||||||
@@ -1402,6 +1403,17 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
updateStock(orderId);
|
updateStock(orderId);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//插入流水表积分
|
||||||
|
UmsMemberAccountTransaction accountTransaction = new UmsMemberAccountTransaction();
|
||||||
|
accountTransaction.setMemberId(member.getId());
|
||||||
|
accountTransaction.setOrderId(orderId);
|
||||||
|
accountTransaction.setFlowType(2);
|
||||||
|
accountTransaction.setTransferPaymentTime(order.getPaymentTime());
|
||||||
|
accountTransaction.setRevenuePoints(-totalPointsAmount.intValue());
|
||||||
|
PmsProduct pmsProduct = orderMapper.selectAll(order.getOrderSn());
|
||||||
|
accountTransaction.setRemarks( "商品名称" + pmsProduct.getName());
|
||||||
|
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||||
|
|
||||||
// 返还积分金额到前端
|
// 返还积分金额到前端
|
||||||
return CommonResult.success(totalPointsAmount, "支付成功");
|
return CommonResult.success(totalPointsAmount, "支付成功");
|
||||||
|
|
||||||
@@ -1442,16 +1454,6 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
// return CommonResult.validateFailed("无效订单");
|
// return CommonResult.validateFailed("无效订单");
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// //插入流水表
|
|
||||||
// UmsMemberAccountTransaction accountTransaction = new UmsMemberAccountTransaction();
|
|
||||||
// accountTransaction.setMemberId(member.getId());
|
|
||||||
// accountTransaction.setOrderId(orderId);
|
|
||||||
// accountTransaction.setTransferPaymentTime(order.getPaymentTime());
|
|
||||||
// accountTransaction.setRevenuePoints(totalPointsAmount.intValue());
|
|
||||||
// PmsProduct pmsProduct = orderMapper.selectAll(order.getOrderSn());
|
|
||||||
// accountTransaction.setRemarks( "商品名称" + pmsProduct.getName());
|
|
||||||
// umsMemberAccountTransactionMapper.insert(accountTransaction);
|
|
||||||
//
|
|
||||||
// Date date = new Date();
|
// Date date = new Date();
|
||||||
//
|
//
|
||||||
// //支付方式:0->未支付;1->支付宝;2->微信;3->线下支付;4->余额支付
|
// //支付方式:0->未支付;1->支付宝;2->微信;3->线下支付;4->余额支付
|
||||||
@@ -1568,6 +1570,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
UmsMemberAccountTransaction accountTransaction = new UmsMemberAccountTransaction();
|
UmsMemberAccountTransaction accountTransaction = new UmsMemberAccountTransaction();
|
||||||
accountTransaction.setMemberId(member.getId());
|
accountTransaction.setMemberId(member.getId());
|
||||||
accountTransaction.setOrderId(orderId);
|
accountTransaction.setOrderId(orderId);
|
||||||
|
accountTransaction.setFlowType(1);
|
||||||
accountTransaction.setTransferPaymentTime(orderResult.getPaymentTime());
|
accountTransaction.setTransferPaymentTime(orderResult.getPaymentTime());
|
||||||
accountTransaction.setRevenueAmount(payAmount.negate());
|
accountTransaction.setRevenueAmount(payAmount.negate());
|
||||||
PmsProduct pmsProduct = orderMapper.selectAll(orderResult.getOrderSn());
|
PmsProduct pmsProduct = orderMapper.selectAll(orderResult.getOrderSn());
|
||||||
@@ -1592,19 +1595,28 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
//增加基金积分
|
//增加基金积分
|
||||||
int fundPoints = (int)(rewardPoints * 0.05);
|
int fundPoints = (int)(rewardPoints * 0.05);
|
||||||
umsDevelopmentFundMapper.updatePoints(fundPoints);
|
umsDevelopmentFundMapper.updatePoints(fundPoints);
|
||||||
|
//插入流水表积分
|
||||||
// //积分分润逻辑
|
UmsMemberAccountTransaction transaction = new UmsMemberAccountTransaction();
|
||||||
// memberPointsSplitProfitService.pointsSplit(order);
|
transaction.setMemberId(member.getId());
|
||||||
|
transaction.setOrderId(orderId);
|
||||||
|
transaction.setFlowType(2);
|
||||||
|
transaction.setTransferPaymentTime(orderResult.getPaymentTime());
|
||||||
|
transaction.setRevenuePoints(rewardPoints);
|
||||||
|
transaction.setRemarks( "购买商品返还积分:" + pmsProduct.getName());
|
||||||
|
umsMemberAccountTransactionMapper.insert(transaction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 更新订单状态为已支付
|
// 更新订单状态为已支付
|
||||||
OmsOrder order = orderMapper.selectByPrimaryKey(orderId);
|
OmsOrder order = orderMapper.selectByPrimaryKey(orderId);
|
||||||
|
|
||||||
// 设置为余额支付
|
// 设置为余额支付
|
||||||
order.setPayType(5);
|
order.setPayType(5);
|
||||||
// 设置订单状态为已支付
|
// 设置订单状态为已支付
|
||||||
order.setStatus(2);
|
order.setStatus(2);
|
||||||
order.setPaymentTime(new Date());
|
order.setPaymentTime(new Date());
|
||||||
orderMapper.updateByPrimaryKey(order);
|
orderMapper.updateByPrimaryKey(order);
|
||||||
|
//积分分润逻辑
|
||||||
|
memberPointsSplitProfitService.pointsSplit(order);
|
||||||
|
|
||||||
// 处理库存、分销等后续操作
|
// 处理库存、分销等后续操作
|
||||||
executorService.execute(() -> {
|
executorService.execute(() -> {
|
||||||
@@ -2052,6 +2064,16 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
int fundPoints = (int)(rewardPoints * 0.05);
|
int fundPoints = (int)(rewardPoints * 0.05);
|
||||||
umsDevelopmentFundMapper.updatePoints(fundPoints);
|
umsDevelopmentFundMapper.updatePoints(fundPoints);
|
||||||
|
|
||||||
|
//插入流水表积分
|
||||||
|
UmsMemberAccountTransaction accountTransaction = new UmsMemberAccountTransaction();
|
||||||
|
accountTransaction.setMemberId(member.getId());
|
||||||
|
accountTransaction.setOrderId(order.getId());
|
||||||
|
accountTransaction.setFlowType(2);
|
||||||
|
accountTransaction.setTransferPaymentTime(order.getPaymentTime());
|
||||||
|
accountTransaction.setRevenuePoints(rewardPoints);
|
||||||
|
accountTransaction.setRemarks( "购买商品返还积分:" + pmsProduct.getName());
|
||||||
|
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||||
|
|
||||||
//积分分润逻辑
|
//积分分润逻辑
|
||||||
memberPointsSplitProfitService.pointsSplit(order);
|
memberPointsSplitProfitService.pointsSplit(order);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,8 +106,8 @@ becomeVipAmount: 899
|
|||||||
# 同等级分润比例
|
# 同等级分润比例
|
||||||
sameLevelProfit: 10
|
sameLevelProfit: 10
|
||||||
#店长升级金额
|
#店长升级金额
|
||||||
storeManagerAmount: 1000
|
storeManagerAmount: 10000
|
||||||
#代理升级金额
|
#代理升级金额
|
||||||
agentAmount: 1000
|
agentAmount: 50000
|
||||||
#市代理升级金额
|
#市代理升级金额
|
||||||
cityAgentAmount: 1000
|
cityAgentAmount: 100000
|
||||||
Reference in New Issue
Block a user