liyong
4 天以前 0f792c9b3b88dc4b1b7b306f89e257d931d2d0bd
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/mdm/MesMdmItemServiceImpl.java
@@ -1,8 +1,11 @@
package cn.iocoder.yudao.module.mes.service.mdm;
import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.mdm.MesMdmItemDO;
import cn.iocoder.yudao.module.mes.dal.mysql.mdm.MesMdmItemMapper;
import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@@ -25,6 +28,8 @@
    @Resource
    private MesMdmItemMapper mesMdmItemMapper;
    @Autowired
    private MesMdItemService mesMdItemService;
    @Override
    public MesMdmItemDO getItem(Long id) {
@@ -41,6 +46,19 @@
    }
    @Override
    public MesMdmItemDO mesValidateItemExists(Long itemId) {
        MesMdItemDO mesItem = mesMdItemService.getItem(itemId);
        if (mesItem == null) {
            throw exception(MD_ITEM_NOT_EXISTS);
        }
        MesMdmItemDO item = mesMdmItemMapper.selectById(mesItem.getMdmItemId());
        if (item == null) {
            throw exception(MD_ITEM_NOT_EXISTS);
        }
        return item;
    }
    @Override
    public MesMdmItemDO validateItemExistsAndEnable(Long id) {
        MesMdmItemDO item = validateItemExists(id);
        if (item.getStatus() != null && item.getStatus() == 1) {