| | |
| | | import com.ycl.platform.domain.entity.TMonitor; |
| | | import com.ycl.platform.domain.param.HK.*; |
| | | import com.ycl.platform.domain.result.HK.*; |
| | | import com.ycl.platform.domain.result.UY.MonitorQualifyResult; |
| | | import com.ycl.platform.domain.result.UY.VideoOnlineResult; |
| | | import com.ycl.platform.domain.vo.UpdateOnlineVO; |
| | | import com.ycl.platform.mapper.CheckIndexCarMapper; |
| | | import com.ycl.platform.mapper.CheckIndexFaceMapper; |
| | | import com.ycl.platform.mapper.TMonitorMapper; |
| | | import com.ycl.platform.mapper.WorkOrderMapper; |
| | | import com.ycl.platform.service.*; |
| | | import com.ycl.utils.DateUtils; |
| | | import constant.ApiConstants; |
| | |
| | | private ICheckIndexFaceService faceService; |
| | | @Autowired |
| | | private CheckIndexFaceMapper faceMapper; |
| | | @Autowired |
| | | private StringHttpMessageConverter stringHttpMessageConverter; |
| | | @Autowired |
| | | private LoadBalancerRequestFactory loadBalancerRequestFactory; |
| | | |
| | | //车辆设备全检指标监测结果 |
| | | public void vehicleDeviceInspectionTask() { |
| | |
| | | JSONObject labelJson = hkClient.getGetLabel(); |
| | | Integer faceLabelId = null; |
| | | Integer carLabelId = null; |
| | | Integer allLabelId = null; |
| | | if (labelJson != null) { |
| | | String code = labelJson.getString("code"); |
| | | if (ApiConstants.HKSuccessCode.equals(code)){ |
| | | //获得label考核标签对象 |
| | | log.error("labelJson的data:{}",labelJson.get("data")); |
| | | List<HKResultLabel> hkResultLabels = labelJson.getList("data",HKResultLabel.class); |
| | | for (HKResultLabel label : hkResultLabels) { |
| | | if ("省厅人脸".equals(label.getLabelName())){ |
| | | faceLabelId = label.getId(); |
| | | }else if ("省厅车辆".equals(label.getLabelName())){ |
| | | carLabelId = label.getId(); |
| | | }else if ("全量".equals(label.getLabelName())){ |
| | | allLabelId = label.getId(); |
| | | } |
| | | } |
| | | log.error("打印hkResultLabels:{}",hkResultLabels); |
| | | |
| | | } |
| | | } |
| | | if (faceLabelId == null || carLabelId == null){ |
| | |
| | | // param.setLabelId(); |
| | | |
| | | //------------默认参数为null请求全量数据 |
| | | if (allLabelId == null){ |
| | | allLabelId = -1; |
| | | } |
| | | param.setLabelId(allLabelId); |
| | | JSONObject scoreJson = hkClient.getScoreNew(param); |
| | | log.error("全量数据"); |
| | | if (scoreJson != null) { |
| | |
| | | //以批次id为key 放入 JSONObject对象 |
| | | map.put(Integer.valueOf(batchIdKey),batch); |
| | | //批次id 下 各区信息集合 |
| | | log.error("打印出data内容中批次id:{},以及对应的结果info:{}",batchIdKey,batch); |
| | | } |
| | | //获得最大的键值 |
| | | Optional<Integer> maxKey = map.keySet().stream() |
| | |
| | | //这一层为获得 data -> 中 批次数组中 -> 区域code数组的key |
| | | for (String areaCodeKey : map.get(id).keySet()) { |
| | | //存放最新批次的内容到allInfo集合中 |
| | | log.error("打印区信息:{}",map.get(id).get(areaCodeKey)); |
| | | allInfo.addAll(map.get(id).getList(areaCodeKey,HkResultInfo.class)); |
| | | } |
| | | } |
| | |
| | | Map<String, List<HkResultInfo>> groupedByAreaName = allInfo.stream() |
| | | .collect(Collectors.groupingBy(HkResultInfo::getAreaCode)); |
| | | for (Map.Entry<String, List<HkResultInfo>> entry : groupedByAreaName.entrySet()) { |
| | | log.error("最新批次内数据:{}",groupedByAreaName.get(entry.getKey()).size()); |
| | | log.error("最新批次内size:{}",groupedByAreaName.get(entry.getKey())); |
| | | log.error("最新批次内size:{}",groupedByAreaName.get(entry.getKey()).size()); |
| | | log.error("最新批次内数据:{}",groupedByAreaName.get(entry.getKey())); |
| | | CheckIndexCar car = new CheckIndexCar(); |
| | | CheckIndexFace face = new CheckIndexFace(); |
| | | score3Index(groupedByAreaName.get(entry.getKey()), car, face,entry.getKey()); |
| | |
| | | cars.add(car); |
| | | faces.add(face); |
| | | } |
| | | //请求省厅数据 |
| | | }else { |
| | | log.error("调用海康全量数据api失败"); |
| | | } |
| | |
| | | List<HkResultInfo> provincialList = new ArrayList<>(); |
| | | //获取省厅人脸数据 |
| | | if (faceLabelId != null){ |
| | | ScoreParam faceParam = new ScoreParam(); |
| | | log.error("faceLabelId:{}",faceLabelId); |
| | | param.setLabelId(faceLabelId); |
| | | JSONObject faceJson = hkClient.getScoreNew(param); |
| | | faceParam.setLabelId(faceLabelId); |
| | | JSONObject faceJson = hkClient.getScoreNew(faceParam); |
| | | log.error("省厅人脸数据"); |
| | | if (faceJson != null) { |
| | | String code = scoreJson.getString("code"); |
| | | String code = faceJson.getString("code"); |
| | | if (ApiConstants.HKSuccessCode.equals(code)){ |
| | | JSONObject data = scoreJson.getJSONObject("data"); |
| | | JSONObject data = faceJson.getJSONObject("data"); |
| | | |
| | | Map<Integer,JSONObject> map = new HashMap<>(); |
| | | //获得data 下 batchId 的批次id对象 放入map中 |
| | |
| | | //批次id 下 各区信息集合 |
| | | log.error("打印出省厅人脸data内容中批次id:{},以及对应的结果info:{}",batchIdKey,batch); |
| | | } |
| | | //获得最大的键值 |
| | | //获得最大的键值 |
| | | Optional<Integer> maxKey = map.keySet().stream() |
| | | .max(Integer::compareTo); |
| | | if (maxKey.isPresent()) { |
| | |
| | | } |
| | | //获取省厅车辆数据v. |
| | | if (carLabelId != null){ |
| | | ScoreParam carParam = new ScoreParam(); |
| | | log.error("carLabelId:{}",carLabelId); |
| | | param.setLabelId(carLabelId); |
| | | JSONObject carJson = hkClient.getScoreNew(param); |
| | | carParam.setLabelId(carLabelId); |
| | | JSONObject carJson = hkClient.getScoreNew(carParam); |
| | | log.error("省厅车辆数据"); |
| | | if (carJson != null) { |
| | | String code = scoreJson.getString("code"); |
| | | String code = carJson.getString("code"); |
| | | if (ApiConstants.HKSuccessCode.equals(code)){ |
| | | JSONObject data = scoreJson.getJSONObject("data"); |
| | | JSONObject data = carJson.getJSONObject("data"); |
| | | |
| | | Map<Integer,JSONObject> map = new HashMap<>(); |
| | | //获得data 下 batchId 的批次id对象 放入map中 |
| | |
| | | Map<String,List<HkResultInfo>> provincialGroupedByAreaName = provincialList.stream() |
| | | .collect(Collectors.groupingBy(HkResultInfo::getAreaCode)); |
| | | for (Map.Entry<String, List<HkResultInfo>> entry : provincialGroupedByAreaName.entrySet()) { |
| | | log.error("最新批次内省厅数据:{}",provincialGroupedByAreaName.get(entry.getKey()).size()); |
| | | log.error("最新批次内省厅size:{}",provincialGroupedByAreaName.get(entry.getKey())); |
| | | CheckIndexCar car = new CheckIndexCar(); |
| | | CheckIndexFace face = new CheckIndexFace(); |
| | | score3Index(provincialGroupedByAreaName.get(entry.getKey()), car, face,entry.getKey()); |
| | |
| | | face.setFaceInformationCollectionAccuracy(new BigDecimal("1")); |
| | | //TODO:没找到考核项 设备目录一致率 |
| | | face.setDeviceDirectoryConsistent(new BigDecimal("1")); |
| | | |
| | | |
| | | //TODO:没找到考核项 车辆卡口信息采集准确率 |
| | | car.setVehicleInformationCollectionAccuracy(new BigDecimal("1")); |
| | | //TODO:没找到考核项 联网卡口设备目录一致率 |