| | |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemTypeDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.md.unitmeasure.MesMdUnitMeasureDO; |
| | | import cn.iocoder.yudao.module.mes.dal.mysql.md.item.MesMdItemMapper; |
| | | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemBatchConfigService; |
| | | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; |
| | | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemTypeService; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Set; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| | | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*; |
| | |
| | | |
| | | @Resource |
| | | private MesMdItemService itemService; |
| | | @Resource |
| | | private MesMdItemMapper itemMapper; |
| | | @Resource |
| | | private MesMdItemTypeService itemTypeService; |
| | | @Resource |
| | |
| | | return saveReqVO; |
| | | } |
| | | |
| | | @Override |
| | | public void deleteItem(Long mdmItemId) { |
| | | log.info("[deleteItem] 同步删除 MES 物料产品,mdmItemId={}", mdmItemId); |
| | | MesMdItemDO existItem = itemService.getItemByMdmItemId(mdmItemId); |
| | | if (existItem != null) { |
| | | itemService.deleteItem(existItem.getId()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void updateItemStatus(Long mdmItemId, Integer status) { |
| | | log.info("[updateItemStatus] 同步更新 MES 物料产品状态,mdmItemId={}, status={}", mdmItemId, status); |
| | | MesMdItemDO existItem = itemService.getItemByMdmItemId(mdmItemId); |
| | | if (existItem != null) { |
| | | itemService.updateItemStatus(existItem.getId(), status); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Set<Long> getSyncedMdmItemIds(Collection<Long> mdmItemIds) { |
| | | return itemMapper.selectMdmItemIdsByMdmItemIds(mdmItemIds); |
| | | } |
| | | |
| | | /** |
| | | * 保存批次配置 |
| | | */ |