| | |
| | | //车辆设备全检指标监测结果 |
| | | public void vehicleDeviceInspectionTask() { |
| | | log.info("开始执行车辆设备全检指标监测结果数据同步"); |
| | | // VehicleDeviceInspectionParam param = new VehicleDeviceInspectionParam(); |
| | | // param.setPageNo(ApiConstants.PageNo); |
| | | // param.setPageSize(ApiConstants.HKPageSize); |
| | | // param.setDate(DateUtils.getDate()); |
| | | // param.setDataType(ApiConstants.HK_DataType_CAR); |
| | | // List<VehicleDeviceInspectionResult> list = HkApiUtil.sendAPI("/api/dqd/service/rs/v2/data/vehFullAmount/query", param, VehicleDeviceInspectionResult.class); |
| | | // if (!CollectionUtils.isEmpty(list)) { |
| | | // //如果存在之前的数据先删除 |
| | | // Query query = new Query(Criteria.where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | // DeleteResult result = mongoTemplate.remove(query, VehicleDeviceInspectionResult.class); |
| | | // //存放在mongo中 |
| | | // mongoTemplate.insertAll(list); |
| | | // //同步的数据进行工单阈值处理 |
| | | // ywThresholdService.carCheck(list); |
| | | // } |
| | | Query query = new Query(Criteria.where("mongoCreateTime").lt(DateUtils.getDayEnd(new Date()))); |
| | | ywThresholdService.carCheck(mongoTemplate.find(query, VehicleDeviceInspectionResult.class)); |
| | | VehicleDeviceInspectionParam param = new VehicleDeviceInspectionParam(); |
| | | param.setPageNo(ApiConstants.PageNo); |
| | | param.setPageSize(ApiConstants.HKPageSize); |
| | | param.setDate(DateUtils.getDate()); |
| | | param.setDataType(ApiConstants.HK_DataType_CAR); |
| | | List<VehicleDeviceInspectionResult> list = HkApiUtil.sendAPI("/api/dqd/service/rs/v2/data/vehFullAmount/query", param, VehicleDeviceInspectionResult.class); |
| | | if (!CollectionUtils.isEmpty(list)) { |
| | | //如果存在之前的数据先删除 |
| | | Query query = new Query(Criteria.where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | DeleteResult result = mongoTemplate.remove(query, VehicleDeviceInspectionResult.class); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(list); |
| | | //同步的数据进行工单阈值处理 |
| | | ywThresholdService.carCheck(list); |
| | | } |
| | | // Query query = new Query(Criteria.where("mongoCreateTime").lt(DateUtils.getDayEnd(new Date()))); |
| | | // ywThresholdService.carCheck(mongoTemplate.find(query, VehicleDeviceInspectionResult.class)); |
| | | log.info("结束车辆设备全检指标监测结果数据同步"); |
| | | } |
| | | |
| | | //人脸设备全检指标监测结果 |
| | | public void faceDeviceInspectionTask() { |
| | | log.info("开始执行人脸设备全检指标监测结果数据同步"); |
| | | // FaceDeviceInspectionParam param = new FaceDeviceInspectionParam(); |
| | | // param.setPageNo(ApiConstants.PageNo); |
| | | // param.setPageSize(ApiConstants.HKPageSize); |
| | | // param.setDate(DateUtils.getDate()); |
| | | // List<FaceDeviceInspectionResult> list = HkApiUtil.sendAPI("/api/dqd/service/rs/v2/data/faceFullAmount/query", param, FaceDeviceInspectionResult.class); |
| | | // if (!CollectionUtils.isEmpty(list)) { |
| | | // //如果存在之前的数据先删除 |
| | | // Query query = new Query(Criteria.where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | // DeleteResult result = mongoTemplate.remove(query, FaceDeviceInspectionResult.class); |
| | | // //存放在mongo中 |
| | | // mongoTemplate.insertAll(list); |
| | | // //同步的数据进行工单阈值处理 |
| | | // //TODO:可能有重复工单 |
| | | // ywThresholdService.faceCheck(list); |
| | | // } |
| | | Query query = new Query(Criteria.where("mongoCreateTime").lt(DateUtils.getDayEnd(new Date()))); |
| | | ywThresholdService.faceCheck(mongoTemplate.find(query, FaceDeviceInspectionResult.class)); |
| | | FaceDeviceInspectionParam param = new FaceDeviceInspectionParam(); |
| | | param.setPageNo(ApiConstants.PageNo); |
| | | param.setPageSize(ApiConstants.HKPageSize); |
| | | param.setDate(DateUtils.getDate()); |
| | | List<FaceDeviceInspectionResult> list = HkApiUtil.sendAPI("/api/dqd/service/rs/v2/data/faceFullAmount/query", param, FaceDeviceInspectionResult.class); |
| | | if (!CollectionUtils.isEmpty(list)) { |
| | | //如果存在之前的数据先删除 |
| | | Query query = new Query(Criteria.where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | DeleteResult result = mongoTemplate.remove(query, FaceDeviceInspectionResult.class); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(list); |
| | | //同步的数据进行工单阈值处理 |
| | | //TODO:可能有重复工单 |
| | | ywThresholdService.faceCheck(list); |
| | | } |
| | | // Query query = new Query(Criteria.where("mongoCreateTime").lt(DateUtils.getDayEnd(new Date()))); |
| | | // ywThresholdService.faceCheck(mongoTemplate.find(query, FaceDeviceInspectionResult.class)); |
| | | log.info("结束人脸设备全检指标监测结果数据同步"); |
| | | } |
| | | |
| | |
| | | } |
| | | //TODO:工单处理 |
| | | log.info("结束人脸设备抽检指标监测结果数据同步"); |
| | | } |
| | | |
| | | //测试 |
| | | public void test() { |
| | | log.info("测试海康接口"); |
| | | HkApiUtil.sendAPI("/api/dqd/service/rs/v2/data/faceDetect/query", new FaceDeviceSamplingParam(), Object.class); |
| | | log.info("结束->{},调用成功"); |
| | | } |
| | | |
| | | //测试 |
| | | public void test1() { |
| | | log.info("测试海康接口"); |
| | | HkApiUtil.sendAPI("/api/dqd/service/rs/v1/device/coordinateExpInfo/query", new FaceDeviceSamplingParam(), Object.class); |
| | | log.info("结束->{},调用成功"); |
| | | } |
| | | |
| | | //测试 |
| | | public void test2() { |
| | | log.info("测试海康接口"); |
| | | HkApiUtil.sendAPI("/api/dqd/service/rs/v1/device/gbCodeExpInfo/query", new FaceDeviceSamplingParam(), Object.class); |
| | | log.info("结束->{},调用成功"); |
| | | } |
| | | |
| | | //测试 |
| | | public void test3() { |
| | | log.info("测试海康接口"); |
| | | HkApiUtil.sendAPI("/api/dqd/service/rs/v2/data/passDetect/query", new FaceDeviceSamplingParam(), Object.class); |
| | | log.info("结束->{},调用成功"); |
| | | } |
| | | |
| | | //解析数据 |