From 7006d2e6e6c0281e4effc7fc70719af91b0c4982 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 30 九月 2024 12:23:46 +0800
Subject: [PATCH] 工单取图片优化
---
ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java | 29 +++++++++++++++--------------
1 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java b/ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java
index bd7b72f..fec0a42 100644
--- a/ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java
+++ b/ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java
@@ -4,11 +4,10 @@
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;
@@ -26,6 +25,7 @@
@Slf4j
@Component("checkScoreTask")
+//TODO锛氫慨鏀箂core銆乮ndex榛樿鍙戝竷
public class CheckScoreTask {
@Autowired
private CheckTemplateMapper templateMapper;
@@ -34,16 +34,15 @@
@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();
//鏌ユ潈閲�
@@ -62,8 +61,8 @@
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);
}
@@ -72,8 +71,8 @@
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);
}
@@ -82,8 +81,8 @@
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);
}
@@ -97,6 +96,7 @@
private <T extends CheckIndex> void addToList(Integer templateId, CheckTemplate checkTemplate, Short examineTag, List<CheckTemplateRule> templateRuleList, List<CheckScore> scoreList, T indexObject, Short checkCategory) {
CheckScore checkScore = new CheckScore();
+ checkScore.setIndexId(indexObject.getId());
BigDecimal scoreFinal = BigDecimal.ZERO;
for (CheckTemplateRule templateRule : templateRuleList) {
//璁$畻鍒嗘暟
@@ -121,7 +121,7 @@
BigDecimal score = index.multiply(templateRule.getWeight());
scoreFinal = scoreFinal.add(score);
} catch (Exception e) {
- log.info("鍙嶅皠寮傚父", e.getMessage());
+ log.error("鍙嶅皠寮傚父", e.getMessage());
}
return scoreFinal;
}
@@ -143,5 +143,6 @@
checkScore.setDeptId(checkIndex.getDeptId());
checkScore.setTemplateId(templateId);
checkScore.setScore(scoreFinal);
+ checkScore.setPublish(PublishType.PUBLISHED.getCode());
}
}
--
Gitblit v1.8.0