| | |
| | | |
| | | @Tag(name = "管理后台 - MDM 物料分类") |
| | | @RestController |
| | | @RequestMapping("/mdm/item-category") |
| | | @RequestMapping("/mdm/category") |
| | | @Validated |
| | | public class MdmItemCategoryController { |
| | | |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "获得物料分类") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1") |
| | | @PreAuthorize("@ss.hasPermission('mdm:item-category:query')") |
| | | public CommonResult<MdmItemCategoryRespVO> getItemCategory(@RequestParam("id") Long id) { |
| | | MdmItemCategoryDO itemCategory = itemCategoryService.getItemCategory(id); |
| | | return success(BeanUtils.toBean(itemCategory, MdmItemCategoryRespVO.class)); |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得物料分类分页") |
| | | @PreAuthorize("@ss.hasPermission('mdm:item-category:query')") |
| | | public CommonResult<PageResult<MdmItemCategoryRespVO>> getItemCategoryPage(@Valid MdmItemCategoryPageReqVO pageReqVO) { |
| | | PageResult<MdmItemCategoryDO> pageResult = itemCategoryService.getItemCategoryPage(pageReqVO); |
| | | return success(BeanUtils.toBean(pageResult, MdmItemCategoryRespVO.class)); |
| | |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "获得物料分类列表") |
| | | @PreAuthorize("@ss.hasPermission('mdm:item-category:query')") |
| | | public CommonResult<List<MdmItemCategoryRespVO>> getItemCategoryList() { |
| | | List<MdmItemCategoryDO> list = itemCategoryService.getItemCategoryList(null); |
| | | return success(BeanUtils.toBean(list, MdmItemCategoryRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/list-all-simple") |
| | | @Operation(summary = "获得启用的分类列表") |
| | | public CommonResult<List<MdmItemCategoryRespVO>> getSimpleItemList() { |
| | | List<MdmItemCategoryDO> list = itemCategoryService.getSimpleItemList(); |
| | | return success(BeanUtils.toBean(list, MdmItemCategoryRespVO.class)); |
| | | } |
| | | |
| | | } |