| | |
| | | private static final String ALARM_TYPE1 = "一线卧式理片笼"; |
| | | private static final String ALARM_TYPE2 = "二线卧式理片笼"; |
| | | private static final String ALARM_CODE_NOGLASS = "noGlass"; |
| | | private static final String ALARM_CODE_ID = "idSame"; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void startOneOpcTask() throws Exception { |
| | |
| | | } |
| | | if (glassInIdOne.equals(task.getGlassIdIn()) || glassInIdTwo.equals(task.getGlassIdIn())) { |
| | | log.info("玻璃id与上次相同,禁止进片"); |
| | | ProductAlarmInfo alarmInfo = new ProductAlarmInfo(); |
| | | alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW); |
| | | alarmInfo.setAlarmModule(ALARM_MODULE); |
| | | if (deviceId == 1) { |
| | | alarmInfo.setAlarmType(ALARM_TYPE1); |
| | | } else { |
| | | alarmInfo.setAlarmType(ALARM_TYPE2); |
| | | } |
| | | alarmInfo.setAlarmCode(ALARM_CODE_ID); |
| | | alarmInfo.setAlarmMessage(task.getGlassIdIn()); |
| | | productAlarmInfoService.save(alarmInfo); |
| | | Date endDate = new Date(); |
| | | log.info("结束进片任务设备为{},结束时间为:{},共耗时:{}ms", deviceId, endDate, endDate.getTime() - startDate.getTime()); |
| | | return Boolean.FALSE; |
| | |
| | | |
| | | private boolean outTask(S7DataWL task, int deviceId, int cellFlag) { |
| | | Date startDate = new Date(); |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, task.getGlassIdOut())); |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, task.getGlassIdIn())); |
| | | if (null == glassInfo && StringUtils.isNotBlank(task.getGlassIdIn())) { |
| | | log.info("进片玻璃信息不存在,玻璃id:{}", task.getGlassIdIn()); |
| | | log.info("直通玻璃信息不存在,玻璃id:{}", task.getGlassIdIn()); |
| | | ProductAlarmInfo alarmInfo = new ProductAlarmInfo(); |
| | | alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW); |
| | | alarmInfo.setAlarmModule(ALARM_MODULE); |