zoujiajian há 2 anos atrás
pai
commit
d72c00e115

+ 36 - 35
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -2279,49 +2279,50 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		//特殊渠道推广优惠. 360
 		if (subsidyId == null && orderDon.getPopularizeId() != null && orderDon.getPopularizeId() != 0L) {
 			String name = channelPopularizeMapper.selectChannelByPid(orderDon.getPopularizeId());
-			//使用了优惠券 不再使用360渠道 折扣
-			if (couponUser == null && goodsType == 1) {
-				if (name.contains(Constant.NO_SIGN_CHANNEL_NAMES.get(0)) || name.contains(Constant.NO_SIGN_CHANNEL_NAMES.get(1))) {
-					String key;
-					if (name.contains(Constant.NO_SIGN_CHANNEL_NAMES.get(0))) {
-						//百度渠道 专门优惠链接
-						key = Constant.CHANNEL_BAIDU_DISCOUNT_KEY;
-					} else {
-						//抖音
-						key = Constant.CHANNEL_DY_DISCOUNT_KEY;
-					}
-					SysConfig channelNoSignConfig = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class)
-							.eq(SysConfig::getSysKey, key).last("limit 1"));
-					if (channelNoSignConfig != null) {
-						String sysValue = channelNoSignConfig.getSysValue();
-						if (StrUtil.isNotBlank(sysValue)) {
-							try {
-								ChannelBaiDuDiscountDto baiDuDiscountDto = Jsons.parseObject(sysValue, ChannelBaiDuDiscountDto.class);
-								List<Long> baiduPopularizeIds = baiDuDiscountDto.getPopularizeIds();
-								BigDecimal discount = baiDuDiscountDto.getDiscount();
-								if (CollUtil.isNotEmpty(baiduPopularizeIds) && discount != null && discount.compareTo(BigDecimal.ZERO) > 0) {
-									if (baiduPopularizeIds.contains(orderDon.getPopularizeId())) {
-										BigDecimal discountMoney = orderDon.getMoney().multiply(discount);
-										orderDon.setMoney(discountMoney);
+			if (StrUtil.isNotBlank(name)) {
+				//使用了优惠券 不再使用360渠道 折扣
+				if (couponUser == null && goodsType == 1) {
+					if (name.contains(Constant.NO_SIGN_CHANNEL_NAMES.get(0)) || name.contains(Constant.NO_SIGN_CHANNEL_NAMES.get(1))) {
+						String key;
+						if (name.contains(Constant.NO_SIGN_CHANNEL_NAMES.get(0))) {
+							//百度渠道 专门优惠链接
+							key = Constant.CHANNEL_BAIDU_DISCOUNT_KEY;
+						} else {
+							//抖音
+							key = Constant.CHANNEL_DY_DISCOUNT_KEY;
+						}
+						SysConfig channelNoSignConfig = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class)
+								.eq(SysConfig::getSysKey, key).last("limit 1"));
+						if (channelNoSignConfig != null) {
+							String sysValue = channelNoSignConfig.getSysValue();
+							if (StrUtil.isNotBlank(sysValue)) {
+								try {
+									ChannelBaiDuDiscountDto baiDuDiscountDto = Jsons.parseObject(sysValue, ChannelBaiDuDiscountDto.class);
+									List<Long> baiduPopularizeIds = baiDuDiscountDto.getPopularizeIds();
+									BigDecimal discount = baiDuDiscountDto.getDiscount();
+									if (CollUtil.isNotEmpty(baiduPopularizeIds) && discount != null && discount.compareTo(BigDecimal.ZERO) > 0) {
+										if (baiduPopularizeIds.contains(orderDon.getPopularizeId())) {
+											BigDecimal discountMoney = orderDon.getMoney().multiply(discount);
+											orderDon.setMoney(discountMoney);
+										}
 									}
-								}
 
-							} catch (Exception e) {
+								} catch (Exception e) {
+								}
 							}
 						}
 					}
-				}
-			} else {
-				//360
-				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);
+				} else {
+					//360
+					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);
+						}
 					}
 				}
 			}
-
 		}
 		//存在余额
 		deductBalancePayOrderMoney(orderDon, balance, user);