| | |
| | | public class DaPointCollectStatusServiceImpl extends BaseServiceImpl<DaPointCollectStatusDao, DaPointCollectStatusEntity> |
| | | implements DaPointCollectStatusService { |
| | | |
| | | @Override |
| | | public void add(String pointNo) { |
| | | DaPointCollectStatusEntity entity = new DaPointCollectStatusEntity(); |
| | | entity.setId(UUID.randomUUID().toString()); |
| | | entity.setPointNo(pointNo); |
| | | baseDao.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public void recordStatus(String pointNo, String collectValue, Date collectTime) { |
| | | QueryWrapper<DaPointCollectStatusEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("point_no", pointNo); |
| | |
| | | |
| | | } |
| | | |
| | | public void recordStatusList(List<InfluxPointValuePOJO> pointValues, Date collectTime) { |
| | | List<String> listGood = new ArrayList<>(); |
| | | List<String> listBad = new ArrayList<>(); |
| | | Object collectValue = null; |
| | | for (InfluxPointValuePOJO pointValue : pointValues) { |
| | | if (pointValue instanceof InfluxPointValueSimPOJO) { |
| | | InfluxPointValueSimPOJO pvo = (InfluxPointValueSimPOJO) pointValue; |
| | | collectValue = pvo.getValue(); |
| | | } else if (pointValue instanceof InfluxPointValueDigPOJO) { |
| | | InfluxPointValueDigPOJO pvo = (InfluxPointValueDigPOJO) pointValue; |
| | | collectValue = pvo.getValue(); |
| | | } else { |
| | | continue; |
| | | } |
| | | switch (DataQualityEnum.getEumByValue(collectValue)) { |
| | | case GOOD: |
| | | listGood.add(pointValue.getPoint()); |
| | | break; |
| | | case BAD: |
| | | listBad.add(pointValue.getPoint()); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | @Override |
| | | public void recordStatusList(List<String> listGood,List<String> listBad, Date collectTime) { |
| | | if (!CollectionUtils.isEmpty(listGood)) { |
| | | QueryWrapper<DaPointCollectStatusEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.in("point_no", listGood); |