| | |
| | | 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:修改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()); |
| | | } |
| | | } |