6 Incheckningar 19fbc5b6b9 ... aa2fbf517f

Upphovsman SHA1 Meddelande Datum
  dail aa2fbf517f Merge branch 'dail-dev' into dev 2 år sedan
  dail d7f851059f 匿名访问 2 år sedan
  Cuiyongming 62050c553a Merge branch 'cym_dev' into dev 2 år sedan
  Cuiyongming d9d6640302 查询门店分类树 2 år sedan
  dail ed2291b33c Merge branch 'dail-dev' into dev 2 år sedan
  dail 8af1ee0940 匿名注解 2 år sedan

+ 2 - 0
Source/group-platform/admin/src/main/java/com/younike/admin/shiro/ShiroConfig.java

@@ -314,6 +314,8 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/tool/gen/batchGenCode", "anon");
         filterChainDefinitionMap.put("/system/menu/roleMenuTreeData", "anon");
         filterChainDefinitionMap.put("/api/*", "anon");
+        // TODO 登录还没做 2022.5.24
+        filterChainDefinitionMap.put("/group-platform/*", "anon");
         // 系统权限列表
         // filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll());
 

+ 12 - 5
Source/group-platform/admin/src/main/java/com/younike/store/controller/StoreCategoryController.java

@@ -18,11 +18,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import com.younike.common.annotation.OpLog;
 import com.younike.common.core.controller.BaseController;
-import com.younike.common.core.dto.AjaxResult;
 import com.younike.common.constant.BusinessType;
 import com.younike.service.pojo.StoreCategory;
 import com.younike.service.service.IStoreCategoryService;
-import com.younike.common.core.page.TableResult;
 
 /**
  * 门店分类Controller
@@ -36,9 +34,9 @@ public class StoreCategoryController extends BaseController {
     @Autowired
     private IStoreCategoryService storeCategoryService;
 
-    /**
-     * 查询门店分类列表
-     */
+//    /**
+//     * 查询门店分类列表
+//     */
     @RequiresPermissions("category:list")
     @PostMapping("/list")
     public Page list(@RequestBody PageParam<StoreCategory> page) {
@@ -85,4 +83,13 @@ public class StoreCategoryController extends BaseController {
     public APIResult remove(@PathVariable List<String> storeCategoryIds) {
         return ResultGenerator.getSuccessResult(storeCategoryService.removeByIds(storeCategoryIds));
     }
+
+
+    /**
+     * 获取门店分类树状图
+     */
+    @GetMapping("/storeCategoryTree")
+    public APIResult getStoreCategoryTree() {
+        return ResultGenerator.getSuccessResult(storeCategoryService.getStoreCategoryTree());
+    }
 }

+ 13 - 0
Source/group-platform/common/src/main/java/com/younike/common/config/AnonymousAccess.java

@@ -0,0 +1,13 @@
+package com.younike.common.config;
+
+import java.lang.annotation.*;
+
+
+/**
+ * @author Dail
+ */
+@Target({ElementType.METHOD, ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface AnonymousAccess {
+}

+ 6 - 0
Source/group-platform/service/src/main/java/com/younike/service/mapper/StoreCategoryMapper.java

@@ -3,6 +3,7 @@ package com.younike.service.mapper;
 import java.util.List;
 import com.younike.service.pojo.StoreCategory;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.younike.service.pojo.vo.StoreCategoryVo;
 
 /**
  * 门店分类Mapper接口
@@ -12,4 +13,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface StoreCategoryMapper extends BaseMapper<StoreCategory> {
 
+    /**
+     * 获取门店分类树状图
+     * @return
+     */
+    List<StoreCategoryVo> getStoreCategoryTree();
 }

+ 12 - 0
Source/group-platform/service/src/main/java/com/younike/service/pojo/vo/StoreCategoryVo.java

@@ -0,0 +1,12 @@
+package com.younike.service.pojo.vo;
+
+import com.younike.service.pojo.StoreCategory;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class StoreCategoryVo extends StoreCategory {
+
+    private List<StoreCategoryVo> children;
+}

+ 7 - 0
Source/group-platform/service/src/main/java/com/younike/service/service/IStoreCategoryService.java

@@ -4,6 +4,8 @@ import java.util.List;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.younike.service.pojo.StoreCategory;
 import com.younike.common.core.page.PageParam;
+import com.younike.service.pojo.vo.StoreCategoryVo;
+
 /**
  * 门店分类Service接口
  *
@@ -20,4 +22,9 @@ public interface IStoreCategoryService extends IService<StoreCategory>{
      */
     public PageParam<StoreCategory> page(PageParam<StoreCategory> pageParam);
 
+    /**
+     * 获取门店分类树状图
+     * @return
+     */
+    List<StoreCategoryVo> getStoreCategoryTree();
 }

+ 14 - 0
Source/group-platform/service/src/main/java/com/younike/service/service/impl/StoreCategoryServiceImpl.java

@@ -4,10 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.younike.service.mapper.StoreCategoryMapper;
 import com.younike.service.pojo.StoreCategory;
+import com.younike.service.pojo.vo.StoreCategoryVo;
 import com.younike.service.service.IStoreCategoryService;
 import com.younike.common.core.page.PageParam;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
 /**
  * 门店分类Service业务层处理
  *
@@ -35,4 +39,14 @@ public class StoreCategoryServiceImpl extends ServiceImpl<StoreCategoryMapper, S
         return page;
     }
 
+    /**
+     * 获取门店分类树状图
+     * @return
+     */
+    @Override
+    public List<StoreCategoryVo> getStoreCategoryTree() {
+
+        return baseMapper.getStoreCategoryTree();
+    }
+
 }

+ 28 - 1
Source/group-platform/service/src/main/resources/mapper/system/StoreCategoryMapper.xml

@@ -23,12 +23,39 @@
         <result property="remark" column="remark"/>
     </resultMap>
 
-
+    <resultMap type="com.younike.service.pojo.vo.StoreCategoryVo" id="StoreCategoryResultVo">
+        <result property="storeCategoryId" column="store_category_id"/>
+        <result property="bizType" column="biz_type"/>
+        <result property="categoryName" column="category_name"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="icon" column="icon"/>
+        <result property="isEnable" column="is_enable"/>
+        <result property="indexShow" column="index_show"/>
+        <result property="type" column="type"/>
+        <result property="sorting" column="sorting"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createdBy" column="created_by"/>
+        <result property="createdTime" column="created_time"/>
+        <result property="updatedBy" column="updated_by"/>
+        <result property="updatedTime" column="updated_time"/>
+        <result property="version" column="version"/>
+        <result property="remark" column="remark"/>
+        <collection property="children" select="gradeCommentId" column="parent_id"
+                    ofType="com.younike.service.pojo.vo.StoreCategoryVo">
+        </collection>
+    </resultMap>
 
 
     <sql id="selectStoreCategoryVo">
         select store_category_id, biz_type, category_name, parent_id, icon, is_enable, index_show, type, sorting, del_flag, created_by, created_time, updated_by, updated_time, version, remark from store_category
     </sql>
+<!--获取门店分类树状图 (只查询一级分类)-->
+    <select id="getStoreCategoryTree" resultMap="StoreCategoryResultVo">
+        <include refid="selectStoreCategoryVo"/>  where parent_id=0 and del_flag=0 ORDER BY sorting,created_time  desc
+    </select>
 
+    <select id="gradeCommentId" resultMap="com.younike.service.mapper.StoreCategoryMapper.StoreCategoryResultVo">
+        <include refid="selectStoreCategoryVo"/>  where comment_id=#{parent_id} and del_flag=0 ORDER BY sorting,created_time  desc
+    </select>
 
 </mapper>