fuliqi
2024-10-15 6371f17b2056b6e4010cbdc60965d5eac12a5d98
考核导出bug,人脸上传及时bug
12个文件已修改
155 ■■■■ 已修改文件
ycl-pojo/src/main/java/com/ycl/platform/base/CheckIndex.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/dto/CheckResultExportDTO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexFace.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrderCheckImg.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/calculate/CarSnapshopDataCalculation.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/calculate/FaceSnapshotDataCalculation.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/base/CheckIndex.java
@@ -53,7 +53,10 @@
    @TableField(exist = false)
    public List<Integer> deptIds;
    @TableField(exist = false)
    public Integer examineTagQuery;
    public Boolean provinceTag;
    @TableField(exist = false)
    public Boolean deptTag;
    @TableField(exist = false)
    public List<Integer> examineCategories;
    /** 请求参数 */
ycl-pojo/src/main/java/com/ycl/platform/domain/dto/CheckResultExportDTO.java
@@ -17,7 +17,7 @@
    /** 部门ids 用于卡片页导出 */
    private List<Integer> deptIds;
    /** 考核标签0/1 省厅/市局 用于卡片页导出 */
    /** 考核标签0/1/2 省厅/区县/公安 用于卡片页导出 */
    private List<Integer> examineTags;
    /** 是否需要平均值 用于卡片页导出 */
    private Boolean average;
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java
@@ -103,7 +103,7 @@
        }else {
            checkIndexCarVo.setCreateTimeStr(checkIndexCar.getCreateTimeStr());
        }
        checkIndexCarVo.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexCarVo.getExamineTag()) ? "省厅考核" : CheckConstants.Examine_Tag_County.equals(checkIndexCarVo.getExamineTag()) ? "区县考核" : "公安部考核");
        checkIndexCarVo.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexCar.getExamineTag()) ? "省厅考核" : CheckConstants.Examine_Tag_County.equals(checkIndexCar.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) + "%");
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexFace.java
@@ -93,7 +93,7 @@
            checkIndexFaceVo.setCreateTimeStr(checkIndexFace.getCreateTimeStr());
        }
        checkIndexFaceVo.setDeptName(checkIndexFace.getDeptName());
        checkIndexFaceVo.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexFaceVo.getExamineTag()) ? "省厅考核" : CheckConstants.Examine_Tag_County.equals(checkIndexFaceVo.getExamineTag()) ? "区县考核" : "公安部考核");
        checkIndexFaceVo.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexFace.getExamineTag()) ? "省厅考核" : CheckConstants.Examine_Tag_County.equals(checkIndexFace.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) + "%");
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrderCheckImg.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@@ -28,5 +29,6 @@
    private String imgUrl;
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
}
ycl-server/src/main/java/com/ycl/calculate/CarSnapshopDataCalculation.java
@@ -90,11 +90,21 @@
        int provinceTotalSites = 0;
        //区县总点位数
        int countyTotalSites = 0;
        //同期省厅抓拍量
        int lastProvinceSnap = 0;
        //同期区县抓拍量
        int lastCountySnap = 0;
        //从字典里筛选省厅值
        int lastProvinceSnap = Integer.parseInt(lastSnap.stream().filter(sysDictData -> CheckConstants.SNAP_PROVINCE_CAR.equals(sysDictData.getDictLabel())).findFirst().get().getDictValue());
        Optional<SysDictData> first = lastSnap.stream().filter(sysDictData -> CheckConstants.SNAP_PROVINCE_CAR.equals(sysDictData.getDictLabel())).findFirst();
        if (first.isPresent()) {
            lastProvinceSnap = Integer.parseInt(first.get().getDictValue());
        }
        //从字典里筛选区县值
        int lastCountySnap = Integer.parseInt(lastSnap.stream().filter(sysDictData -> CheckConstants.SNAP_COUNTY_CAR.equals(sysDictData.getDictLabel())).findFirst().get().getDictValue());;
        Optional<SysDictData> first2 = lastSnap.stream().filter(sysDictData -> CheckConstants.SNAP_COUNTY_CAR.equals(sysDictData.getDictLabel())).findFirst();
        if (first2.isPresent()) {
            lastCountySnap = Integer.parseInt(first2.get().getDictValue());
        }
        log.info("省厅同期:{},区县同期:{}",lastProvinceSnap,lastCountySnap);
        //计算总数
        for (Map.Entry<String, AreaStats> entry : areaStatsMap.entrySet()) {
            String key = entry.getKey();
@@ -105,6 +115,7 @@
                countyTotalSites += value.totalSites;
            }
        }
        log.info("省厅总数:{},区县总数:{}",provinceTotalSites,countyTotalSites);
        //加权操作,补充同期抓拍量
        for (Map.Entry<String, AreaStats> entry : areaStatsMap.entrySet()) {
            String key = entry.getKey();
@@ -114,16 +125,23 @@
                if (value.totalSites == 0) {
                    value.lastSnapCount = 0;
                } else {
                    value.lastSnapCount = (value.totalSites / provinceTotalSites) * lastProvinceSnap;
                    BigDecimal result = new BigDecimal(value.totalSites)
                            .divide(new BigDecimal(provinceTotalSites), 2, RoundingMode.HALF_UP)
                            .multiply(new BigDecimal(lastProvinceSnap));
                    value.lastSnapCount = result.setScale(0, RoundingMode.HALF_UP).intValue();
                }
            } else {
                //区县
                if (value.totalSites == 0) {
                    value.lastSnapCount = 0;
                } else {
                    value.lastSnapCount = (value.totalSites / countyTotalSites) * lastCountySnap;
                    BigDecimal result = new BigDecimal(value.totalSites)
                            .divide(new BigDecimal(countyTotalSites), 2, RoundingMode.HALF_UP)
                            .multiply(new BigDecimal(lastCountySnap));
                    value.lastSnapCount = result.setScale(0, RoundingMode.HALF_UP).intValue();
                }
            }
            log.info("计算的数据:总点位数:{},总抓拍量:{},同期抓拍量:{}",value.totalSites,value.totalDataSum,value.lastSnapCount);
        }
    }
