| | |
| | | import com.google.common.base.CaseFormat; |
| | | import com.ycl.platform.base.CheckIndex; |
| | | import com.ycl.platform.domain.entity.*; |
| | | import com.ycl.platform.mapper.CheckScoreMapper; |
| | | import com.ycl.platform.mapper.CheckTemplateMapper; |
| | | import com.ycl.platform.mapper.CheckTemplateRuleMapper; |
| | | 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:增加考核标签字典:公安部 |
| | | //TODO:修改点位状态字典:在线、离线 |
| | | //TODO:修改score、index默认发布 |
| | | public class CheckScoreTask { |
| | | @Autowired |
| | | private CheckTemplateMapper templateMapper; |
| | |
| | | @Autowired |
| | | private CheckScoreMapper scoreMapper; |
| | | @Autowired |
| | | private ICheckIndexVideoService videoService; |
| | | private CheckIndexVideoMapper videoMapper; |
| | | @Autowired |
| | | private ICheckIndexFaceService faceService; |
| | | private CheckIndexFaceMapper faceMapper; |
| | | @Autowired |
| | | private ICheckIndexCarService carService; |
| | | private CheckIndexCarMapper carMapper; |
| | | |
| | | 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 = videoService.selectCheckIndexVideoList(checkIndexVideo); |
| | | //根据模板的考核标签查各区县对应省厅或市局或公安部视频数据 |
| | | 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 = carService.selectCheckIndexCarList(checkIndexCar); |
| | | //根据模板的考核标签查各区县对应省厅或市局或公安部车辆数据 |
| | | 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 = faceService.selectCheckIndexFaceList(checkIndexFace); |
| | | //根据模板的考核标签查各区县对应省厅或市局或公安部人脸数据 |
| | | 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()); |
| | | } |
| | | } |