Browse Source

完善代码

yuansh 2 tháng trước cách đây
mục cha
commit
8a633e2394

+ 25 - 0
srm-module-code/src/main/java/org/jeecg/modules/baseCode/controller/BaseProductClassController.java

@@ -178,6 +178,31 @@ public class BaseProductClassController extends JeecgController<BaseProductClass
         return Result.OK(baseProductClass);
     }
 
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    //@AutoLog(value = "产品分类-通过id查询")
+    @ApiOperation(value = "产品分类-通过id查询", notes = "产品分类-通过id查询")
+    @GetMapping(value = "/queryByParentId")
+    public Result<List<BaseProductClass>> queryByParentId(@RequestParam(name = "id", required = true) String id) {
+
+        QueryWrapper<BaseProductClass> queryWrapper = new QueryWrapper();
+        queryWrapper.eq("parentId", id);
+        queryWrapper.eq("del_flag", "0");
+
+        List<BaseProductClass> list = baseProductClassService.list(queryWrapper);
+
+        if(list.size() == 0){
+
+            return Result.error("数据为空");
+        }
+        return Result.OK(list);
+    }
+
     /**
      * 导出excel
      *