| | |
| | | @Excel(name = "得分") |
| | | @TableField(exist = false) |
| | | private BigDecimal score; |
| | | /** 设备数量 */ |
| | | @Excel(name = "设备数量") |
| | | @TableField(exist = false) |
| | | private Integer num; |
| | | |
| | | @TableField(exist = false) |
| | | public List<Integer> deptIds; |
| | | @TableField(exist = false) |
| | | public List<Integer> examineTags; |
| | | public Integer examineTagQuery; |
| | | @TableField(exist = false) |
| | | public List<Integer> examineCategories; |
| | | /** 请求参数 */ |
| | |
| | | //转换成字符串用于excel导出 |
| | | public static CheckIndexCarVO getExcelVo(@NonNull CheckIndexCar checkIndexCar) { |
| | | CheckIndexCarVO checkIndexCarVo = new CheckIndexCarVO(); |
| | | checkIndexCarVo.setNum(checkIndexCar.getNum()); |
| | | checkIndexCarVo.setScore(checkIndexCar.getScore().setScale(2,RoundingMode.HALF_UP)); |
| | | checkIndexCarVo.setDeptName(checkIndexCar.getDeptName()); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | |
| | | * 导出时用于计算平均值 |
| | | */ |
| | | public static CheckIndexCar calculateAverage(List<CheckIndexCar> checkIndexCars) { |
| | | Integer numSum = 0; |
| | | BigDecimal scoreSum = BigDecimal.ZERO; |
| | | BigDecimal viewConnectStabilitySum = BigDecimal.ZERO; |
| | | BigDecimal siteOnlineSum = BigDecimal.ZERO; |
| | |
| | | BigDecimal vehicleUrlAvailabilitySum = BigDecimal.ZERO; |
| | | BigDecimal vehiclePictureAvailabilitySum = BigDecimal.ZERO; |
| | | for (CheckIndexCar car : checkIndexCars) { |
| | | numSum = numSum + (car.getNum() == null? 0:car.getNum()); |
| | | scoreSum = scoreSum.add(car.getScore() == null ? BigDecimal.ZERO : car.getScore()); |
| | | viewConnectStabilitySum = viewConnectStabilitySum.add(car.getViewConnectStability()); |
| | | siteOnlineSum = siteOnlineSum.add(car.getSiteOnline()); |
| | |
| | | checkIndexCar.setDeptName(checkIndexCars.get(0).getDeptName()); |
| | | checkIndexCar.setExamineTag(checkIndexCars.get(0).getExamineTag()); |
| | | checkIndexCar.setScore(scoreSum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP)); |
| | | checkIndexCar.setNum(numSum/checkIndexCars.size()); |
| | | checkIndexCar.setViewConnectStability(viewConnectStabilitySum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP)); |
| | | checkIndexCar.setSiteOnline(siteOnlineSum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP)); |
| | | checkIndexCar.setDeviceDirectoryConsistent(deviceDirectoryConsistentSum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP)); |
| | |
| | | //转换成字符串用于excel导出 |
| | | public static CheckIndexFaceVO getExcelVo(@NonNull CheckIndexFace checkIndexFace) { |
| | | CheckIndexFaceVO checkIndexFaceVo = new CheckIndexFaceVO(); |
| | | checkIndexFaceVo.setNum(checkIndexFace.getNum()); |
| | | checkIndexFaceVo.setScore(checkIndexFace.getScore().setScale(2,RoundingMode.HALF_UP)); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | //避免合计行报错(合计数据 缺少createTimeStr字段 直接将createTimeStr设置为"合计") |
| | |
| | | } |
| | | /** 用于导出计算平均值 */ |
| | | public static CheckIndexFace calculateAverage(List<CheckIndexFace> checkIndexFaces) { |
| | | Integer numSum = 0; |
| | | BigDecimal scoreSum = BigDecimal.ZERO; |
| | | BigDecimal totalViewConnectStability = BigDecimal.ZERO; |
| | | BigDecimal totalSiteOnline = BigDecimal.ZERO; |
| | |
| | | int count = checkIndexFaces.size(); |
| | | |
| | | for (CheckIndexFace indexFace : checkIndexFaces) { |
| | | numSum = numSum + (indexFace.getNum() == null? 0:indexFace.getNum()); |
| | | scoreSum = scoreSum.add(indexFace.getScore() == null ? BigDecimal.ZERO : indexFace.getScore()); |
| | | totalViewConnectStability = totalViewConnectStability.add(indexFace.getViewConnectStability()); |
| | | totalSiteOnline = totalSiteOnline.add(indexFace.getSiteOnline()); |
| | |
| | | result.setCreateTimeStr("合计"); |
| | | result.setDeptName(checkIndexFaces.get(0).getDeptName()); |
| | | result.setExamineTag(checkIndexFaces.get(0).getExamineTag()); |
| | | result.setNum(numSum/count); |
| | | result.setScore(scoreSum.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); |
| | | result.setViewConnectStability(totalViewConnectStability.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); |
| | | result.setSiteOnline(totalSiteOnline.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); |
| | |
| | | //转换成字符串用于excel导出 |
| | | public static CheckIndexVideoVO getExcelVo(@NonNull CheckIndexVideo checkIndexVideo) { |
| | | CheckIndexVideoVO checkIndexVideoVO = new CheckIndexVideoVO(); |
| | | checkIndexVideoVO.setScore(checkIndexVideo.getScore().setScale(2,RoundingMode.HALF_UP)); |
| | | checkIndexVideoVO.setNum(checkIndexVideo.getNum()); |
| | | checkIndexVideoVO.setScore(checkIndexVideo.getScore().setScale(2, RoundingMode.HALF_UP)); |
| | | checkIndexVideoVO.setDeptName(checkIndexVideo.getDeptName()); |
| | | //避免合计行报错(合计数据 缺少createTimeStr字段 直接将createTimeStr设置为"合计") |
| | | if (StringUtils.isEmpty(checkIndexVideo.getCreateTimeStr())) { |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | checkIndexVideoVO.setCreateTimeStr(format.format(checkIndexVideo.getCreateTime())); |
| | | }else { |
| | | } else { |
| | | checkIndexVideoVO.setCreateTimeStr(checkIndexVideo.getCreateTimeStr()); |
| | | } |
| | | checkIndexVideoVO.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexVideo.getExamineTag()) ? "省厅考核" : "区县考核"); |
| | |
| | | * 用于导出计算平均值 |
| | | */ |
| | | public static CheckIndexVideo calculateAverage(List<CheckIndexVideo> videos) { |
| | | Integer numSum = 0; |
| | | BigDecimal scoreSum = BigDecimal.ZERO; |
| | | BigDecimal totalPlatformOnline = BigDecimal.ZERO; |
| | | BigDecimal totalMonitorQualification = BigDecimal.ZERO; |
| | |
| | | |
| | | int count = videos.size(); |
| | | for (CheckIndexVideo video : videos) { |
| | | 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.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)); |
| | |
| | | /** |
| | | * 录象可用率 |
| | | */ |
| | | @Excel(name = "录象可用率") |
| | | @Excel(name = "录像可用率") |
| | | private String videoAvailableText; |
| | | |
| | | /** |
| | |
| | | @Log(title = "详情页导出考核积分", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/detailExport") |
| | | @PreAuthorize("@ss.hasPermi('check:result:detail:export')") |
| | | //共用的一个方法用checkScore接参,new对象的方式防护。 |
| | | public void detailExport(HttpServletResponse response, CheckScore checkScore) throws IOException { |
| | | CheckResultExportDTO exportDTO = new CheckResultExportDTO(); |
| | | exportDTO.setDate(checkScore.getDate()); |
| | |
| | | checkIndexCar.setQuarter(exportDTO.getQuarter()); |
| | | checkIndexCar.setDeptId(exportDTO.getDeptId()); |
| | | checkIndexCar.setDeptIds(exportDTO.getDeptIds()); |
| | | checkIndexCar.setExamineTags(exportDTO.getExamineTags()); |
| | | //权限控制 只能查看已发布 |
| | | roleControl(checkIndexCar); |
| | | List<CheckIndexCar> checkIndexCars = indexCarService.selectCheckIndexCarList(checkIndexCar); |
| | | List<CheckIndexCar> checkIndexCars = new ArrayList<>(); |
| | | for (Integer examineTag : exportDTO.getExamineTags()) { |
| | | checkIndexCar.setExamineTag(Short.valueOf(examineTag+"")); |
| | | if(examineTag ==0){ |
| | | checkIndexCar.setExamineTagQuery(1); |
| | | } |
| | | checkIndexCars.addAll(indexCarService.selectCheckIndexCarList(checkIndexCar)); |
| | | } |
| | | //计算平均值放在excel最后 |
| | | if (exportDTO.getAverage() != null && exportDTO.getAverage() && !CollectionUtils.isEmpty(checkIndexCars)) { |
| | | //先区分考核标签,再区分区县 |
| | |
| | | checkIndexFace.setQuarter(exportDTO.getQuarter()); |
| | | checkIndexFace.setDeptId(exportDTO.getDeptId()); |
| | | checkIndexFace.setDeptIds(exportDTO.getDeptIds()); |
| | | checkIndexFace.setExamineTags(exportDTO.getExamineTags()); |
| | | //权限控制 只能查看已发布 |
| | | roleControl(checkIndexFace); |
| | | List<CheckIndexFace> checkIndexFaces = indexFaceService.selectCheckIndexFaceList(checkIndexFace); |
| | | List<CheckIndexFace> checkIndexFaces = new ArrayList<>(); |
| | | for (Integer examineTag : exportDTO.getExamineTags()) { |
| | | checkIndexFace.setExamineTag(Short.valueOf(examineTag+"")); |
| | | if(examineTag ==0){ |
| | | checkIndexFace.setExamineTagQuery(1); |
| | | } |
| | | checkIndexFaces.addAll(indexFaceService.selectCheckIndexFaceList(checkIndexFace)); |
| | | } |
| | | //计算平均值放在excel最后 |
| | | if (exportDTO.getAverage() != null && exportDTO.getAverage() && !CollectionUtils.isEmpty(checkIndexFaces)) { |
| | | //先区分考核标签,再区分区县 |
| | |
| | | checkIndexVideo.setQuarter(exportDTO.getQuarter()); |
| | | checkIndexVideo.setDeptId(exportDTO.getDeptId()); |
| | | checkIndexVideo.setDeptIds(exportDTO.getDeptIds()); |
| | | checkIndexVideo.setExamineTags(exportDTO.getExamineTags()); |
| | | //权限控制 只能查看已发布 |
| | | roleControl(checkIndexVideo); |
| | | List<CheckIndexVideo> checkIndexVideos = indexVideoService.selectCheckIndexVideoList(checkIndexVideo); |
| | | List<CheckIndexVideo> checkIndexVideos = new ArrayList<>(); |
| | | for (Integer examineTag : exportDTO.getExamineTags()) { |
| | | checkIndexVideo.setExamineTag(Short.valueOf(examineTag+"")); |
| | | if(examineTag ==0){ |
| | | checkIndexVideo.setExamineTagQuery(1); |
| | | } |
| | | checkIndexVideos.addAll(indexVideoService.selectCheckIndexVideoList(checkIndexVideo)); |
| | | } |
| | | //计算平均值放在excel最后 |
| | | if (exportDTO.getAverage() != null && exportDTO.getAverage() && !CollectionUtils.isEmpty(checkIndexVideos)) { |
| | | //先区分考核标签,再区分区县 |
| | |
| | | for (CheckScore checkScore : dashboard) { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("value",checkScore.getScore()); |
| | | if(dashboardQuery.getDataScope() ==1) { |
| | | map.put("value", checkScore.getScore()); |
| | | if (dashboardQuery.getDataScope() == 1) { |
| | | map.put("name", "省厅得分"); |
| | | }else { |
| | | } else { |
| | | map.put("name", "区县得分"); |
| | | } |
| | | list.add(map); |
| | | resultMap.put(checkScore.getDeptName(),list ); |
| | | resultMap.put(checkScore.getDeptName(), list); |
| | | } |
| | | return resultMap; |
| | | } |
| | |
| | | <result property="examineTag" column="examine_tag" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="score" column="score" /> |
| | | <result property="num" column="num" /> |
| | | <result property="viewConnectStability" column="view_connect_stability" /> |
| | | <result property="siteOnline" column="site_online" /> |
| | | <result property="deviceDirectoryConsistent" column="device_directory_consistent" /> |
| | |
| | | </sql> |
| | | |
| | | <select id="selectCheckIndexCarList" resultMap="CheckIndexCarResult"> |
| | | select tcic.*,sd.dept_name,tcs.score |
| | | select tcic.*,sd.dept_name,tcs.score,count(m.serial_number) as num |
| | | from t_check_index_car tcic left join sys_dept sd on tcic.dept_id = sd.dept_id |
| | | left join t_check_score tcs on tcic.id = tcs.index_id |
| | | left join t_yw_point p on p.dept_id = tcic.dept_id |
| | | left join t_monitor m on p.serial_number = m.serial_number |
| | | <where> |
| | | tcs.examine_category = 2 |
| | | tcs.examine_category = 2 and m.camera_fun_type like concat('%',2,'%') |
| | | <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="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> |
| | |
| | | #{deptId} |
| | | </foreach> |
| | | </if> |
| | | <if test="examineTags != null and examineTags.size()>0">and tcic.examine_tag in |
| | | <foreach collection="examineTags" separator="," open="(" close=")" item="examineTag"> |
| | | #{examineTag} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by tcic.examine_tag desc,tcic.create_time,tcs.score desc |
| | | group by tcic.id |
| | | order by tcic.examine_tag desc,sd.area_code,tcic.create_time |
| | | </select> |
| | | |
| | | <select id="getCheckIndexCarList" resultMap="CheckIndexCarResult"> |
| | |
| | | <result property="id" column="id" /> |
| | | <result property="deptId" column="dept_id" /> |
| | | <result property="examineTag" column="examine_tag" /> |
| | | <result property="num" column="num" /> |
| | | <result property="score" column="score" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="viewConnectStability" column="view_connect_stability" /> |
| | | <result property="siteOnline" column="site_online" /> |
| | |
| | | </sql> |
| | | |
| | | <select id="selectCheckIndexFaceList" resultMap="CheckIndexFaceResult"> |
| | | select tcif.*,sd.dept_name,tcs.score |
| | | select tcif.*,sd.dept_name,tcs.score,count(m.serial_number) as num |
| | | from t_check_index_face tcif left join sys_dept sd on tcif.dept_id = sd.dept_id |
| | | left join t_check_score tcs on tcif.id = tcs.index_id |
| | | left join t_yw_point p on p.dept_id = tcif.dept_id |
| | | left join t_monitor m on p.serial_number = m.serial_number |
| | | <where> |
| | | tcs.examine_category = 3 |
| | | tcs.examine_category = 3 and m.camera_fun_type like concat('%',3,'%') |
| | | <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="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> |
| | |
| | | #{deptId} |
| | | </foreach> |
| | | </if> |
| | | <if test="examineTags != null and examineTags.size()>0">and tcif.examine_tag in |
| | | <foreach collection="examineTags" separator="," open="(" close=")" item="examineTag"> |
| | | #{examineTag} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by tcif.examine_tag desc,tcif.create_time,tcs.score desc |
| | | group by tcif.id |
| | | order by tcif.examine_tag desc,sd.area_code,tcif.create_time |
| | | </select> |
| | | |
| | | <select id="getCheckIndexFaceList" resultMap="CheckIndexFaceResult"> |
| | |
| | | <result property="id" column="id" /> |
| | | <result property="deptId" column="dept_id" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="num" column="num" /> |
| | | <result property="score" column="score" /> |
| | | <result property="examineTag" column="examine_tag" /> |
| | | <result property="platformOnline" column="platform_online" /> |
| | | <result property="monitorQualification" column="monitor_qualification" /> |
| | |
| | | </sql> |
| | | |
| | | <select id="selectCheckIndexVideoList" parameterType="CheckIndexVideo" resultMap="CheckIndexVideoResult"> |
| | | select tciv.*,sd.dept_name,tcs.score |
| | | select tciv.*,sd.dept_name,tcs.score,count(m.serial_number) as num |
| | | from t_check_index_video tciv left join sys_dept sd on tciv.dept_id = sd.dept_id |
| | | left join t_check_score tcs on tciv.id = tcs.index_id |
| | | left join t_yw_point p on p.dept_id = tciv.dept_id |
| | | left join t_monitor m on p.serial_number = m.serial_number |
| | | <where> |
| | | tcs.examine_category = 1 |
| | | tcs.examine_category = 1 and m.camera_fun_type like concat('%',1,'%') |
| | | <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="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> |
| | |
| | | #{deptId} |
| | | </foreach> |
| | | </if> |
| | | <if test="examineTags != null and examineTags.size()>0">and tciv.examine_tag in |
| | | <foreach collection="examineTags" separator="," open="(" close=")" item="examineTag"> |
| | | #{examineTag} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by tciv.examine_tag desc,tciv.create_time,tcs.score desc |
| | | group by tciv.id |
| | | order by tciv.examine_tag desc,sd.area_code,tciv.create_time |
| | | </select> |
| | | <select id="getCheckIndexVideoList" parameterType="CheckIndexVideo" resultMap="CheckIndexVideoResult"> |
| | | select tciv.*,sd.dept_name |