| | |
| | | String confirmationWrodAddress = plcParameterObject.getPlcParameter("confirmationWord").getAddress(); |
| | | String currentSlot = plcParameterObject.getPlcParameter("currentCell").getValue(); |
| | | |
| | | // requestWord="3"; |
| | | // glassIdeValue="P25031802|4|1"; |
| | | // out06Glassstate="1"; |
| | | // out08Glassstate="1"; |
| | | // out11Glassstate ="1"; |
| | | // out13Glassstate="1"; |
| | | // currentSlot="1"; |
| | | // confirmationWrodValue="0"; |
| | | |
| | | |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:g06:{}、g08:{}、g11:{}、g13:{},当前格子号为:{}", |
| | | requestWord, glassIdeValue, confirmationWrodValue, out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, currentSlot); |
| | |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | s7control.writeWord(plcMesObject.getPlcParameter("alarm_signal").getAddress(), 1); |
| | | }else{ |
| | | } else { |
| | | s7control.writeWord(plcMesObject.getPlcParameter("alarm_signal").getAddress(), 0); |
| | | } |
| | | } |
| | |
| | | //下片数量-1 |
| | | for (DownGlassTask downGlassTask : downGlassTaskList |
| | | ) { |
| | | if (Const.GLASS_CACHE_TYPE_OUT_ALL.equals(downGlassTask.getTaskType())) { |
| | | if (Const.GLASS_CACHE_TYPE_OUT_ALL.contains(downGlassTask.getTaskType())) { |
| | | downWorkstationService.update( |
| | | new LambdaUpdateWrapper<DownWorkstation>() |
| | | .setSql("racks_number = racks_number-1") |
| | |
| | | damage.setLine(Const.TEMPERING_OUT_TARGET_POSITION); |
| | | damage.setWorkingProcedure("下片"); |
| | | damage.setRemark("下片"); |
| | | damage.setStatus(0); |
| | | damage.setStatus(1); |
| | | damage.setType(e.getTaskStatus()); |
| | | return damage; |
| | | }).collect(Collectors.toList()); |
| | |
| | | //更新工位其他玻璃信息的数量 |
| | | QueryWrapper<Damage> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("process_id", downWorkstation.getFlowCardId()); |
| | | queryWrapper.eq("technology_number", downWorkstation.getLayer()); |
| | | queryWrapper.gt("type", 3); |
| | | if (downWorkstation.getLayer() != 0) { |
| | | queryWrapper.eq("technology_number", downWorkstation.getLayer()); |
| | | } |
| | | int otherNumber = damageService.count(queryWrapper); |
| | | downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>().set(DownWorkstation::getOtherNumber, otherNumber) |
| | | .eq(DownWorkstation::getWorkstationId, downWorkstation.getWorkstationId())); |
| | |
| | | //玻璃尺寸是否走人工下片 |
| | | if (glassWidth > maxWidth || glassHeight > maxHeight || glassWidth < minWidth || glassHeight < minHeight) { |
| | | log.info("该玻璃尺寸不符合要求,需要走人工下片直接进片"); |
| | | return; |
| | | } else { |
| | | log.info("该玻璃尺寸非人工下片"); |
| | | //获取该玻璃的流程卡是否已绑定架子 |
| | |
| | | for (DownGlassInfoDTO e : downGlassInfoDTOList) { |
| | | List<GlassInfo> glassInfoList = e.getGlassInfoList(); |
| | | List<GlassInfo> glassInfoTempList = glassInfoList.stream().filter(item -> item.getWidth() == glassInfo.getWidth() && item.getHeight() == glassInfo.getHeight() |
| | | && item.getThickness() == glassInfo.getThickness() && item.getFilmsid().equals(glassInfo.getFilmsid())).collect(Collectors.toList()); |
| | | && item.getThickness() == glassInfo.getThickness() && item.getMarkIcon().equals(glassInfo.getMarkIcon()) |
| | | && item.getFilmsid().equals(glassInfo.getFilmsid())).collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(glassInfoTempList)) { |
| | | for (GlassInfo item : glassInfoTempList) { |
| | | //玻璃是否为多层:1、先获取当前流程卡落架最多的层数,如果为空,表明未绑定流程卡,未落架,然后按照是否可绑定架子决定是否替换。(可忽略不计,本校验仅在前一次调用起作用) |
| | |
| | | wrapper.eq(DownGlassInfo::getLayer, downGlassInfo.getLayer()); |
| | | } |
| | | // downGlassInfo.setSequence(downGlassInfoService.queryMaxSequence(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer())); |
| | | int k = 0; |
| | | DownGlassInfo downGlassInfo1 = downGlassInfoService.getOne(wrapper); |
| | | if (downGlassInfo1 != null) { |
| | | k = 1; |
| | | } else { |
| | | k = 1; |
| | | } |
| | | int k = 1; |
| | | // DownGlassInfo downGlassInfo1 = downGlassInfoService.getOne(wrapper); |
| | | // if (downGlassInfo1 != null) { |
| | | // k = 1; |
| | | // } else { |
| | | // k = 1; |
| | | // } |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | | BeanUtils.copyProperties(downStorageCageDetails, glassInfo); |
| | | GlassInfo glassInfo1 = glassInfoService.getOne( |
| | | new LambdaUpdateWrapper<GlassInfo>().eq(GlassInfo::getGlassId, glassInfo.getGlassId()) |
| | | ); |
| | | downGlassInfo.setSequence(k); |
| | | downGlassInfo.setWorkStationId(endCell); |
| | | downGlassInfo.setGmtCreate(new Date()); |
| | | downGlassInfo.setLayer(glassInfo1.getLayer()); |
| | | downGlassInfoService.save(downGlassInfo); |
| | | //生成任务信息 |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | | downStorageCageDetails.setLayer(0); |
| | | BeanUtils.copyProperties(downStorageCageDetails, glassInfo); |
| | | |
| | | |
| | | //删除理片笼表拿走/破损数据数据 |
| | | glassInfo.setLayer(glassInfo1.getLayer()); |
| | | damageService.deleteByGlassId(glassInfo.getGlassId()); |
| | | return initDownGlassTask(glassInfo, downStorageCageDetails.getSlot(), endCell, taskType); |
| | | } |
| | |
| | | downGlassTask.setTaskStatus(0); |
| | | downGlassTask.setCreateTime(new Date()); |
| | | downGlassTaskService.save(downGlassTask); |
| | | //添加报工数据 |
| | | Damage damage = new Damage(); |
| | | damage.setGlassId(glassInfo.getGlassId()); |
| | | damage.setWorkingProcedure("钢化"); |
| | | damage.setLine(4001); |
| | | damage.setType(1); |
| | | damage.setRemark("钢化后卧式理片"); |
| | | damageService.insertDamage(damage); |
| | | //向plc发送命令 |
| | | return sendMessageToPlc((int) glassInfo.getWidth(), (int) glassInfo.getHeight(), (int) glassInfo.getThickness(), |
| | | startCell, endCell, taskType); |