| | |
| | | //报工 |
| | | log.info("将接收到的玻璃进行钢化自动报工,玻璃id有:{}", glassIdList); |
| | | for (String glass : glassIdList) { |
| | | damageService.autoSubmitReport(glass, inTaskList.get(0).getStartSlot(), "钢化", "进中空理片笼"); |
| | | damageService.autoSubmitReport(glass, inTaskList.get(0).getStartSlot(), "钢化", "进中空理片笼", 1); |
| | | } |
| | | Map<String, List<GlassInfo>> glassListMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getGlassId)); |
| | | |
| | |
| | | } |
| | | |
| | | //获取空闲且领取任务的数据信息,没有任务直接走玻璃调度 |
| | | ReadWriteEntity oneEntity = miloService.readFromOpcUa("DLP2B.DLP2B.outOneRequest"); |
| | | ReadWriteEntity twoEntity = miloService.readFromOpcUa("DLP2B.DLP2B.outTwoRequest"); |
| | | ReadWriteEntity threeEntity = miloService.readFromOpcUa("DLP2B.DLP2B.outThreeRequest"); |
| | | int cell = -1; |
| | | ReadWriteEntity oneEntity = miloService.readFromOpcUa("CMJ1.CMJ1.isFree"); |
| | | HollowGlassOutRelationInfo hollowGlassOutRelationInfo = null; |
| | | if ("1".equals(oneEntity.getValue() + "")) { |
| | | int cell = -1; |
| | | //李赛克线需要获取韩江plc的线路空闲状态:10000000第8位为 1表示忙碌 0表示空闲 |
| | | if (null != oneEntity.getValue() && "1".equals(oneEntity.getValue() + "")) { |
| | | cell = 930; |
| | | hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService |
| | | .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | } |
| | | if (1 == 1 || null == hollowGlassOutRelationInfo && "1".equals(twoEntity.getValue() + "")) { |
| | | |
| | | ReadWriteEntity twoEntity = miloService.readFromOpcUa("ZKQ2.ZKQ2.isFree"); |
| | | if (null == hollowGlassOutRelationInfo && null != twoEntity.getValue() && Boolean.parseBoolean(twoEntity.getValue() + "")) { |
| | | cell = 931; |
| | | hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService |
| | | .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | } |
| | | if (null == hollowGlassOutRelationInfo && "1".equals(threeEntity.getValue() + "")) { |
| | | cell = 932; |
| | | hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService |
| | | .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | } |
| | | |
| | | if (null != hollowGlassOutRelationInfo) { |
| | | //是否允许中空 |
| | | //是否有正在中空的玻璃:中空小片表筛选未出笼的玻璃信息 |
| | |
| | | .eq(HollowGlassOutRelationInfo::getCell, hollowGlassOutRelationInfo.getCell()) |
| | | .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_SUCCESS)); |
| | | } |
| | | // if (redisUtil.getCacheObject("hollowSwitch")) { |
| | | // List<HollowGlassOutRelationInfo> HollowGlassOutRelationInfoList = hollowGlassOutRelationInfoService |
| | | // .list(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | // .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | // .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_NEW)); |
| | | // for (HollowGlassOutRelationInfo e : HollowGlassOutRelationInfoList) { |
| | | // //中空优先:获取理片笼 玻璃小片 破损表 数量 判断笼内版图是否到齐 |
| | | // List<FlowCardGlassInfoDTO> flowCardGlassInfoDTO = hollowBigStorageCageDetailsService.hollowIsAll(e.getFlowCardId(), e.getTotalLayer(), Boolean.TRUE); |
| | | // if (CollectionUtil.isNotEmpty(flowCardGlassInfoDTO)) { |
| | | // //玻璃到齐包括已出片的 |
| | | // //到齐,将玻璃小片数据存入中空小片表,逻辑生成出片任务 结束 |
| | | // for (FlowCardGlassInfoDTO item : flowCardGlassInfoDTO) { |
| | | // List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.queryOutGlassList(item.getFlowCardId(), cell); |
| | | // int finalCell = cell; |
| | | // List<HollowGlassQueueInfo> hollowQueues = hollowBigStorageCageDetailsList.stream().map(queue -> { |
| | | // HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo(); |
| | | // BeanUtils.copyProperties(queue, queueInfo); |
| | | // queueInfo.setState(Const.TEMPERING_NEW); |
| | | // queueInfo.setCell(finalCell); |
| | | // return queueInfo; |
| | | // }).collect(Collectors.toList()); |
| | | // |
| | | // List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.queryOutGlassList(flowCardId, cell); |
| | | // int isPairCount = glassInfo.getTotalLayer() * e.getTotalLayer(); |
| | | // List<HollowGlassQueueInfo> hollowQueues = new ArrayList<>(); |
| | | // loop: |
| | | // for (HollowBigStorageCageDetails queue : hollowBigStorageCageDetailsList) { |
| | | // HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo(); |
| | | // BeanUtils.copyProperties(queue, queueInfo); |
| | | // queueInfo.setState(Const.TEMPERING_NEW); |
| | | // queueInfo.setCell(cell); |
| | | // hollowQueues.add(queueInfo); |
| | | // if (queue.getIsPair() == 1){ |
| | | // isPairCount -=1; |
| | | // if (isPairCount == 0){ |
| | | // break loop; |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // if (CollectionUtil.isNotEmpty(hollowQueues)) { |
| | | // hollowGlassQueueInfoService.saveBatch(hollowQueues); |
| | | // Integer isPair = hollowQueues.get(0).getIsPair(); |
| | | // hollowOutGlassByIsPair(hollowQueues, cell, isPair, e.getTotalLayer()); |
| | | // //将中空任务状态改为开始 |
| | | // hollowGlassOutRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>() |
| | | // .eq(HollowGlassOutRelationInfo::getFlowCardId, e.getFlowCardId()) |
| | | // .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | // .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)); |
| | | // Date endDate = new Date(); |
| | | // log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | // return; |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | // redisUtil.setCacheObject("dispatchHollowSwitch",true); |
| | | //是否存在需要内部调度的格子:执行内部调度任务 |
| | |
| | | if (totalLayer != 0) { |
| | | resultList.add(list.get(0)); |
| | | HollowBigStorageCage storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>() |
| | | .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth).last("limit 1")); |
| | | .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .le(HollowBigStorageCage::getMinThickness, list.get(0).getThickness()) |
| | | .ge(HollowBigStorageCage::getMaxThickness, list.get(0).getThickness()) |
| | | .eq(HollowBigStorageCage::getRemainWidth, slotWidth) |
| | | .orderByAsc(HollowBigStorageCage::getMaxThickness).last("limit 1")); |
| | | targetSlot = storageCage.getSlot(); |
| | | hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>() |
| | | .set(HollowBigStorageCage::getRemainWidth, 0).eq(HollowBigStorageCage::getSlot, targetSlot)); |
| | |
| | | } |
| | | } |
| | | |
| | | private ReadWriteEntity generateReadWriteEntity(String identifier, Object value) { |
| | | public ReadWriteEntity generateReadWriteEntity(String identifier, Object value) { |
| | | return ReadWriteEntity.builder() |
| | | .identifier(identifier) |
| | | //Kep中是Long类型,即:Int32,Java中的int类型 |
| | | .value(value) |
| | | .build(); |
| | | } |
| | | // |
| | | // private List<BigStorageCageTask> computeOutTaskList(List<BigStorageCageTask> taskList, int totalLayer, int target) { |
| | | //// if (target == 931){} |
| | | // if (taskList.get(0).get) |
| | | // return null; |
| | | // } |
| | | } |