| | |
| | | @Autowired |
| | | private CheckScoreMapper scoreMapper; |
| | | @Autowired |
| | | private ICheckScoreService checkScoreService; |
| | | @Autowired |
| | | private CheckIndexVideoMapper videoMapper; |
| | | @Autowired |
| | | private CheckIndexFaceMapper faceMapper; |
| | |
| | | //查今天的index指标 |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String day = dateFormat.format(new Date()); |
| | | |
| | | //创建score集合方便最后批量存储 |
| | | List<CheckScore> scoreList = new ArrayList<>(); |
| | | //根据考核类别和考核标签,查不同index表(区分省厅区县) |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |