xiangpei
2024-09-02 5a62cf2c51da8c1caca1d8bcfdcb97eeda27cc68
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
@@ -99,7 +99,7 @@
                .setDate(checkScoreIndexDTO.getDate())
                .setQuarter(checkScoreIndexDTO.getQuarter());
        scoreIndexDTO.setParams(checkScoreIndexDTO.getParams());
        scoreIndexDTO.setExamineTag(checkScore.getExamineTag());
        //获当月份
        if(StringUtils.isEmpty(scoreIndexDTO.getDate()) && CollectionUtils.isEmpty(checkScoreIndexDTO.getQuarter())){
            //如果查询条件不含参数,查询积分对应创建时间
@@ -244,12 +244,14 @@
    @Override
    public void exportIndex(HttpServletResponse response,CheckScore checkScoreDTO) throws IOException {
        String date = checkScoreDTO.getDate();
        Integer examineTag = null;
        //如果请求参数时间为空,查这条记录的时间
        if(StringUtils.isEmpty(checkScoreDTO.getDate()) && CollectionUtils.isEmpty(checkScoreDTO.getQuarter())){
            CheckScore checkScore = getById(checkScoreDTO.getId());
            Date createTime = checkScore.getCreateTime();
            SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
            date = formatter.format(createTime);
            examineTag = checkScore.getExamineTag();
        }
        /** 导三张sheet */
@@ -257,18 +259,27 @@
        CheckIndexCar checkIndexCar = new CheckIndexCar();
        checkIndexCar.setDate(date);
        checkIndexCar.setQuarter(checkScoreDTO.getQuarter());
        if(examineTag!=null) {
            checkIndexCar.setExamineTag(Short.parseShort(examineTag + ""));
        }
        List<CheckIndexCar> checkIndexCars = indexCarService.selectCheckIndexCarList(checkIndexCar);
        ExcelExp e1 = new ExcelExp("车辆考核指标数据",checkIndexCars,CheckIndexCar.class);
        //人脸
        CheckIndexFace checkIndexFace = new CheckIndexFace();
        checkIndexFace.setDate(date);
        checkIndexFace.setQuarter(checkScoreDTO.getQuarter());
        if(examineTag!=null) {
            checkIndexFace.setExamineTag(Short.parseShort(examineTag + ""));
        }
        List<CheckIndexFace> checkIndexFaces = indexFaceService.selectCheckIndexFaceList(checkIndexFace);
        ExcelExp e2 = new ExcelExp("人脸考核指标数据",checkIndexFaces,CheckIndexFace.class);
        //视频
        CheckIndexVideo checkIndexVideo = new CheckIndexVideo();
        checkIndexVideo.setDate(date);
        checkIndexVideo.setQuarter(checkScoreDTO.getQuarter());
        if(examineTag!=null) {
            checkIndexVideo.setExamineTag(Short.parseShort(examineTag + ""));
        }
        List<CheckIndexVideo> checkIndexVideos = indexVideoService.selectCheckIndexVideoList(checkIndexVideo);
        ExcelExp e3 = new ExcelExp("视频考核指标数据",checkIndexVideos,CheckIndexVideo.class);
@@ -290,6 +301,20 @@
        }
    }
    @Override
    public List<Map<String, Object>> home() {
        return baseMapper.home();
    }
    @Override
    public List<Map<String, Object>> calculate(String category) {
        Calendar calendar = Calendar.getInstance();
        Date endDate = calendar.getTime();
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        Date startDate = calendar.getTime();
        return scoreMapper.calculate(startDate, endDate, category);
    }
    //    /**
//     * 新增考核积分