jiangping
2024-07-12 3faf877e3ca03028d60bba265249a543e8f9b533
server/service/src/main/java/com/doumee/service/business/impl/ShopServiceImpl.java
@@ -841,11 +841,17 @@
                    s.setIdPath(s.getId()+"/");
                    shopMapper.updateById(s);
                }else{
                    String idPath = StringUtils.defaultString(parent.getIdPath(),"")+ shop.getId()+"/";
                    String namePath =StringUtils.defaultString(parent.getNamePath(),"")+"/"+shop.getName();
                    s.setParentId(parent.getId());
                    s.setNamePath(parent.getNamePath()+"/"+s.getName());
                    s.setIdPath(parent.getIdPath()+s.getId()+"/");
                    s.setNamePath(namePath);
                    s.setIdPath(idPath);
                    if(!(Constants.equalsLong(parent.getId(),shop.getParentId())
                            && StringUtils.equals(idPath,shop.getIdPath())
                            &&StringUtils.equals(namePath,shop.getNamePath())) ){
                    shopMapper.updateById(s);
                }
                }
                if(shop.getChildList()!=null && shop.getChildList().size()>0){
                    updateNamePath(s,shop.getChildList());
                }