| | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.BigStorageDTO; |
| | | import com.mes.bigstorage.entity.dto.SlotSequenceDTO; |
| | | import com.mes.bigstorage.entity.dto.TemperingLayoutDTO; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | |
| | | |
| | | @Value("${mes.sequence.order}") |
| | | private boolean sequenceOrder; |
| | | |
| | | @Value("${mes.slotWidth}") |
| | | private Integer slotWidth; |
| | | |
| | | public static boolean bigStorageCageFullAlarm = false; |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | //todo:获取状态字 钢化优先 or 人工下片优先 |
| | | //获取状态字 钢化优先 or 人工下片优先 |
| | | if (true) { |
| | | //todo:钢化优先:获取理片笼 玻璃小片 破损表 数量 判断笼内版图是否到齐 |
| | | //钢化优先:获取理片笼 玻璃小片 破损表 数量 判断笼内版图是否到齐 |
| | | TemperingLayoutDTO temperingLayoutDTO = bigStorageCageDetailsService.temperingIsAll(); |
| | | if (null != temperingLayoutDTO) { |
| | | //玻璃到齐 |
| | | //todo: 到齐,将玻璃小片数据存入钢化小片表,逻辑生成出片任务 结束 |
| | | //到齐,将玻璃小片数据存入钢化小片表,逻辑生成出片任务 结束 |
| | | List<BigStorageCageDetails> bigStorageCageDetails = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getTemperingLayoutId, temperingLayoutDTO.getTemperingLayoutId()) |
| | | .eq(BigStorageCageDetails::getEngineerId, temperingLayoutDTO.getEngineerId())); |
| | |
| | | }).collect(Collectors.toList()); |
| | | temperingGlassInfoService.saveBatch(temperingGlassInfos); |
| | | |
| | | //打车剩余尺寸 |
| | | //大车剩余尺寸 |
| | | AtomicReference<Integer> remainWidth = new AtomicReference<>(Const.BIG_STORAGE_WIDTH); |
| | | temperingGlassInfoList.stream().forEach(e -> { |
| | | if (bigStorageCageOutTaskList.size() > 5 || e.getWidth() > remainWidth.get()) { |
| | |
| | | bigStorageCageOutTaskService.saveBatch(bigStorageCageOutTaskList); |
| | | return; |
| | | } |
| | | //todo: 未到齐 执行内部调度任务 结束 |
| | | //未到齐 执行内部调度任务 结束 |
| | | TemperingLayoutDTO temperingOccupySlot = bigStorageCageDetailsService.queryTemperingOccupySlot(); |
| | | if (null != temperingOccupySlot) { |
| | | List<SlotSequenceDTO> slotSequenceList = bigStorageCageDetailsService.queryGlassMaxAndMin(temperingOccupySlot.getEngineerId(), temperingOccupySlot.getTemperingLayoutId()); |
| | | for (int i = 0; i < slotSequenceList.size() - 1; i++) { |
| | | SlotSequenceDTO first = slotSequenceList.get(i); |
| | | SlotSequenceDTO second = slotSequenceList.get(i + 1); |
| | | if (first.getMinSequence() == second.getMaxSequence() + 1 |
| | | && second.getRemainWidth() > Const.BIG_STORAGE_WIDTH - first.getRemainWidth() - Const.BIG_STORAGE_GAP) { |
| | | List<BigStorageCageDetails> list = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getSlot, first.getSlot()).eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | List<BigStorageCageOutTask> outTasks = list.stream().map(e -> new BigStorageCageOutTask(e.getGlassId(), first.getSlot(), second.getSlot(), |
| | | 0, 0, 1)).collect(Collectors.toList()); |
| | | bigStorageCageOutTaskService.saveBatch(outTasks); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | } |
| | | //todo:笼内是否有人工下片玻璃 有直接出 无 结束 |
| | | |
| | | } |
| | | //笼内是否有人工下片玻璃 有直接出 无 结束 |
| | | List<BigStorageCageDetails> oneList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN).orderByDesc(BigStorageCageDetails::getWidth)); |
| | | AtomicReference<Integer> remainWidth = new AtomicReference<>(Const.BIG_STORAGE_WIDTH); |
| | | if (CollectionUtils.isNotEmpty(oneList)) { |
| | | oneList.stream().forEach(e -> { |
| | | if (remainWidth.get() < e.getWidth().intValue()) { |
| | | return; |
| | | } |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), 0, 0, 0, 1)); |
| | | remainWidth.set(remainWidth.get() - e.getWidth().intValue() - Const.BIG_STORAGE_GAP); |
| | | }); |
| | | bigStorageCageOutTaskService.saveBatch(bigStorageCageOutTaskList); |
| | | return; |
| | | } |
| | | |
| | | } |
| | | |