| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mdm.api.item; |
| | | |
| | | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.module.mdm.api.item.dto.MdmItemSkuRespDTO; |
| | | import cn.iocoder.yudao.module.mdm.dal.dataobject.item.MdmItemSkuDO; |
| | | import cn.iocoder.yudao.module.mdm.service.item.MdmItemSkuService; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| | | |
| | | /** |
| | | * MDM ç©æ SKU API å®ç°ç±» |
| | | * |
| | | * @author èéæºç |
| | | */ |
| | | @RestController |
| | | @RequestMapping(MdmItemSkuApi.PREFIX) |
| | | @Validated |
| | | public class MdmItemSkuApiImpl implements MdmItemSkuApi { |
| | | |
| | | @Resource |
| | | private MdmItemSkuService itemSkuService; |
| | | |
| | | @Override |
| | | public CommonResult<MdmItemSkuRespDTO> getItemSku(Long id) { |
| | | MdmItemSkuDO sku = itemSkuService.getItemSku(id); |
| | | return success(BeanUtils.toBean(sku, MdmItemSkuRespDTO.class)); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult<List<MdmItemSkuRespDTO>> getItemSkuList(Collection<Long> ids) { |
| | | List<MdmItemSkuDO> list = itemSkuService.getItemSkuList(ids); |
| | | return success(BeanUtils.toBean(list, MdmItemSkuRespDTO.class)); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult<List<MdmItemSkuRespDTO>> getItemSkuListByItemId(Long itemId) { |
| | | List<MdmItemSkuDO> list = itemSkuService.getItemSkuListByItemId(itemId); |
| | | return success(BeanUtils.toBean(list, MdmItemSkuRespDTO.class)); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult<MdmItemSkuRespDTO> validateItemSkuExists(Long id) { |
| | | MdmItemSkuDO sku = itemSkuService.validateItemSkuExists(id); |
| | | return success(BeanUtils.toBean(sku, MdmItemSkuRespDTO.class)); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult<MdmItemSkuRespDTO> validateItemSkuExistsAndEnable(Long id) { |
| | | MdmItemSkuDO sku = itemSkuService.validateItemSkuExistsAndEnable(id); |
| | | return success(BeanUtils.toBean(sku, MdmItemSkuRespDTO.class)); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult<MdmItemSkuRespDTO> getItemSkuByCode(String code) { |
| | | MdmItemSkuDO sku = itemSkuService.getItemSkuByCode(code); |
| | | return success(BeanUtils.toBean(sku, MdmItemSkuRespDTO.class)); |
| | | } |
| | | |
| | | @Override |
| | | public CommonResult<MdmItemSkuRespDTO> getItemSkuByBarCode(String barCode) { |
| | | MdmItemSkuDO sku = itemSkuService.getItemSkuByBarCode(barCode); |
| | | return success(BeanUtils.toBean(sku, MdmItemSkuRespDTO.class)); |
| | | } |
| | | |
| | | } |