| | |
| | | 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; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private MesMdmItemMapper mesMdmItemMapper; |
| | | @Autowired |
| | | private MesMdItemService mesMdItemService; |
| | | |
| | | @Override |
| | | public MesMdmItemDO getItem(Long id) { |
| | |
| | | } |
| | | |
| | | @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) { |