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

修改添加关系代码

Harper 1 éve
szülő
commit
b292f11ec1

+ 9 - 2
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/sharepath/SharePathMapper.java

@@ -34,8 +34,15 @@ public interface SharePathMapper extends BaseMapperX<SharePathDO> {
                 .orderByDesc(SharePathDO::getId));
     }
 
-    void addNode(@Param("parentId") Long parentId, @Param("parentName") String parentName, @Param("parentMobile") String parentMobile,
-                 @Param("newDescendantId") Long newDescendantId, @Param("newDescendantName") String newDescendantName, @Param("newDescendantMobile") String newDescendantMobile);
+    void addNode(@Param("parentId") Long parentId,
+                 @Param("parentName") String parentName,
+                 @Param("parentNickName") String parentNickName,
+                 @Param("parentMobile") String parentMobile,
+
+                 @Param("newDescendantId") Long newDescendantId,
+                 @Param("newDescendantName") String newDescendantName,
+                 @Param("newDescendantNickName") String newDescendantNickName,
+                 @Param("newDescendantMobile") String newDescendantMobile);
 
 
     int getMaxSortByParentId(@Param("parentId") Long parentId);

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

@@ -78,8 +78,16 @@ public class SharePathServiceImpl implements SharePathService {
         duserService.hasUserAndCreat(createReqVO);
 
         // 存储他们之间的关系
-        sharePathMapper.addNode(createReqVO.getAncestor(), ancestor.getName(), ancestor.getMobile(),
-                createReqVO.getDescendant(), descendant.getName(), descendant.getMobile());
+        sharePathMapper.addNode(
+                createReqVO.getAncestor(),
+                ancestor.getName(),
+                ancestor.getNickname(),
+                ancestor.getMobile(),
+
+                createReqVO.getDescendant(),
+                descendant.getName(),
+                descendant.getNickname(),
+                descendant.getMobile());
     }
 
     @Override

+ 18 - 1
feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/sharepath/SharePathMapper.xml

@@ -5,13 +5,27 @@
 
     <!-- 增加节点 -->
     <insert id="addNode">
-        INSERT INTO distri_share_path (ancestor, anc_name, anc_phone, descendant, desc_name, desc_phone, depth, sort)
+        INSERT INTO distri_share_path (ancestor,
+                                       anc_name,
+                                       anc_nick_name,
+                                       anc_phone,
+
+                                       descendant,
+                                       desc_name,
+                                       desc_nick_name,
+                                       desc_phone,
+
+                                       depth, sort)
         SELECT ancestor,
                anc_name,
+               anc_nick_name,
                anc_phone,
+
                #{newDescendantId},
                #{newDescendantName},
+               #{newDescendantNickName},
                #{newDescendantMobile},
+
                depth + 1,
                (SELECT IFNULL(MAX(sort), 0) + 1 FROM distri_share_path WHERE ancestor = #{parentId} AND depth = 1)
         FROM distri_share_path
@@ -19,9 +33,12 @@
         UNION ALL
         SELECT #{parentId},
                #{parentName},
+               #{parentNickName},
                #{parentMobile},
+
                #{newDescendantId},
                #{newDescendantName},
+               #{newDescendantNickName},
                #{newDescendantMobile},
                1,
                (SELECT IFNULL(MAX(sort), 0) + 1 FROM distri_share_path WHERE ancestor = #{parentId} AND depth = 1);

+ 1 - 1
feifan-server/src/main/resources/application-local.yaml

@@ -1,5 +1,5 @@
 server:
-  port: 8002
+  port: 8004
 
 --- #################### 数据库相关配置 ####################