| | |
| | | return result.setScale(4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //数据完整性 |
| | | public BigDecimal dataIntegrity(Map<String, Object> param){ |
| | | //车辆数据完整性 |
| | | public BigDecimal dataIntegrity(Map<String, Object> param) { |
| | | BigDecimal totalSites = new BigDecimal((Integer) param.get("totalSites")); |
| | | BigDecimal importantTotalSites = new BigDecimal((Integer) param.get("importantTotalSites")); |
| | | BigDecimal integritySites = new BigDecimal((Integer) param.get("integritySites")); |
| | |
| | | BigDecimal result = integritySites.divide(totalSites, 10, RoundingMode.HALF_UP) |
| | | .add(importantIntegritySites.divide(importantTotalSites, 10, RoundingMode.HALF_UP)); |
| | | return result.setScale(4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //车辆数据完整性 |
| | | public BigDecimal dataAccuracy(Map<String, Object> param) { |
| | | BigDecimal totalSites = new BigDecimal((Integer) param.get("totalSites")); |
| | | BigDecimal importantTotalSites = new BigDecimal((Integer) param.get("importantTotalSites")); |
| | | BigDecimal accuracySites = new BigDecimal((Integer) param.get("accuracySites")); |
| | | BigDecimal importantAccuracySites = new BigDecimal((Integer) param.get("importantAccuracySites")); |
| | | BigDecimal result = accuracySites.divide(totalSites, 10, RoundingMode.HALF_UP) |
| | | .add(importantAccuracySites.divide(importantTotalSites, 10, RoundingMode.HALF_UP)); |
| | | return result.setScale(4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //时钟准确性 |
| | | public BigDecimal clockAccuracy(Map<String, Object> param) { |
| | | BigDecimal totalSitesCount = new BigDecimal((Integer) param.get("totalSites")); |
| | | BigDecimal accuracySites = new BigDecimal((Integer) param.get("accuracySites")); |
| | | return accuracySites.divide(totalSitesCount, 4, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | //返回省厅国标码集合 |
| | |
| | | } |
| | | |
| | | //检查是否存在当日数据 |
| | | public <T extends CheckIndex> T getCheckIndex(String key, List<T> checkIndexList) { |
| | | public <T extends CheckIndex> T getCheckIndex(String key, List<T> checkIndexList, Class<T> clazz) { |
| | | T checkIndex; |
| | | |
| | | // 检查是否已存在今日数据 |
| | |
| | | checkIndex = existingIndex.get(); |
| | | } else { |
| | | try { |
| | | checkIndex = (T) CheckIndexCar.class.getDeclaredConstructor().newInstance(); |
| | | checkIndex = clazz.getDeclaredConstructor().newInstance(); |
| | | checkIndex.setDeptId(key.startsWith("Province_") ? Long.parseLong(key.split("_")[1]) : Long.parseLong(key)); |
| | | checkIndex.setExamineTag(key.startsWith("Province_") ? CheckConstants.Examine_Tag_City : CheckConstants.Examine_Tag_County); |
| | | checkIndex.setCreateTime(new Date()); |