yjwang пре 15 часа
родитељ
комит
a161b1d4c3

+ 7 - 5
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseCategoryController.java

@@ -158,27 +158,29 @@ public class FsUserCourseCategoryController extends BaseController
 
     //获取1级总分类
     @GetMapping("/getCatePidList")
-    public R getCatePidList()
+    public R getCatePidList(Integer categoryType)
     {
+        Integer ct = categoryType != null ? categoryType : 0;
         if( !"医健宝".equals(signProjectName) ){
             LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
             Long userId = loginUser.getUser().getUserId();
             String json = configService.selectConfigByKey("course.config");
             CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
             if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
-                List<OptionsVO> list = fsUserCourseCategoryService.selectFsUserCourseCategoryPidList(userId);
+                List<OptionsVO> list = fsUserCourseCategoryService.selectFsUserCourseCategoryPidList(userId, ct);
                 return R.ok().put("data", list);
             }
         }
-        List<OptionsVO> list = fsUserCourseCategoryService.selectFsUserCourseCategoryPidList();
+        List<OptionsVO> list = fsUserCourseCategoryService.selectFsUserCourseCategoryPidList(ct);
         return R.ok().put("data", list);
     }
 
     //获取总分类下子分类
     @GetMapping("/getCateListByPid/{pid}")
-    public R getCateListByPid(@PathVariable("pid")Long pid)
+    public R getCateListByPid(@PathVariable("pid")Long pid, Integer categoryType)
     {
-        List<OptionsVO> list = fsUserCourseCategoryService.selectCateListByPid(pid);
+        Integer ct = categoryType != null ? categoryType : 0;
+        List<OptionsVO> list = fsUserCourseCategoryService.selectCateListByPid(pid, ct);
         return R.ok().put("data", list);
     }
 }

+ 6 - 4
fs-company/src/main/java/com/fs/company/controller/course/FsUserCourseCategoryController.java

@@ -107,17 +107,19 @@ public class FsUserCourseCategoryController extends BaseController
 
     //获取1级总分类
     @GetMapping("/getCatePidList")
-    public R getCatePidList()
+    public R getCatePidList(Integer categoryType)
     {
-        List<OptionsVO> list = fsUserCourseCategoryService.selectFsUserCourseCategoryPidList();
+        Integer ct = categoryType != null ? categoryType : 0;
+        List<OptionsVO> list = fsUserCourseCategoryService.selectFsUserCourseCategoryPidList(ct);
         return R.ok().put("data", list);
     }
 
     //获取总分类下子分类
     @GetMapping("/getCateListByPid/{pid}")
-    public R getCateListByPid(@PathVariable("pid")Long pid)
+    public R getCateListByPid(@PathVariable("pid")Long pid, Integer categoryType)
     {
-        List<OptionsVO> list = fsUserCourseCategoryService.selectCateListByPid(pid);
+        Integer ct = categoryType != null ? categoryType : 0;
+        List<OptionsVO> list = fsUserCourseCategoryService.selectCateListByPid(pid, ct);
         return R.ok().put("data", list);
     }
 }

+ 4 - 0
fs-service/src/main/java/com/fs/course/domain/FsUserCourseCategory.java

@@ -38,6 +38,10 @@ public class FsUserCourseCategory extends BaseEntity
     @Excel(name = "删除状态")
     private Integer isDel;
 
+    /** 分类类型 0-私域 1-公域 */
+    @Excel(name = "分类类型", readConverterExp = "0=私域,1=公域")
+    private Integer categoryType;
+
     private String pic;
 
 

+ 6 - 6
fs-service/src/main/java/com/fs/course/mapper/FsUserCourseCategoryMapper.java

@@ -68,14 +68,14 @@ public interface FsUserCourseCategoryMapper
     @Select("select cate_id dict_value, cate_name dict_label,is_del status from fs_store_product_category WHERE pid = 0 and is_del=0 ")
     List<OptionsVO> selectFsUserCoursePidList();
 
