修改我的钱包bug

This commit is contained in:
2025-02-27 15:23:39 +08:00
parent 392da5a396
commit d64f5b4bbb
6 changed files with 57 additions and 20 deletions

View File

@@ -85,7 +85,11 @@ public class PmsProductServiceImpl implements PmsProductService {
log.info("c"+String.valueOf(product.getProductCategoryId()));
log.info("d"+String.valueOf(product.getProductAttributeCategoryId()));
product.setOriginalPrice(productParam.getPrice());
productMapper.insertAll(product);
productParam.getSkuStockList().forEach(item->{
item.setPrice(product.getPrice());
});
//根据促销类型设置价格:、阶梯价格、满减价格
Long productId = product.getId();
//会员价格

View File

@@ -109,10 +109,10 @@
SELECT LAST_INSERT_ID()
</selectKey>
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},
#{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 id="insertSelective" parameterType="com.buy507.mall.model.UmsMemberAccountTransaction">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">

View File

@@ -80,7 +80,7 @@
<!-- 微信小程序支付 -->
<dependency>
<groupId>org.apache.commons</groupId>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>

View File

@@ -119,6 +119,17 @@ public class OrderResult {
@ApiModelProperty(value = "积分兑换专区")
private Integer intergrationExchange;
@ApiModelProperty(value = "订单类型")
private Integer orderType;
public Integer getOrderType() {
return orderType;
}
public void setOrderType(Integer orderType) {
this.orderType = orderType;
}
public Integer getIntergrationExchange() {
return intergrationExchange;
}

View File

@@ -377,7 +377,8 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
orderResult.setNote(order.getNote());
orderResult.setDeliveryCompany(order.getDeliveryCompany());
orderResult.setDeliverySn(order.getDeliverySn());
orderResult.setPaymentTime(order.getPaymentTime());
orderResult.setOrderType(order.getOrderType());
orderResult.setPaymentTime(new Date());
// 获取商品信息,判断是否是积分专区商品
PmsProduct product = productMapper.getProductByOrderSn(order.getOrderSn());
@@ -1402,6 +1403,17 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
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, "支付成功");
@@ -1442,16 +1454,6 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
// 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();
//
// //支付方式0->未支付1->支付宝2->微信3->线下支付4->余额支付
@@ -1568,6 +1570,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
UmsMemberAccountTransaction accountTransaction = new UmsMemberAccountTransaction();
accountTransaction.setMemberId(member.getId());
accountTransaction.setOrderId(orderId);
accountTransaction.setFlowType(1);
accountTransaction.setTransferPaymentTime(orderResult.getPaymentTime());
accountTransaction.setRevenueAmount(payAmount.negate());
PmsProduct pmsProduct = orderMapper.selectAll(orderResult.getOrderSn());
@@ -1592,19 +1595,28 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
//增加基金积分
int fundPoints = (int)(rewardPoints * 0.05);
umsDevelopmentFundMapper.updatePoints(fundPoints);
// //积分分润逻辑
// memberPointsSplitProfitService.pointsSplit(order);
//插入流水表积分
UmsMemberAccountTransaction transaction = new UmsMemberAccountTransaction();
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);
// 设置为余额支付
order.setPayType(5);
// 设置订单状态为已支付
order.setStatus(2);
order.setPaymentTime(new Date());
orderMapper.updateByPrimaryKey(order);
//积分分润逻辑
memberPointsSplitProfitService.pointsSplit(order);
// 处理库存、分销等后续操作
executorService.execute(() -> {
@@ -2052,6 +2064,16 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
int fundPoints = (int)(rewardPoints * 0.05);
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);
}

View File

@@ -106,8 +106,8 @@ becomeVipAmount: 899
# 同等级分润比例
sameLevelProfit: 10
#店长升级金额
storeManagerAmount: 1000
storeManagerAmount: 10000
#代理升级金额
agentAmount: 1000
agentAmount: 50000
#市代理升级金额
cityAgentAmount: 1000
cityAgentAmount: 100000