| | |
| | | return nodeid; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | if(!nodeIdList.isEmpty()){ |
| | | List<ReadWriteEntity> readWriteEntityList = new ArrayList<>(); |
| | | if(CollUtil.isNotEmpty(nodeIdList)){ |
| | | long time1 = new Date().getTime(); |
| | | List<ReadWriteEntity> readWriteEntityList = miloService.readFromOpcUa(nodeIdList); |
| | | readWriteEntityList = miloService.readFromOpcUa(nodeIdList); |
| | | long time2 = new Date().getTime(); |
| | | log.info("读取点位花费时间:{},",time2-time1); |
| | | |
| | | } |
| | | //返回plc保存成功 |
| | | if (parts.length==3){ |
| | | if ("SaveRequest".equals(parts[2])){ |
| | |
| | | log.info("-------请求返回-----,{}",LocalDateTime.now()); |
| | | } |
| | | List<DaParamCollection> daParamCollectionlist = new ArrayList<>(); |
| | | for(int i=0;i<nodeIdList.size();i++){ |
| | | if(!readWriteEntityList.get(i).getValue().toString().equals("0.0")){ |
| | | DaParamCollection ParamCollection = new DaParamCollection(); |
| | | ParamCollection.setParamCode(readWriteEntityList.get(i).getIdentifier().toString().split("[.]")[2]); |
| | | ParamCollection.setLocationCode(parts[1]); |
| | | if (readWriteEntityList.get(i) == null){ |
| | | ParamCollection.setParamValue("0"); |
| | | }else { |
| | | ParamCollection.setParamValue(readWriteEntityList.get(i).getValue().toString()); |
| | | if (CollUtil.isNotEmpty(nodeIdList)){ |
| | | for(int i=0;i<nodeIdList.size();i++){ |
| | | if(!readWriteEntityList.get(i).getValue().toString().equals("0.0")){ |
| | | DaParamCollection ParamCollection = new DaParamCollection(); |
| | | ParamCollection.setParamCode(readWriteEntityList.get(i).getIdentifier().toString().split("[.]")[2]); |
| | | ParamCollection.setLocationCode(parts[1]); |
| | | if (readWriteEntityList.get(i) == null){ |
| | | ParamCollection.setParamValue("0"); |
| | | }else { |
| | | ParamCollection.setParamValue(readWriteEntityList.get(i).getValue().toString()); |
| | | } |
| | | ParamCollection.setSfcCode(SNCode); |
| | | ParamCollection.setParamName(list.get(i).getCollectParameterName()); |
| | | ParamCollection.setParamUpper(list.get(i).getParamUpper()); |
| | | ParamCollection.setParamLower(list.get(i).getParamLower()); |
| | | ParamCollection.setUnit(list.get(i).getCollectParameterUnit()); |
| | | ParamCollection.setState("合格"); |
| | | ParamCollection.setType(list.get(i).getCollectParameterType()); |
| | | ParamCollection.setCollectionTime(new Date()); |
| | | daParamCollectionlist.add(ParamCollection); |
| | | } |
| | | ParamCollection.setSfcCode(SNCode); |
| | | ParamCollection.setParamName(list.get(i).getCollectParameterName()); |
| | | ParamCollection.setParamUpper(list.get(i).getParamUpper()); |
| | | ParamCollection.setParamLower(list.get(i).getParamLower()); |
| | | ParamCollection.setUnit(list.get(i).getCollectParameterUnit()); |
| | | ParamCollection.setState("合格"); |
| | | ParamCollection.setType(list.get(i).getCollectParameterType()); |
| | | ParamCollection.setCollectionTime(new Date()); |
| | | daParamCollectionlist.add(ParamCollection); |
| | | } |
| | | daParamCollectionService.saveBeachDaParamCollection(daParamCollectionlist); |
| | | log.info("-------保存数据完成---------"); |
| | | } |
| | | daParamCollectionService.saveBeachDaParamCollection(daParamCollectionlist); |
| | | log.info("-------保存数据完成---------"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | Long beatTime = 0L; |