| | |
| | | |
| | | //省厅前缀 |
| | | public final static String Province = "Province_"; |
| | | //区县前缀 |
| | | public final static String County = "County_"; |
| | | //公安部前缀 |
| | | public final static String Dept = "Dept_"; |
| | | |
| | | //海康访问OSD路径 |
| | | public final static String HK_OSD_PATH = "/ISAPI/System/Video/inputs/channels/1/overlays"; |
| | | //海康访问时间路径 |
| | |
| | | public static final Short Examine_Tag_Province = 0; |
| | | //区县 |
| | | public static final Short Examine_Tag_County = 1; |
| | | //公安部 |
| | | public static final Short Examine_Tag_Dept = 2; |
| | | |
| | | public static final String Delete = "1"; |
| | | |
| | |
| | | public String day; |
| | | @TableField("dept_id") |
| | | public Long deptId; |
| | | /** 考核标签(省厅/市局) */ |
| | | /** 考核标签(省厅/市局/公安部) */ |
| | | @TableField("examine_tag") |
| | | public Short examineTag; |
| | | @TableField("create_time") |
| | | public Date createTime; |
| | | @TableField("publish") |
| | | public String publish; |
| | | |
| | | @Excel(name = "日期") |
| | | @TableField(exist = false) |
| | |
| | | |
| | | private Long deptId; |
| | | private String deptName; |
| | | private Integer provinceTag; |
| | | private Boolean provinceTag; |
| | | private Boolean deptTag; |
| | | private String area; |
| | | private String error; |
| | | private String unitName; |
| | |
| | | String provinceKey = ApiConstants.Province + deptId; |
| | | updateAreaStats(areaStatsMap, provinceKey, result); |
| | | } |
| | | // 处理公安部数据 |
| | | if (result.getDeptTag()!=null && result.getDeptTag()) { |
| | | String deptKey = ApiConstants.Dept + deptId; |
| | | updateAreaStats(areaStatsMap, deptKey, result); |
| | | } |
| | | } |
| | | return areaStatsMap; |
| | | } |
| | |
| | | import com.ycl.platform.base.CheckIndex; |
| | | import constant.ApiConstants; |
| | | import constant.CheckConstants; |
| | | import enumeration.general.PublishType; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | Optional<T> existingIndex = checkIndexList.stream() |
| | | .filter(index -> key.startsWith(ApiConstants.Province) ? |
| | | CheckConstants.Examine_Tag_Province.equals(index.getExamineTag()) && key.split("_")[1].equals(index.getDeptId().toString()) |
| | | : key.startsWith(ApiConstants.Dept) ? CheckConstants.Examine_Tag_Dept.equals(index.getExamineTag()) && key.split("_")[1].equals(index.getDeptId().toString()) |
| | | : CheckConstants.Examine_Tag_County.equals(index.getExamineTag()) && key.equals(index.getDeptId().toString())) |
| | | .findFirst(); |
| | | |
| | |
| | | } else { |
| | | try { |
| | | checkIndex = clazz.getDeclaredConstructor().newInstance(); |
| | | checkIndex.setDeptId(key.startsWith(ApiConstants.Province) ? Long.parseLong(key.split("_")[1]) : Long.parseLong(key)); |
| | | checkIndex.setExamineTag(key.startsWith(ApiConstants.Province) ? CheckConstants.Examine_Tag_Province : CheckConstants.Examine_Tag_County); |
| | | checkIndex.setDeptId(key.startsWith(ApiConstants.Province) || key.startsWith(ApiConstants.Dept) ? Long.parseLong(key.split("_")[1]) : Long.parseLong(key)); |
| | | checkIndex.setExamineTag(key.startsWith(ApiConstants.Province) ? CheckConstants.Examine_Tag_Province : key.startsWith(ApiConstants.Dept) ? CheckConstants.Examine_Tag_Dept : CheckConstants.Examine_Tag_County); |
| | | checkIndex.setCreateTime(new Date()); |
| | | //默认发布 |
| | | checkIndex.setPublish(PublishType.PUBLISHED.getCode()); |
| | | } catch (Exception e) { |
| | | checkIndex = null; |
| | | log.error("无法创建 checkIndex 实例", e); |
| | |
| | | List<TMonitorVO> monitorVOS = monitorMapper.selectMonitorVOList(); |
| | | areaStatsMap.forEach((key,areaStats)->{ |
| | | if(key.startsWith(ApiConstants.Province)){ |
| | | long count = monitorVOS.stream().filter(vo -> ApiConstants.TRUE.equals(vo.getProvinceTag())) |
| | | long count = monitorVOS.stream().filter(TMonitorVO::getProvinceTag) |
| | | .filter(vo -> key.split("_")[1].equals(vo.getDeptId() + "")).count(); |
| | | areaStats.allFiles = Integer.parseInt(count+""); |
| | | }else { |
| | | }else if(key.startsWith(ApiConstants.Dept)){ |
| | | long count = monitorVOS.stream().filter(TMonitorVO::getDeptTag) |
| | | .filter(vo -> key.split("_")[1].equals(vo.getDeptId() + "")).count(); |
| | | areaStats.allFiles = Integer.parseInt(count+""); |
| | | } |
| | | else { |
| | | long count = monitorVOS.stream().filter(vo -> key.equals(vo.getDeptId() + "")).count(); |
| | | areaStats.allFiles = Integer.parseInt(count+""); |
| | | } |
| | |
| | | double score = Math.max(1 - num * 0.1, 0); |
| | | map.put(deptId+"",score); |
| | | map.put(ApiConstants.Province + deptId,score); |
| | | map.put(ApiConstants.Dept + deptId,score); |
| | | } |
| | | } |
| | | |
| | |
| | | @Log(title = "详情页导出考核积分", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/detailExport") |
| | | @PreAuthorize("@ss.hasPermi('check:result:detail:export')") |
| | | public void detailExport(HttpServletResponse response, CheckScore checkScore) throws IOException { |
| | | CheckResultExportDTO exportDTO = new CheckResultExportDTO(); |
| | | exportDTO.setDate(checkScore.getDate()); |
| | | exportDTO.setQuarter(checkScore.getQuarter()); |
| | | exportDTO.setDeptId(checkScore.getDeptId()); |
| | | exportDTO.setId(checkScore.getId()); |
| | | //TODO:检查权限 |
| | | public void detailExport(HttpServletResponse response, CheckResultExportDTO exportDTO) throws IOException { |
| | | checkScoreService.exportIndex(response,exportDTO); |
| | | } |
| | | /** |
| | |
| | | } |
| | | |
| | | private void getCheckScore(CheckScore checkScore, Calendar calendar) { |
| | | // 0 省厅月度 1 市局月度 2 省厅季度 3 市局季度 |
| | | // 0.省厅月度 1.省厅季度 2.市局月度 3.市局季度 4.公安部月度 5.公安部季度 |
| | | switch (checkScore.getExamineTag()) { |
| | | case 0, 1: |
| | | case 0, 2 ,4: |
| | | checkScore.setEndDate(calendar.getTime()); |
| | | calendar.set(Calendar.DAY_OF_MONTH, 1); |
| | | checkScore.setStartDate(calendar.getTime()); |
| | | if(checkScore.getExamineTag() == 0) checkScore.setExamineTag(Integer.valueOf(CheckConstants.Examine_Tag_Province+"")); |
| | | if(checkScore.getExamineTag() == 2) checkScore.setExamineTag(Integer.valueOf(CheckConstants.Examine_Tag_County+"")); |
| | | if(checkScore.getExamineTag() == 4) checkScore.setExamineTag(Integer.valueOf(CheckConstants.Examine_Tag_Dept+"")); |
| | | break; |
| | | case 2, 3: |
| | | case 1, 3, 5: |
| | | checkScore.setStartDate(DateUtils.getQuarterStart(calendar).getTime()); |
| | | checkScore.setEndDate(DateUtils.getQuarterEnd(calendar).getTime()); |
| | | checkScore.setExamineTag(checkScore.getExamineTag() == 2 ? 0 : 1); |
| | | if(checkScore.getExamineTag() == 1) checkScore.setExamineTag(Integer.valueOf(CheckConstants.Examine_Tag_Province+"")); |
| | | if(checkScore.getExamineTag() == 3) checkScore.setExamineTag(Integer.valueOf(CheckConstants.Examine_Tag_County+"")); |
| | | if(checkScore.getExamineTag() == 5) checkScore.setExamineTag(Integer.valueOf(CheckConstants.Examine_Tag_Dept+"")); |
| | | break; |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param form |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * id删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | Map<String, Map<String, Object>> resultMap = new HashMap<>(); |
| | | for (AreaDeptEnum value : AreaDeptEnum.values()) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("platformOnline",Boolean.TRUE); |
| | | resultMap.put(value.getName(),map); |
| | | map.put("platformOnline", Boolean.TRUE); |
| | | resultMap.put(value.getName(), map); |
| | | } |
| | | //平台在线状态 默认在线,如果一个不在线改为false。 |
| | | List<Platform> platformList = new LambdaQueryChainWrapper<>(platformMapper) |
| | |
| | | for (Platform platform : platformList) { |
| | | reachable = InetAddress.getByName(platform.getPlatformIP()).isReachable(3000); |
| | | //不在线 |
| | | if(!reachable) { |
| | | if (!reachable) { |
| | | //获取平台管理的区域编码集合 |
| | | List<String> areaCodes = Arrays.asList(com.ycl.utils.StringUtils.split(platform.getArea(), ",")); |
| | | resultMap.forEach((deptName, map) -> { |
| | | if(areaCodes.contains(AreaDeptEnum.fromName(deptName).getCode())){ |
| | | map.put("platformOnline",Boolean.FALSE); |
| | | if (areaCodes.contains(AreaDeptEnum.fromName(deptName).getCode())) { |
| | | map.put("platformOnline", Boolean.FALSE); |
| | | } |
| | | }); |
| | | } |
| | |
| | | import com.ycl.platform.mapper.*; |
| | | import com.ycl.platform.service.*; |
| | | import constant.CheckConstants; |
| | | import enumeration.general.PublishType; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | |
| | | |
| | | @Slf4j |
| | | @Component("checkScoreTask") |
| | | //TODO:增加考核标签字典:公安部 |
| | | //TODO:修改点位状态字典:在线、离线 |
| | | //TODO:修改score、index默认发布 |
| | | public class CheckScoreTask { |
| | | @Autowired |
| | | private CheckTemplateMapper templateMapper; |
| | |
| | | public void executeTemplate(Integer templateId) { |
| | | CheckTemplate checkTemplate = templateMapper.selectCheckTemplateById(templateId); |
| | | if (checkTemplate != null) { |
| | | log.info("执行考核模板---------->{}", checkTemplate.getTemplateName()); |
| | | Short examineCategory = checkTemplate.getExamineCategory(); |
| | | Short examineTag = checkTemplate.getExamineTag(); |
| | | //查权重 |
| | |
| | | checkIndexVideo.setExamineTag(examineTag); |
| | | checkIndexVideo.setDay(day); |
| | | checkIndexVideo.setDeptIds(JSONArray.parseArray(checkTemplate.getDeptId(), Integer.class)); |
| | | //根据模板的考核标签查各区县对应省厅或市局视频数据 |
| | | //根据模板的考核标签查各区县对应省厅或市局或公安部视频数据 |
| | | List<CheckIndexVideo> checkIndexVideos = videoMapper.getCheckIndexVideoList(checkIndexVideo); |
| | | for (CheckIndexVideo indexVideo : checkIndexVideos) { |
| | | addToList(templateId, checkTemplate, examineTag, templateRuleList, scoreList, indexVideo, CheckConstants.Rule_Category_Video); |
| | |
| | | checkIndexCar.setDay(day); |
| | | checkIndexCar.setExamineTag(examineTag); |
| | | checkIndexCar.setDeptIds(JSONArray.parseArray(checkTemplate.getDeptId(), Integer.class)); |
| | | //根据模板的考核标签查各区县对应省厅或市局车辆数据 |
| | | //根据模板的考核标签查各区县对应省厅或市局或公安部车辆数据 |
| | | List<CheckIndexCar> checkIndexCars = carMapper.getCheckIndexCarList(checkIndexCar); |
| | | for (CheckIndexCar indexCar : checkIndexCars) { |
| | | addToList(templateId, checkTemplate, examineTag, templateRuleList, scoreList, indexCar, CheckConstants.Rule_Category_Car); |
| | |
| | | checkIndexFace.setDay(day); |
| | | checkIndexFace.setExamineTag(examineTag); |
| | | checkIndexFace.setDeptIds(JSONArray.parseArray(checkTemplate.getDeptId(), Integer.class)); |
| | | //根据模板的考核标签查各区县对应省厅或市局人脸数据 |
| | | //根据模板的考核标签查各区县对应省厅或市局或公安部人脸数据 |
| | | List<CheckIndexFace> checkIndexFaces = faceMapper.getCheckIndexFaceList(checkIndexFace); |
| | | for (CheckIndexFace indexFace : checkIndexFaces) { |
| | | addToList(templateId, checkTemplate, examineTag, templateRuleList, scoreList, indexFace, CheckConstants.Rule_Category_Face); |
| | |
| | | BigDecimal score = index.multiply(templateRule.getWeight()); |
| | | scoreFinal = scoreFinal.add(score); |
| | | } catch (Exception e) { |
| | | log.info("反射异常", e.getMessage()); |
| | | log.error("反射异常", e.getMessage()); |
| | | } |
| | | return scoreFinal; |
| | | } |
| | |
| | | checkScore.setDeptId(checkIndex.getDeptId()); |
| | | checkScore.setTemplateId(templateId); |
| | | checkScore.setScore(scoreFinal); |
| | | checkScore.setPublish(PublishType.PUBLISHED.getCode()); |
| | | } |
| | | } |
| | |
| | | |
| | | <select id="selectTMonitorList" resultType="com.ycl.platform.domain.vo.TMonitorVO"> |
| | | select m.id, m.serial_number, name, site_type, mac_addr, ip, camera_fun_type, longitude, latitude, |
| | | camera_capture_area, p.online as onState, civil_code, d.dept_id, d.dept_name, d.area, p.province_tag, |
| | | camera_capture_area, p.online as onState, civil_code, d.dept_id, d.dept_name, d.area, p.province_tag,p.dept_tag, |
| | | IF(COUNT(w.id) OVER() > 0, '是', '否') AS error, u.unit_name,p.recovery_time,p.reason,p.start_time,p.end_time,w.work_order_no |
| | | from t_monitor m |
| | | left join t_yw_point p on m.serial_number = p.serial_number and p.deleted = 0 |
| | |
| | | or u.unit_name like concat('%', #{name}, '%')) |
| | | </if> |
| | | <if test="provinceTag != null ">and p.province_tag = #{provinceTag}</if> |
| | | <if test="deptTag != null ">and p.dept_tag = #{deptTag}</if> |
| | | <if test="siteType != null ">and site_type = #{siteType}</if> |
| | | <if test="macAddr != null and macAddr != ''">and mac_addr = #{macAddr}</if> |
| | | <if test="ip != null and ip != ''">and ip = #{ip}</if> |
| | |
| | | camera_capture_area, on_state, civil_code, integrated_device, camera_brand, address, net_working, |
| | | public_security, installed_time, management_unit, mu_contact_info, storage_days |
| | | , 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,p.province_tag from t_monitor m |
| | | camera_dept, hybm, lxbm,d.dept_id, d.dept_name,p.province_tag,p.dept_tag from t_monitor m |
| | | 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 |
| | | </select> |
| | |
| | | <if test="provinceTag!=null"> |
| | | and p.province_tag = #{provinceTag} |
| | | </if> |
| | | <if test="deptTag!=null"> |
| | | and p.dept_tag = #{deptTag} |
| | | </if> |
| | | ${params.dataScope} |
| | | </where> |
| | | </select> |