| | |
| | | } |
| | | |
| | | //获取空闲且领取任务的数据信息,没有任务直接走玻璃调度 |
| | | 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); |
| | | //是否存在需要内部调度的格子:执行内部调度任务 |