fuliqi
2024-10-15 3bf7e93280dfb00e6a1a9cee5a841ba5c5aeb863
考核积分刷新功能
3个文件已修改
26 ■■■■■ 已修改文件
ycl-server/src/main/java/com/ycl/platform/mapper/CheckScoreMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/mapper/CheckScoreMapper.java
@@ -95,4 +95,7 @@
    CheckScore getLast(CheckScore checkScore);
    List<CheckScore> dashboard(DashboardQuery dashboardQuery);
    List<CheckScore> selectToday(String day);
}
ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java
@@ -34,6 +34,8 @@
    @Autowired
    private CheckScoreMapper scoreMapper;
    @Autowired
    private ICheckScoreService checkScoreService;
    @Autowired
    private CheckIndexVideoMapper videoMapper;
    @Autowired
    private CheckIndexFaceMapper faceMapper;
@@ -52,7 +54,6 @@
            //查今天的index指标
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
            String day = dateFormat.format(new Date());
            //创建score集合方便最后批量存储
            List<CheckScore> scoreList = new ArrayList<>();
            //根据考核类别和考核标签,查不同index表(区分省厅区县)
@@ -87,9 +88,22 @@
                    addToList(templateId, checkTemplate, examineTag, templateRuleList, scoreList, indexFace, CheckConstants.Rule_Category_Face);
                }
            }
            //查出今天生成score
            List<CheckScore> todays = scoreMapper.selectToday(day);
            //遍历scoreList集合,如果今天生成过补充id
            for (CheckScore result : scoreList) {
                for (CheckScore today : todays) {
                    //根据考核标签、考核种类、部门id查询是否存在今日数据
                    if(result.getExamineTag().equals(today.getExamineTag()) && result.getExamineCategory().equals(today.getExamineCategory()) && result.getDeptId().equals(today.getDeptId())){
                        //补充id,后续根据id saveOrUpdate
                        result.setId(today.getId());
                    }
                }
            }
            //储存分数
            if (!CollectionUtils.isEmpty(scoreList)) {
                scoreMapper.saveBatch(scoreList);
                checkScoreService.saveOrUpdateBatch(scoreList);
            }
        }
    }
ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml
@@ -224,4 +224,9 @@
        GROUP BY s.dept_id
        ORDER BY s.create_time DESC
    </select>
    <select id="selectToday" resultType="com.ycl.platform.domain.entity.CheckScore">
        select * from t_check_score
        where date(create_time) = #{day}
    </select>
</mapper>