From dd0833ef33804b7cf085b8c3c005e5788a3617d6 Mon Sep 17 00:00:00 2001
From: jyy <935090232@qq.com>
Date: Mon, 22 Mar 2021 17:10:38 +0800
Subject: [PATCH] 积分商城16
---
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java | 46 ++++++++++++++++++++++++----------------------
1 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java
index 8e21a83..f099fdc 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java
@@ -48,30 +48,32 @@
List<ShopOrderDetails> orderDetails = shopOrderDetailsDao.selectByOrderId(Integer.valueOf(orderId));
order.setDetails(orderDetails);
//扣除积分
- if(order.getScorePay()!=null){
- scoreVipDetailService.deductionScore(order.getUserId(),null,Long.parseLong(order.getStoreId()+""),order.getScorePay(),Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH);
- }
- //消费获得积分
- int addScore=0;
- for(ShopOrderDetails shopOrderDetail : orderDetails) {
- if(shopOrderDetail.getPayType()==ShopOrderDetails.PAYTYPE_MICRO){
- Integer xfkdScore= shopOrderDetail.getShopSku().getScore();
- if(xfkdScore!=null && xfkdScore>0){
- addScore+=xfkdScore;
- }
+ if(order.getScorePay()!=null&&order.getScorePay()>0){
+ scoreVipDetailService.deductionScore(order.getUserId(),null,Long.parseLong(order.getStoreId()+""),order.getScorePay(),Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH,"商城积分抵扣");
+ }else{
+ //消费获得积分
+ int addScore=0;
+ for(ShopOrderDetails shopOrderDetail : orderDetails) {
+ if(shopOrderDetail.getPayType()==ShopOrderDetails.PAYTYPE_MICRO){
+ Integer xfkdScore= shopOrderDetail.getShopSku().getScore();
+ if(xfkdScore!=null && xfkdScore>0){
+ addScore+=xfkdScore;
+ }
+ }
+ }
+ if(addScore>0){
+ //插入新的积分
+ scoreVipDetailService.addScore(
+ order.getUserId(),null,
+ null,
+ Long.parseLong(order.getStoreId()+""),
+ addScore,
+ Long.parseLong(orderId+""),
+ ScoreVipDetail.SCORE_VIP_TYPE_CASH,
+ "微商城消费");
}
}
- if(addScore>0){
- //插入新的积分
- scoreVipDetailService.addScore(
- order.getUserId(),null,
- null,
- Long.parseLong(order.getStoreId()+""),
- addScore,
- Long.parseLong(orderId+""),
- ScoreVipDetail.SCORE_VIP_TYPE_CASH,
- "微商城消费");
- }
+
}
--
Gitblit v1.9.1