| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | |
| | | @Value("${mes.minCount}") |
| | | private int minCount; |
| | | |
| | | @Value("${mes.carWidth}") |
| | | private Integer carWidth; |
| | | |
| | | @Value("${mes.slotWidth}") |
| | | private Integer slotWidth; |
| | | |
| | | @Value("${mes.carMaxSize}") |
| | | private Integer carMaxSize; |
| | | |
| | | @Value("${mes.galssGap}") |
| | | private Integer galssGap; |
| | | |
| | | /** |
| | | * 查询进/出片任务 |
| | |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList |
| | | ) { |
| | | if (bigStorageCageDetails.getBigStorageCageFeedTask().getTaskState() == 0) { |
| | | carWidth -= Integer.parseInt(bigStorageCageDetails.getWidth().toString()) + bigStorageCageDetails.getGap(); |
| | | carWidth -= Integer.parseInt(bigStorageCageDetails.getWidth().toString()) + galssGap; |
| | | } |
| | | } |
| | | return carWidth; |
| | |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setState(0); |
| | | bigStorageCageDetails.setGap(Const.BIG_STORAGE_GAP); |
| | | bigStorageCageDetails.setGap(galssGap); |
| | | return bigStorageCageDetails; |
| | | } |
| | | |
| | |
| | | public BigStorageDTO queryTargetSlotByTempering(GlassInfo glassInfo) { |
| | | BigStorageDTO bigStorageDTO = null; |
| | | MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(BigStorageCage.class) |
| | | .selectAsClass(BigStorageCage.class, BigStorageDTO.class) |
| | | .selectAll(BigStorageCage.class) |
| | | .leftJoin(BigStorageCageDetails.class, BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | .gt(BigStorageCage::getRemainWidth, glassInfo.getWidth()) |
| | | .last("limit 1"); |
| | | if (glassInfo.getTemperingLayoutId() == 0) { |
| | | wrapper.eq(BigStorageCageDetails::getWidth, glassInfo.getWidth()).eq(BigStorageCageDetails::getHeight, glassInfo.getHeight()); |
| | | } else { |
| | | wrapper.eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() + 1); |
| | | } |
| | | bigStorageDTO = bigStorageCageService.selectJoinOne(BigStorageDTO.class, wrapper); |
| | | if (null != bigStorageDTO) { |
| | | BigStorageCage bigStorageCage = bigStorageCageService.selectJoinOne(BigStorageCage.class, wrapper); |
| | | if (null != bigStorageCage) { |
| | | bigStorageDTO = new BigStorageDTO(); |
| | | bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | return bigStorageDTO; |
| | | } |
| | | BigStorageCage bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, Const.BIG_STORAGE_WIDTH) |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .inSql(BigStorageCage::getDeviceId, |
| | | "select distinct device_id from big_storage_cage_details where tempering_layout_id = " + glassInfo.getTemperingLayoutId()) |
| | | .last("limit 1")); |
| | |
| | | return bigStorageDTO; |
| | | } |
| | | bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, Const.BIG_STORAGE_WIDTH) |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .last("limit 1")); |
| | | Assert.isTrue(null != bigStorageCage, "没有空余的笼子存放玻璃"); |
| | | bigStorageDTO = new BigStorageDTO(); |
| | | bigStorageDTO.setWidth(bigStorageCage.getRemainWidth()); |
| | | bigStorageDTO.setSlot(bigStorageCage.getSlot()); |
| | | return bigStorageDTO; |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |