| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import com.mes.alarm.entity.ProductAlarmInfo; |
| | | import com.mes.alarm.service.ProductAlarmInfoService; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.entity.dto.BigStorageSummaryDTO; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | |
| | | @Resource |
| | | private WebSocketUtils webSocketUtils; |
| | | |
| | | private JSONObject jsonObject = new JSONObject(); |
| | | @Resource |
| | | private ProductAlarmInfoService productAlarmInfoService; |
| | | |
| | | public void queryDataSource1() throws Exception { |
| | | S7DataDLPOne s7DataDLPOne = s7SerializerDLPOne.read(S7DataDLPOne.class); |
| | | S7DataDLPTwo s7DataWLTwo = s7SerializerDLPTwo.read(S7DataDLPTwo.class); |
| | | |
| | | private static final String ALARM_MODULE = "钢化"; |
| | | private static final String ALARM_TYPE = "钢化大理片"; |
| | | private static final String ALARM_CODE_SIZE = "sizeSame"; |
| | | private static final String ALARM_CODE_ID = "idSame"; |
| | | |
| | | |
| | | public JSONObject queryDataSource1() throws Exception { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.append("alarmInfo", productAlarmInfoService.list(new LambdaQueryWrapper<ProductAlarmInfo>() |
| | | .eq(ProductAlarmInfo::getState, Const.LOAD_RAW_GLASS_NEW) |
| | | .eq(ProductAlarmInfo::getAlarmModule, ALARM_MODULE) |
| | | .eq(ProductAlarmInfo::getAlarmType, ALARM_TYPE))); |
| | | List<Double> carPostion = new ArrayList<>(); |
| | | carPostion.add(0.25); |
| | | carPostion.add(0.5); |
| | |
| | | //界面展示笼子信息 |
| | | jsonObject.append("bigStorageCageInfos", bigStorageCageDetailsService.querybigStorageCageDetail()); |
| | | |
| | | S7DataDLPOne s7DataDLPOne = s7SerializerDLPOne.read(S7DataDLPOne.class); |
| | | S7DataDLPTwo s7DataWLTwo = s7SerializerDLPTwo.read(S7DataDLPTwo.class); |
| | | try { |
| | | //进片任务数据 |
| | | List<BigStorageTaskVO> inTaskList = new ArrayList(); |
| | |
| | | //当前指定工程 |
| | | jsonObject.append("temperingEngineerId", redisUtil.getCacheObject("temperingEngineerId")); |
| | | |
| | | |
| | | return jsonObject; |
| | | } |
| | | |
| | | public void queryDataSource2() throws InterruptedException { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //出片队列 |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list( |
| | | new LambdaQueryWrapper<TemperingGlassInfo>() |
| | |
| | | */ |
| | | @Scheduled(fixedDelay = 3000) |
| | | public void plcStorageCageTask() throws Exception { |
| | | jsonObject = new JSONObject(); |
| | | //查询使用数据源1查询数据 |
| | | queryDataSource1(); |
| | | JSONObject jsonObject = queryDataSource1(); |
| | | //查询使用数据源2查询数据 |
| | | // queryDataSource2(); |
| | | webSocketUtils.sendToWeb("slicecage", jsonObject); |