hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassTask.java
@@ -201,8 +201,8 @@ // list.add(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".mesControl", true)); list.add(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".glassId", Integer.parseInt(toEndingId))); list.add(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".toEdingId", Integer.parseInt(toEndingId))); list.add(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".width", (int) Math.max(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10))); list.add(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".height", (int) Math.min(glassInfo.getWidth() * 10, glassInfo.getHeight() * 10))); list.add(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".width", (int) Math.max(glassInfo.getEdgWidth() * 10, glassInfo.getEdgHeight() * 10))); list.add(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".height", (int) Math.min(glassInfo.getEdgWidth() * 10, glassInfo.getEdgHeight() * 10))); miloService.writeToOpcUa(list); miloService.writeToOpcWord(generateReadWriteEntity("MB" + cell + ".MB" + cell + ".thickness", (int) glassInfo.getThickness() * 10)); hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java
@@ -3,6 +3,8 @@ import cn.hutool.json.JSONObject; import cn.smallbun.screw.core.util.CollectionUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.kangaroohy.milo.model.ReadWriteEntity; import com.kangaroohy.milo.service.MiloService; import com.mes.bigstorage.entity.BigStorageCageDetails; import com.mes.bigstorage.service.BigStorageCageDetailsService; import com.mes.bigstorage.service.BigStorageCageService; @@ -48,6 +50,9 @@ @Resource private BigStorageCageTaskService bigStorageCageTaskService; @Autowired(required = false) MiloService miloService; @Value("${mes.scan.ip}") private String scanIp; @@ -56,28 +61,34 @@ private JSONObject jsonObject = new JSONObject(); public void queryDataSource1() throws InterruptedException { public void queryDataSource1() throws Exception { List<Double> carPostion = new ArrayList<>(); carPostion.add(0.25); carPostion.add(0.5); jsonObject.append("carPostion", carPostion); //界面展示笼子信息 // jsonObject.append("bigStorageCageInfos", bigStorageCageService.querybigStorageCageDetail()); jsonObject.append("bigStorageCageInfos", bigStorageCageService.querybigStorageCageDetail()); //进片任务数据 List<BigStorageCageTask> inTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_in_one_task"); List<BigStorageCageTask> inTaskList = new ArrayList(); ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP1A.DLP1A.FROM1"); for (int i = 1; i <= 6; i++) { ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP1A.DLP1A.DI" + i); if (null != requestWord.getValue()) { BigStorageCageTask task = new BigStorageCageTask(); task.setGlassId(requestWord.getValue() + ""); task.setStartSlot(Integer.parseInt(fromOpcUa.getValue() + "")); inTaskList.add(task); continue; } } jsonObject.append("bigStorageCageDetailsFeedTask", inTaskList); //出片任务数据 List<BigStorageCageTask> outTaskList = bigStorageCageTaskService.queryTaskMessage("big_storage_cage_out_one_task"); jsonObject.append("bigStorageCageDetailsOutTask", outTaskList); //理片笼使用情况 List<Map<String, Object>> bigStorageCageUsage = bigStorageCageService.selectBigStorageCageUsage(); // jsonObject.append("bigStorageCageUsage", bigStorageCageUsage); //理片笼表格信息 // jsonObject.append("bigStorageCageInfo", bigStorageCageService.querybigStorageCageDetailAll()); jsonObject.append("bigStorageCageInfo", bigStorageCageService.querybigStorageCageDetailAll()); //钢化开关 boolean temperingSwitch = false; @@ -87,6 +98,7 @@ temperingSwitch = redisUtil.getCacheObject("temperingSwitch"); } jsonObject.append("temperingSwitch", temperingSwitch); //调度开关 boolean dispatchSwitch = false; if (redisUtil.getCacheObject("dispatchSwitch") == null) { @@ -95,6 +107,14 @@ dispatchSwitch = redisUtil.getCacheObject("dispatchSwitch"); } jsonObject.append("dispatchSwitch", dispatchSwitch); //理片笼使用情况 List<Map<String, Object>> bigStorageCageUsage = bigStorageCageService.selectBigStorageCageUsage(); jsonObject.append("bigStorageCageUsage", bigStorageCageUsage); //理片笼表格信息 jsonObject.append("bigStorageCageInfo", bigStorageCageService.querybigStorageCageDetailAll()); //打印开关 boolean autoPrint = false; if (redisUtil.getCacheObject("autoPrint") == null) { @@ -130,7 +150,7 @@ * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) * fixedDelay : 上一个调用结束后再次调用的延时 */ @Scheduled(fixedDelay = 1000) @Scheduled(fixedDelay = 3000) public void plcStorageCageTask() throws InterruptedException { jsonObject = new JSONObject(); try { @@ -159,7 +179,7 @@ } } // @Scheduled(fixedDelay = 1000) // @Scheduled(fixedDelay = 1000) public void temperingIsRun() { JSONObject jsonObject = new JSONObject(); //进片任务数据 hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
@@ -96,7 +96,7 @@ private Integer artificialOutTargetPosition; // @Scheduled(fixedDelay = 1000) @Scheduled(fixedDelay = 1000) public void inBigStorageTask() throws Exception { ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1A.DLP1A.mesControl"); if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) { @@ -201,7 +201,7 @@ miloService.writeToOpcWord(list); } // @Scheduled(fixedDelay = 1000) @Scheduled(fixedDelay = 1000) public void outBigStorageTask() throws Exception { Date startDate = new Date(); ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1B.DLP1B.mesControl"); @@ -322,7 +322,7 @@ return; } // @Scheduled(fixedDelay = 1000) @Scheduled(fixedDelay = 1000) public void finishInBigStorageTask() throws Exception { ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1A.DLP1A.mesControl"); if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) { @@ -411,7 +411,7 @@ miloService.writeToOpcWord(list); } // @Scheduled(fixedDelay = 1000) @Scheduled(fixedDelay = 1000) public void finishOutBigStorageTask() throws Exception { ReadWriteEntity inkageEntity = miloService.readFromOpcUa("DLP1B.DLP1B.mesControl"); if (true != Boolean.parseBoolean(inkageEntity.getValue() + "")) { hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcSlicecage.java
@@ -118,7 +118,7 @@ * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) * fixedDelay : 上一个调用结束后再次调用的延时 */ @Scheduled(fixedDelay = 1000) // @Scheduled(fixedDelay = 1000) public void plcStorageCageTask() throws InterruptedException { jsonObject = new JSONObject(); try { @@ -156,7 +156,7 @@ } } @Scheduled(fixedDelay = 1000) // @Scheduled(fixedDelay = 1000) public void temperingIsRun() { JSONObject jsonObject = new JSONObject(); //进片任务数据 @@ -177,7 +177,7 @@ } } @Scheduled(fixedDelay = Long.MAX_VALUE) // @Scheduled(fixedDelay = Long.MAX_VALUE) public void scanCodeTask() { log.info("扫描任务已启动"); while (true) { hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/OpcNGTemperingTask.java
@@ -83,7 +83,7 @@ */ @Scheduled(fixedDelay = 5000) public void updateTemperingTask() throws Exception { ReadWriteEntity furanchiIdEntity = miloService.readFromOpcUa("GH1S7.GH1S7.Furanch1Id");//进片完成 炉号ID ReadWriteEntity furanchiIdEntity = miloService.readFromOpcUa("GH1.GH1.Furanch1Id");//进片完成 炉号ID if (StringUtils.isNotBlank(furanchiIdEntity.getValue()+"")){ int temperingid = Integer.parseInt(furanchiIdEntity.getValue().toString()); temperingAgoService.update(new LambdaUpdateWrapper<TemperingGlassInfo>().set(TemperingGlassInfo::getState, Const.TEMPERING_START) hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
@@ -141,7 +141,7 @@ } } List<HollowBigStorageCageDetails> detailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>().in(HollowBigStorageCageDetails::getGlassId, glassIdList) .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)); if (CollectionUtil.isNotEmpty(detailsList)) { log.info("理片笼存在相同的进片玻璃{},结束本次任务", detailsList); //todo:向plc发送报警