| | |
| | | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.module.mdm.api.category.dto.MdmItemCategoryRespDTO; |
| | | import cn.iocoder.yudao.module.mdm.api.category.dto.MdmItemCategorySaveReqDTO; |
| | | import cn.iocoder.yudao.module.mdm.controller.admin.category.vo.MdmItemCategorySaveReqVO; |
| | | import cn.iocoder.yudao.module.mdm.dal.dataobject.category.MdmItemCategoryDO; |
| | | import cn.iocoder.yudao.module.mdm.service.category.MdmItemCategoryService; |
| | | import jakarta.annotation.Resource; |
| | |
| | | /** |
| | | * MDM 物料分类 API 实现类 |
| | | * |
| | | * @author 芋道源码 |
| | | * @author 超级管理员 |
| | | */ |
| | | @RestController |
| | | @RequestMapping(MdmItemCategoryApi.PREFIX) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult<MdmItemCategoryRespDTO> getItemCategoryByCode(String code) { |
| | | MdmItemCategoryDO itemCategory = itemCategoryService.getItemCategoryByCode(code); |
| | | return success(BeanUtils.toBean(itemCategory, MdmItemCategoryRespDTO.class)); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult<List<MdmItemCategoryRespDTO>> getItemCategoryList(Collection<Long> ids) { |
| | | List<MdmItemCategoryDO> list = itemCategoryService.getItemCategoryList(ids); |
| | | return success(BeanUtils.toBean(list, MdmItemCategoryRespDTO.class)); |
| | |
| | | return success(BeanUtils.toBean(itemCategory, MdmItemCategoryRespDTO.class)); |
| | | } |
| | | |
| | | } |
| | | @Override |
| | | public CommonResult<MdmItemCategoryRespDTO> getItemCategoryByItemOrProduct(String itemOrProduct) { |
| | | MdmItemCategoryDO itemCategory = itemCategoryService.getItemCategoryByItemOrProduct(itemOrProduct); |
| | | return success(BeanUtils.toBean(itemCategory, MdmItemCategoryRespDTO.class)); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult<List<MdmItemCategoryRespDTO>> getItemCategoryAllList() { |
| | | List<MdmItemCategoryDO> list = itemCategoryService.getItemCategoryAllList(); |
| | | return success(BeanUtils.toBean(list, MdmItemCategoryRespDTO.class)); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult<Long> createItemCategory(MdmItemCategorySaveReqDTO createReqDTO) { |
| | | MdmItemCategorySaveReqVO reqVO = BeanUtils.toBean(createReqDTO, MdmItemCategorySaveReqVO.class); |
| | | return success(itemCategoryService.createItemCategory(reqVO)); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult<Boolean> updateItemCategory(MdmItemCategorySaveReqDTO updateReqDTO) { |
| | | MdmItemCategorySaveReqVO reqVO = BeanUtils.toBean(updateReqDTO, MdmItemCategorySaveReqVO.class); |
| | | itemCategoryService.updateItemCategory(reqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult<Boolean> deleteItemCategory(Long id) { |
| | | itemCategoryService.deleteItemCategory(id); |
| | | return success(true); |
| | | } |
| | | |
| | | } |