1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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.MdmItemBatchConfigRespDTO;
import cn.iocoder.yudao.module.mdm.dal.dataobject.item.MdmItemBatchConfigDO;
import cn.iocoder.yudao.module.mdm.service.item.MdmItemBatchConfigService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
/**
 * MDM 物料批次配置 API 实现类
 *
 * @author 芋道源码
 */
@RestController
@Validated
public class MdmItemBatchConfigApiImpl implements MdmItemBatchConfigApi {
 
    @Resource
    private MdmItemBatchConfigService itemBatchConfigService;
 
    @Override
    public CommonResult<MdmItemBatchConfigRespDTO> getItemBatchConfigByItemId(Long itemId) {
        MdmItemBatchConfigDO config = itemBatchConfigService.getItemBatchConfigByItemId(itemId);
        return success(BeanUtils.toBean(config, MdmItemBatchConfigRespDTO.class));
    }
 
    @Override
    public CommonResult<Long> saveItemBatchConfig(MdmItemBatchConfigDO config) {
        return success(itemBatchConfigService.saveItemBatchConfig(config));
    }
 
}