ycl-server/src/main/java/com/ycl/calculate/FaceSnapshotDataCalculation.java
@@ -101,12 +101,20 @@
        int provinceTotalSites = 0;
        //区县总点位数
        int countyTotalSites = 0;
        //同期省厅抓拍量
        int lastProvinceSnap = 0;
        //同期区县抓拍量
        int lastCountySnap = 0;
        //从字典里筛选省厅值
        int lastProvinceSnap = Integer.parseInt(lastSnap.stream().filter(sysDictData -> CheckConstants.SNAP_PROVINCE_FACE.equals(sysDictData.getDictLabel())).findFirst().get().getDictValue());
        Optional<SysDictData> first = lastSnap.stream().filter(sysDictData -> CheckConstants.SNAP_PROVINCE_FACE.equals(sysDictData.getDictLabel())).findFirst();
        if (first.isPresent()) {
            lastProvinceSnap = Integer.parseInt(first.get().getDictValue());
        }
        //从字典里筛选区县值
        int lastCountySnap = Integer.parseInt(lastSnap.stream().filter(sysDictData -> CheckConstants.SNAP_COUNTY_FACE.equals(sysDictData.getDictLabel())).findFirst().get().getDictValue());
        ;
        Optional<SysDictData> first2 = lastSnap.stream().filter(sysDictData -> CheckConstants.SNAP_COUNTY_FACE.equals(sysDictData.getDictLabel())).findFirst();
        if (first2.isPresent()) {
            lastCountySnap = Integer.parseInt(first2.get().getDictValue());
        }
        //计算总数
        for (Map.Entry<String, AreaStats> entry : areaStatsMap.entrySet()) {
            String key = entry.getKey();
@@ -126,14 +134,20 @@
                if (value.totalSites == 0) {
                    value.lastSnapCount = 0;
                } else {
                    value.lastSnapCount = (value.totalSites / provinceTotalSites) * lastProvinceSnap;
                    BigDecimal result = new BigDecimal(value.totalSites)
                            .divide(new BigDecimal(provinceTotalSites), 2, RoundingMode.HALF_UP)
                            .multiply(new BigDecimal(lastProvinceSnap));
                    value.lastSnapCount = result.setScale(0, RoundingMode.HALF_UP).intValue();
                }
            } else {
                //区县
                if (value.totalSites == 0) {
                    value.lastSnapCount = 0;
                } else {
                    value.lastSnapCount = (value.totalSites / countyTotalSites) * lastCountySnap;
                    BigDecimal result = new BigDecimal(value.totalSites)
                            .divide(new BigDecimal(countyTotalSites), 2, RoundingMode.HALF_UP)
                            .multiply(new BigDecimal(lastCountySnap));
                    value.lastSnapCount = result.setScale(0, RoundingMode.HALF_UP).intValue();
                }
            }
        }
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
@@ -317,22 +317,29 @@
//                date = formatter.format(new Date());
//            }
//        }
        //TODO:标签bug修复
        //没有标签默认全导
        if(CollectionUtils.isEmpty(exportDTO.getExamineTags())){
            exportDTO.setExamineTags(Arrays.asList(0,1,2));
        }
        /** 导三张sheet */
        //车辆
        CheckIndexCar checkIndexCar = new CheckIndexCar();
