| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.mdc.service.IMdcProductionEquipmentService; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.MdcProductionEquipment; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author: LiuS |
| | |
| | | |
| | | @Resource |
| | | private IMdcProductionService mdcProductionService; |
| | | @Resource |
| | | private IMdcEquipmentService mdcEquipmentService; |
| | | |
| | | /** |
| | | * 根据设备id查询产线信息 |
| | |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * 根据指定产线id查询设备信息 |
| | | */ |
| | | @Override |
| | | public List<MdcEquipment> queryEquipmentsOfProduction(String productionId){ |
| | | List<String> equipmentIds = this.list(new LambdaQueryWrapper<MdcProductionEquipment>().eq(MdcProductionEquipment::getProductionId, productionId)) |
| | | .stream().map(MdcProductionEquipment::getEquipmentId).collect(Collectors.toList()); |
| | | if (!equipmentIds.isEmpty()) { |
| | | return mdcEquipmentService.list(new LambdaQueryWrapper<MdcEquipment>().in(MdcEquipment::getId, equipmentIds)); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 根据指定产线ids查询设备信息 |
| | | */ |
| | | @Override |
| | | public List<MdcEquipment> queryEquipmentsOfProductions(List<String> productionIds){ |
| | | List<String> equipmentIds = this.list(new LambdaQueryWrapper<MdcProductionEquipment>() |
| | | .in(MdcProductionEquipment::getProductionId, productionIds)).stream().map(MdcProductionEquipment::getEquipmentId).collect(Collectors.toList()); |
| | | if (!equipmentIds.isEmpty()) { |
| | | return mdcEquipmentService.list(new LambdaQueryWrapper<MdcEquipment>().in(MdcEquipment::getId, equipmentIds)); |
| | | } |
| | | return null; |
| | | } |
| | | } |