|
@@ -433,9 +433,11 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
if (relation != null && relation.getStatus() == GroupsRelation.Status.outside) {
|
|
if (relation != null && relation.getStatus() == GroupsRelation.Status.outside) {
|
|
|
orderDon.setIsOt(true);
|
|
orderDon.setIsOt(true);
|
|
|
}
|
|
}
|
|
|
|
|
+ UserDistributeShared userDistributeShared = null;
|
|
|
|
|
+ UserDistribute userDistribute = null;
|
|
|
if (orderDon.getYhsId() == 0) {
|
|
if (orderDon.getYhsId() == 0) {
|
|
|
//虚拟商品订单,是否是分销订单
|
|
//虚拟商品订单,是否是分销订单
|
|
|
- setDistributeOrderMark(orderDon, goodsDon.getType(), user.getId());
|
|
|
|
|
|
|
+ setDistributeOrderMark(orderDon, goodsDon.getType(), user.getId(), userDistributeShared, userDistribute);
|
|
|
}
|
|
}
|
|
|
if (relationId != 0) {
|
|
if (relationId != 0) {
|
|
|
Long gtSkuId = groupsRelationMapper.getGroupTripsSkuIdByRelationId(relationId);
|
|
Long gtSkuId = groupsRelationMapper.getGroupTripsSkuIdByRelationId(relationId);
|
|
@@ -607,9 +609,13 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
}
|
|
}
|
|
|
Boolean isCtRealGoods = false;
|
|
Boolean isCtRealGoods = false;
|
|
|
BigDecimal galaxycoin = unifiedOrderPayReq.getGalaxycoin();
|
|
BigDecimal galaxycoin = unifiedOrderPayReq.getGalaxycoin();
|
|
|
|
|
+ Boolean isDistribute = false;
|
|
|
|
|
+ Boolean isFixedDistribute = false;
|
|
|
if (galaxycoin != null && galaxycoin.compareTo(BigDecimal.valueOf(100)) < 0) {
|
|
if (galaxycoin != null && galaxycoin.compareTo(BigDecimal.valueOf(100)) < 0) {
|
|
|
throw BusinessRuntimeException.getInstance("银河币大于100才可使用");
|
|
throw BusinessRuntimeException.getInstance("银河币大于100才可使用");
|
|
|
}
|
|
}
|
|
|
|
|
+ UserDistributeShared userDistributeShared = null;
|
|
|
|
|
+ UserDistribute userDistribute = null;
|
|
|
for (OrderPayRequest payRequest : payGoods) {
|
|
for (OrderPayRequest payRequest : payGoods) {
|
|
|
GoodsDonSku sku = null;
|
|
GoodsDonSku sku = null;
|
|
|
Long goodsId;
|
|
Long goodsId;
|
|
@@ -775,7 +781,13 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
}
|
|
}
|
|
|
if (orderDon.getYhsId() == 0) {
|
|
if (orderDon.getYhsId() == 0) {
|
|
|
//虚拟商品订单,是否是分销订单
|
|
//虚拟商品订单,是否是分销订单
|
|
|
- setDistributeOrderMark(orderDon, goodsDon.getType(), user.getId());
|
|
|
|
|
|
|
+ setDistributeOrderMark(orderDon, goodsDon.getType(), user.getId(), userDistributeShared, userDistribute);
|
|
|
|
|
+ if (!isDistribute && orderDon.getIsDistribute()) {
|
|
|
|
|
+ isDistribute = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!isFixedDistribute && orderDon.getIsFixedDistribute()) {
|
|
|
|
|
+ isFixedDistribute = true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (relationId != 0) {
|
|
if (relationId != 0) {
|
|
|
Long gtSkuId = groupsRelationMapper.getGroupTripsSkuIdByRelationId(relationId);
|
|
Long gtSkuId = groupsRelationMapper.getGroupTripsSkuIdByRelationId(relationId);
|
|
@@ -955,6 +967,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
orderMasterDon.setUserId(userId);
|
|
orderMasterDon.setUserId(userId);
|
|
|
orderMasterDon.setBalance(pay_balance);
|
|
orderMasterDon.setBalance(pay_balance);
|
|
|
orderMasterDon.setGalaxycoin(pay_galaxycoin);
|
|
orderMasterDon.setGalaxycoin(pay_galaxycoin);
|
|
|
|
|
+ orderMasterDon.setIsDistribute(isDistribute);
|
|
|
|
|
+ orderMasterDon.setIsFixedDistribute(isFixedDistribute);
|
|
|
//默认支付宝支付
|
|
//默认支付宝支付
|
|
|
orderMasterDon.setType(OrderMasterDon.Type.ALI_PAY);
|
|
orderMasterDon.setType(OrderMasterDon.Type.ALI_PAY);
|
|
|
orderMasterDonService.save(orderMasterDon);
|
|
orderMasterDonService.save(orderMasterDon);
|
|
@@ -1356,9 +1370,11 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
if (relation != null && relation.getStatus() == GroupsRelation.Status.outside) {
|
|
if (relation != null && relation.getStatus() == GroupsRelation.Status.outside) {
|
|
|
orderDon.setIsOt(true);
|
|
orderDon.setIsOt(true);
|
|
|
}
|
|
}
|
|
|
|
|
+ UserDistributeShared userDistributeShared = null;
|
|
|
|
|
+ UserDistribute userDistribute = null;
|
|
|
if (orderDon.getYhsId() == 0) {
|
|
if (orderDon.getYhsId() == 0) {
|
|
|
//虚拟商品订单,是否是分销订单
|
|
//虚拟商品订单,是否是分销订单
|
|
|
- setDistributeOrderMark(orderDon, goodsDon.getType(), userId);
|
|
|
|
|
|
|
+ setDistributeOrderMark(orderDon, goodsDon.getType(), userId, userDistributeShared, userDistribute);
|
|
|
}
|
|
}
|
|
|
orderDon.setRealMoney(orderDon.getMoney());
|
|
orderDon.setRealMoney(orderDon.getMoney());
|
|
|
//扣除使用优惠券、余额的订单金额
|
|
//扣除使用优惠券、余额的订单金额
|
|
@@ -2928,7 +2944,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void setDistributeOrderMark(OrderDon orderDon, Integer goodsType, Long userId) {
|
|
|
|
|
|
|
+ public void setDistributeOrderMark(OrderDon orderDon, Integer goodsType, Long userId, UserDistributeShared userDistributeShared, UserDistribute userDistribute) {
|
|
|
if (userId == null || userId == 0) {
|
|
if (userId == null || userId == 0) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -2938,10 +2954,14 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
if (StrUtil.isNotBlank(orderDon.getCouponExCode()) && orderDon.getUserId() != 0) {
|
|
if (StrUtil.isNotBlank(orderDon.getCouponExCode()) && orderDon.getUserId() != 0) {
|
|
|
addDistributeCouponCode(orderDon.getUserId(), orderDon.getCouponExCode());
|
|
addDistributeCouponCode(orderDon.getUserId(), orderDon.getCouponExCode());
|
|
|
}
|
|
}
|
|
|
- UserDistributeShared userDistributeShared = userDistributeSharedMapper.selectOne(Wrappers.lambdaQuery(UserDistributeShared.class).eq(UserDistributeShared::getUserId, userId).last("limit 1"));
|
|
|
|
|
|
|
+ if (userDistributeShared == null) {
|
|
|
|
|
+ userDistributeShared = userDistributeSharedMapper.selectOne(Wrappers.lambdaQuery(UserDistributeShared.class).eq(UserDistributeShared::getUserId, userId).last("limit 1"));
|
|
|
|
|
+ }
|
|
|
if (userDistributeShared != null) {
|
|
if (userDistributeShared != null) {
|
|
|
orderDon.setIsDistribute(true);
|
|
orderDon.setIsDistribute(true);
|
|
|
- UserDistribute userDistribute = userDistributeMapper.selectOne(Wrappers.lambdaQuery(UserDistribute.class).eq(UserDistribute::getUserId, userDistributeShared.getSharedId()));
|
|
|
|
|
|
|
+ if (userDistribute == null) {
|
|
|
|
|
+ userDistribute = userDistributeMapper.selectOne(Wrappers.lambdaQuery(UserDistribute.class).eq(UserDistribute::getUserId, userDistributeShared.getSharedId()));
|
|
|
|
|
+ }
|
|
|
if (userDistribute != null) {
|
|
if (userDistribute != null) {
|
|
|
//直接去除
|
|
//直接去除
|
|
|
if (!userDistributeShared.getIsBind()) {
|
|
if (!userDistributeShared.getIsBind()) {
|