| | |
| | | private static final String ALARM_TYPE = "中空大理片"; |
| | | private static final String ALARM_CODE_SIZE = "sizeSame"; |
| | | private static final String ALARM_CODE_ID = "idSame"; |
| | | private static final String ALARM_CODE_SLOT = "slotLess"; |
| | | private static final String ALARM_CODE_OVER = "overSize"; |
| | | |
| | | /** |
| | | * 直通格子 |
| | |
| | | .ge(HollowBigStorageCage::getMaxThickness, entry.getKey())); |
| | | if (count < entry.getValue()) { |
| | | log.info("笼内格子剩余数量不足,结束本次进片"); |
| | | ProductAlarmInfo alarmInfo = new ProductAlarmInfo(); |
| | | alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW); |
| | | alarmInfo.setAlarmModule(ALARM_MODULE); |
| | | alarmInfo.setAlarmType(ALARM_TYPE); |
| | | alarmInfo.setAlarmCode(ALARM_CODE_SLOT); |
| | | alarmInfo.setAlarmMessage(count + ""); |
| | | productAlarmInfoService.save(alarmInfo); |
| | | //向plc发送报警:笼内格子剩余数量不足 |
| | | s7DataZKDLPOne = new S7DataZKDLPOne(); |
| | | s7DataZKDLPOne.setAlramSignal(16); |
| | |
| | | }); |
| | | } |
| | | |
| | | List<HollowGlassQueueInfo> infoList = unFinishHollowQueueList.stream().filter(e -> !(e.getSlot() > 500 && e.getSlot() < 900 && e.getIsPair() != 1)).collect(Collectors.toList()); |
| | | List<HollowGlassQueueInfo> infoList = unFinishHollowQueueList.stream().filter(e -> !(e.getSlot() >= 500 && e.getSlot() < 900 && e.getIsPair() != 1)).collect(Collectors.toList()); |
| | | log.info("有正在出片的中空任务"); |
| | | Integer isPair = infoList.get(0).getIsPair(); |
| | | hollowOutGlassByIsPair(infoList, hollowGlassOutRelationInfo.getCell(), isPair, hollowGlassOutRelationInfo.getTotalLayer(), hollowGlassOutRelationInfo.getIsForce()); |
| | |
| | | log.info("当前未收到进片请求,结束进片任务"); |
| | | return; |
| | | } |
| | | if (StringUtils.isNotBlank(s7DataZKDLPOne.getId1())) { |
| | | log.info("当前存在进片任务,结束"); |
| | | return; |
| | | } |
| | | if (StringUtils.isNotBlank(s7DataZKDLPOne.getId1())) { |
| | | log.info("当前存在进片任务请求,结束本次大笼子调度"); |
| | | return; |
| | | } |
| | | //有请求信号 |
| | | List<String> glassIdList = hollowGlassQueueInfoService.queryNeedInCarGlass(); |
| | | if (CollectionUtil.isEmpty(glassIdList)) { |
| | |
| | | if (count > 0) { |
| | | return; |
| | | } |
| | | List<HollowBigStorageCageDetails> list = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | // .in(HollowBigStorageCageDetails::getDeviceId, 6) |
| | | .in(HollowBigStorageCageDetails::getGlassId, glassIdList)); |
| | | log.info("获取调度任务列表:{}", list); |
| | | if (CollectionUtil.isEmpty(list)) { |
| | | HollowBigStorageCageDetails details = null; |
| | | for (String glassId : glassIdList) { |
| | | details = hollowBigStorageCageDetailsService.getOne(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(HollowBigStorageCageDetails::getGlassId, glassId).last("limit 1")); |
| | | log.info("获取调度任务:{}", details); |
| | | if (details != null) { |
| | | break; |
| | | } |
| | | } |
| | | if (details == null) { |
| | | return; |
| | | } |
| | | HollowBigStorageCageDetails details = list.get(0); |
| | | log.info("获取需要调度的单条任务:{}", details); |
| | | //生成进进片大车任务 |
| | | hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>() |
| | |
| | | S7DataZKDLPOne s7DataZKDLPOne = new S7DataZKDLPOne(); |
| | | s7DataZKDLPOne.setAlramSignal(16); |
| | | s7SerializerZKDLPOne.write(s7DataZKDLPOne); |
| | | ProductAlarmInfo alarmInfo = new ProductAlarmInfo(); |
| | | alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW); |
| | | alarmInfo.setAlarmModule(ALARM_MODULE); |
| | | alarmInfo.setAlarmType(ALARM_TYPE); |
| | | alarmInfo.setAlarmCode(ALARM_CODE_SLOT); |
| | | alarmInfo.setAlarmMessage(""); |
| | | productAlarmInfoService.save(alarmInfo); |
| | | Assert.isFalse(storageCage == null, "任务调度没有多余格子,结束调度任务"); |
| | | } |
| | | |