| | |
| | | }else { |
| | | checkIndexCarVo.setCreateTimeStr(checkIndexCar.getCreateTimeStr()); |
| | | } |
| | | checkIndexCarVo.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexCar.getExamineTag()) ? "省厅考核" : "区县考核"); |
| | | checkIndexCarVo.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexCarVo.getExamineTag()) ? "省厅考核" : CheckConstants.Examine_Tag_County.equals(checkIndexCarVo.getExamineTag()) ? "区县考核" : "公安部考核"); |
| | | checkIndexCarVo.setSiteOnlineText(checkIndexCar.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); |
| | | checkIndexCarVo.setVehicleCaptureAccuracyText(checkIndexCar.getVehicleCaptureAccuracy().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); |
| | | checkIndexCarVo.setDeviceDirectoryConsistentText(checkIndexCar.getDeviceDirectoryConsistent().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); |
| | |
| | | checkIndexFaceVo.setCreateTimeStr(checkIndexFace.getCreateTimeStr()); |
| | | } |
| | | checkIndexFaceVo.setDeptName(checkIndexFace.getDeptName()); |
| | | checkIndexFaceVo.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexFace.getExamineTag()) ? "省厅考核" : "区县考核"); |
| | | checkIndexFaceVo.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexFaceVo.getExamineTag()) ? "省厅考核" : CheckConstants.Examine_Tag_County.equals(checkIndexFaceVo.getExamineTag()) ? "区县考核" : "公安部考核"); |
| | | checkIndexFaceVo.setSiteOnlineText(checkIndexFace.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); |
| | | checkIndexFaceVo.setFaceInformationCollectionAccuracyText(checkIndexFace.getFaceInformationCollectionAccuracy().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); |
| | | checkIndexFaceVo.setFacePictureAvailabilityText(checkIndexFace.getFacePictureAvailability().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); |
| | |
| | | } else { |
| | | checkIndexVideoVO.setCreateTimeStr(checkIndexVideo.getCreateTimeStr()); |
| | | } |
| | | checkIndexVideoVO.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexVideo.getExamineTag()) ? "省厅考核" : "区县考核"); |
| | | checkIndexVideoVO.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexVideo.getExamineTag()) ? "省厅考核" : CheckConstants.Examine_Tag_County.equals(checkIndexVideo.getExamineTag()) ? "区县考核" : "公安部考核"); |
| | | checkIndexVideoVO.setSiteOnlineText(checkIndexVideo.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); |
| | | checkIndexVideoVO.setImageResourceSecurityText(checkIndexVideo.getImageResourceSecurity().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); |
| | | checkIndexVideoVO.setArchivesRateText(checkIndexVideo.getArchivesRate().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); |
| | |
| | | |
| | | int count = videos.size(); |
| | | for (CheckIndexVideo video : videos) { |
| | | numSum = numSum + (video.getNum() == null? 0:video.getNum()); |
| | | numSum = numSum + (video.getNum() == null ? 0 : video.getNum()); |
| | | scoreSum = scoreSum.add(video.getScore() == null ? BigDecimal.ZERO : video.getScore()); |
| | | totalPlatformOnline = totalPlatformOnline.add(video.getPlatformOnline()); |
| | | totalMonitorQualification = totalMonitorQualification.add(video.getMonitorQualification()); |
| | |
| | | averageVideo.setCreateTimeStr("合计"); |
| | | averageVideo.setDeptName(videos.get(0).getDeptName()); |
| | | averageVideo.setExamineTag(videos.get(0).getExamineTag()); |
| | | averageVideo.setNum(numSum/count); |
| | | averageVideo.setNum(numSum / count); |
| | | averageVideo.setScore(scoreSum.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); |
| | | averageVideo.setPlatformOnline(totalPlatformOnline.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); |
| | | averageVideo.setMonitorQualification(totalMonitorQualification.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); |
| | |
| | | public class VideoExportForm { |
| | | @NotBlank(message = "月份不能为空") |
| | | private String month; |
| | | @NotEmpty(message = "部门不能为空") |
| | | private List<Integer> deptIds; |
| | | // 0/1/2/3 省厅、重点点位、重点指挥图像、部级 |
| | | private List<Integer> tags; |
| | |
| | | @Override |
| | | public void calculate(List<VehicleDeviceInspectionResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<MonitorQualifyResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<DataIntegrityMonitoringResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, CarDataIntegrityCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, CarDataIntegrityCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<VehicleDeviceSamplingResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, CarDeviceSampleCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, CarDeviceSampleCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<CrossDetailResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, CarInFoAccuracyCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, CarInFoAccuracyCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<TMonitorResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, CarOnlineCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, CarOnlineCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<SnapshotDataMonitorResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, CarSnapshopDataCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, CarSnapshopDataCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 获取当前日期 |
| | |
| | | @Override |
| | | public void calculate(List<SnapshotDelayMonitorResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, CarSnapshotDelayCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, CarSnapshotDelayCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<FaceDeviceInspectionResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, FaceClockAccuracyCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, FaceClockAccuracyCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<MonitorQualifyResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, FaceConsistentCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, FaceConsistentCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<FaceDeviceSamplingResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, FaceDeviceSampleCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, FaceDeviceSampleCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<MonitoringDetailResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, FaceInFoAccuracyCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, FaceInFoAccuracyCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<TMonitorResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, FaceOnlineCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, FaceOnlineCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<SnapshotDataMonitorResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, FaceSnapshotDataCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, FaceSnapshotDataCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 获取当前日期 |
| | |
| | | @Override |
| | | public void calculate(List<SnapshotDelayMonitorResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, FaceSnapshotDelayCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, FaceSnapshotDelayCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.FALSE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public abstract class IndexCalculationServe <T extends BaseResult, S> extends IndexCalculationUtils { |
| | | public abstract class IndexCalculationServe<T extends BaseResult, S> extends IndexCalculationUtils { |
| | | @Autowired |
| | | private TMonitorMapper monitorMapper; |
| | | |
| | | //抽象方法,由子类编写具体逻辑算法 |
| | | protected abstract void updateAreaStats(Map<String, S> areaStatsMap, String key, T result); |
| | | |
| | | protected Map<String, S> getAreaStatsMap(List<T> list){ |
| | | protected Map<String, S> getAreaStatsMap(List<T> list, Boolean needDept) { |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | log.info("数据为空"); |
| | | return null; |
| | |
| | | updateAreaStats(areaStatsMap, deptId, result); |
| | | |
| | | // 处理省厅数据 |
| | | if (result.getProvinceTag()!=null && result.getProvinceTag()) { |
| | | if (result.getProvinceTag() != null && result.getProvinceTag()) { |
| | | String provinceKey = ApiConstants.Province + deptId; |
| | | updateAreaStats(areaStatsMap, provinceKey, result); |
| | | } |
| | | // 处理公安部数据 |
| | | if (result.getDeptTag()!=null && result.getDeptTag()) { |
| | | String deptKey = ApiConstants.Dept + deptId; |
| | | updateAreaStats(areaStatsMap, deptKey, result); |
| | | if (needDept) { |
| | | if (result.getDeptTag() != null && result.getDeptTag()) { |
| | | String deptKey = ApiConstants.Dept + deptId; |
| | | updateAreaStats(areaStatsMap, deptKey, result); |
| | | } |
| | | } |
| | | } |
| | | return areaStatsMap; |
| | |
| | | @Override |
| | | public void calculate(List<MonitorQualifyResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, MonitorQualifyCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, MonitorQualifyCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.TRUE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<MonitorQualifyResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, MonitorRegistrationCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, MonitorRegistrationCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.TRUE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | //查数据库补充全年留存数 |
| | |
| | | @Override |
| | | public void calculate(List<TMonitorResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, VideoOnlineCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, VideoOnlineCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.TRUE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<OsdCheckResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, VideoOsdCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, VideoOsdCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.TRUE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | @Override |
| | | public void calculate(List<RecordMetaDSumResult> list) { |
| | | //获取分区域的指标数量 |
| | | Map<String, VideoUsabilityCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); |
| | | Map<String, VideoUsabilityCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.TRUE); |
| | | if (areaStatsMap == null) return; |
| | | |
| | | // 查询是否index表已经存在今日数据 |
| | |
| | | */ |
| | | @Override |
| | | public void exportVideoTotal(HttpServletResponse response, VideoExportForm exportForm) throws IOException { |
| | | //默认查所有部门 |
| | | if(CollectionUtils.isEmpty(exportForm.getDeptIds())){ |
| | | List<Integer> deptIds = new ArrayList<>(); |
| | | for (AreaDeptEnum value : AreaDeptEnum.values()) { |
| | | deptIds.add(value.getDeptId()); |
| | | } |
| | | exportForm.setDeptIds(deptIds); |
| | | } |
| | | List<ExcelExp> mysheet = new ArrayList<>(); |
| | | exportForm.setCameraFunType(Integer.valueOf(CheckConstants.Rule_Category_Video + "")); |
| | | VideoExportForm.convertTags(exportForm); |
| | |
| | | */ |
| | | @Override |
| | | public void exportVideoOnline(HttpServletResponse response, VideoExportForm exportForm) throws IOException, NoSuchFieldException, IllegalAccessException { |
| | | //默认查所有部门 |
| | | if(CollectionUtils.isEmpty(exportForm.getDeptIds())){ |
| | | List<Integer> deptIds = new ArrayList<>(); |
| | | for (AreaDeptEnum value : AreaDeptEnum.values()) { |
| | | deptIds.add(value.getDeptId()); |
| | | } |
| | | exportForm.setDeptIds(deptIds); |
| | | } |
| | | List<ExcelExp> mysheet = new ArrayList<>(); |
| | | exportForm.setCameraFunType(Integer.valueOf(CheckConstants.Rule_Category_Video + "")); |
| | | VideoExportForm.convertTags(exportForm); |
| | |
| | | */ |
| | | @Override |
| | | public void exportVideoRecord(HttpServletResponse response, VideoExportForm exportForm) throws IOException, NoSuchFieldException, IllegalAccessException { |
| | | //默认查所有部门 |
| | | if(CollectionUtils.isEmpty(exportForm.getDeptIds())){ |
| | | List<Integer> deptIds = new ArrayList<>(); |
| | | for (AreaDeptEnum value : AreaDeptEnum.values()) { |
| | | deptIds.add(value.getDeptId()); |
| | | } |
| | | exportForm.setDeptIds(deptIds); |
| | | } |
| | | List<ExcelExp> mysheet = new ArrayList<>(); |
| | | exportForm.setCameraFunType(Integer.valueOf(CheckConstants.Rule_Category_Video + "")); |
| | | VideoExportForm.convertTags(exportForm); |
| | |
| | | */ |
| | | @Override |
| | | public void exportVideoLoseTime(HttpServletResponse response, VideoExportForm exportForm) throws NoSuchFieldException, IllegalAccessException, IOException { |
| | | //默认查所有部门 |
| | | if(CollectionUtils.isEmpty(exportForm.getDeptIds())){ |
| | | List<Integer> deptIds = new ArrayList<>(); |
| | | for (AreaDeptEnum value : AreaDeptEnum.values()) { |
| | | deptIds.add(value.getDeptId()); |
| | | } |
| | | exportForm.setDeptIds(deptIds); |
| | | } |
| | | List<ExcelExp> mysheet = new ArrayList<>(); |
| | | exportForm.setCameraFunType(Integer.valueOf(CheckConstants.Rule_Category_Video + "")); |
| | | VideoExportForm.convertTags(exportForm); |
| | |
| | | private CheckIndexFaceMapper faceMapper; |
| | | @Autowired |
| | | private CheckIndexCarMapper carMapper; |
| | | |
| | | //公安部只有视频考核 |
| | | public void executeTemplate(Integer templateId) { |
| | | CheckTemplate checkTemplate = templateMapper.selectCheckTemplateById(templateId); |
| | | if (checkTemplate != null) { |
| | |
| | | } |
| | | } |
| | | //储存分数 |
| | | if(!CollectionUtils.isEmpty(scoreList)) { |
| | | if (!CollectionUtils.isEmpty(scoreList)) { |
| | | scoreMapper.saveBatch(scoreList); |
| | | } |
| | | } |
| | |
| | | <if test="deptId != null "> and tcic.dept_id = #{deptId}</if> |
| | | <if test="examineTag != null "> and tcic.examine_tag = #{examineTag}</if> |
| | | <if test="examineTagQuery != null "> and p.province_tag = #{examineTagQuery}</if> |
| | | <if test="quarter != null and quarter.size > 0"> |
| | | and date_format(tcs.create_time, '%Y-%m') between #{quarter[0]} and #{quarter[1]} |
| | | </if> |
| | | <if test="date != null "> and date_format(tcic.create_time,'%Y-%m') = #{date}</if> |
| | | <if test="day != null "> and date(tcic.create_time) = #{day}</if> |
| | | <if test="params.publish != null and params.publish != ''">and tcic.publish = #{params.publish}</if> |
| | |
| | | <if test="deptId != null "> and tcif.dept_id = #{deptId}</if> |
| | | <if test="examineTag != null "> and tcif.examine_tag = #{examineTag}</if> |
| | | <if test="examineTagQuery != null "> and p.province_tag = #{examineTagQuery}</if> |
| | | <if test="quarter != null and quarter.size > 0"> |
| | | and date_format(tcs.create_time, '%Y-%m') between #{quarter[0]} and #{quarter[1]} |
| | | </if> |
| | | <if test="date != null "> and date_format(tcif.create_time,'%Y-%m') = #{date}</if> |
| | | <if test="day != null "> and date(tcif.create_time) = #{day}</if> |
| | | <if test="params.publish != null and params.publish != ''">and tcif.publish = #{params.publish}</if> |
| | |
| | | <if test="deptId != null "> and tciv.dept_id = #{deptId}</if> |
| | | <if test="examineTag != null "> and tciv.examine_tag = #{examineTag}</if> |
| | | <if test="examineTagQuery != null "> and p.province_tag = #{examineTagQuery}</if> |
| | | <if test="quarter != null and quarter.size > 0"> |
| | | and date_format(tcs.create_time, '%Y-%m') between #{quarter[0]} and #{quarter[1]} |
| | | </if> |
| | | <if test="date != null "> and date_format(tciv.create_time,'%Y-%m') = #{date}</if> |
| | | <if test="day != null "> and date(tciv.create_time) = #{day}</if> |
| | | <if test="createTime != null "> and date(tciv.create_time) = #{createTime}</if> |
| | |
| | | left join t_yw_point p on m.serial_number = p.serial_number |
| | | left join sys_dept d on p.dept_id = d.dept_id |
| | | <where> |
| | | p.examine_status = 1 |
| | | <if test="cameraFunType!=null"> |
| | | and m.camera_fun_type like concat('%',#{cameraFunType},'%') |
| | | </if> |