| | |
| | | import com.kangaroohy.milo.model.ReadWriteEntity; |
| | | import com.kangaroohy.milo.runner.subscription.SubscriptionCallback; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import javafx.animation.Timeline; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | //获取过站记录的最大工位 |
| | | String maxCode = null; |
| | | if (CollUtil.isNotEmpty(daPassingStationCollections)){ |
| | | DaPassingStationCollection lastOne = daPassingStationCollections.get(daPassingStationCollections.size() - 1); |
| | | maxCode = lastOne.getLocationCode(); |
| | | List<DaPassingStationCollection> collect2 = daPassingStationCollections.stream().filter(x -> "不合格".equals(x.getOutRsSign())).collect(Collectors.toList()); |
| | | if (CollUtil.isNotEmpty(collect2)){ |
| | | DaPassingStationCollection lastOne = collect2.get(collect2.size() - 1); |
| | | maxCode = lastOne.getLocationCode(); |
| | | }else { |
| | | DaPassingStationCollection lastOne = daPassingStationCollections.get(daPassingStationCollections.size() - 1); |
| | | maxCode = lastOne.getLocationCode(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | List<DaParamCollection> daParamCollectionlist = new ArrayList<>(); |
| | | if (CollUtil.isNotEmpty(nodeIdList)){ |
| | | for(int i=0;i<nodeIdList.size();i++){ |
| | | if(!readWriteEntityList.get(i).getValue().toString().equals("0.0")){ |
| | | if(ObjectUtil.isNotEmpty(readWriteEntityList.get(i).getValue()) && !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]); |
| | |
| | | String str = object.toString(); |
| | | beatTime = Float.valueOf(str).longValue(); |
| | | } |
| | | Object ProductStatus = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".ProductStatus").getValue(); |
| | | log.info("ProductStatus,{}",ProductStatus.toString()); |
| | | String str1="合格" ; |
| | | if (ObjectUtil.isNotEmpty(ProductStatus)){ |
| | | String productStatusString = ProductStatus.toString(); |
| | | if (productStatusString.contains("2") || productStatusString.contains("3")){ |
| | | str1="不合格"; |
| | | }else { |
| | | str1="合格"; |
| | | } |
| | | } |
| | | DaPassingStationCollection PassingStationCollection=new DaPassingStationCollection(); |
| | | PassingStationCollection.setSfcCode(SNCode); |
| | | PassingStationCollection.setLocationCode(parts[1]); |
| | |
| | | PassingStationCollection.setCollectionTime(new Date()); |
| | | PassingStationCollection.setCreateTime(new Date()); |
| | | PassingStationCollection.setBeatTime(beatTime.toString()); |
| | | PassingStationCollection.setOutRsSign("合格"); |
| | | PassingStationCollection.setOutRsSign(str1); |
| | | passingStationCollectionServiceImpl.insertDaPassingStationCollection(PassingStationCollection); |
| | | log.info("-------保存过站记录数据完成---------"); |
| | | |