|
@@ -155,6 +155,8 @@ public class DistributeServiceImpl implements DistributeService {
|
|
|
}
|
|
}
|
|
|
//渠道附加功能
|
|
//渠道附加功能
|
|
|
handlerDistributeOtherFunc(userDistribute, userDistributeReq);
|
|
handlerDistributeOtherFunc(userDistribute, userDistributeReq);
|
|
|
|
|
+ //设置过个人专属推广码 升级为渠道专属优惠码
|
|
|
|
|
+ setDistributePopularizeCode(userDistribute.getId(), userDistribute.getUserId());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -605,4 +607,25 @@ public class DistributeServiceImpl implements DistributeService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private void setDistributePopularizeCode(Long distributeId, Long userId) {
|
|
|
|
|
+ CouponDistributePopularize couponDistributePopularize = couponDistributePopularizeMapper.selectOne(Wrappers.lambdaQuery(CouponDistributePopularize.class)
|
|
|
|
|
+ .eq(CouponDistributePopularize::getCouponId, Constant.GENERAL_POPULARIZE_COUPON_ID)
|
|
|
|
|
+ .eq(CouponDistributePopularize::getUserId, userId)
|
|
|
|
|
+ .eq(CouponDistributePopularize::getDeleted, 1)
|
|
|
|
|
+ .eq(CouponDistributePopularize::getIsGeneral, 1)
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ if (couponDistributePopularize != null) {
|
|
|
|
|
+ //先删除
|
|
|
|
|
+ couponDistributePopularize.setDeleted(false);
|
|
|
|
|
+ couponDistributePopularizeMapper.updateById(couponDistributePopularize);
|
|
|
|
|
+
|
|
|
|
|
+ //后升级
|
|
|
|
|
+ CouponDistributePopularize newPopularizeCode = new CouponDistributePopularize();
|
|
|
|
|
+ newPopularizeCode.setDistributeId(distributeId);
|
|
|
|
|
+ newPopularizeCode.setExCode(couponDistributePopularize.getExCode());
|
|
|
|
|
+ newPopularizeCode.setCouponId(Constant.DISTRIBUTE_POPULARIZE_COUPON_ID);
|
|
|
|
|
+ couponDistributePopularizeMapper.insert(newPopularizeCode);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|