Bladeren bron

fix 微信退款扣除购买实物权益

zoujiajian 3 jaren geleden
bovenliggende
commit
6fab2f32ca

+ 2 - 2
netflix-service/src/main/java/com/cyksj/service/distribute/impl/DistributeServiceImpl.java

@@ -57,7 +57,7 @@ public class DistributeServiceImpl implements DistributeService {
 				throw new BusinessRuntimeException("比例错误");
 			}
 			GoodsDon goodsDon = goodsDonMapper.selectById(rate.getGoodsId());
-			if (goodsDon == null || !goodsDon.getDeleted() || goodsDon.getType() == 2) {
+			if (goodsDon == null || !goodsDon.getDeleted() || goodsDon.getType() == 3) {
 				throw new BusinessRuntimeException("平台错误");
 			}
 			rate.setDistributeId(userDistribute.getId());
@@ -79,7 +79,7 @@ public class DistributeServiceImpl implements DistributeService {
 				throw new BusinessRuntimeException("比例错误");
 			}
 			GoodsDon goodsDon = goodsDonMapper.selectById(rate.getGoodsId());
-			if (goodsDon == null || !goodsDon.getDeleted() || goodsDon.getType() == 2) {
+			if (goodsDon == null || !goodsDon.getDeleted() || goodsDon.getType() == 3) {
 				throw new BusinessRuntimeException("平台错误");
 			}
 			rate.setDistributeId(userDistribute.getId());

+ 2 - 0
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -1134,6 +1134,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 				GoodsDon goodsDon = goodsDonMapper.selectById(orderDon.getGoodsId());
 				if (goodsDon.getType() == 2) {
 					equipmentDistributeService.subDistributeBenefitsChance(orderDon.getUserId(), orderDon.getId());
+					//扣除用户自身实物权益
+					userRealOrderBenefitsService.deductUserRealGoodsBenefits(orderDon.getId());
 				}
 			} catch (Exception e) {
 				log.error("wx减少抽奖机会错误,orderId:{},error:{}", orderDon.getId(), e);