| | |
| | | @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; |
| | | |
| | |
| | | |
| | | public static String engineerId = ""; |
| | | |
| | | //@Scheduled(fixedDelay = 1000) |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void plcHomeEdgTask() { |
| | | Date startDate = new Date(); |
| | | log.info("本次任务开始执行时间:{}", startDate); |
| | |
| | | String out10Glassstate = plcParameterObject.getPlcParameter("A10_glass_status").getValue(); |
| | | String confirmationWrodAddress = plcParameterObject.getPlcParameter("MES_confirmation_word").getAddress(); |
| | | String currentSlot = plcParameterObject.getPlcParameter("Current_slot").getValue(); |
| | | |
| | | // taskRequestTypeValue = "3"; |
| | | // out08Glassstate = "1"; |
| | | // out10Glassstate = "1"; |
| | | // currentSlot = "2"; |
| | | // confirmationWrodValue = "0"; |
| | | // glassIdeValue = "P24092706|15|5"; |
| | | |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:A09:{}、A10:{},当前格子号为:{}", |
| | | taskRequestTypeValue, glassIdeValue, confirmationWrodValue, out08Glassstate, out10Glassstate, currentSlot); |
| | |
| | | //09空闲 :1 10空闲 :2 都空闲:3 其他0 |
| | | log.info("2、出片请求,且确认字为0,执行出片任务"); |
| | | outTo(Integer.parseInt(out08Glassstate), |
| | | Integer.parseInt(out10Glassstate), confirmationWrodAddress, "", 0); |
| | | Integer.parseInt(out10Glassstate), confirmationWrodAddress, "", Integer.parseInt(currentSlot)); |
| | | } else if ("3".equals(taskRequestTypeValue)) { |
| | | log.info("2、进片和出片都空闲,执行出片任务"); |
| | | //加笼子里面是否有玻璃,有先出,无玻璃先进 |
| | |
| | | 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, "格子已满"); |
| | |
| | | .eq(GlassInfo::getHeight, glassInfo.getHeight()) |
| | | .eq(GlassInfo::getThickness, glassInfo.getThickness()) |
| | | .eq(GlassInfo::getFilmsid, glassInfo.getFilmsid()) |
| | | .eq(GlassInfo::getFlowCardId, glassInfo.getFlowCardId()) |
| | | .ne(GlassInfo::getGlassId, glassInfo.getGlassId()) |
| | | .eq(GlassInfo::getTotalLayer, glassInfo.getTotalLayer()) |
| | | .eq(GlassInfo::getLayer, glassInfo.getLayer()) |
| | | .eq(GlassInfo::getEngineerId, glassInfo.getEngineerId()) |
| | | .notInSql(GlassInfo::getGlassId, "select distinct glass_id from edg_storage_cage_details " + |
| | | "where engineer_id = '" + glassInfo.getEngineerId() + "' and width = " + glassInfo.getWidth() + " and height = " + glassInfo.getHeight()) |
| | | "where engineer_id = '" + glassInfo.getEngineerId() + "' and width = " + glassInfo.getWidth() + " and height = " + glassInfo.getHeight() |
| | | + " and state != 100") |
| | | .orderByAsc(GlassInfo::getTemperingLayoutId) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence) |
| | | .last("Limit 1"); |
| | |
| | | // 获取待出笼的玻璃需要替换的玻璃信息 |
| | | EdgStorageCageDetails swapGlassDetailInfo = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getGlassId, swapGlassId).eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)); |
| | | |
| | | // 玻璃小片表中玻璃已经替换,更新卧理笼内现有的准备出笼的玻璃信息, |
| | | if (null == swapGlassDetailInfo) { |
| | | GlassInfo glassInfoBase = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, swapGlassId)); |
| | | //需要替换的玻璃为存进卧理,仅需更新当前需要出笼的玻璃信息即可 |
| | | edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getGlassId, glassId).set(EdgStorageCageDetails::getGlassId, swapGlassId)); |
| | | .eq(EdgStorageCageDetails::getGlassId, glassId) |
| | | .set(EdgStorageCageDetails::getTemperingLayoutId, glassInfoBase.getTemperingLayoutId()) |
| | | .set(EdgStorageCageDetails::getTemperingFeedSequence, glassInfoBase.getTemperingFeedSequence())); |
| | | } else { |
| | | //需要替换的玻璃都在卧理内,按照玻璃id对调玻璃信息:对调玻璃id即可 |
| | | edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getId, glassInfo.getId()).set(EdgStorageCageDetails::getGlassId, swapGlassId)); |
| | | .eq(EdgStorageCageDetails::getId, glassInfo.getId()) |
| | | .set(EdgStorageCageDetails::getTemperingLayoutId, swapGlassDetailInfo.getTemperingLayoutId()) |
| | | .set(EdgStorageCageDetails::getTemperingFeedSequence, swapGlassDetailInfo.getTemperingFeedSequence()) |
| | | ); |
| | | edgStorageCageDetailsService.update(new LambdaUpdateWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getId, swapGlassDetailInfo.getId()).set(EdgStorageCageDetails::getGlassId, glassId)); |
| | | .eq(EdgStorageCageDetails::getId, swapGlassDetailInfo.getId()) |
| | | .set(EdgStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | .set(EdgStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence()) |
| | | ); |
| | | } |
| | | } |
| | | |
| | |
| | | //定义出片玻璃信息 |
| | | int endcell = 0; |
| | | EdgStorageCageDetails glassInfo = null; |
| | | |
| | | boolean flag = queryMaxMinDiff(threshold); |
| | | log.info("1、获取钢化版图是否超过阈值:{}", flag); |
| | | if (flag) { |
| | |
| | | } |
| | | } |
| | | } |
| | | return saveOutGlassMessage(glassInfo, endcell, confirmationWrodAddress, glassId, currentSlot); |
| | | return saveOutGlassMessageBySlot(glassInfo, endcell, confirmationWrodAddress, glassId, currentSlot); |
| | | } |
| | | |
| | | /** |
| | |
| | | log.info("4、添加出片任务,玻璃id:{},任务类型:{},起始位置:{},结束位置:{}", glassInfo.getGlassId(), |
| | | 2, glassInfo.getSlot(), endcell); |
| | | if (glassInfo.getGlassId().equals(glassId)) { |
| | | |
| | | log.info("5、直通任务,将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo); |
| | | EdgStorageCageDetails details = new EdgStorageCageDetails(); |
| | | BeanUtils.copyProperties(glassInfo, details); |
| | |
| | | BeanUtils.copyProperties(glassInfo, details); |
| | | } else { |
| | | GlassInfo one = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassId)); |
| | | BeanUtils.copyProperties(glassInfo, details); |
| | | BeanUtils.copyProperties(one, details); |
| | | } |
| | | EdgStorageCage nearestEmpty = edgStorageCageService.selectNearestEmpty(currentSlot, Boolean.TRUE); |
| | | Assert.isTrue(null != nearestEmpty, "格子已满,无法执行直通任务"); |
| | |
| | | log.info("6、添加出片任务是否完成:{}", taskCacheStatus); |
| | | } else { |
| | | log.info("5、非直通任务,将玻璃信息插入卧式理片笼,当前玻璃信息:{}", glassInfo); |
| | | if (endcell != currentSlot) { |
| | | if (!glassInfo.getSlot().equals(currentSlot)) { |
| | | EdgStorageCageDetails currentGlass = edgStorageCageDetailsService.getOne(new LambdaQueryWrapper<EdgStorageCageDetails>() |
| | | .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(EdgStorageCageDetails::getSlot, currentSlot).eq(EdgStorageCageDetails::getWidth, glassInfo.getWidth()) |
| | |
| | | ); |
| | | if (null != currentGlass) { |
| | | glassInfo = currentGlass; |
| | | endcell = currentSlot; |
| | | } |
| | | } |
| | | //玻璃信息替换 |