| | |
| | | |
| | | /** 车辆点位在线率和视图库对接稳定性 */ |
| | | private CheckIndexCar createOrUpdateCheckIndexCar(String key, AreaStats stats, BigDecimal cityCountAvg, BigDecimal countyCountAvg, List<CheckIndexCar> checkIndexCarList) { |
| | | CheckIndexCar checkIndexCar; |
| | | |
| | | // 检查是否已存在今日数据 |
| | | Optional<CheckIndexCar> existingCar = checkIndexCarList.stream() |
| | | .filter(car -> key.equals(car.getDeptId().toString()) && |
| | | (key.startsWith("Province_") ? CheckConstants.Examine_Tag_City.equals(car.getExamineTag()) |
| | | : CheckConstants.Examine_Tag_County.equals(car.getExamineTag()))) |
| | | .findFirst(); |
| | | |
| | | if (existingCar.isPresent()) { |
| | | checkIndexCar = existingCar.get(); |
| | | } else { |
| | | checkIndexCar = new CheckIndexCar(); |
| | | checkIndexCar.setDeptId(key.startsWith("Province_") ? Long.parseLong(key.split("_")[1]) : Long.parseLong(key)); |
| | | checkIndexCar.setExamineTag(key.startsWith("Province_") ? CheckConstants.Examine_Tag_City : CheckConstants.Examine_Tag_County); |
| | | checkIndexCar.setCreateTime(new Date()); |
| | | } |
| | | CheckIndexCar checkIndexCar = getCheckIndex(key, checkIndexCarList); |
| | | //调用点位在线计算方法 |
| | | Map<String, Object> siteOnlineParam = new HashMap<>(); |
| | | siteOnlineParam.put("totalSites", stats.totalSites); |