-    @Select("select cate_id dict_value, cate_name dict_label  from fs_user_course_category WHERE pid = 0 and is_del=0 AND is_show = 1")
-    List<OptionsVO> selectFsUserCourseCategoryPidList();
+    @Select("select cate_id dict_value, cate_name dict_label  from fs_user_course_category WHERE pid = 0 and is_del=0 AND is_show = 1 and category_type = #{categoryType}")
+    List<OptionsVO> selectFsUserCourseCategoryPidList(@Param("categoryType") Integer categoryType);
 
-    @Select("select cate_id dict_value, cate_name dict_label  from fs_user_course_category WHERE pid = 0 and is_del=0 and user_id = #{userId}")
-    List<OptionsVO> selectFsUserCourseCategoryPidListByUserId(Long userId);
+    @Select("select cate_id dict_value, cate_name dict_label  from fs_user_course_category WHERE pid = 0 and is_del=0 and user_id = #{userId} and category_type = #{categoryType}")
+    List<OptionsVO> selectFsUserCourseCategoryPidListByUserId(@Param("userId") Long userId, @Param("categoryType") Integer categoryType);
 
-    @Select("select cate_id dict_value, cate_name dict_label  from fs_user_course_category WHERE pid =#{pid} and is_del=0 ")
-    List<OptionsVO> selectCateListByPid(Long pid);
+    @Select("select cate_id dict_value, cate_name dict_label  from fs_user_course_category WHERE pid =#{pid} and is_del=0 and category_type = #{categoryType}")
+    List<OptionsVO> selectCateListByPid(@Param("pid") Long pid, @Param("categoryType") Integer categoryType);
 
     /**
      * 根据名称查询分类

+ 3 - 3
fs-service/src/main/java/com/fs/course/service/IFsUserCourseCategoryService.java

@@ -63,8 +63,8 @@ public interface IFsUserCourseCategoryService
 
     List<OptionsVO> selectFsUserCoursePidList();
 
-    List<OptionsVO> selectFsUserCourseCategoryPidList();
-    List<OptionsVO> selectFsUserCourseCategoryPidList(Long userId);
+    List<OptionsVO> selectFsUserCourseCategoryPidList(Integer categoryType);
+    List<OptionsVO> selectFsUserCourseCategoryPidList(Long userId, Integer categoryType);
 
-    List<OptionsVO> selectCateListByPid(Long pid);
+    List<OptionsVO> selectCateListByPid(Long pid, Integer categoryType);
 }

+ 6 - 6
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseCategoryServiceImpl.java

@@ -101,16 +101,16 @@ public class FsUserCourseCategoryServiceImpl implements IFsUserCourseCategorySer
     }
 
     @Override
-    public List<OptionsVO> selectFsUserCourseCategoryPidList() {
-        return fsUserCourseCategoryMapper.selectFsUserCourseCategoryPidList();
+    public List<OptionsVO> selectFsUserCourseCategoryPidList(Integer categoryType) {
+        return fsUserCourseCategoryMapper.selectFsUserCourseCategoryPidList(categoryType);
     }
 
     @Override
-    public List<OptionsVO> selectFsUserCourseCategoryPidList(Long userId) {
-        return fsUserCourseCategoryMapper.selectFsUserCourseCategoryPidListByUserId(userId);
+    public List<OptionsVO> selectFsUserCourseCategoryPidList(Long userId, Integer categoryType) {
+        return fsUserCourseCategoryMapper.selectFsUserCourseCategoryPidListByUserId(userId, categoryType);
     }
     @Override
-    public List<OptionsVO> selectCateListByPid(Long pid) {
-        return fsUserCourseCategoryMapper.selectCateListByPid(pid);
+    public List<OptionsVO> selectCateListByPid(Long pid, Integer categoryType) {
+        return fsUserCourseCategoryMapper.selectCateListByPid(pid, categoryType);
     }
 }

+ 6 - 1
fs-service/src/main/resources/mapper/course/FsUserCourseCategoryMapper.xml

@@ -14,10 +14,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime"    column="update_time"    />
         <result property="isDel"    column="is_del"    />
         <result property="userId"    column="user_id"    />
+        <result property="categoryType"    column="category_type"    />
     </resultMap>
 
     <sql id="selectFsUserCourseCategoryVo">
-        select cate_id, pid, cate_name, sort, is_show, create_time, update_time, is_del from fs_user_course_category
+        select cate_id, pid, cate_name, sort, is_show, create_time, update_time, is_del, category_type from fs_user_course_category
     </sql>
 
     <select id="selectFsUserCourseCategoryList" parameterType="FsUserCourseCategory" resultMap="FsUserCourseCategoryResult">
@@ -29,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isShow != null "> and is_show = #{isShow}</if>
             <if test="isDel != null  and isDel != ''"> and is_del = #{isDel}</if>
             <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="categoryType != null "> and category_type = #{categoryType}</if>
         </where>
     </select>
 
@@ -48,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">update_time,</if>
             <if test="isDel != null">is_del,</if>
             <if test="userId != null">user_id,</if>
+            <if test="categoryType != null">category_type,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="pid != null">#{pid},</if>
@@ -58,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">#{updateTime},</if>
             <if test="isDel != null">#{isDel},</if>
             <if test="userId != null">#{userId},</if>
+            <if test="categoryType != null">#{categoryType},</if>
          </trim>
     </insert>
 
@@ -71,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="isDel != null">is_del = #{isDel},</if>
+            <if test="categoryType != null">category_type = #{categoryType},</if>
         </trim>
         where cate_id = #{cateId}
     </update>

+ 2 - 2
fs-user-app/src/main/java/com/fs/app/controller/CourseController.java

@@ -53,7 +53,7 @@ public class CourseController extends  AppBaseController{
     @GetMapping("/getCourseCate")
     public R getCourseCate(){
         try {
-            List<OptionsVO> list = courseCategoryService.selectFsUserCourseCategoryPidList();
+            List<OptionsVO> list = courseCategoryService.selectFsUserCourseCategoryPidList(1);
             return R.ok().put("data",list);
         } catch (Exception e){
             return R.error("操作异常");
@@ -65,7 +65,7 @@ public class CourseController extends  AppBaseController{
     @GetMapping("/getProductCateByPid")
     public R getProductCateByPid(@RequestParam(value="pid") Long pid){
         try {
-            List<OptionsVO> list = courseCategoryService.selectCateListByPid(pid);
+            List<OptionsVO> list = courseCategoryService.selectCateListByPid(pid, 0);
             return R.ok().put("data",list);
         } catch (Exception e){
             return R.error("操作异常");

+ 2 - 2
fs-user-app/src/main/java/com/fs/app/controller/store/CourseScrmController.java

@@ -89,7 +89,7 @@ public class CourseScrmController extends AppBaseController {
     @GetMapping("/getCourseCate")
     public R getCourseCate(){
         try {
-            List<OptionsVO> list = courseCategoryService.selectFsUserCourseCategoryPidList();
+            List<OptionsVO> list = courseCategoryService.selectFsUserCourseCategoryPidList(0);
             return R.ok().put("data",list);
         } catch (Exception e){
             return R.error("操作异常");
@@ -100,7 +100,7 @@ public class CourseScrmController extends AppBaseController {
     @GetMapping("/getProductCateByPid")
     public R getProductCateByPid(@RequestParam(value="pid") Long pid){
         try {
-            List<OptionsVO> list = courseCategoryService.selectCateListByPid(pid);
+            List<OptionsVO> list = courseCategoryService.selectCateListByPid(pid, 0);
             return R.ok().put("data",list);
         } catch (Exception e){
             return R.error("操作异常");