|
|
@@ -4,6 +4,8 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.mapper.GoodsDonMapper;
|
|
|
import com.cyksj.mapper.manage.distribute.UserDistributeSharedMapper;
|
|
|
+import com.cyksj.mapper.mirrorshop.UserMirrorShopMapper;
|
|
|
+import com.cyksj.mapper.mirrorshop.UserMirrorShopUserDistributeSharedMapper;
|
|
|
import com.cyksj.mapper.shop.*;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.service.distribute.UserBusinessFrontService;
|
|
|
@@ -41,6 +43,10 @@ public class YhShopDistributeServiceImpl implements YhShopDistributeService {
|
|
|
private final GoodsDonMapper goodsDonMapper;
|
|
|
|
|
|
private final UserDistributeSharedMapper userDistributeSharedMapper;
|
|
|
+
|
|
|
+ private final UserMirrorShopMapper userMirrorShopMapper;
|
|
|
+
|
|
|
+ private final UserMirrorShopUserDistributeSharedMapper userMirrorShopUserDistributeSharedMapper;
|
|
|
@Override
|
|
|
public void distributeWaitingSendPointsRecord(OrderDon order) {
|
|
|
BigDecimal orderMoney = order.getMoney();
|
|
|
@@ -159,8 +165,22 @@ public class YhShopDistributeServiceImpl implements YhShopDistributeService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void saveDistributionInvitation(String customId, Long userId) {
|
|
|
+ public void saveDistributionInvitation(String customId, Long userId, Integer cmt) {
|
|
|
customId = customId.trim();
|
|
|
+ if (cmt != null && cmt == 2) {
|
|
|
+ UserMirrorShop userMirrorShop = userMirrorShopMapper.selectOne(Wrappers.lambdaQuery(UserMirrorShop.class)
|
|
|
+ .eq(UserMirrorShop::getCustomId, customId)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (userMirrorShop != null && userMirrorShop.getStatus()) {
|
|
|
+ log.info("用户镜像店铺shopUserId:{}新用户uid:{}注册关联上下级", userMirrorShop.getUserId(), userId);
|
|
|
+ UserMirrorShopUserDistributeShared shopUserDistributeShared = new UserMirrorShopUserDistributeShared();
|
|
|
+ shopUserDistributeShared.setShopUserId(userMirrorShop.getUserId());
|
|
|
+ shopUserDistributeShared.setUserId(userId);
|
|
|
+ userMirrorShopUserDistributeSharedMapper.insert(shopUserDistributeShared);
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
YhShop yhShop = yhShopMapper.selectOne(Wrappers.lambdaQuery(YhShop.class).eq(YhShop::getCustomId, customId).last("limit 1"));
|
|
|
if (yhShop.getVerifyStatus() != YhShop.Status.success) {
|
|
|
return;
|