| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer; |
| | | import com.github.xingshuangs.iot.protocol.s7.service.S7PLC; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.kangaroohy.milo.model.ReadWriteEntity; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | |
| | | @Autowired |
| | | @Qualifier("s7SerializerDLPTwo") |
| | | private S7Serializer s7SerializerDLPTwo; |
| | | @Autowired |
| | | @Qualifier("s7plcWZL") |
| | | private S7PLC s7plcWZL; |
| | | |
| | | @Resource |
| | | SysConfigService sysConfigService; |
| | |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | | if (count > 0) { |
| | | log.info("直通片台存在玻璃,结束本次进片"); |
| | | ProductAlarmInfo alarmInfo = new ProductAlarmInfo(); |
| | | alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW); |
| | | alarmInfo.setAlarmModule(ALARM_MODULE); |
| | | alarmInfo.setAlarmType(ALARM_TYPE); |
| | | alarmInfo.setAlarmCode(ALARM_CODE_OVER); |
| | | alarmInfo.setAlarmMessage(""); |
| | | productAlarmInfoService.save(alarmInfo); |
| | | // ProductAlarmInfo alarmInfo = new ProductAlarmInfo(); |
| | | // alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW); |
| | | // alarmInfo.setAlarmModule(ALARM_MODULE); |
| | | // alarmInfo.setAlarmType(ALARM_TYPE); |
| | | // alarmInfo.setAlarmCode(ALARM_CODE_OVER); |
| | | // alarmInfo.setAlarmMessage(""); |
| | | // productAlarmInfoService.save(alarmInfo); |
| | | //向plc发送报警:直通片台存在玻璃,无法继续直通 |
| | | // miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 64)); |
| | | s7DataDLPOne = new S7DataDLPOne(); |
| | |
| | | LambdaQueryWrapper<BigStorageCage> queryWrapper = new LambdaQueryWrapper<BigStorageCage>() |
| | | .eq(BigStorageCage::getRemainWidth, slotWidth) |
| | | .eq(BigStorageCage::getEnableState, Const.SLOT_ON) |
| | | .le(BigStorageCage::getMinThickness, info.getThickness()) |
| | | .ge(BigStorageCage::getMaxThickness, info.getThickness()) |
| | | .orderByAsc(BigStorageCage::getDeviceId).orderByAsc(BigStorageCage::getSlot) |
| | | .last("limit 1"); |
| | | |
| | |
| | | |
| | | Integer temperingOutTargetPosition = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_TEMPERING_OUT_TARGET_POSITION); |
| | | if (redisUtil.getCacheObject("temperingSwitch")) { |
| | | try { |
| | | int outRequest = s7plcWZL.readUInt16("DB51.8"); |
| | | if (outRequest == 0) { |
| | | log.info("当前未收到卧转立允许出片请求,结束出片任务"); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("读取卧转立信号异常", e); |
| | | return; |
| | | } |
| | | //是否允许钢化 |
| | | //是否有正在钢化的玻璃:钢化小片表关联历史任务表,筛选未出笼的玻璃信息 |
| | | // 获取当前钢化任务未完成出片的玻璃信息 |
| | |
| | | List<TemperingLayoutDTO> temperingLayoutDTOS = bigStorageCageDetailsService.temperingIsAllByTemperingLayoutId(temperingEngineerId, temperingLayoutId); |
| | | if (CollectionUtil.isNotEmpty(temperingLayoutDTOS)) { |
| | | List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class) |
| | | .select("-1 as state,t.filmsid as films_id,t.glass_id,t.flow_card_id,t.glass_type,t.width,t.height" + |
| | | .select("-1 as state,t.filmsid as films_id,t.glass_id,t.flow_card_id,t.layer,t.glass_type,t.width,t.height" + |
| | | ",t.thickness,t.ishorizontal,t.tempering_layout_id,t.tempering_feed_sequence,t.x_coordinate,t.y_coordinate," + |
| | | "t.angle,t1.slot,t.engineer_id") |
| | | .innerJoin(BigStorageCageDetails.class, BigStorageCageDetails::getGlassId, GlassInfo::getGlassId) |
| | |
| | | damage.setWorkingProcedure("大理片笼"); |
| | | damage.setRemark("进笼前卧转立"); |
| | | damage.setStatus(1); |
| | | damage.setType(item.getTaskState()); |
| | | damage.setType(Const.GLASS_STATE_DAMAGE); |
| | | damageService.insertDamage(damage); |
| | | slotList.add(item.getTargetSlot()); |
| | | } |
| | |
| | | damage.setWorkingProcedure("钢化前"); |
| | | damage.setRemark("进笼后卧转立"); |
| | | damage.setStatus(1); |
| | | damage.setType(item.getTaskState()); |
| | | damage.setType(Const.GLASS_STATE_DAMAGE); |
| | | damageService.insertDamage(damage); |
| | | slotList.add(item.getTargetSlot()); |
| | | slotList.add(item.getStartSlot()); |