| | |
| | | @Value("${mes.height}") |
| | | private Integer temperingHeight; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void temperingGlassBefore() { |
| | | Date startDate = new Date(); |
| | | log.info("本次任务开始执行时间:{}", startDate); |
| | |
| | | //将确认字置为0 |
| | | plcControl.writeWord(plcParameterObject.getPlcParameter("confirmationWord").getAddress(), 0); |
| | | //可能有几炉玻璃同时在钢,需要获取钢化小片表中的数据信息状态为2(旋转台玻璃已送出未钢化,正在钢化) |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temporaryGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>() |
| | | .eq(TemperingGlassInfo::getState, Const.TEMPERING_START)); |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temporaryGlassInfoService.list( |
| | | new LambdaQueryWrapper<TemperingGlassInfo>() |
| | | .inSql(TemperingGlassInfo::getTemperingLayoutId, "select distinct tempering_layout_id from tempering_glass_info where state=1") |
| | | .lt(TemperingGlassInfo::getState, Const.TEMPERING_START) |
| | | ); |
| | | if (CollectionUtils.isEmpty(temperingGlassInfoList)) { |
| | | log.info("当前系统没有需要钢化的玻璃信息"); |
| | | return; |
| | | } |
| | | TemperingGlassInfo minGlassInfo = temperingGlassInfoList.stream().min(Comparator.comparingLong(TemperingGlassInfo::getState)).get(); |
| | | if (minGlassInfo.getState() < Const.TEMPERING_DROP) { |
| | | log.info("当前炉玻璃未到齐,稍后在执行"); |
| | | return; |
| | | } |
| | | //拿到工程id及炉号 |
| | | TemperingGlassInfo maxGlassInfo = temperingGlassInfoList.stream().max(Comparator.comparingLong(TemperingGlassInfo::getId)).get(); |
| | | |
| | | //将正在钢化的炉号过滤掉,仅获取待钢化的玻璃:判断待钢的玻璃是否已发送对接数据 |
| | | List<TemperingRecord> temperingRecordList = temperingRecordService.list(new LambdaQueryWrapper<TemperingRecord>().eq(TemperingRecord::getEngineerId, maxGlassInfo.getEngineerId()) |
| | | .eq(TemperingRecord::getTemperingLayoutId, maxGlassInfo.getTemperingLayoutId())); |
| | |
| | | //暂不处理 |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | // @Scheduled(fixedDelay = 1000) |
| | | public void dealDamageTask() { |
| | | Date startDate = new Date(); |
| | | log.info("钢化破损玻璃清除任务开始执行时间:{}", startDate); |
| | |
| | | damage.setLine(Const.TEMPERING_OUT_TARGET_POSITION); |
| | | damage.setWorkingProcedure("钢化"); |
| | | damage.setRemark("钢化"); |
| | | damage.setStatus(0); |
| | | damage.setStatus(1); |
| | | damage.setType(e.getState()); |
| | | return damage; |
| | | }).collect(Collectors.toList()); |