| | |
| | | import com.ycl.platform.service.*; |
| | | import com.ycl.utils.DateUtils; |
| | | import constant.ApiConstants; |
| | | import constant.CheckConstants; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | item.setNo(item.getExternalIndexCode()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(list); |
| | | pointService.setDeviceTagByGB(list, CheckConstants.Rule_Category_Car); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(list); |
| | | //同步的数据进行工单阈值处理 |
| | |
| | | item.setNo(item.getExternalIndexCode()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(list); |
| | | pointService.setDeviceTagByGB(list,CheckConstants.Rule_Category_Face); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(list); |
| | | //同步的数据进行工单阈值处理 |
| | |
| | | item.setNo(item.getExternalIndexCode()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(carList); |
| | | pointService.setDeviceTagByGB(carList,CheckConstants.Rule_Category_Car); |
| | | //存放在mongo中 |
| | | carList.forEach(item -> item.setDataType(ApiConstants.HK_DataType_CAR)); |
| | | mongoTemplate.insertAll(carList); |
| | | //TODO:更新point表在线状态(有抓拍量视作在线) |
| | | //工单 |
| | | } |
| | | |
| | | /** 人脸数据 */ |
| | |
| | | item.setNo(item.getExternalIndexCode()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(faceList); |
| | | pointService.setDeviceTagByGB(faceList,CheckConstants.Rule_Category_Face); |
| | | //存放在mongo中 |
| | | faceList.forEach(item -> item.setDataType(ApiConstants.HK_DataType_FACE)); |
| | | mongoTemplate.insertAll(faceList); |
| | | //TODO:更新point表在线状态(有抓拍量视作在线) |
| | | //工单 |
| | | } |
| | | |
| | | log.info("结束抓拍数据量检测结果数据同步"); |
| | | } |
| | | |
| | |
| | | item.setNo(item.getExternalIndexCode()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(faceList); |
| | | pointService.setDeviceTagByGB(faceList,CheckConstants.Rule_Category_Face); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(faceList); |
| | | } |
| | |
| | | param.setPageNo(ApiConstants.PageNo); |
| | | param.setPageSize(ApiConstants.HKPageSize); |
| | | param.setDate(DateUtils.getDate()); |
| | | List<CrossDetailResult> faceList = HkApiUtil.sendAPI(host,appKey,appSecret,"/api/dqd/service/rs/v1/device/crossExpDetailInfo/query", param, CrossDetailResult.class); |
| | | if (!CollectionUtils.isEmpty(faceList)) { |
| | | List<CrossDetailResult> carList = HkApiUtil.sendAPI(host,appKey,appSecret,"/api/dqd/service/rs/v1/device/crossExpDetailInfo/query", param, CrossDetailResult.class); |
| | | if (!CollectionUtils.isEmpty(carList)) { |
| | | //如果今天存在之前的数据先删除 |
| | | Query query = new Query(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | DeleteResult result = mongoTemplate.remove(query, CrossDetailResult.class); |
| | | faceList.stream().forEach(item -> { |
| | | carList.stream().forEach(item -> { |
| | | if (Objects.nonNull(item.getExternalIndexCode())) { |
| | | item.setNo(item.getExternalIndexCode()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(faceList); |
| | | pointService.setDeviceTagByGB(carList,CheckConstants.Rule_Category_Car); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(faceList); |
| | | mongoTemplate.insertAll(carList); |
| | | } |
| | | log.info("结束卡口属性监测结果数据同步"); |
| | | } |
| | |
| | | param.setPageSize(ApiConstants.HKPageSize); |
| | | param.setDate(DateUtils.getDate()); |
| | | param.setDataType(ApiConstants.HK_DataType_CAR); |
| | | List<DataIntegrityMonitoringResult> faceList = HkApiUtil.sendAPI(host,appKey,appSecret,"/api/dqd/service/rs/v1/data/attributeIntegrity/query", param, DataIntegrityMonitoringResult.class); |
| | | List<DataIntegrityMonitoringResult> carList = HkApiUtil.sendAPI(host,appKey,appSecret,"/api/dqd/service/rs/v1/data/attributeIntegrity/query", param, DataIntegrityMonitoringResult.class); |
| | | |
| | | if (!CollectionUtils.isEmpty(faceList)) { |
| | | if (!CollectionUtils.isEmpty(carList)) { |
| | | //如果今天存在之前的数据先删除 |
| | | Query query = new Query(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | DeleteResult result = mongoTemplate.remove(query, DataIntegrityMonitoringResult.class); |
| | | faceList.stream().forEach(item -> { |
| | | carList.stream().forEach(item -> { |
| | | if (Objects.nonNull(item.getExternalIndexCode())) { |
| | | item.setNo(item.getExternalIndexCode()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(faceList); |
| | | pointService.setDeviceTagByGB(carList,CheckConstants.Rule_Category_Car); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(faceList); |
| | | mongoTemplate.insertAll(carList); |
| | | } |
| | | log.info("结束数据完整性监测结果数据同步"); |
| | | } |
| | |
| | | param.setPageSize(ApiConstants.HKPageSize); |
| | | param.setDate(DateUtils.getDate()); |
| | | param.setDataType(ApiConstants.HK_DataType_CAR); |
| | | List<AttrRecognitionMonitorResult> faceList = HkApiUtil.sendAPI(host,appKey,appSecret,"/api/dqd/service/rs/v1/data/attributeRecognition/query", param, AttrRecognitionMonitorResult.class); |
| | | List<AttrRecognitionMonitorResult> carList = HkApiUtil.sendAPI(host,appKey,appSecret,"/api/dqd/service/rs/v1/data/attributeRecognition/query", param, AttrRecognitionMonitorResult.class); |
| | | |
| | | if (!CollectionUtils.isEmpty(faceList)) { |
| | | if (!CollectionUtils.isEmpty(carList)) { |
| | | //如果今天存在之前的数据先删除 |
| | | Query query = new Query(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | DeleteResult result = mongoTemplate.remove(query, AttrRecognitionMonitorResult.class); |
| | | faceList.stream().forEach(item -> { |
| | | carList.stream().forEach(item -> { |
| | | if (Objects.nonNull(item.getExternalIndexCode())) { |
| | | item.setNo(item.getExternalIndexCode()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(faceList); |
| | | pointService.setDeviceTagByGB(carList,CheckConstants.Rule_Category_Car); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(faceList); |
| | | mongoTemplate.insertAll(carList); |
| | | } |
| | | log.info("结束属性识别准确监测结果数据同步"); |
| | | |
| | |
| | | .and("dataType").is(ApiConstants.HK_DataType_CAR)); |
| | | DeleteResult result = mongoTemplate.remove(query, SnapshotDelayMonitorResult.class); |
| | | //存放在mongo中 |
| | | carList.forEach(item -> item.setDataType(ApiConstants.HK_DataType_CAR)); |
| | | carList.stream().forEach(item -> { |
| | | item.setDataType(ApiConstants.HK_DataType_CAR); |
| | | if (Objects.nonNull(item.getExternalIndexCode())) { |
| | | item.setNo(item.getExternalIndexCode()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(carList); |
| | | pointService.setDeviceTagByGB(carList,CheckConstants.Rule_Category_Car); |
| | | mongoTemplate.insertAll(carList); |
| | | } |
| | | |
| | |
| | | .and("dataType").is(ApiConstants.HK_DataType_FACE)); |
| | | DeleteResult result = mongoTemplate.remove(query, SnapshotDelayMonitorResult.class); |
| | | //存放在mongo中 |
| | | faceList.forEach(item -> item.setDataType(ApiConstants.HK_DataType_FACE)); |
| | | faceList.forEach(item -> { |
| | | item.setDataType(ApiConstants.HK_DataType_FACE); |
| | | if (Objects.nonNull(item.getExternalIndexCode())) { |
| | | item.setNo(item.getExternalIndexCode()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(faceList,CheckConstants.Rule_Category_Face); |
| | | mongoTemplate.insertAll(faceList); |
| | | } |
| | | log.info("结束抓拍数据时延监测结果数据同步"); |
| | |
| | | param.setPageSize(ApiConstants.HKPageSize); |
| | | param.setDate(DateUtils.getDate()); |
| | | param.setDataType(ApiConstants.HK_DataType_CAR); |
| | | List<PicAccessResult> faceList = HkApiUtil.sendAPI(host,appKey,appSecret,"/api/dqd/service/rs/v1/data/picAccessDetail/query", param, PicAccessResult.class); |
| | | List<PicAccessResult> carList = HkApiUtil.sendAPI(host,appKey,appSecret,"/api/dqd/service/rs/v1/data/picAccessDetail/query", param, PicAccessResult.class); |
| | | |
| | | if (!CollectionUtils.isEmpty(faceList)) { |
| | | if (!CollectionUtils.isEmpty(carList)) { |
| | | //如果今天存在之前的数据先删除 |
| | | Query query = new Query(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | DeleteResult result = mongoTemplate.remove(query, PicAccessResult.class); |
| | | faceList.stream().forEach(item -> { |
| | | carList.stream().forEach(item -> { |
| | | if (Objects.nonNull(item.getExternalIndexCode())) { |
| | | item.setNo(item.getExternalIndexCode()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(faceList); |
| | | pointService.setDeviceTagByGB(carList,CheckConstants.Rule_Category_Car); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(faceList); |
| | | mongoTemplate.insertAll(carList); |
| | | } |
| | | log.info("结束图片访问监测结果数据同步"); |
| | | } |
| | |
| | | param.setPageSize(ApiConstants.HKPageSize); |
| | | param.setDate(DateUtils.getDate()); |
| | | param.setDataType(ApiConstants.HK_DataType_CAR); |
| | | List<VehicleDeviceSamplingResult> faceList = HkApiUtil.sendAPI(host,appKey,appSecret,"/api/dqd/service/rs/v2/data/vehSampleAmount/query", param, VehicleDeviceSamplingResult.class); |
| | | List<VehicleDeviceSamplingResult> carList = HkApiUtil.sendAPI(host,appKey,appSecret,"/api/dqd/service/rs/v2/data/vehSampleAmount/query", param, VehicleDeviceSamplingResult.class); |
| | | |
| | | if (!CollectionUtils.isEmpty(faceList)) { |
| | | if (!CollectionUtils.isEmpty(carList)) { |
| | | //如果今天存在之前的数据先删除 |
| | | Query query = new Query(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | DeleteResult result = mongoTemplate.remove(query, VehicleDeviceSamplingResult.class); |
| | | faceList.stream().forEach(item -> { |
| | | carList.stream().forEach(item -> { |
| | | if (Objects.nonNull(item.getExternalIndexCode())) { |
| | | item.setNo(item.getExternalIndexCode()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(faceList); |
| | | pointService.setDeviceTagByGB(carList,CheckConstants.Rule_Category_Car); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(faceList); |
| | | mongoTemplate.insertAll(carList); |
| | | } |
| | | log.info("结束车辆设备抽检指标监测结果数据同步"); |
| | | } |
| | |
| | | item.setNo(item.getExternalIndexCode()); |
| | | } |
| | | }); |
| | | pointService.setDeviceTagByGB(faceList); |
| | | pointService.setDeviceTagByGB(faceList,CheckConstants.Rule_Category_Face); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(faceList); |
| | | } |
| | | log.info("结束人脸设备抽检指标监测结果数据同步"); |
| | | } |
| | | |
| | | //业务树 |
| | | public void TreeTask() { |
| | | log.info("开始执行业务树数据"); |
| | | TreeParam param = new TreeParam(); |
| | | param.setStartDate("2024-12-06"); |
| | | param.setEndDate("2024-12-06"); |
| | | List<HKTreeResult> faceList = HkApiUtil.sendGetAPI(host,appKey,appSecret,"/api/third/timeTree", param, HKTreeResult.class); |
| | | // if (!CollectionUtils.isEmpty(faceList)) { |
| | | // //如果今天存在之前的数据先删除 |
| | | // Query query = new Query(Criteria |
| | | // .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | // DeleteResult result = mongoTemplate.remove(query, FaceDeviceSamplingResult.class); |
| | | // faceList.stream().forEach(item -> { |
| | | // if (Objects.nonNull(item.getExternalIndexCode())) { |
| | | // item.setNo(item.getExternalIndexCode()); |
| | | // } |
| | | // }); |
| | | // pointService.setDeviceTagByGB(faceList,CheckConstants.Rule_Category_Face); |
| | | // //存放在mongo中 |
| | | // mongoTemplate.insertAll(faceList); |
| | | // } |
| | | log.info("结束业务树数据"); |
| | | } |
| | | |
| | | //解析数据 |
| | | private <T> List<T> getDataList(JSONObject jsonObject, Class<T> resultClass, String message) { |
| | | if (jsonObject != null && ApiConstants.HKSuccessCode.equals(jsonObject.getString("code"))) { |