| | |
| | | @Value("${youYun.passwd}") |
| | | private String passwd; |
| | | |
| | | // 图像检测 |
| | | public void imageDetection() { |
| | | log.info("开始执行图像检测数据同步"); |
| | | ImageDetectionParam param = new ImageDetectionParam(); |
| | | param.setPageNum(ApiConstants.PageNo); |
| | | param.setPageSize(ApiConstants.PageSize); |
| | | JSONObject jsonObject = uyClient.imageDetection(param); |
| | | if (jsonObject != null) { |
| | | log.info("数据格式" + jsonObject); |
| | | Integer statusCode = jsonObject.getInteger("statusCode"); |
| | | if (ApiConstants.UYSuccessCode.equals(statusCode)) { |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | | if (data != null) { |
| | | List<ImageDetectionResult> records = data.getList("records", ImageDetectionResult.class); |
| | | if (!CollectionUtils.isEmpty(records)) { |
| | | //如果今天存在之前的数据先删除 |
| | | Query query = new Query(Criteria |
| | | .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); |
| | | DeleteResult result = mongoTemplate.remove(query, QueryVqdResult.class); |
| | | //存放在mongo中 |
| | | mongoTemplate.insertAll(records); |
| | | } else { |
| | | log.error("图像监测数据为空{}", data); |
| | | } |
| | | } else { |
| | | log.error("图像监测数据为空{}", jsonObject); |
| | | } |
| | | } else { |
| | | log.error("图像监测请求失败{}", jsonObject); |
| | | } |
| | | } else { |
| | | log.error("图像监测数据为空"); |
| | | } |
| | | log.info("结束执行图像监测数据同步"); |
| | | } |
| | | |
| | | //一机一档 |
| | | public void monitorTask() { |
| | | //一机一档合格率 |