//        checkIndexCar.setDate(date);
        checkIndexCar.setQuarter(exportDTO.getQuarter());
        checkIndexCar.setDeptId(exportDTO.getDeptId());
        checkIndexCar.setDeptIds(exportDTO.getDeptIds());
        //权限控制 只能查看已发布
        roleControl(checkIndexCar);
        List<CheckIndexCar> checkIndexCars = new ArrayList<>();
        //车辆和人脸没有公安部
        for (Integer examineTag : exportDTO.getExamineTags()) {
            if(examineTag ==2) continue;
            CheckIndexCar checkIndexCar = new CheckIndexCar();
//        checkIndexCar.setDate(date);
            checkIndexCar.setQuarter(exportDTO.getQuarter());
            checkIndexCar.setDeptId(exportDTO.getDeptId());
            checkIndexCar.setDeptIds(exportDTO.getDeptIds());
            //权限控制 只能查看已发布
            roleControl(checkIndexCar);
            checkIndexCar.setExamineTag(Short.valueOf(examineTag + ""));
            if (examineTag == 0) {
                checkIndexCar.setExamineTagQuery(1);
                checkIndexCar.setProvinceTag(Boolean.TRUE);
            }
            checkIndexCars.addAll(indexCarService.selectCheckIndexCarList(checkIndexCar));
        }
        //计算平均值放在excel最后
@@ -368,18 +375,19 @@
        }
        ExcelExp e1 = new ExcelExp("车辆考核指标数据", checkIndexCarVOS, CheckIndexCarVO.class);
        //人脸
        CheckIndexFace checkIndexFace = new CheckIndexFace();
//        checkIndexFace.setDate(date);
        checkIndexFace.setQuarter(exportDTO.getQuarter());
        checkIndexFace.setDeptId(exportDTO.getDeptId());
        checkIndexFace.setDeptIds(exportDTO.getDeptIds());
        //权限控制 只能查看已发布
        roleControl(checkIndexFace);
        List<CheckIndexFace> checkIndexFaces = new ArrayList<>();
        for (Integer examineTag : exportDTO.getExamineTags()) {
            if(examineTag ==2) continue;
            CheckIndexFace checkIndexFace = new CheckIndexFace();
//        checkIndexFace.setDate(date);
            checkIndexFace.setQuarter(exportDTO.getQuarter());
            checkIndexFace.setDeptId(exportDTO.getDeptId());
            checkIndexFace.setDeptIds(exportDTO.getDeptIds());
            //权限控制 只能查看已发布
            roleControl(checkIndexFace);
            checkIndexFace.setExamineTag(Short.valueOf(examineTag + ""));
            if (examineTag == 0) {
                checkIndexFace.setExamineTagQuery(1);
                checkIndexFace.setProvinceTag(Boolean.TRUE);
            }
            checkIndexFaces.addAll(indexFaceService.selectCheckIndexFaceList(checkIndexFace));
        }
@@ -416,18 +424,21 @@
        }
        ExcelExp e2 = new ExcelExp("人脸考核指标数据", checkIndexFaceVOS, CheckIndexFaceVO.class);
        //视频
        CheckIndexVideo checkIndexVideo = new CheckIndexVideo();
