New file |
| | |
| | | package com.ycl.platform.domain.param.HK; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ScoreParam extends BaseParam{ |
| | | //yyyy-MM-dd |
| | | private String startDate; |
| | | private String endDate; |
| | | //重点点位标注 非必填 1重点 0全量 默认全量 |
| | | private Integer focusFlag; |
| | | //人脸业务树编码 |
| | | private String faceTree; |
| | | //车辆业务树编码 |
| | | private String carTree; |
| | | } |
New file |
| | |
| | | package com.ycl.platform.domain.result.HK; |
| | | |
| | | import com.ycl.platform.domain.result.BaseResult; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | //考核成绩 |
| | | @Data |
| | | public class HKScoreResult extends BaseResult { |
| | | private List<HkScore> list; |
| | | |
| | | /** |
| | | * 考核成绩 |
| | | */ |
| | | @Data |
| | | public static class HkScore { |
| | | //区域名 |
| | | private String areaName; |
| | | //区域编码 |
| | | private String areaCode; |
| | | //排名 |
| | | private Integer ranking; |
| | | //总分 |
| | | private String totalScore; |
| | | //focusFlag为0涉及到的全量指标 |
| | | private String downCarDataUploadScoreString; |
| | | private Date dCreateTime; |
| | | |
| | | } |
| | | } |
| | |
| | | AreaStats stats = areaStatsMap.computeIfAbsent(key, k -> new AreaStats()); |
| | | stats.totalSites++; |
| | | //时钟准确率大于90%为合格设备 |
| | | if (result.getSnapClock().getClockPercent() >= 0.9) { |
| | | if (result.getSnapClock()!=null && result.getSnapClock().getClockPercent()!=null && result.getSnapClock().getClockPercent() >= 0.9) { |
| | | stats.accuracySites++; |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public void calculate(List<DataIntegrityMonitoringResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, CarDataIntegrityCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | Map<String, CarDataIntegrityCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list, Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | AreaStats stats = areaStatsMap.computeIfAbsent(key, k -> new AreaStats()); |
| | | stats.totalSites++; |
| | | //90%及以上数据合格则此车辆卡口设备被视为抓拍数据完整 |
| | | if (result.getMainNoIntegrityPercent() <= 0.1) { |
| | | if (result.getMainNoIntegrityPercent() != null && result.getMainNoIntegrityPercent() <= 0.1) { |
| | | stats.integritySites++; |
| | | } |
| | | //重点点位为六项属性完整 |
| | | if (result.getImportantTag()!=null && result.getImportantTag()) { |
| | | if (result.getImportantTag() != null && result.getImportantTag()) { |
| | | stats.importantTotalSites++; |
| | | if (result.getNoIntegrityPercent() <= 0.1) { |
| | | stats.importantIntegritySites++; |
| | |
| | | AreaStats stats = areaStatsMap.computeIfAbsent(key, k -> new AreaStats()); |
| | | stats.totalSites++; |
| | | //时钟准确率大于90%为合格设备 |
| | | if (result.getSnapClock().getClockPercent() >= 0.9) { |
| | | if (result.getSnapClock()!=null && result.getSnapClock().getClockPercent()!=null && result.getSnapClock().getClockPercent() >= 0.9) { |
| | | stats.accuracySites++; |
| | | } |
| | | } |
| | |
| | | if (!CollectionUtils.isEmpty(reportNumbers)) { |
| | | if (reportNumbers.contains(workOrder.getSerialNumber())) continue; |
| | | } |
| | | if(!WorkOrderStatusEnum.AUDITING_SUCCESS.equals(workOrder.getStatus())) continue; |
| | | String errorType = workOrder.getErrorType(); |
| | | //存储故障 录像或图片访问异常 (改成手动打分了) |
| | | // if (ErrorType.VIDEO_NONE.getValue().equals(errorType) || ErrorType.PIC_URLABNORMAL.getValue().equals(errorType)) { |
| | |
| | | log.info("结束业务树数据"); |
| | | } |
| | | |
| | | //考核成绩 |
| | | public void HkScoreTask() { |
| | | log.info("开始执行海康考核成绩数据"); |
| | | ScoreParam param = new ScoreParam(); |
| | | param.setStartDate("2024-12-06"); |
| | | param.setEndDate("2024-12-06"); |
| | | List<HKScoreResult> dataList = HkApiUtil.sendGetAPI(host,appKey,appSecret,"/api/third/score/get", param, HKScoreResult.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"))) { |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="/home/java/logs" /> |
| | | <property name="log.path" value="/opt/zgyw/logs" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | |
| | | </foreach> |
| | | </delete> |
| | | <select id="getLatest" resultType="com.ycl.platform.domain.entity.ImageResourceSecurity"> |
| | | select * from t_image_resource_security where dept_id = #{deptId} |
| | | where date_format(create_time,'%Y-%m') = date_format(#{date}, '%Y-%m') |
| | | select * from t_image_resource_security |
| | | where dept_id = #{deptId} |
| | | and date_format(create_time,'%Y-%m') = date_format(#{date}, '%Y-%m') |
| | | order by create_time desc |
| | | limit 1 |
| | | </select> |
| | |
| | | , monitor_azimuth, scene_photo_addr, model, site_vulgo, camera_type, camera_light_type, encoded_format, |
| | | camera_dept, hybm, lxbm,d.dept_id, d.dept_name, |
| | | CASE |
| | | WHEN p.provnce_tag_video = 1 OR p.provnce_tag_car = 1 OR p.provnce_tag_face = 1 THEN 1 |
| | | WHEN p.province_tag_video = 1 OR p.province_tag_car = 1 OR p.province_tag_face = 1 THEN 1 |
| | | ELSE 0 |
| | | END AS province_tag,p.dept_tag |
| | | from t_monitor m |