修改bug
This commit is contained in:
@@ -29,4 +29,6 @@ public interface OmsOrderItemMapper {
|
|||||||
int updateByPrimaryKey(OmsOrderItem record);
|
int updateByPrimaryKey(OmsOrderItem record);
|
||||||
|
|
||||||
OmsOrderItem selectByOrderId(Long orderId);
|
OmsOrderItem selectByOrderId(Long orderId);
|
||||||
|
|
||||||
|
OmsOrderItem getByOrderSn(String orderSn);
|
||||||
}
|
}
|
||||||
@@ -33,4 +33,5 @@ public interface OmsOrderMapper {
|
|||||||
int updateByPrimaryKey(OmsOrder record);
|
int updateByPrimaryKey(OmsOrder record);
|
||||||
|
|
||||||
|
|
||||||
PmsProduct selectAll(@Param("orderSn") String orderSn);}
|
PmsProduct selectAll(@Param("orderSn") String orderSn);
|
||||||
|
}
|
||||||
|
|||||||
@@ -361,6 +361,11 @@ public class UmsMemberAccountTransactionExample {
|
|||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Criteria andFlowTypeEqualTo(Integer value) {
|
||||||
|
addCriterion("flow_type =", value, "flowType");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
public Criteria andTransactionStateNotEqualTo(Integer value) {
|
public Criteria andTransactionStateNotEqualTo(Integer value) {
|
||||||
addCriterion("transaction_state <>", value, "transactionState");
|
addCriterion("transaction_state <>", value, "transactionState");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
|
|||||||
@@ -513,4 +513,34 @@
|
|||||||
select * from mall.oms_order_item where order_id = #{orderId}
|
select * from mall.oms_order_item where order_id = #{orderId}
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getByOrderSn" resultType="com.buy507.mall.model.OmsOrderItem">
|
||||||
|
select id,
|
||||||
|
order_id,
|
||||||
|
order_sn,
|
||||||
|
product_id,
|
||||||
|
product_pic,
|
||||||
|
product_name,
|
||||||
|
product_brand,
|
||||||
|
product_sn,
|
||||||
|
product_price,
|
||||||
|
product_quantity,
|
||||||
|
product_sku_id,
|
||||||
|
product_sku_code,
|
||||||
|
product_category_id,
|
||||||
|
promotion_name,
|
||||||
|
promotion_amount,
|
||||||
|
coupon_amount,
|
||||||
|
integration_amount,
|
||||||
|
real_amount,
|
||||||
|
gift_integration,
|
||||||
|
gift_growth,
|
||||||
|
product_attr,
|
||||||
|
sp1,
|
||||||
|
sp2,
|
||||||
|
sp3,
|
||||||
|
intergrationPrice,
|
||||||
|
intergrationExchange
|
||||||
|
from oms_order_item
|
||||||
|
where order_sn = #{orderSn}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -926,4 +926,5 @@
|
|||||||
JOIN oms_order o ON oi.order_sn = o.order_sn
|
JOIN oms_order o ON oi.order_sn = o.order_sn
|
||||||
WHERE o.order_sn = #{orderSn}
|
WHERE o.order_sn = #{orderSn}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getPnameByOrderSn" resultType="java.lang.String"></select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -336,39 +336,39 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
OrderResult orderResult = new OrderResult();
|
OrderResult orderResult = new OrderResult();
|
||||||
OmsOrder order = orderMapper.selectByPrimaryKey(orderId);
|
OmsOrder order = orderMapper.selectByPrimaryKey(orderId);
|
||||||
//删除状态:0->未删除;1->已删除
|
//删除状态:0->未删除;1->已删除
|
||||||
if(order != null && order.getMemberId().equals(loginMember.getId()) && order.getDeleteStatus() == 0) {
|
if (order != null && order.getMemberId().equals(loginMember.getId()) && order.getDeleteStatus() == 0) {
|
||||||
orderResult.setOrderId(order.getId());
|
orderResult.setOrderId(order.getId());
|
||||||
orderResult.setOrderSn(order.getOrderSn());
|
orderResult.setOrderSn(order.getOrderSn());
|
||||||
orderResult.setCreateTime(order.getCreateTime());
|
orderResult.setCreateTime(order.getCreateTime());
|
||||||
orderResult.setPayAmount(order.getPayAmount());
|
orderResult.setPayAmount(order.getPayAmount());
|
||||||
orderResult.setOrderStatus(order.getStatus());
|
orderResult.setOrderStatus(order.getStatus());
|
||||||
orderResult.setDeliveryType(order.getDeliveryType());
|
orderResult.setDeliveryType(order.getDeliveryType());
|
||||||
if(order.getStatus() == 0) {
|
if (order.getStatus() == 0) {
|
||||||
orderResult.setOrderStatusName("待付款");
|
orderResult.setOrderStatusName("待付款");
|
||||||
if(order.getPayType() != null && order.getPayType() == 3) {
|
if (order.getPayType() != null && order.getPayType() == 3) {
|
||||||
orderResult.setOrderStatusName("已付款待审核");
|
orderResult.setOrderStatusName("已付款待审核");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(order.getStatus() == 1) {
|
if (order.getStatus() == 1) {
|
||||||
orderResult.setOrderStatusName("待发货");
|
orderResult.setOrderStatusName("待发货");
|
||||||
}
|
}
|
||||||
if(order.getStatus() == 2) {
|
if (order.getStatus() == 2) {
|
||||||
// 提货方式:0->自提;1->物流
|
// 提货方式:0->自提;1->物流
|
||||||
if(order.getDeliveryType() == 0) {
|
if (order.getDeliveryType() == 0) {
|
||||||
orderResult.setOrderStatusName("待提货");
|
orderResult.setOrderStatusName("待提货");
|
||||||
} else {
|
} else {
|
||||||
orderResult.setOrderStatusName("待收货");
|
orderResult.setOrderStatusName("待收货");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(order.getStatus() == 3) {
|
if (order.getStatus() == 3) {
|
||||||
orderResult.setOrderStatusName("交易完成");
|
orderResult.setOrderStatusName("交易完成");
|
||||||
if(order.getCommentTime() == null) {
|
if (order.getCommentTime() == null) {
|
||||||
orderResult.setCommentStatus(0); //未评价
|
orderResult.setCommentStatus(0); //未评价
|
||||||
} else {
|
} else {
|
||||||
orderResult.setCommentStatus(1); //已评价
|
orderResult.setCommentStatus(1); //已评价
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(order.getStatus() == 4) {
|
if (order.getStatus() == 4) {
|
||||||
orderResult.setOrderStatusName("交易关闭");
|
orderResult.setOrderStatusName("交易关闭");
|
||||||
orderResult.setOrderStatus(4);
|
orderResult.setOrderStatus(4);
|
||||||
}
|
}
|
||||||
@@ -387,14 +387,14 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
|
|
||||||
//支付类型: 0->未支付;1->支付宝;2->微信; 3->线下支付; 4->积分支付
|
//支付类型: 0->未支付;1->支付宝;2->微信; 3->线下支付; 4->积分支付
|
||||||
//判断是否为积分专区商品
|
//判断是否为积分专区商品
|
||||||
if(isPointsExchangeStatus) {
|
if (isPointsExchangeStatus) {
|
||||||
orderResult.setIntergrationPrice(product.getIntergrationPrice());
|
orderResult.setIntergrationPrice(product.getIntergrationPrice());
|
||||||
orderResult.setIntergrationExchange(product.getPointsExchangeStatus());
|
orderResult.setIntergrationExchange(product.getPointsExchangeStatus());
|
||||||
orderResult.setPayType(order.getPayType());
|
orderResult.setPayType(order.getPayType());
|
||||||
if (order.getPayType() == 0) {
|
if (order.getPayType() == 0) {
|
||||||
orderResult.setPayTypeName("未支付");
|
orderResult.setPayTypeName("未支付");
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
// 如果不是积分兑换专区商品,则继续使用其他支付方式
|
// 如果不是积分兑换专区商品,则继续使用其他支付方式
|
||||||
if (order.getPayType() != null) {
|
if (order.getPayType() != null) {
|
||||||
orderResult.setPayType(order.getPayType());
|
orderResult.setPayType(order.getPayType());
|
||||||
@@ -433,11 +433,11 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
orderResult.setOrderStatus(0);
|
orderResult.setOrderStatus(0);
|
||||||
|
|
||||||
//0->不开发票;1->电子发票;2->纸质发票
|
//0->不开发票;1->电子发票;2->纸质发票
|
||||||
if(order.getBillType() != null) {
|
if (order.getBillType() != null) {
|
||||||
orderResult.setBillType(order.getBillType());
|
orderResult.setBillType(order.getBillType());
|
||||||
if(order.getBillType() == 1) {
|
if (order.getBillType() == 1) {
|
||||||
orderResult.setBillTypeName("电子发票");
|
orderResult.setBillTypeName("电子发票");
|
||||||
} else if(order.getBillType() == 2) {
|
} else if (order.getBillType() == 2) {
|
||||||
orderResult.setBillTypeName("纸质发票");
|
orderResult.setBillTypeName("纸质发票");
|
||||||
} else {
|
} else {
|
||||||
orderResult.setBillTypeName("不开发票");
|
orderResult.setBillTypeName("不开发票");
|
||||||
@@ -463,7 +463,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
OrderItemResult orderItemResult = null;
|
OrderItemResult orderItemResult = null;
|
||||||
orderResult.setProductsNum(orderItemList.size());
|
orderResult.setProductsNum(orderItemList.size());
|
||||||
List<OrderItemResult> orderItemResultList = new ArrayList<>();
|
List<OrderItemResult> orderItemResultList = new ArrayList<>();
|
||||||
for(OmsOrderItem orderItem : orderItemList) {
|
for (OmsOrderItem orderItem : orderItemList) {
|
||||||
orderItemResult = new OrderItemResult();
|
orderItemResult = new OrderItemResult();
|
||||||
orderItemResult.setOrderId(order.getId());
|
orderItemResult.setOrderId(order.getId());
|
||||||
orderItemResult.setOrderSn(order.getOrderSn());
|
orderItemResult.setOrderSn(order.getOrderSn());
|
||||||
@@ -752,30 +752,30 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
*/
|
*/
|
||||||
public CommonResult createOrder(OrderParam orderParam) {
|
public CommonResult createOrder(OrderParam orderParam) {
|
||||||
//orderParam.setSkuId(98L);
|
//orderParam.setSkuId(98L);
|
||||||
if(orderParam.getSkuId() == null) {
|
if (orderParam.getSkuId() == null) {
|
||||||
return CommonResult.validateFailed("商品SKU不能为空");
|
return CommonResult.validateFailed("商品SKU不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(orderParam.getDeliveryType() == null || (orderParam.getDeliveryType() != 0 && orderParam.getDeliveryType() != 1) ) {
|
if (orderParam.getDeliveryType() == null || (orderParam.getDeliveryType() != 0 && orderParam.getDeliveryType() != 1)) {
|
||||||
return CommonResult.validateFailed("提货方式不能为空");
|
return CommonResult.validateFailed("提货方式不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(orderParam.getMemberReceiveAddressId() == null) {
|
if (orderParam.getMemberReceiveAddressId() == null) {
|
||||||
return CommonResult.validateFailed("会员收货地址不能为空");
|
return CommonResult.validateFailed("会员收货地址不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
UmsMemberReceiveAddress address = memberReceiveAddressMapper.selectOneById(orderParam.getMemberReceiveAddressId());
|
UmsMemberReceiveAddress address = memberReceiveAddressMapper.selectOneById(orderParam.getMemberReceiveAddressId());
|
||||||
if(address == null) {
|
if (address == null) {
|
||||||
return CommonResult.validateFailed("未查询到会员收货地址");
|
return CommonResult.validateFailed("未查询到会员收货地址");
|
||||||
}
|
}
|
||||||
if(orderParam.getQuantity() == null) {
|
if (orderParam.getQuantity() == null) {
|
||||||
return CommonResult.validateFailed("商品数量不能为空");
|
return CommonResult.validateFailed("商品数量不能为空");
|
||||||
}
|
}
|
||||||
if(orderParam.getQuantity() <= 0) {
|
if (orderParam.getQuantity() <= 0) {
|
||||||
return CommonResult.validateFailed("商品数量错误");
|
return CommonResult.validateFailed("商品数量错误");
|
||||||
}
|
}
|
||||||
PmsSkuStock skuStock = skuStockMapper.selectByPrimaryKey(orderParam.getSkuId());
|
PmsSkuStock skuStock = skuStockMapper.selectByPrimaryKey(orderParam.getSkuId());
|
||||||
if(skuStock == null) {
|
if (skuStock == null) {
|
||||||
return CommonResult.validateFailed("未查询到商品信息");
|
return CommonResult.validateFailed("未查询到商品信息");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -801,12 +801,12 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
if(product != null) {
|
if (product != null) {
|
||||||
|
|
||||||
UmsMember member = memberMapper.selectByPrimaryKey(memberService.getCurrentMember().getId());
|
UmsMember member = memberMapper.selectByPrimaryKey(memberService.getCurrentMember().getId());
|
||||||
BigDecimal discount = commonService.getDiscount(member.getId());
|
BigDecimal discount = commonService.getDiscount(member.getId());
|
||||||
|
|
||||||
if(discount != null) {
|
if (discount != null) {
|
||||||
price = skuStock.getPrice().multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP);
|
price = skuStock.getPrice().multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -814,7 +814,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
BigDecimal zero = new BigDecimal(0);
|
BigDecimal zero = new BigDecimal(0);
|
||||||
totalAmount = price.multiply(new BigDecimal(orderParam.getQuantity()));
|
totalAmount = price.multiply(new BigDecimal(orderParam.getQuantity()));
|
||||||
|
|
||||||
if(orderParam.getIntegration() == null) {
|
if (orderParam.getIntegration() == null) {
|
||||||
orderParam.setIntegration(zero);
|
orderParam.setIntegration(zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -823,7 +823,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
//flag = -1,表示integration小于0;flag = 0,表示integration等于0;flag = 1,表示integration大于0;
|
//flag = -1,表示integration小于0;flag = 0,表示integration等于0;flag = 1,表示integration大于0;
|
||||||
//int integerationFlag = orderParam.getIntegration().compareTo(new BigDecimal(0)); //mcoo
|
//int integerationFlag = orderParam.getIntegration().compareTo(new BigDecimal(0)); //mcoo
|
||||||
int integerationFlag = 0;
|
int integerationFlag = 0;
|
||||||
if(integerationFlag == 1) {
|
if (integerationFlag == 1) {
|
||||||
int flag = member.getBalance().compareTo(orderParam.getIntegration());
|
int flag = member.getBalance().compareTo(orderParam.getIntegration());
|
||||||
//flag = -1,表示balance小于integration;flag = 0,表示balance等于integration;flag = 1,表示balance大于integration;
|
//flag = -1,表示balance小于integration;flag = 0,表示balance等于integration;flag = 1,表示balance大于integration;
|
||||||
/*if(flag == -1) {
|
/*if(flag == -1) {
|
||||||
@@ -831,9 +831,9 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
while(true) {
|
while (true) {
|
||||||
long time = System.currentTimeMillis() + RedisLock.TIMEOUT;
|
long time = System.currentTimeMillis() + RedisLock.TIMEOUT;
|
||||||
if(redisLock.lock(String.valueOf(skuStock.getProductId()), String.valueOf(time))) {
|
if (redisLock.lock(String.valueOf(skuStock.getProductId()), String.valueOf(time))) {
|
||||||
|
|
||||||
//重新查询获取最新的数据
|
//重新查询获取最新的数据
|
||||||
skuStock = skuStockMapper.selectByPrimaryKey(orderParam.getSkuId());
|
skuStock = skuStockMapper.selectByPrimaryKey(orderParam.getSkuId());
|
||||||
@@ -856,13 +856,13 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
order.setTotalAmount(totalAmount); // 订单总金额
|
order.setTotalAmount(totalAmount); // 订单总金额
|
||||||
order.setIntegrationAmount(zero); // 积分部分金额设为零
|
order.setIntegrationAmount(zero); // 积分部分金额设为零
|
||||||
order.setIntegrationAmount(orderParam.getIntegration() == null ? zero : orderParam.getIntegration());
|
order.setIntegrationAmount(orderParam.getIntegration() == null ? zero : orderParam.getIntegration());
|
||||||
if(integerationFlag == 1) {
|
if (integerationFlag == 1) {
|
||||||
int flag = orderParam.getIntegration().compareTo(totalAmount);
|
int flag = orderParam.getIntegration().compareTo(totalAmount);
|
||||||
BigDecimal integeration = new BigDecimal(0);
|
BigDecimal integeration = new BigDecimal(0);
|
||||||
//flag = -1,表示integration小于totalAmount;flag = 0,表示integration等于totalAmount;flag = 1,表示integration大于totalAmount;
|
//flag = -1,表示integration小于totalAmount;flag = 0,表示integration等于totalAmount;flag = 1,表示integration大于totalAmount;
|
||||||
//如果传入的积分小于实际支付金额,用实际支付金额减去抵扣积分。
|
//如果传入的积分小于实际支付金额,用实际支付金额减去抵扣积分。
|
||||||
//如果传入的积分等于或者大于实际支付金额,表示全额抵扣
|
//如果传入的积分等于或者大于实际支付金额,表示全额抵扣
|
||||||
if(flag == -1) {
|
if (flag == -1) {
|
||||||
order.setPayAmount(totalAmount.subtract(orderParam.getIntegration())); //实际支付金额
|
order.setPayAmount(totalAmount.subtract(orderParam.getIntegration())); //实际支付金额
|
||||||
order.setIntegrationAmount(orderParam.getIntegration());
|
order.setIntegrationAmount(orderParam.getIntegration());
|
||||||
integeration = orderParam.getIntegration();
|
integeration = orderParam.getIntegration();
|
||||||
@@ -1361,7 +1361,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
// 判断是否使用积分支付
|
// 判断是否使用积分支付
|
||||||
UmsMember member = memberMapper.selectByPrimaryKey(currentMember.getId());
|
UmsMember member = memberMapper.selectByPrimaryKey(currentMember.getId());
|
||||||
|
|
||||||
if(product1.getPointsExchangeStatus() == 1) {
|
if (product1.getPointsExchangeStatus() == 1) {
|
||||||
|
|
||||||
// 获取积分兑换价格
|
// 获取积分兑换价格
|
||||||
// 使用订单中的积分字段
|
// 使用订单中的积分字段
|
||||||
@@ -1411,7 +1411,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
accountTransaction.setTransferPaymentTime(order.getPaymentTime());
|
accountTransaction.setTransferPaymentTime(order.getPaymentTime());
|
||||||
accountTransaction.setRevenuePoints(-totalPointsAmount.intValue());
|
accountTransaction.setRevenuePoints(-totalPointsAmount.intValue());
|
||||||
PmsProduct pmsProduct = orderMapper.selectAll(order.getOrderSn());
|
PmsProduct pmsProduct = orderMapper.selectAll(order.getOrderSn());
|
||||||
accountTransaction.setRemarks( "商品名称" + pmsProduct.getName());
|
accountTransaction.setRemarks("商品名称" + pmsProduct.getName());
|
||||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||||
|
|
||||||
// 返还积分金额到前端
|
// 返还积分金额到前端
|
||||||
@@ -1573,10 +1573,11 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
accountTransaction.setFlowType(1);
|
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());
|
OmsOrderItem orderItem = orderItemMapper.getByOrderSn(orderResult.getOrderSn());
|
||||||
accountTransaction.setRemarks( "商品名称" + pmsProduct.getName());
|
accountTransaction.setRemarks("商品名称" + orderItem.getProductName());
|
||||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||||
|
|
||||||
|
PmsProduct pmsProduct = orderMapper.selectAll(orderResult.getOrderSn());
|
||||||
//如果是积分专区的商品则进行积分专区相对应的逻辑
|
//如果是积分专区的商品则进行积分专区相对应的逻辑
|
||||||
if (pmsProduct.getPointsAreaStatus() == 1) {
|
if (pmsProduct.getPointsAreaStatus() == 1) {
|
||||||
//奖励积分是购买的价格的100%
|
//奖励积分是购买的价格的100%
|
||||||
@@ -1593,7 +1594,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
// 更新用户积分
|
// 更新用户积分
|
||||||
memberMapper.updateByPrimaryKey(member);
|
memberMapper.updateByPrimaryKey(member);
|
||||||
//增加基金积分
|
//增加基金积分
|
||||||
int fundPoints = (int)(rewardPoints * 0.05);
|
int fundPoints = (int) (rewardPoints * 0.05);
|
||||||
umsDevelopmentFundMapper.updatePoints(fundPoints);
|
umsDevelopmentFundMapper.updatePoints(fundPoints);
|
||||||
//插入流水表积分
|
//插入流水表积分
|
||||||
UmsMemberAccountTransaction transaction = new UmsMemberAccountTransaction();
|
UmsMemberAccountTransaction transaction = new UmsMemberAccountTransaction();
|
||||||
@@ -1602,7 +1603,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
transaction.setFlowType(2);
|
transaction.setFlowType(2);
|
||||||
transaction.setTransferPaymentTime(orderResult.getPaymentTime());
|
transaction.setTransferPaymentTime(orderResult.getPaymentTime());
|
||||||
transaction.setRevenuePoints(rewardPoints);
|
transaction.setRevenuePoints(rewardPoints);
|
||||||
transaction.setRemarks( "购买商品返还积分:" + pmsProduct.getName());
|
transaction.setRemarks("购买商品返还积分:" + pmsProduct.getName());
|
||||||
umsMemberAccountTransactionMapper.insert(transaction);
|
umsMemberAccountTransactionMapper.insert(transaction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1615,8 +1616,10 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
order.setStatus(2);
|
order.setStatus(2);
|
||||||
order.setPaymentTime(new Date());
|
order.setPaymentTime(new Date());
|
||||||
orderMapper.updateByPrimaryKey(order);
|
orderMapper.updateByPrimaryKey(order);
|
||||||
|
if (pmsProduct.getPointsAreaStatus() == 1) {
|
||||||
//积分分润逻辑
|
//积分分润逻辑
|
||||||
memberPointsSplitProfitService.pointsSplit(order);
|
memberPointsSplitProfitService.pointsSplit(order);
|
||||||
|
}
|
||||||
|
|
||||||
// 处理库存、分销等后续操作
|
// 处理库存、分销等后续操作
|
||||||
executorService.execute(() -> {
|
executorService.execute(() -> {
|
||||||
@@ -1628,7 +1631,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*处理库存的逻辑
|
* 处理库存的逻辑
|
||||||
*/
|
*/
|
||||||
private void updateStock(Long orderId) {
|
private void updateStock(Long orderId) {
|
||||||
// 查询订单商品信息,进行库存更新等操作
|
// 查询订单商品信息,进行库存更新等操作
|
||||||
@@ -1646,8 +1649,6 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信预支付
|
* 微信预支付
|
||||||
*
|
*
|
||||||
@@ -2061,7 +2062,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
// 更新用户积分
|
// 更新用户积分
|
||||||
memberMapper.updateByPrimaryKey(member);
|
memberMapper.updateByPrimaryKey(member);
|
||||||
//增加基金积分
|
//增加基金积分
|
||||||
int fundPoints = (int)(rewardPoints * 0.05);
|
int fundPoints = (int) (rewardPoints * 0.05);
|
||||||
umsDevelopmentFundMapper.updatePoints(fundPoints);
|
umsDevelopmentFundMapper.updatePoints(fundPoints);
|
||||||
|
|
||||||
//插入流水表积分
|
//插入流水表积分
|
||||||
@@ -2071,7 +2072,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
|||||||
accountTransaction.setFlowType(2);
|
accountTransaction.setFlowType(2);
|
||||||
accountTransaction.setTransferPaymentTime(order.getPaymentTime());
|
accountTransaction.setTransferPaymentTime(order.getPaymentTime());
|
||||||
accountTransaction.setRevenuePoints(rewardPoints);
|
accountTransaction.setRevenuePoints(rewardPoints);
|
||||||
accountTransaction.setRemarks( "购买商品返还积分:" + pmsProduct.getName());
|
accountTransaction.setRemarks("购买商品返还积分:" + pmsProduct.getName());
|
||||||
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
umsMemberAccountTransactionMapper.insert(accountTransaction);
|
||||||
|
|
||||||
//积分分润逻辑
|
//积分分润逻辑
|
||||||
|
|||||||
@@ -529,6 +529,7 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
|||||||
BigDecimal totalIncome = BigDecimal.ZERO;
|
BigDecimal totalIncome = BigDecimal.ZERO;
|
||||||
accountTransactionExample.createCriteria()
|
accountTransactionExample.createCriteria()
|
||||||
.andTransactionStateEqualTo(UmsMemberAccountTransaction.TRANSACTION_STATE_YES)
|
.andTransactionStateEqualTo(UmsMemberAccountTransaction.TRANSACTION_STATE_YES)
|
||||||
|
.andFlowTypeEqualTo(1)
|
||||||
.andMemberIdEqualTo(member.getId());
|
.andMemberIdEqualTo(member.getId());
|
||||||
|
|
||||||
List<UmsMemberAccountTransaction> totalList = umsMemberAccountTransactionMapper.selectByExample(accountTransactionExample);
|
List<UmsMemberAccountTransaction> totalList = umsMemberAccountTransactionMapper.selectByExample(accountTransactionExample);
|
||||||
@@ -546,6 +547,7 @@ public class UmsMemberServiceImpl implements UmsMemberService {
|
|||||||
accountTransactionExample.createCriteria()
|
accountTransactionExample.createCriteria()
|
||||||
.andTransferPaymentTimeBetween(DateUtil.beginOfDay(nowTime) ,nowTime)
|
.andTransferPaymentTimeBetween(DateUtil.beginOfDay(nowTime) ,nowTime)
|
||||||
.andTransactionStateEqualTo(UmsMemberAccountTransaction.TRANSACTION_STATE_YES)
|
.andTransactionStateEqualTo(UmsMemberAccountTransaction.TRANSACTION_STATE_YES)
|
||||||
|
.andFlowTypeEqualTo(1)
|
||||||
.andMemberIdEqualTo(member.getId());
|
.andMemberIdEqualTo(member.getId());
|
||||||
List<UmsMemberAccountTransaction> todayIncomeList = umsMemberAccountTransactionMapper.selectByExample(accountTransactionExample);
|
List<UmsMemberAccountTransaction> todayIncomeList = umsMemberAccountTransactionMapper.selectByExample(accountTransactionExample);
|
||||||
if(todayIncomeList!= null && !todayIncomeList.isEmpty()){
|
if(todayIncomeList!= null && !todayIncomeList.isEmpty()){
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public class VipCenterServiceImpl implements VipCenterService {
|
|||||||
//返回订单id
|
//返回订单id
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
result.put("orderId", order.getId());
|
result.put("orderId", order.getId());
|
||||||
|
result.put("orderType", order.getOrderType());
|
||||||
return CommonResult.success(result, "下单成功");
|
return CommonResult.success(result, "下单成功");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user