Explorar o código

Merge branch 'master' into pre

zoujiajian %!s(int64=3) %!d(string=hai) anos
pai
achega
6929cbb747

+ 10 - 7
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -2009,13 +2009,16 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 			userBenefitsService.recordBalanceBySource(user.getId(), BigDecimal.valueOf(-balance.longValue()), UserBalanceSourceRecord.Source.payment);
 		}
 		//特殊渠道推广优惠. 360
-		if(orderDon.getPopularizeId() != null && orderDon.getPopularizeId() != 0L){
-			String name = channelPopularizeMapper.selectChannelByPid(orderDon.getPopularizeId());
-			if (Constant.CHANNEL_NAME_360.equals(name)) {
-				SysConfig sysConfig = sysConfigService.getBaseMapper().selectOne(Wrappers.lambdaQuery(SysConfig.class).eq(SysConfig::getSysKey, Constant.CHANNEL_360_DISCOUNT));
-				if (sysConfig != null) {
-					BigDecimal discountMoney = orderDon.getMoney().multiply(BigDecimal.valueOf(Double.valueOf(sysConfig.getSysValue())));
-					orderDon.setMoney(discountMoney);
+		if (orderDon.getPopularizeId() != null && orderDon.getPopularizeId() != 0L) {
+			//使用了优惠券 不再使用360渠道 折扣
+			if (couponUser == null) {
+				String name = channelPopularizeMapper.selectChannelByPid(orderDon.getPopularizeId());
+				if (Constant.CHANNEL_NAME_360.equals(name)) {
+					SysConfig sysConfig = sysConfigService.getBaseMapper().selectOne(Wrappers.lambdaQuery(SysConfig.class).eq(SysConfig::getSysKey, Constant.CHANNEL_360_DISCOUNT));
+					if (sysConfig != null) {
+						BigDecimal discountMoney = orderDon.getMoney().multiply(BigDecimal.valueOf(Double.valueOf(sysConfig.getSysValue())));
+						orderDon.setMoney(discountMoney);
+					}
 				}
 			}
 		}