| | |
| | | } |
| | | } |
| | | //超大尺寸 |
| | | if (slotMaxHeight < Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) || glassInfoList.get(0).getThickness() > slotMaxthickness) { |
| | | if (slotMaxHeight < Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) || glassInfoList.get(0).getThickness() >= slotMaxthickness) { |
| | | int count = hollowBigStorageCageDetailsService.count(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getSlot, THROUGH_SLOT) |
| | | .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | |
| | | //计算目标格子 |
| | | List<HollowBigStorageCageHistoryTask> historyTasks = new ArrayList<>(); |
| | | try { |
| | | for (BigStorageCageTask task : inTaskList) { |
| | | GlassInfo info = glassListMap.get(task.getGlassId()).get(0); |
| | | HollowBigStorageDTO bigStorageDTO = hollowGlassRelationInfoService.queryHollowTargetSlot(info.getFlowCardId(), |
| | | info.getWidth(), info.getHeight(), info.getTotalLayer(), info.getLayer()); |
| | | if (slotMaxHeight > Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) && glassInfoList.get(0).getThickness() < slotMaxthickness) { |
| | | for (BigStorageCageTask task : inTaskList) { |
| | | GlassInfo info = glassListMap.get(task.getGlassId()).get(0); |
| | | HollowBigStorageDTO bigStorageDTO = hollowGlassRelationInfoService.queryHollowTargetSlot(info.getFlowCardId(), |
| | | info.getWidth(), info.getHeight(), info.getTotalLayer(), info.getLayer()); |
| | | // 临时更新格子的剩余尺寸:防止相邻玻璃进同一格子造成剩余尺寸不足,玻璃越界的情况,任务完成后再次更新大理片笼表剩余宽度(按照笼内玻璃数量更新大理片笼剩余尺寸) |
| | | hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>() |
| | | .set(HollowBigStorageCage::getRemainWidth, bigStorageDTO.getRemainWidth() - Math.max(info.getWidth(), info.getHeight()) - glassGap) |
| | | .eq(HollowBigStorageCage::getSlot, bigStorageDTO.getSlot())); |
| | | task.setTargetSlot(bigStorageDTO.getSlot()); |
| | | task.setGlassId(info.getGlassId()); |
| | | bigStorageCageTaskService.updateTaskMessage(BIG_STORAGE_CAGE_IN_TWO_TASK, task); |
| | | hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>() |
| | | .set(HollowBigStorageCage::getRemainWidth, bigStorageDTO.getRemainWidth() - Math.max(info.getWidth(), info.getHeight()) - glassGap) |
| | | .eq(HollowBigStorageCage::getSlot, bigStorageDTO.getSlot())); |
| | | task.setTargetSlot(bigStorageDTO.getSlot()); |
| | | task.setGlassId(info.getGlassId()); |
| | | bigStorageCageTaskService.updateTaskMessage(BIG_STORAGE_CAGE_IN_TWO_TASK, task); |
| | | //存放历史任务 |
| | | HollowBigStorageCageHistoryTask historyTask = new HollowBigStorageCageHistoryTask(); |
| | | BeanUtils.copyProperties(task, historyTask); |
| | | historyTask.setTaskType(Const.BIG_STORAGE_AFTER_IN); |
| | | historyTask.setGlassCount(glassInfoList.size()); |
| | | historyTask.setTaskState(Const.ENGINEERING_NEW); |
| | | historyTasks.add(historyTask); |
| | | //存放详情数据 |
| | | HollowBigStorageCageDetails cageDetails = new HollowBigStorageCageDetails(); |
| | | BeanUtils.copyProperties(bigStorageDTO, cageDetails); |
| | | BeanUtils.copyProperties(info, cageDetails); |
| | | cageDetails.setState(Const.GLASS_STATE_NEW); |
| | | cageDetails.setSequence(bigStorageDTO.getSlotSequence()); |
| | | cageDetails.setGap(glassGap); |
| | | cageDetails.setId(null); |
| | | hollowBigStorageCageDetailsService.save(cageDetails); |
| | | hollowGlassRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassRelationInfo>() |
| | | .set(HollowGlassRelationInfo::getGlassId, cageDetails.getGlassId()) |
| | | .set(HollowGlassRelationInfo::getTemperingLayoutId, cageDetails.getTemperingLayoutId()) |
| | | .set(HollowGlassRelationInfo::getTemperingFeedSequence, cageDetails.getTemperingFeedSequence()) |
| | | .set(HollowGlassRelationInfo::getEngineerId, cageDetails.getEngineerId()) |
| | | .set(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_OCCUPY) |
| | | .eq(HollowGlassRelationInfo::getFlowCardId, bigStorageDTO.getFlowCardId()) |
| | | .eq(HollowGlassRelationInfo::getLayer, bigStorageDTO.getLayer()) |
| | | .eq(HollowGlassRelationInfo::getVirtualSlot, bigStorageDTO.getVirtualSlot()) |
| | | .eq(HollowGlassRelationInfo::getSlotSequence, bigStorageDTO.getSlotSequence()) |
| | | .eq(HollowGlassRelationInfo::getHollowSequence, bigStorageDTO.getHollowSequence()) |
| | | ); |
| | | } |
| | | } else { |
| | | BigStorageCageTask task = inTaskList.get(0); |
| | | task.setTargetSlot(THROUGH_SLOT); |
| | | bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_two_task", task); |
| | | //存放历史任务 |
| | | HollowBigStorageCageHistoryTask historyTask = new HollowBigStorageCageHistoryTask(); |
| | | BeanUtils.copyProperties(task, historyTask); |
| | |
| | | historyTask.setGlassCount(glassInfoList.size()); |
| | | historyTask.setTaskState(Const.ENGINEERING_NEW); |
| | | historyTasks.add(historyTask); |
| | | //存放详情数据 |
| | | GlassInfo info = glassInfoList.get(0); |
| | | HollowBigStorageCageDetails cageDetails = new HollowBigStorageCageDetails(); |
| | | BeanUtils.copyProperties(bigStorageDTO, cageDetails); |
| | | BeanUtils.copyProperties(info, cageDetails); |
| | | cageDetails.setSlot(THROUGH_SLOT); |
| | | cageDetails.setState(Const.GLASS_STATE_NEW); |
| | | cageDetails.setSequence(bigStorageDTO.getSlotSequence()); |
| | | cageDetails.setDeviceId(0); |
| | | cageDetails.setSequence(0); |
| | | cageDetails.setHollowSequence(0); |
| | | cageDetails.setGap(glassGap); |
| | | cageDetails.setFilmsId(info.getFilmsid()); |
| | | cageDetails.setId(null); |
| | | hollowBigStorageCageDetailsService.save(cageDetails); |
| | | hollowGlassRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassRelationInfo>() |
| | | .set(HollowGlassRelationInfo::getGlassId, cageDetails.getGlassId()) |
| | | .set(HollowGlassRelationInfo::getTemperingLayoutId, cageDetails.getTemperingLayoutId()) |
| | | .set(HollowGlassRelationInfo::getTemperingFeedSequence, cageDetails.getTemperingFeedSequence()) |
| | | .set(HollowGlassRelationInfo::getEngineerId, cageDetails.getEngineerId()) |
| | | .set(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_OCCUPY) |
| | | .eq(HollowGlassRelationInfo::getFlowCardId, bigStorageDTO.getFlowCardId()) |
| | | .eq(HollowGlassRelationInfo::getLayer, bigStorageDTO.getLayer()) |
| | | .eq(HollowGlassRelationInfo::getVirtualSlot, bigStorageDTO.getVirtualSlot()) |
| | | .eq(HollowGlassRelationInfo::getSlotSequence, bigStorageDTO.getSlotSequence()) |
| | | .eq(HollowGlassRelationInfo::getHollowSequence, bigStorageDTO.getHollowSequence()) |
| | | ); |
| | | } |
| | | } catch (Exception exception) { |
| | | log.info("进片任务执行中发生异常:{}", exception); |