//        checkIndexVideo.setDate(date);
        checkIndexVideo.setQuarter(exportDTO.getQuarter());
        checkIndexVideo.setDeptId(exportDTO.getDeptId());
        checkIndexVideo.setDeptIds(exportDTO.getDeptIds());
        //权限控制 只能查看已发布
        roleControl(checkIndexVideo);
        List<CheckIndexVideo> checkIndexVideos = new ArrayList<>();
        for (Integer examineTag : exportDTO.getExamineTags()) {
            CheckIndexVideo checkIndexVideo = new CheckIndexVideo();
//        checkIndexVideo.setDate(date);
            checkIndexVideo.setQuarter(exportDTO.getQuarter());
            checkIndexVideo.setDeptId(exportDTO.getDeptId());
            checkIndexVideo.setDeptIds(exportDTO.getDeptIds());
            //权限控制 只能查看已发布
            roleControl(checkIndexVideo);
            checkIndexVideo.setExamineTag(Short.valueOf(examineTag + ""));
            if (examineTag == 0) {
                checkIndexVideo.setExamineTagQuery(1);
                checkIndexVideo.setProvinceTag(Boolean.TRUE);
            }else if(examineTag ==2){
                //只有视频有公安部数据
                checkIndexVideo.setDeptTag(Boolean.TRUE);
            }
            checkIndexVideos.addAll(indexVideoService.selectCheckIndexVideoList(checkIndexVideo));
        }
@@ -456,6 +467,17 @@
                //根据积分降序
                checkIndexVideos.addAll(videos.stream().sorted(Comparator.comparing(CheckIndexVideo::getScore).reversed()).collect(Collectors.toList()));
            }
            List<CheckIndexVideo> deptList = checkIndexVideos.stream().filter(video -> CheckConstants.Examine_Tag_Dept.equals(video.getExamineTag())).collect(Collectors.toList());
            if (!CollectionUtils.isEmpty(deptList)) {
                Map<Long, List<CheckIndexVideo>> videoMap = deptList.stream().collect(Collectors.groupingBy(CheckIndexVideo::getDeptId));
                List<CheckIndexVideo> videos = new ArrayList<>();
                videoMap.forEach((deptId, list) -> {
                    CheckIndexVideo video = CheckIndexVideo.calculateAverage(list);
                    videos.add(video);
                });
                //根据积分降序
                checkIndexVideos.addAll(videos.stream().sorted(Comparator.comparing(CheckIndexVideo::getScore).reversed()).collect(Collectors.toList()));
            }
        }
        List<CheckIndexVideoVO> checkIndexVideoVOS = new ArrayList<>();
        for (CheckIndexVideo indexVideo : checkIndexVideos) {
ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java
@@ -98,6 +98,7 @@
                    if(result.getExamineTag().equals(today.getExamineTag()) && result.getExamineCategory().equals(today.getExamineCategory()) && result.getDeptId().equals(today.getDeptId())){
                        //补充id,后续根据id saveOrUpdate
                        result.setId(today.getId());
                        result.setPublish(today.getPublish());
                    }
                }
            }
ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml
@@ -31,13 +31,14 @@
        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_yw_point p on p.dept_id = tcic.dept_id and p.examine_status = 1
        left join t_monitor m on p.serial_number = m.serial_number
        <where>
            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="provinceTag != null "> and p.province_tag = #{provinceTag}</if>
            <if test="deptTag != null "> and p.dept_tag = #{deptTag}</if>
            <if test="quarter != null and quarter.size > 0">
                and date_format(tcs.create_time, '%Y-%m') between #{quarter[0]} and #{quarter[1]}
            </if>
ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml
@@ -29,13 +29,14 @@
        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_yw_point p on p.dept_id = tcif.dept_id  and p.examine_status = 1
        left join t_monitor m on p.serial_number = m.serial_number
        <where>
            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="provinceTag != null "> and p.province_tag = #{provinceTag}</if>
            <if test="deptTag != null "> and p.dept_tag = #{deptTag}</if>
            <if test="quarter != null and quarter.size > 0">
                and date_format(tcs.create_time, '%Y-%m') between #{quarter[0]} and #{quarter[1]}
            </if>
ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
@@ -35,13 +35,14 @@
        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_yw_point p on p.dept_id = tciv.dept_id  and p.examine_status = 1
        left join t_monitor m on p.serial_number = m.serial_number
        <where>
            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="provinceTag != null "> and p.province_tag = #{provinceTag}</if>
            <if test="deptTag != null "> and p.dept_tag = #{deptTag}</if>
            <if test="quarter != null and quarter.size > 0">
                and date_format(tcs.create_time, '%Y-%m') between #{quarter[0]} and #{quarter[1]}
            </if>