| | |
| | | import com.ruoyi.production.pojo.ProcessRouteItem; |
| | | import com.ruoyi.production.pojo.ProcessRouteItemParam; |
| | | import com.ruoyi.production.service.ProcessRouteItemService; |
| | | import com.ruoyi.production.service.ProductMaterialSkuService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | private ProcessRouteItemParamMapper processRouteItemParamMapper; |
| | | |
| | | @Autowired |
| | | private ProductMaterialSkuService productMaterialSkuService; |
| | | |
| | | @Override |
| | | public List<ProcessRouteItemDto> listProcessRouteItemDto(ProcessRouteItemDto processRouteItemDto) { |
| | |
| | | if (processRouteItem == null) { |
| | | throw new ServiceException("数据不能为空"); |
| | | } |
| | | if (processRouteItem.getProductModelId() != null) { |
| | | Object product = productMaterialSkuService.getById(processRouteItem.getProductModelId()); |
| | | if (product == null) { |
| | | throw new ServiceException("操作失败:关联的产品(ID:" + processRouteItem.getProductModelId() + ")不存在"); |
| | | } |
| | | } else { |
| | | throw new ServiceException("产品ID不能为空"); |
| | | } |
| | | |
| | | Long tenantId = SecurityUtils.getLoginUser().getTenantId(); |
| | | processRouteItem.setTenantId(tenantId); |
| | | |