| | |
| | | return; |
| | | } |
| | | boolean result = edgStorageCageDetailsService.inToVerify(glassIdeValue); |
| | | if ("1".equals(taskRequestTypeValue)&&result) { |
| | | log.info("2、进片请求,且确认字为0,执行进片任务,扫码重复ID验证【有重复=false,无重复=true】:{}",result); |
| | | if ("1".equals(taskRequestTypeValue) && result) { |
| | | log.info("2、进片请求,且确认字为0,执行进片任务,扫码重复ID验证【有重复=false,无重复=true】:{}", result); |
| | | inTo(glassIdeValue, confirmationWrodAddress, currentSlot); |
| | | } else if ("2".equals(taskRequestTypeValue)) { |
| | | //09空闲 :1 10空闲 :2 都空闲:3 其他0 |
| | |
| | | //加笼子里面是否有玻璃,有先出,无玻璃先进 |
| | | boolean outFlase = outTo(Integer.parseInt(out08Glassstate), |
| | | Integer.parseInt(out10Glassstate), confirmationWrodAddress, glassIdeValue, Integer.parseInt(currentSlot)); |
| | | log.info("出片任务是否完成:{},且玻璃id:{}不为空则执行进片任务,扫码重复ID验证【有重复=false,无重复=true】:{}", outFlase, glassIdeValue,result); |
| | | if (!outFlase && StringUtils.isNotBlank(glassIdeValue)&&result) { |
| | | log.info("出片任务是否完成:{},且玻璃id:{}不为空则执行进片任务,扫码重复ID验证【有重复=false,无重复=true】:{}", outFlase, glassIdeValue, result); |
| | | if (!outFlase && StringUtils.isNotBlank(glassIdeValue) && result) { |
| | | inTo(glassIdeValue, confirmationWrodAddress, currentSlot); |
| | | } |
| | | } |
| | |
| | | Assert.isTrue(null != nearestEmpty, "格子已满"); |
| | | log.info("2、查询卧式理片笼里面的空格:{}", nearestEmpty); |
| | | |
| | | //查询玻璃并进行交换 |
| | | GlassInfo glassInfo = queryAndChangeGlass(glassId); |
| | | //查询玻璃信息 |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | if (glassInfo == null) { |
| | | return; |
| | | } |
| | | if ((glassInfo.getWidth() < Double.parseDouble(minTwoFirstLength) && glassInfo.getHeight() < Double.parseDouble(minTwoSecondLength)) || (glassInfo.getWidth() < Double.parseDouble(minTwoSecondLength) && glassInfo.getHeight() < Double.parseDouble(minTwoFirstLength))) { |
| | | log.info("3、玻璃信息不符合进入理片笼最小尺寸,玻璃信息为{}", glassInfo); |
| | | return; |
| | | } |
| | | log.info("4、将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo); |
| | |
| | | * @param glassId |
| | | * @return |
| | | */ |
| | | public GlassInfo queryAndChangeGlass(String glassId) { |
| | | public String queryAndChangeGlass(String glassId) { |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | // .inSql(GlassInfo::getEngineerId, "select engineer_id from engineering where state = 1")); |
| | | Assert.isFalse(null == glassInfo, "玻璃信息不存在"); |
| | | if ((glassInfo.getWidth() < Double.parseDouble(minTwoFirstLength) && glassInfo.getHeight() < Double.parseDouble(minTwoSecondLength)) || (glassInfo.getWidth() < Double.parseDouble(minTwoSecondLength) && glassInfo.getHeight() < Double.parseDouble(minTwoFirstLength))) { |
| | | log.info("3、玻璃信息不符合进入理片笼最小尺寸,玻璃信息为{}", glassInfo); |
| | | return null; |
| | | } |
| | | //按照玻璃尺寸 |
| | | Assert.isFalse(null == glassInfo, "玻璃信息不存在"); //按照玻璃尺寸 |
| | | LambdaQueryWrapper<GlassInfo> queryWrapper = new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getWidth, glassInfo.getWidth()) |
| | | .eq(GlassInfo::getHeight, glassInfo.getHeight()) |
| | |
| | | glassInfo.setGlassId(swapGlassId); |
| | | glassInfoService.updateById(swapGlassInfo); |
| | | glassInfoService.updateById(glassInfo); |
| | | return swapGlassInfo; |
| | | return swapGlassId; |
| | | } |
| | | return glassInfo; |
| | | return ""; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询卧式理片玻璃并进行交换 |
| | | * |
| | | * @param glassId |
| | | * @return |
| | | */ |
| | | public void queryEdgAndChangeGlass(String glassId, String swapGlassId) { |
| | | if (StringUtils.isBlank(swapGlassId)) { |
| | | log.info("当前出笼玻璃不存在需要替换的玻璃"); |
| | | return; |
| | | } |
| | | //获取待出笼的玻璃 |
| | | EdgStorageCageDetails glassInfo = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getGlassId, glassId).eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | // 获取待出笼的玻璃需要替换的玻璃信息 |
| | | EdgStorageCageDetails swapGlassDetailInfo = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getGlassId, swapGlassId).eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | // 玻璃小片表中玻璃已经替换,更新卧理笼内现有的准备出笼的玻璃信息, |
| | | if (null == swapGlassDetailInfo) { |
| | | //需要替换的玻璃为存进卧理,仅需更新当前需要出笼的玻璃信息即可 |
| | | edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getGlassId, glassId).set(EdgStorageCageDetails::getGlassId, swapGlassId)); |
| | | } else { |
| | | //需要替换的玻璃都在卧理内,按照玻璃id对调玻璃信息:对调玻璃id即可 |
| | | edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getId, glassInfo.getId()).set(EdgStorageCageDetails::getGlassId, swapGlassId)); |
| | | edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getId, swapGlassDetailInfo.getId()).set(EdgStorageCageDetails::getGlassId, glassId)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | 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("7、添加出片玻璃尺寸信息到磨边前玻璃表是否完成:{}", glassSizeStatus); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 1); |
| | | log.info("8、发送确认字已完成"); |
| | | Damage damage=new Damage(); |
| | | 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 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); |