From a1d5268502e9c98ebe7f469bd142fe3330629131 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 15 一月 2025 14:27:30 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/qijisheng

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
index aae53d3..bfda500 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
@@ -190,7 +190,7 @@
 		info.setVip(appUser.getVipId());
 		GoodsSeckill goodsSeckill = seckillActivityInfoClient.getSeckillActivityInfo(info).getData();
 		//没有秒杀活动或者添加的普通商品则不使用秒杀活动价格
-		if(null == goodsSeckill || type == 1){
+		if((null == goodsSeckill || (null != goodsSeckill.getCashPayment() && null != goodsSeckill.getPointPayment())) || type == 1){
 			//没有秒杀价,则判断门店特价
 			GetGoodsBargainPrice goodsBargainPrice = new GetGoodsBargainPrice();
 			goodsBargainPrice.setGoodsId(goodsId);
@@ -209,17 +209,17 @@
 				area.setVip(appUser.getVipId());
 				area.setGoodsId(goodsId);
 				GoodsArea goodsArea = goodsAreaClient.getGoodsArea(area).getData();
-				if(null == goodsArea){
+				if(null == goodsArea || (null == goodsArea.getCashPayment() && null == goodsArea.getPointPayment())){
 					//没有地区价格,则使用会员价格
 					GoodsVip goodsVip = goodsVipClient.getGoodsVip(goodsId, appUser.getVipId()).getData();
-					if(null == goodsVip){
+					if(null == goodsVip || (null == goodsVip.getCashPayment() && null == goodsVip.getPointPayment())){
 						//没有配置价格,直接使用原始基础价格
 						return null;
 					}else{
 						price.setCash(goodsVip.getSellingPrice());
 						price.setPoint(goodsVip.getIntegral());
-						price.setCashPayment(goodsVip.getCashPayment() == 1);
-						price.setPointPayment(goodsVip.getPointPayment() == 1);
+						price.setCashPayment(null != goodsVip.getCashPayment() && goodsVip.getCashPayment() == 1);
+						price.setPointPayment(null != goodsVip.getPointPayment() && goodsVip.getPointPayment() == 1);
 						price.setEarnSpendingPoints(goodsVip.getEarnSpendingPoints());
 						price.setSuperiorSubcommission(goodsVip.getSuperiorSubcommission());
 						price.setSuperiorRebatePoints(goodsVip.getSuperiorRebatePoints());
@@ -236,8 +236,8 @@
 				}else{
 					price.setCash(goodsArea.getSellingPrice());
 					price.setPoint(goodsArea.getIntegral());
-					price.setCashPayment(goodsArea.getCashPayment() == 1);
-					price.setPointPayment(goodsArea.getPointPayment() == 1);
+					price.setCashPayment(null !=goodsArea.getCashPayment() && goodsArea.getCashPayment() == 1);
+					price.setPointPayment(null !=goodsArea.getPointPayment() && goodsArea.getPointPayment() == 1);
 					price.setEarnSpendingPoints(goodsArea.getEarnSpendingPoints());
 					price.setSuperiorSubcommission(goodsArea.getSuperiorSubcommission());
 					price.setSuperiorRebatePoints(goodsArea.getSuperiorRebatePoints());
@@ -304,8 +304,8 @@
 			if(goodsSeckill.getCashPayment() == 0 && goodsSeckill.getPointPayment() == 1){
 				price.setPoint(goodsSeckill.getIntegral());
 			}
-			price.setCashPayment(goodsSeckill.getCashPayment() == 1);
-			price.setPointPayment(goodsSeckill.getPointPayment() == 1);
+			price.setCashPayment(null != goodsSeckill.getCashPayment() && goodsSeckill.getCashPayment() == 1);
+			price.setPointPayment(null != goodsSeckill.getPointPayment() && goodsSeckill.getPointPayment() == 1);
 			price.setEndTime(goodsSeckill.getEndTime());
 			price.setEarnSpendingPoints(goodsSeckill.getEarnSpendingPoints());
 			price.setSuperiorSubcommission(goodsSeckill.getSuperiorSubcommission());
@@ -424,8 +424,8 @@
 		}else{
 			int sum = 0;
 			for (MyShoppingCartVo myShoppingCartVo : goodsList) {
-				sum += (myShoppingCartVo.getPoint() * myShoppingCartVo.getNumber());
-				myShoppingCartVo.setEarnSpendingPoints(myShoppingCartVo.getEarnSpendingPoints() * myShoppingCartVo.getNumber());
+				sum += ((null != myShoppingCartVo.getPoint() ? myShoppingCartVo.getPoint() : 0) * myShoppingCartVo.getNumber());
+				myShoppingCartVo.setEarnSpendingPoints((null != myShoppingCartVo.getEarnSpendingPoints() ? myShoppingCartVo.getEarnSpendingPoints() : 0) * myShoppingCartVo.getNumber());
 			}
 			confirmOrderVo.setOrderPoint(sum);
 		}
@@ -1007,7 +1007,7 @@
 		}
 		if(3 == shoppingCartPayment.getPaymentType()){
 			Integer availablePoint = appUser.getAvailablePoint();
-			if(availablePoint < orderPoint){
+			if(availablePoint.compareTo(orderPoint) < 0){
 				return R.fail("账户可用积分不足");
 			}
 		}

--
Gitblit v1.7.1