Forráskód Böngészése

Merge branch 'dev/2024/0419/updateSharePath'

# Conflicts:
#	feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/sharepath/SharePathServiceImpl.java
gaohp 10 hónapja
szülő
commit
65795d9bd1

+ 14 - 34
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/sharepath/SharePathServiceImpl.java

@@ -7,7 +7,6 @@ import cn.newfeifan.mall.module.distri.service.duser.DuserService;
 import cn.newfeifan.mall.module.distri.service.ordercalc.OrderCalcService;
 import cn.newfeifan.mall.module.member.dal.dataobject.user.MemberUserDO;
 import cn.newfeifan.mall.module.member.service.user.MemberUserService;
-import com.aliyuncs.utils.StringUtils;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
@@ -171,18 +170,13 @@ public class SharePathServiceImpl implements SharePathService {
         List<TreeNode> deep = sharePathDO2TreeNode(sharePathDOS);
         if (maxDepth > 1) {
             List<Long> descs = sharePathDOS.stream().filter(k -> k.getDepth() > 1).map(SharePathDO::getDescendant).collect(Collectors.toList());
-
-            if (!descs.isEmpty()) {
+            if (descs.size()>0){
                 // 获取大于1层级的数据
-                List<SharePathDO> descList = sharePathMapper.selectList(new LambdaQueryWrapperX<SharePathDO>()
-                        .in(SharePathDO::getDescendant, descs)
-                        .ne(SharePathDO::getAncestor, 1)
-                );
+                List<SharePathDO> descList = sharePathMapper.selectList(new LambdaQueryWrapperX<SharePathDO>().ne(SharePathDO::getAncestor, 1).in(SharePathDO::getDescendant, descs));
                 List<TreeNode> treeNodes1 = sharePathDO2TreeNode(descList);
                 deep = deep.stream().filter(k -> k.getDeep() == 1).collect(Collectors.toList());
                 deep.addAll(treeNodes1);
             }
-
         }
         // 整合结构
         List<TreeNode> treeNodes = listWithTree(deep, userId);
@@ -197,31 +191,8 @@ public class SharePathServiceImpl implements SharePathService {
 
     @Override
     public TreeNode getTreeByNameOrMobile(SharePathTreeReqVO sharePathTreeReqVO) {
-        //拿到当前用户ID
-        Long userId = getUserIdByNameOrMobile(sharePathTreeReqVO.getNickName(), sharePathTreeReqVO.getMobile());
-
-        //拿到推荐人ID
-        Long ancestor = sharePathMapper.selectAncestorByDescendant(userId);
-        return getTree(ancestor, sharePathTreeReqVO.getMaxDepth());
-    }
-
-    private Long getUserIdByNameOrMobile(String nickName, String mobile) {
-        if (!StringUtils.isEmpty(nickName)) {
-            List<DuserDO> duserDOS = duserService.getDuserByName(nickName);
-            if (duserDOS.isEmpty()) {
-                throw exception(DUSER_NAME_NOT_EXISTS);
-            } else if (duserDOS.size() > 1) {
-                throw exception(DUSER_NAME_IS_NOT_ONLY_ONE);
-            }
-
-            return duserDOS.get(0).getUserId();
-        } else {
-            DuserDO duserDO = duserService.getDuserByMobile(mobile);
-            if (duserDO == null) {
-                throw exception(DUSER_MOBILE_NOT_EXISTS);
-            }
-            return duserDO.getUserId();
-        }
+//        duserService.getDuserByName(sharePathTreeReqVO.getName());
+        return null;
     }
 
 
@@ -356,9 +327,16 @@ public class SharePathServiceImpl implements SharePathService {
         return Stream.concat(orderUserId.stream(), userId.stream()).distinct().collect(Collectors.toList());
 
     }
-
     @Override
     public PageResult<SharePathRespVO> getDescendants(SharePathPageReqVO pageReqVO) {
+        LambdaQueryWrapperX<SharePathDO> wrapper = new LambdaQueryWrapperX<SharePathDO>()
+                .eq(SharePathDO::getAncestor, pageReqVO.getAncestor());
+        if(pageReqVO.getDepth() != null){
+            wrapper.eq(SharePathDO::getDepth, 1);
+        }else {
+            wrapper.ne(SharePathDO::getDepth, 1);
+        }
+
         PageResult<SharePathDO> sharePathDOPageResult = sharePathMapper.selectDescendantsPage(pageReqVO);
         PageResult<SharePathRespVO> result = BeanUtils.toBean(sharePathDOPageResult, SharePathRespVO.class);
         List<SharePathRespVO> list = result.getList();
@@ -369,4 +347,6 @@ public class SharePathServiceImpl implements SharePathService {
     }
 
 
+
+
 }

+ 1 - 0
feifan-module-pay/feifan-module-pay-biz/src/main/java/cn/newfeifan/mall/module/pay/service/wallet/PayWalletServiceImpl.java

@@ -37,6 +37,7 @@ public class PayWalletServiceImpl implements  PayWalletService {
     @Resource
     private PayWalletMapper walletMapper;
     @Resource
+    @Lazy
     private PayWalletTransactionService walletTransactionService;
     @Resource
     @Lazy

+ 2 - 0
feifan-module-pay/feifan-module-pay-biz/src/main/java/cn/newfeifan/mall/module/pay/service/wallet/PayWalletTransactionServiceImpl.java

@@ -12,6 +12,7 @@ import cn.newfeifan.mall.module.pay.dal.redis.no.PayNoRedisDAO;
 import cn.newfeifan.mall.module.pay.enums.wallet.PayWalletBizTypeEnum;
 import cn.newfeifan.mall.module.pay.service.wallet.bo.WalletTransactionCreateReqBO;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.validation.annotation.Validated;
 
@@ -38,6 +39,7 @@ public class PayWalletTransactionServiceImpl implements PayWalletTransactionServ
     private static final String WALLET_NO_PREFIX = "W";
 
     @Resource
+    @Lazy
     private PayWalletService payWalletService;
     @Resource
     private PayWalletTransactionMapper payWalletTransactionMapper;

+ 1 - 1
feifan-server/src/main/resources/application-pro.yaml → feifan-server/src/main/resources/application-prod.yaml

@@ -60,7 +60,7 @@ spring:
 
   # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
   redis:
-    host: 47.107.29.61  # 地址
+    host: 47.107.29.61 # 地址
     port: 6379 # 端口
     database: 0 # 数据库索引
 #    password: 123456 # 密码,建议生产环境开启