| | |
| | | @Value("${mes.max.secondLength}") |
| | | private String secondLength; |
| | | |
| | | @Value("${mes.cache.cacheWidth}") |
| | | private double cacheWidth; |
| | | |
| | | @Value("${mes.cache.cacheHeight}") |
| | | private double cacheHeight; |
| | | |
| | | @Value("${mes.min.one.firstLength}") |
| | | private String minOneFirstLength; |
| | | |
| | |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(e.getGlassId()); |
| | | damage.setLine(e.getEndCell()); |
| | | damage.setWorkingProcedure("冷加工"); |
| | | damage.setWorkingProcedure("磨边"); |
| | | damage.setRemark("磨边前卧式理片"); |
| | | damage.setStatus(0); |
| | | damage.setStatus(1); |
| | | damage.setType(e.getTaskStatus()); |
| | | return damage; |
| | | }).collect(Collectors.toList()); |
| | |
| | | */ |
| | | public void inTo(String glassId, String confirmationWrodAddress, String currentSlot) { |
| | | log.info("1、按照玻璃id:{}获取玻璃小片信息,当前格子为:{}", glassId, currentSlot); |
| | | |
| | | GlassInfo feedGlassInfo = glassInfoService.getOne( |
| | | new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, glassId) |
| | | ); |
| | | if (Math.max(feedGlassInfo.getWidth(), feedGlassInfo.getHeight()) > cacheWidth || Math.min(feedGlassInfo.getWidth(), feedGlassInfo.getHeight()) > cacheHeight) { |
| | | log.info("1.1、玻璃超过卧式理片最大尺寸:{}", feedGlassInfo); |
| | | return; |
| | | } |
| | | |
| | | //添加进片任务 查找空格 |
| | | EdgStorageCage nearestEmpty = edgStorageCageService.selectNearestEmpty(Integer.parseInt(currentSlot), Boolean.FALSE); |
| | | Assert.isTrue(null != nearestEmpty, "格子已满"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 保存出片任务相关信息 |
| | | * |
| | | * @param glassInfo |
| | | * @param endcell |
| | | * @param confirmationWrodAddress |
| | | * @param glassId |
| | | * @return |
| | | */ |
| | | private boolean saveOutGlassMessageBySlot(EdgStorageCageDetails glassInfo, int endcell, String confirmationWrodAddress, String glassId, Integer currentSlot) { |
| | | if (glassInfo != null) { |
| | | log.info("4、添加出片任务,玻璃id:{},任务类型:{},起始位置:{},结束位置:{}", glassInfo.getGlassId(), |
| | | 2, glassInfo.getSlot(), endcell); |
| | | if (glassInfo.getGlassId().equals(glassId)) { |
| | | log.info("5、直通任务,将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo); |
| | | EdgStorageCageDetails details = new EdgStorageCageDetails(); |
| | | //玻璃信息替换 |
| | | String glassIdChange = queryAndChangeGlass(glassId); |
| | | if (StringUtils.isBlank(glassIdChange)) { |
| | | BeanUtils.copyProperties(glassInfo, details); |
| | | } else { |
| | | GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | BeanUtils.copyProperties(glassInfo, details); |
| | | } |
| | | EdgStorageCage nearestEmpty = edgStorageCageService.selectNearestEmpty(currentSlot, Boolean.TRUE); |
| | | Assert.isTrue(null != nearestEmpty, "格子已满,无法执行直通任务"); |
| | | log.info("3、查询卧式理片笼里面的空格:{}", nearestEmpty); |
| | | details.setSlot(nearestEmpty.getSlot()); |
| | | details.setState(Const.GLASS_STATE_OUT); |
| | | edgStorageCageDetailsService.save(details); |
| | | boolean taskCacheStatus = saveTaskCache(glassInfo.getGlassId(), nearestEmpty.getSlot(), endcell, Const.GLASS_CACHE_TYPE_THROUGH); |
| | | log.info("6、添加出片任务是否完成:{}", taskCacheStatus); |
| | | } else { |
| | | log.info("5、非直通任务,将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo); |
| | | if (endcell != currentSlot) { |
| | | EdgStorageCageDetails currentGlass = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(EdgStorageCageDetails::getSlot, currentSlot).eq(EdgStorageCageDetails::getWidth, glassInfo.getWidth()) |
| | | .eq(EdgStorageCageDetails::getHeight, glassInfo.getHeight()).eq(EdgStorageCageDetails::getThickness, glassInfo.getThickness()) |
| | | ); |
| | | if (null != currentGlass) { |
| | | glassInfo = currentGlass; |
| | | endcell = currentSlot; |
| | | } |
| | | } |
| | | //玻璃信息替换 |
| | | String glassIdChange = queryAndChangeGlass(glassInfo.getGlassId()); |
| | | //处理在卧理内的玻璃信息:笼内的数据处理 |
| | | queryEdgAndChangeGlass(glassInfo.getGlassId(), glassIdChange); |
| | | LambdaUpdateWrapper<EdgStorageCageDetails> wrapper = new LambdaUpdateWrapper<>(); |
| | | wrapper.eq(EdgStorageCageDetails::getGlassId, glassInfo.getGlassId()).set(EdgStorageCageDetails::getState, Const.GLASS_STATE_OUT); |
| | | edgStorageCageDetailsService.update(wrapper); |
| | | log.info("5、更新出片玻璃的状态为{}", Const.GLASS_STATE_OUT); |
| | | |
| | | boolean taskCacheStatus = saveTaskCache(glassInfo.getGlassId(), glassInfo.getSlot(), endcell, Const.GLASS_CACHE_TYPE_OUT); |
| | | log.info("6、添加出片任务是否完成:{}", taskCacheStatus); |
| | | } |
| | | boolean glassSizeStatus = saveGlassSize(glassInfo, endcell); |
| | | log.info("7、添加出片玻璃尺寸信息到磨边前玻璃表是否完成:{}", glassSizeStatus); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 1); |
| | | log.info("8、发送确认字已完成"); |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(glassInfo.getGlassId()); |
| | | damage.setWorkingProcedure("切割"); |
| | | damage.setLine(1001); |
| | | damage.setType(1); |
| | | damage.setRemark("过卧式理片"); |
| | | damageService.insertDamage(damage); |
| | | return Boolean.TRUE; |
| | | } |
| | | return Boolean.FALSE; |
| | | } |
| | | |
| | | /** |
| | | * 添加理片笼任务 |
| | | * |
| | | * @param glassId |