From 3848c5677aefdb201c24d615a7c2ad03fd5154e6 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期五, 06 九月 2024 00:18:12 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml | 21 - ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateRuleMapper.java | 17 ycl-pojo/src/main/java/com/ycl/platform/domain/vo/RuleExcelVO.java | 33 +++ ycl-pojo/src/main/java/com/ycl/platform/domain/dto/CheckResultExportDTO.java | 24 ++ ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexVideo.java | 105 ++++++++- ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml | 16 ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexFace.java | 51 ++++ ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml | 9 ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java | 9 ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java | 120 ++++++++-- ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java | 6 ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java | 1 ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml | 4 ycl-pojo/src/main/java/com/ycl/platform/base/CheckIndex.java | 28 + ycl-server/src/main/java/com/ycl/platform/controller/CheckScoreController.java | 27 ++ ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java | 137 +++++++++-- ycl-server/src/main/java/com/ycl/task/MonitorTask.java | 1 ycl-pojo/src/main/java/com/ycl/platform/domain/vo/CheckIndexCarVO.java | 4 ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml | 22 - 19 files changed, 498 insertions(+), 137 deletions(-) diff --git a/ycl-pojo/src/main/java/com/ycl/platform/base/CheckIndex.java b/ycl-pojo/src/main/java/com/ycl/platform/base/CheckIndex.java index 8fb2927..0b52092 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/base/CheckIndex.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/base/CheckIndex.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Data; +import java.math.BigDecimal; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -21,25 +22,34 @@ //鏌ヨ鏉′欢锛屾棩鏈� @TableField(exist = false) public String day; - - @Excel(name = "鏃ユ湡",dateFormat = "yyyy-MM-dd") - @TableField("create_time") - public Date createTime; @TableField("dept_id") public Long deptId; - @Excel(name = "鍖哄幙") - @TableField(exist = false) - public String deptName; - /** 鑰冩牳鏍囩锛堢渷鍘�/甯傚眬锛� */ @TableField("examine_tag") public Short examineTag; + @TableField("create_time") + public Date createTime; + + @Excel(name = "鏃ユ湡") + @TableField(exist = false) + public String createTimeStr; + @Excel(name = "鍖哄幙") + @TableField(exist = false) + public String deptName; @Excel(name = "鑰冩牳鏍囩") @TableField(exist = false) public String examineTagStr; + /** 寰楀垎 */ + @Excel(name = "寰楀垎") + @TableField(exist = false) + private BigDecimal score; + @TableField(exist = false) public List<Integer> deptIds; - + @TableField(exist = false) + public List<Integer> examineTags; + @TableField(exist = false) + public List<Integer> examineCategories; /** 璇锋眰鍙傛暟 */ @JsonInclude(JsonInclude.Include.NON_EMPTY) @TableField(exist = false) diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/dto/CheckResultExportDTO.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/dto/CheckResultExportDTO.java new file mode 100644 index 0000000..90d2e95 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/dto/CheckResultExportDTO.java @@ -0,0 +1,24 @@ +package com.ycl.platform.domain.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Data; + +import java.util.List; + +@Data +public class CheckResultExportDTO { + private String date; + /** 鏃堕棿鑼冨洿 */ + private List<String> quarter; + /** 绉垎id 鐢ㄤ簬璇︽儏椤靛鍑�*/ + private Long id; + /** 閮ㄩ棬id 鐢ㄤ簬璇︽儏椤靛鍑�*/ + private Long deptId; + + /** 閮ㄩ棬ids 鐢ㄤ簬鍗$墖椤靛鍑� */ + private List<Integer> deptIds; + /** 鑰冩牳鏍囩0/1 鐪佸巺/甯傚眬 鐢ㄤ簬鍗$墖椤靛鍑� */ + private List<Integer> examineTags; + /** 鏄惁闇�瑕佸钩鍧囧�� 鐢ㄤ簬鍗$墖椤靛鍑� */ + private Boolean average; +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java index d7fda06..a6a0591 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java @@ -8,9 +8,11 @@ import constant.CheckConstants; import lombok.Data; import org.springframework.lang.NonNull; +import utils.StringUtils; import java.math.BigDecimal; import java.math.RoundingMode; +import java.text.SimpleDateFormat; import java.util.List; /** @@ -21,47 +23,66 @@ */ @Data @TableName("t_check_index_car") -public class CheckIndexCar extends CheckIndex -{ +public class CheckIndexCar extends CheckIndex { private static final long serialVersionUID = 1L; - /** 瑙嗗浘搴撳鎺ョǔ瀹氭�� */ + /** + * 瑙嗗浘搴撳鎺ョǔ瀹氭�� + */ @TableField("view_connect_stability") private BigDecimal viewConnectStability; - /** 鐐逛綅鍦ㄧ嚎鐜� */ + /** + * 鐐逛綅鍦ㄧ嚎鐜� + */ @TableField("site_online") private BigDecimal siteOnline; - /** 鑱旂綉鍗″彛璁惧鐩綍涓�鑷寸巼 */ + /** + * 鑱旂綉鍗″彛璁惧鐩綍涓�鑷寸巼 + */ @TableField("device_directory_consistent") private BigDecimal deviceDirectoryConsistent; - /** 杞﹁締鍗″彛淇℃伅閲囬泦鍑嗙‘鐜� */ + /** + * 杞﹁締鍗″彛淇℃伅閲囬泦鍑嗙‘鐜� + */ @TableField("vehicle_information_collection_accuracy") private BigDecimal vehicleInformationCollectionAccuracy; - /** 杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁瀹屾暣鎬� */ + /** + * 杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁瀹屾暣鎬� + */ @TableField("vehicle_capture_integrity") private BigDecimal vehicleCaptureIntegrity; - /** 杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁鍑嗙‘鎬� */ + /** + * 杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁鍑嗙‘鎬� + */ @TableField("vehicle_capture_accuracy") private BigDecimal vehicleCaptureAccuracy; - /** 杞﹁締鍗″彛璁惧鏃堕挓鍑嗙‘鎬� */ + /** + * 杞﹁締鍗″彛璁惧鏃堕挓鍑嗙‘鎬� + */ @TableField("vehicle_timing_accuracy") private BigDecimal vehicleTimingAccuracy; - /** 杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁涓婁紶鍙婃椂鎬� */ + /** + * 杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁涓婁紶鍙婃椂鎬� + */ @TableField("vehicle_upload_timeliness") private BigDecimal vehicleUploadTimeliness; - /** 杞﹁締鍗″彛璁惧url鍙敤鎬� */ + /** + * 杞﹁締鍗″彛璁惧url鍙敤鎬� + */ @TableField("vehicle_url_availability") private BigDecimal vehicleUrlAvailability; - /** 杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁澶у浘鍙敤鎬� */ + /** + * 杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁澶у浘鍙敤鎬� + */ @TableField("vehicle_picture_availability") private BigDecimal vehiclePictureAvailability; @@ -72,19 +93,72 @@ //杞崲鎴愬瓧绗︿覆鐢ㄤ簬excel瀵煎嚭 public static CheckIndexCarVO getExcelVo(@NonNull CheckIndexCar checkIndexCar) { CheckIndexCarVO checkIndexCarVo = new CheckIndexCarVO(); + checkIndexCarVo.setScore(checkIndexCar.getScore()); checkIndexCarVo.setDeptName(checkIndexCar.getDeptName()); - checkIndexCarVo.setCreateTime(checkIndexCar.getCreateTime()); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + //閬垮厤鍚堣琛屾姤閿�(鍚堣鏁版嵁 缂哄皯createTimeStr瀛楁 鐩存帴灏哻reateTimeStr璁剧疆涓�"鍚堣") + if (StringUtils.isEmpty(checkIndexCar.getCreateTimeStr())) { + checkIndexCarVo.setCreateTimeStr(format.format(checkIndexCar.getCreateTime())); + }else { + checkIndexCarVo.setCreateTimeStr(checkIndexCar.getCreateTimeStr()); + } checkIndexCarVo.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexCar.getExamineTag()) ? "鐪佸巺鑰冩牳" : "鍖哄幙鑰冩牳"); - checkIndexCarVo.setSiteOnlineText(checkIndexCar.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexCarVo.setVehicleCaptureAccuracyText(checkIndexCar.getVehicleCaptureAccuracy().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexCarVo.setDeviceDirectoryConsistentText(checkIndexCar.getDeviceDirectoryConsistent().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexCarVo.setVehicleCaptureIntegrityText(checkIndexCar.getVehicleCaptureIntegrity().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexCarVo.setVehicleTimingAccuracyText(checkIndexCar.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexCarVo.setVehicleUploadTimelinessText(checkIndexCar.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexCarVo.setViewConnectStabilityText(checkIndexCar.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexCarVo.setVehicleUrlAvailabilityText(checkIndexCar.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexCarVo.setVehiclePictureAvailabilityText(checkIndexCar.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexCarVo.setVehicleInformationCollectionAccuracyText(checkIndexCar.getVehicleInformationCollectionAccuracy().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); + checkIndexCarVo.setSiteOnlineText(checkIndexCar.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexCarVo.setVehicleCaptureAccuracyText(checkIndexCar.getVehicleCaptureAccuracy().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexCarVo.setDeviceDirectoryConsistentText(checkIndexCar.getDeviceDirectoryConsistent().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexCarVo.setVehicleCaptureIntegrityText(checkIndexCar.getVehicleCaptureIntegrity().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexCarVo.setVehicleTimingAccuracyText(checkIndexCar.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexCarVo.setVehicleUploadTimelinessText(checkIndexCar.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexCarVo.setViewConnectStabilityText(checkIndexCar.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexCarVo.setVehicleUrlAvailabilityText(checkIndexCar.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexCarVo.setVehiclePictureAvailabilityText(checkIndexCar.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexCarVo.setVehicleInformationCollectionAccuracyText(checkIndexCar.getVehicleInformationCollectionAccuracy().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); return checkIndexCarVo; } + + /** + * 瀵煎嚭鏃剁敤浜庤绠楀钩鍧囧�� + */ + public static CheckIndexCar calculateAverage(List<CheckIndexCar> checkIndexCars) { + BigDecimal scoreSum = BigDecimal.ZERO; + BigDecimal viewConnectStabilitySum = BigDecimal.ZERO; + BigDecimal siteOnlineSum = BigDecimal.ZERO; + BigDecimal deviceDirectoryConsistentSum = BigDecimal.ZERO; + BigDecimal vehicleInformationCollectionAccuracySum = BigDecimal.ZERO; + BigDecimal vehicleCaptureIntegritySum = BigDecimal.ZERO; + BigDecimal vehicleCaptureAccuracySum = BigDecimal.ZERO; + BigDecimal vehicleTimingAccuracySum = BigDecimal.ZERO; + BigDecimal vehicleUploadTimelinessSum = BigDecimal.ZERO; + BigDecimal vehicleUrlAvailabilitySum = BigDecimal.ZERO; + BigDecimal vehiclePictureAvailabilitySum = BigDecimal.ZERO; + for (CheckIndexCar car : checkIndexCars) { + scoreSum = scoreSum.add(car.getScore() == null ? BigDecimal.ZERO : car.getScore()); + viewConnectStabilitySum = viewConnectStabilitySum.add(car.getViewConnectStability()); + siteOnlineSum = siteOnlineSum.add(car.getSiteOnline()); + deviceDirectoryConsistentSum = deviceDirectoryConsistentSum.add(car.getDeviceDirectoryConsistent()); + vehicleInformationCollectionAccuracySum = vehicleInformationCollectionAccuracySum.add(car.getVehicleInformationCollectionAccuracy()); + vehicleCaptureIntegritySum = vehicleCaptureIntegritySum.add(car.getVehicleCaptureIntegrity()); + vehicleCaptureAccuracySum = vehicleCaptureAccuracySum.add(car.getVehicleCaptureAccuracy()); + vehicleTimingAccuracySum = vehicleTimingAccuracySum.add(car.getVehicleTimingAccuracy()); + vehicleUploadTimelinessSum = vehicleUploadTimelinessSum.add(car.getVehicleUploadTimeliness()); + vehicleUrlAvailabilitySum = vehicleUrlAvailabilitySum.add(car.getVehicleUrlAvailability()); + vehiclePictureAvailabilitySum = vehiclePictureAvailabilitySum.add(car.getVehiclePictureAvailability()); + } + CheckIndexCar checkIndexCar = new CheckIndexCar(); + checkIndexCar.setCreateTimeStr("鍚堣"); + checkIndexCar.setDeptName(checkIndexCars.get(0).getDeptName()); + checkIndexCar.setExamineTag(checkIndexCars.get(0).getExamineTag()); + checkIndexCar.setScore(scoreSum); + checkIndexCar.setViewConnectStability(viewConnectStabilitySum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP)); + checkIndexCar.setSiteOnline(siteOnlineSum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP)); + checkIndexCar.setDeviceDirectoryConsistent(deviceDirectoryConsistentSum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP)); + checkIndexCar.setVehicleInformationCollectionAccuracy(vehicleInformationCollectionAccuracySum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP)); + checkIndexCar.setVehicleCaptureIntegrity(vehicleCaptureIntegritySum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP)); + checkIndexCar.setVehicleCaptureAccuracy(vehicleCaptureAccuracySum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP)); + checkIndexCar.setVehicleTimingAccuracy(vehicleTimingAccuracySum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP)); + checkIndexCar.setVehicleUploadTimeliness(vehicleUploadTimelinessSum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP)); + checkIndexCar.setVehicleUrlAvailability(vehicleUrlAvailabilitySum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP)); + checkIndexCar.setVehiclePictureAvailability(vehiclePictureAvailabilitySum.divide(new BigDecimal(checkIndexCars.size()), 2, RoundingMode.HALF_UP)); + return checkIndexCar; + } } diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexFace.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexFace.java index 3ae107b..0c80fc1 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexFace.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexFace.java @@ -10,9 +10,11 @@ import constant.CheckConstants; import lombok.Data; import org.springframework.lang.NonNull; +import utils.StringUtils; import java.math.BigDecimal; import java.math.RoundingMode; +import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; @@ -81,8 +83,15 @@ //杞崲鎴愬瓧绗︿覆鐢ㄤ簬excel瀵煎嚭 public static CheckIndexFaceVO getExcelVo(@NonNull CheckIndexFace checkIndexFace) { CheckIndexFaceVO checkIndexFaceVo = new CheckIndexFaceVO(); + checkIndexFaceVo.setScore(checkIndexFace.getScore()); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + //閬垮厤鍚堣琛屾姤閿�(鍚堣鏁版嵁 缂哄皯createTimeStr瀛楁 鐩存帴灏哻reateTimeStr璁剧疆涓�"鍚堣") + if (StringUtils.isEmpty(checkIndexFace.getCreateTimeStr())) { + checkIndexFaceVo.setCreateTimeStr(format.format(checkIndexFace.getCreateTime())); + }else { + checkIndexFaceVo.setCreateTimeStr(checkIndexFace.getCreateTimeStr()); + } checkIndexFaceVo.setDeptName(checkIndexFace.getDeptName()); - checkIndexFaceVo.setCreateTime(checkIndexFace.getCreateTime()); checkIndexFaceVo.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexFace.getExamineTag()) ? "鐪佸巺鑰冩牳" : "鍖哄幙鑰冩牳"); checkIndexFaceVo.setSiteOnlineText(checkIndexFace.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); checkIndexFaceVo.setFaceInformationCollectionAccuracyText(checkIndexFace.getFaceInformationCollectionAccuracy().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); @@ -95,4 +104,44 @@ return checkIndexFaceVo; } + /** 鐢ㄤ簬瀵煎嚭璁$畻骞冲潎鍊� */ + public static CheckIndexFace calculateAverage(List<CheckIndexFace> checkIndexFaces) { + BigDecimal scoreSum = BigDecimal.ZERO; + BigDecimal totalViewConnectStability = BigDecimal.ZERO; + BigDecimal totalSiteOnline = BigDecimal.ZERO; + BigDecimal totalDeviceDirectoryConsistent = BigDecimal.ZERO; + BigDecimal totalFaceInformationCollectionAccuracy = BigDecimal.ZERO; + BigDecimal totalFacePictureQualification = BigDecimal.ZERO; + BigDecimal totalFaceTimingAccuracy = BigDecimal.ZERO; + BigDecimal totalFaceUploadTimeliness = BigDecimal.ZERO; + BigDecimal totalFacePictureAvailability = BigDecimal.ZERO; + + int count = checkIndexFaces.size(); + + for (CheckIndexFace indexFace : checkIndexFaces) { + scoreSum = scoreSum.add(indexFace.getScore() == null ? BigDecimal.ZERO : indexFace.getScore()); + totalViewConnectStability = totalViewConnectStability.add(indexFace.getViewConnectStability()); + totalSiteOnline = totalSiteOnline.add(indexFace.getSiteOnline()); + totalDeviceDirectoryConsistent = totalDeviceDirectoryConsistent.add(indexFace.getDeviceDirectoryConsistent()); + totalFaceInformationCollectionAccuracy = totalFaceInformationCollectionAccuracy.add(indexFace.getFaceInformationCollectionAccuracy()); + totalFacePictureQualification = totalFacePictureQualification.add(indexFace.getFacePictureQualification()); + totalFaceTimingAccuracy = totalFaceTimingAccuracy.add(indexFace.getFaceTimingAccuracy()); + totalFaceUploadTimeliness = totalFaceUploadTimeliness.add(indexFace.getFaceUploadTimeliness()); + totalFacePictureAvailability = totalFacePictureAvailability.add(indexFace.getFacePictureAvailability()); + } + CheckIndexFace result = new CheckIndexFace(); + result.setCreateTimeStr("鍚堣"); + result.setDeptName(checkIndexFaces.get(0).getDeptName()); + result.setExamineTag(checkIndexFaces.get(0).getExamineTag()); + result.setScore(scoreSum); + result.setViewConnectStability(totalViewConnectStability.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + result.setSiteOnline(totalSiteOnline.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + result.setDeviceDirectoryConsistent(totalDeviceDirectoryConsistent.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + result.setFaceInformationCollectionAccuracy(totalFaceInformationCollectionAccuracy.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + result.setFacePictureQualification(totalFacePictureQualification.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + result.setFaceTimingAccuracy(totalFaceTimingAccuracy.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + result.setFaceUploadTimeliness(totalFaceUploadTimeliness.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + result.setFacePictureAvailability(totalFacePictureAvailability.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + return result; + } } diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexVideo.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexVideo.java index d747433..6408f46 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexVideo.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexVideo.java @@ -10,9 +10,11 @@ import constant.CheckConstants; import lombok.Data; import org.springframework.lang.NonNull; +import utils.StringUtils; import java.math.BigDecimal; import java.math.RoundingMode; +import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; @@ -100,7 +102,7 @@ private BigDecimal keyTimingAccuracy; /** - * 閲嶇偣鎸囨尌鍥惧儚鍦ㄧ嚎鐜� + * 閲嶇偣鎸囨尌鍥惧儚鍦ㄧ嚎鐜� */ @TableField("key_command_image_online") private BigDecimal keyCommandImageOnline; @@ -115,27 +117,98 @@ @ExcelIgnore @TableField(exist = false) private List<String> quarter; + //杞崲鎴愬瓧绗︿覆鐢ㄤ簬excel瀵煎嚭 public static CheckIndexVideoVO getExcelVo(@NonNull CheckIndexVideo checkIndexVideo) { CheckIndexVideoVO checkIndexVideoVO = new CheckIndexVideoVO(); + checkIndexVideoVO.setScore(checkIndexVideo.getScore()); checkIndexVideoVO.setDeptName(checkIndexVideo.getDeptName()); - checkIndexVideoVO.setCreateTime(checkIndexVideo.getCreateTime()); + //閬垮厤鍚堣琛屾姤閿�(鍚堣鏁版嵁 缂哄皯createTimeStr瀛楁 鐩存帴灏哻reateTimeStr璁剧疆涓�"鍚堣") + if (StringUtils.isEmpty(checkIndexVideo.getCreateTimeStr())) { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + checkIndexVideoVO.setCreateTimeStr(format.format(checkIndexVideo.getCreateTime())); + }else { + checkIndexVideoVO.setCreateTimeStr(checkIndexVideo.getCreateTimeStr()); + } checkIndexVideoVO.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexVideo.getExamineTag()) ? "鐪佸巺鑰冩牳" : "鍖哄幙鑰冩牳"); - checkIndexVideoVO.setSiteOnlineText(checkIndexVideo.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexVideoVO.setImageResourceSecurityText(checkIndexVideo.getImageResourceSecurity().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexVideoVO.setArchivesRateText(checkIndexVideo.getArchivesRate().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexVideoVO.setKeyAnnotationAccuracyText(checkIndexVideo.getKeyAnnotationAccuracy().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexVideoVO.setKeyCommandImageOnlineText(checkIndexVideo.getKeyCommandImageOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexVideoVO.setKeyVideoAvailableText(checkIndexVideo.getKeyVideoAvailable().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexVideoVO.setKeySiteOnlineText(checkIndexVideo.getKeySiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexVideoVO.setKeyTimingAccuracyText(checkIndexVideo.getKeyTimingAccuracy().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexVideoVO.setMinistryVideoAvailableText(checkIndexVideo.getMinistryVideoAvailable().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexVideoVO.setVideoAvailableText(checkIndexVideo.getVideoAvailable().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexVideoVO.setMinistrySiteOnlineText(checkIndexVideo.getMinistrySiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexVideoVO.setPlatformOnlineText(checkIndexVideo.getPlatformOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexVideoVO.setMonitorQualificationText(checkIndexVideo.getMonitorQualification().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); - checkIndexVideoVO.setMonitorRegistrationText(checkIndexVideo.getMonitorRegistration().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)+"%"); + checkIndexVideoVO.setSiteOnlineText(checkIndexVideo.getSiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexVideoVO.setImageResourceSecurityText(checkIndexVideo.getImageResourceSecurity().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexVideoVO.setArchivesRateText(checkIndexVideo.getArchivesRate().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexVideoVO.setKeyAnnotationAccuracyText(checkIndexVideo.getKeyAnnotationAccuracy().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexVideoVO.setKeyCommandImageOnlineText(checkIndexVideo.getKeyCommandImageOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexVideoVO.setKeyVideoAvailableText(checkIndexVideo.getKeyVideoAvailable().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexVideoVO.setKeySiteOnlineText(checkIndexVideo.getKeySiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexVideoVO.setKeyTimingAccuracyText(checkIndexVideo.getKeyTimingAccuracy().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexVideoVO.setMinistryVideoAvailableText(checkIndexVideo.getMinistryVideoAvailable().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexVideoVO.setVideoAvailableText(checkIndexVideo.getVideoAvailable().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexVideoVO.setMinistrySiteOnlineText(checkIndexVideo.getMinistrySiteOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexVideoVO.setPlatformOnlineText(checkIndexVideo.getPlatformOnline().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexVideoVO.setMonitorQualificationText(checkIndexVideo.getMonitorQualification().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); + checkIndexVideoVO.setMonitorRegistrationText(checkIndexVideo.getMonitorRegistration().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%"); return checkIndexVideoVO; } + + /** + * 鐢ㄤ簬瀵煎嚭璁$畻骞冲潎鍊� + */ + public static CheckIndexVideo calculateAverage(List<CheckIndexVideo> videos) { + BigDecimal scoreSum = BigDecimal.ZERO; + BigDecimal totalPlatformOnline = BigDecimal.ZERO; + BigDecimal totalMonitorQualification = BigDecimal.ZERO; + BigDecimal totalMonitorRegistration = BigDecimal.ZERO; + BigDecimal totalArchivesRate = BigDecimal.ZERO; + BigDecimal totalSiteOnline = BigDecimal.ZERO; + BigDecimal totalVideoAvailable = BigDecimal.ZERO; + BigDecimal totalMinistrySiteOnline = BigDecimal.ZERO; + BigDecimal totalMinistryVideoAvailable = BigDecimal.ZERO; + BigDecimal totalKeySiteOnline = BigDecimal.ZERO; + BigDecimal totalKeyVideoAvailable = BigDecimal.ZERO; + BigDecimal totalKeyAnnotationAccuracy = BigDecimal.ZERO; + BigDecimal totalKeyTimingAccuracy = BigDecimal.ZERO; + BigDecimal totalKeyCommandImageOnline = BigDecimal.ZERO; + BigDecimal totalImageResourceSecurity = BigDecimal.ZERO; + + int count = videos.size(); + for (CheckIndexVideo video : videos) { + scoreSum = scoreSum.add(video.getScore() == null ? BigDecimal.ZERO : video.getScore()); + totalPlatformOnline = totalPlatformOnline.add(video.getPlatformOnline()); + totalMonitorQualification = totalMonitorQualification.add(video.getMonitorQualification()); + totalMonitorRegistration = totalMonitorRegistration.add(video.getMonitorRegistration()); + totalArchivesRate = totalArchivesRate.add(video.getArchivesRate()); + totalSiteOnline = totalSiteOnline.add(video.getSiteOnline()); + totalVideoAvailable = totalVideoAvailable.add(video.getVideoAvailable()); + totalMinistrySiteOnline = totalMinistrySiteOnline.add(video.getMinistrySiteOnline()); + totalMinistryVideoAvailable = totalMinistryVideoAvailable.add(video.getMinistryVideoAvailable()); + totalKeySiteOnline = totalKeySiteOnline.add(video.getKeySiteOnline()); + totalKeyVideoAvailable = totalKeyVideoAvailable.add(video.getKeyVideoAvailable()); + totalKeyAnnotationAccuracy = totalKeyAnnotationAccuracy.add(video.getKeyAnnotationAccuracy()); + totalKeyTimingAccuracy = totalKeyTimingAccuracy.add(video.getKeyTimingAccuracy()); + totalKeyCommandImageOnline = totalKeyCommandImageOnline.add(video.getKeyCommandImageOnline()); + totalImageResourceSecurity = totalImageResourceSecurity.add(video.getImageResourceSecurity()); + } + + // 鍒涘缓涓�涓柊鐨凜heckIndexVideo瀵硅薄骞惰缃钩鍧囧�� + CheckIndexVideo averageVideo = new CheckIndexVideo(); + averageVideo.setCreateTimeStr("鍚堣"); + averageVideo.setDeptName(videos.get(0).getDeptName()); + averageVideo.setExamineTag(videos.get(0).getExamineTag()); + averageVideo.setScore(scoreSum); + averageVideo.setPlatformOnline(totalPlatformOnline.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + averageVideo.setMonitorQualification(totalMonitorQualification.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + averageVideo.setMonitorRegistration(totalMonitorRegistration.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + averageVideo.setArchivesRate(totalArchivesRate.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + averageVideo.setSiteOnline(totalSiteOnline.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + averageVideo.setVideoAvailable(totalVideoAvailable.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + averageVideo.setMinistrySiteOnline(totalMinistrySiteOnline.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + averageVideo.setMinistryVideoAvailable(totalMinistryVideoAvailable.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + averageVideo.setKeySiteOnline(totalKeySiteOnline.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + averageVideo.setKeyVideoAvailable(totalKeyVideoAvailable.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + averageVideo.setKeyAnnotationAccuracy(totalKeyAnnotationAccuracy.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + averageVideo.setKeyTimingAccuracy(totalKeyTimingAccuracy.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + averageVideo.setKeyCommandImageOnline(totalKeyCommandImageOnline.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + averageVideo.setImageResourceSecurity(totalImageResourceSecurity.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP)); + + return averageVideo; + } } diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java index 9006893..c38c6bf 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java @@ -13,7 +13,7 @@ /** * 鑰冩牳绉垎鏄庣粏瀵硅薄 t_check_score - * + * * @author ruoyi * @date 2024-04-22 */ @@ -31,6 +31,7 @@ @Excel(name = "鍒嗗��") private BigDecimal score; + /** deptid */ @Excel(name = "鍖哄幙") private Long deptId; @@ -38,7 +39,8 @@ /** 鑰冩牳妯℃澘id */ @Excel(name = "鑰冩牳妯℃澘id") private Integer templateId; - + /** 瀵瑰簲check_index_琛╥d */ + private Long indexId; /** 鑰冩牳鏍囩(鐪佸巺/甯傚眬) */ @Excel(name = "鑰冩牳鏍囩(鐪佸巺/甯傚眬)") private Integer examineTag; diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/CheckIndexCarVO.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/CheckIndexCarVO.java index d7146e0..114438e 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/CheckIndexCarVO.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/CheckIndexCarVO.java @@ -3,8 +3,12 @@ import annotation.Excel; import com.ycl.platform.base.CheckIndex; import lombok.Data; + +import java.math.BigDecimal; + @Data public class CheckIndexCarVO extends CheckIndex { + /** 瑙嗗浘搴撳鎺ョǔ瀹氭�� */ @Excel(name = "瑙嗗浘搴撳鎺ョǔ瀹氭��") private String viewConnectStabilityText; diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/RuleExcelVO.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/RuleExcelVO.java new file mode 100644 index 0000000..bcba672 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/RuleExcelVO.java @@ -0,0 +1,33 @@ +package com.ycl.platform.domain.vo; + +import annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class RuleExcelVO { + /** 瑙勫垯id */ + private Integer ruleId; + /** 鑰冩牳绫诲埆 */ + private Integer examineCategory; + /** 鑰冩牳鏍囩 */ + private Integer examineTag; + /** 鏉冮噸 */ + private BigDecimal weight; + /** 妯℃澘鍚� */ + @Excel(name = "妯℃澘鍚�") + private String templateName; + /** 瑙勫垯鍚� */ + @Excel(name = "瑙勫垯鍚�",width = 25) + private String ruleName; + /** 鏉冮噸 */ + @Excel(name = "鐪佸巺鑰冩牳鏉冮噸") + private BigDecimal provinceWeight; + /** 鏉冮噸 */ + @Excel(name = "鍖哄幙鑰冩牳鏉冮噸") + private BigDecimal countyWeight; + /** 瑙勫垯鎻忚堪 */ + @Excel(name = "瑙勫垯鎻忚堪",width = 200,height = 25) + private String ruleDescription; +} diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/CheckScoreController.java b/ycl-server/src/main/java/com/ycl/platform/controller/CheckScoreController.java index 5b13ba3..5a31930 100644 --- a/ycl-server/src/main/java/com/ycl/platform/controller/CheckScoreController.java +++ b/ycl-server/src/main/java/com/ycl/platform/controller/CheckScoreController.java @@ -1,6 +1,7 @@ package com.ycl.platform.controller; import annotation.Log; +import com.ycl.platform.domain.dto.CheckResultExportDTO; import com.ycl.platform.domain.dto.CheckScoreDTO; import com.ycl.platform.domain.dto.CheckScoreIndexDTO; import com.ycl.platform.domain.entity.CheckScore; @@ -8,6 +9,7 @@ import com.ycl.system.AjaxResult; import com.ycl.system.controller.BaseController; import com.ycl.system.page.TableDataInfo; +import com.ycl.utils.SecurityUtils; import enumeration.BusinessType; import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; @@ -88,13 +90,28 @@ } /** - * 瀵煎嚭鑰冩牳绉垎鍒楄〃 + * 璇︽儏椤靛鍑鸿�冩牳绉垎鍒楄〃 */ - @PreAuthorize("@ss.hasPermi('check:score:export')") - @Log(title = "瀵煎嚭鑰冩牳绉垎", businessType = BusinessType.EXPORT) + @Log(title = "璇︽儏椤靛鍑鸿�冩牳绉垎", businessType = BusinessType.EXPORT) + @PostMapping("/detailExport") + @PreAuthorize("@ss.hasPermi('check:result:detail:export')") + //鍏辩敤鐨勪竴涓柟娉曠敤checkScore鎺ュ弬,new瀵硅薄鐨勬柟寮忛槻鎶ゃ�� + public void detailExport(HttpServletResponse response, CheckScore checkScore) throws IOException { + CheckResultExportDTO exportDTO = new CheckResultExportDTO(); + exportDTO.setDate(checkScore.getDate()); + exportDTO.setQuarter(checkScore.getQuarter()); + exportDTO.setDeptId(checkScore.getDeptId()); + exportDTO.setId(checkScore.getId()); + checkScoreService.exportIndex(response,exportDTO); + } + /** + * 鍗$墖椤靛鍑鸿�冩牳绉垎鍒楄〃 + */ + @PreAuthorize("@ss.hasPermi('check:result:export')") + @Log(title = "鍗$墖椤靛鍑鸿�冩牳绉垎", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, CheckScore checkScore) throws IOException { - checkScoreService.exportIndex(response,checkScore); + public void export(HttpServletResponse response, CheckResultExportDTO exportDTO) throws IOException { + checkScoreService.exportIndex(response,exportDTO); } // /** // * 鏂板鑰冩牳绉垎 diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateRuleMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateRuleMapper.java index 2d1f9e0..0b120cb 100644 --- a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateRuleMapper.java +++ b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckTemplateRuleMapper.java @@ -2,12 +2,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ycl.platform.domain.entity.CheckTemplateRule; +import com.ycl.platform.domain.vo.RuleExcelVO; import java.util.List; /** * 鑰冩牳妯℃澘-瑙勫垯涓棿Mapper鎺ュ彛 - * + * * @author ruoyi * @date 2024-04-01 */ @@ -15,7 +16,7 @@ { /** * 鏌ヨ鑰冩牳妯℃澘-瑙勫垯涓棿 - * + * * @param id 鑰冩牳妯℃澘-瑙勫垯涓棿涓婚敭 * @return 鑰冩牳妯℃澘-瑙勫垯涓棿 */ @@ -23,7 +24,7 @@ /** * 鏌ヨ鑰冩牳妯℃澘-瑙勫垯涓棿鍒楄〃 - * + * * @param checkTemplateRule 鑰冩牳妯℃澘-瑙勫垯涓棿 * @return 鑰冩牳妯℃澘-瑙勫垯涓棿闆嗗悎 */ @@ -31,7 +32,7 @@ /** * 鏂板鑰冩牳妯℃澘-瑙勫垯涓棿 - * + * * @param checkTemplateRule 鑰冩牳妯℃澘-瑙勫垯涓棿 * @return 缁撴灉 */ @@ -39,7 +40,7 @@ /** * 淇敼鑰冩牳妯℃澘-瑙勫垯涓棿 - * + * * @param checkTemplateRule 鑰冩牳妯℃澘-瑙勫垯涓棿 * @return 缁撴灉 */ @@ -47,7 +48,7 @@ /** * 鍒犻櫎鑰冩牳妯℃澘-瑙勫垯涓棿 - * + * * @param id 鑰冩牳妯℃澘-瑙勫垯涓棿涓婚敭 * @return 缁撴灉 */ @@ -55,7 +56,7 @@ /** * 鎵归噺鍒犻櫎鑰冩牳妯℃澘-瑙勫垯涓棿 - * + * * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎 * @return 缁撴灉 */ @@ -64,4 +65,6 @@ List<CheckTemplateRule> selectListByTemplateId(Integer id); void deleteByTemplateId(Integer templateId); + + List<RuleExcelVO> getAllRuleTemplate(); } diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java index 48af587..6754ff1 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java @@ -1,6 +1,7 @@ package com.ycl.platform.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.ycl.platform.domain.dto.CheckResultExportDTO; import com.ycl.platform.domain.dto.CheckScoreDTO; import com.ycl.platform.domain.dto.CheckScoreIndexDTO; import com.ycl.platform.domain.entity.CheckScore; @@ -13,7 +14,7 @@ /** * 鑰冩牳绉垎鏄庣粏Service鎺ュ彛 - * + * * @author ruoyi * @date 2024-04-22 */ @@ -21,7 +22,7 @@ { /** * 鏌ヨ鑰冩牳绉垎鏄庣粏 - * + * * @param * @return 鑰冩牳绉垎鏄庣粏 */ @@ -29,7 +30,7 @@ /** * 鏌ヨ鑰冩牳绉垎鏄庣粏鍒楄〃 - * + * * @param checkScore 鑰冩牳绉垎鏄庣粏 * @return 鑰冩牳绉垎鏄庣粏闆嗗悎 */ @@ -48,7 +49,7 @@ List<CheckScore> page(CheckScore checkScore); - void exportIndex(HttpServletResponse response,CheckScore checkScore) throws IOException; + void exportIndex(HttpServletResponse response, CheckResultExportDTO exportDTO) throws IOException; /** * 棣栭〉鑰冩牳棰勮 diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java index eb9098a..1294a76 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java @@ -5,14 +5,12 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ycl.platform.base.CheckIndex; +import com.ycl.platform.domain.dto.CheckResultExportDTO; import com.ycl.platform.domain.dto.CheckScoreDTO; import com.ycl.platform.domain.dto.CheckScoreIndexDTO; import com.ycl.platform.domain.dto.ScoreIndexDTO; import com.ycl.platform.domain.entity.*; -import com.ycl.platform.domain.vo.CheckIndexCarVO; -import com.ycl.platform.domain.vo.CheckIndexFaceVO; -import com.ycl.platform.domain.vo.CheckIndexVideoVO; -import com.ycl.platform.domain.vo.CheckScoreDetailVO; +import com.ycl.platform.domain.vo.*; import com.ycl.platform.mapper.CheckRuleMapper; import com.ycl.platform.mapper.CheckScoreMapper; import com.ycl.platform.mapper.CheckTemplateMapper; @@ -40,9 +38,12 @@ import utils.poi.ExcelUtilManySheet; import java.io.IOException; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -71,6 +72,7 @@ @Autowired private ISysDeptService deptService; + /** * 鏌ヨ鑰冩牳绉垎鎸囨爣 * @@ -88,10 +90,10 @@ Integer templateId = 0; //鏂逛究鍒囨崲鏀逛负锛氭牴鎹畇core鑰冩牳绫诲埆鍜宒to鑰冩牳鏍囩鏌ユā鏉胯鍒欏拰鏉冮噸,娉ㄦ剰鍚岀绫诲悓鏍囩鍙兘鏈変竴涓ā鏉� QueryWrapper<CheckTemplate> wrapper = new QueryWrapper<>(); - wrapper.eq("examine_tag",checkScoreIndexDTO.getExamineTag()); - wrapper.eq("examine_category",checkScore.getExamineCategory()); + wrapper.eq("examine_tag", checkScoreIndexDTO.getExamineTag()); + wrapper.eq("examine_category", checkScore.getExamineCategory()); Optional<CheckTemplate> first = templateMapper.selectList(wrapper).stream().findFirst(); - if(first.isPresent()){ + if (first.isPresent()) { CheckTemplate checkTemplate = first.get(); templateId = checkTemplate.getId(); } @@ -256,31 +258,25 @@ //鎺у埗index琛ㄧ殑鍙戝竷鐘舵�� List<Integer> ids = checkScoreDTO.getId(); QueryWrapper<CheckScore> queryWrapper = new QueryWrapper<>(); - queryWrapper.in("id",ids); + queryWrapper.in("id", ids); List<CheckScore> scoreList = scoreMapper.selectList(queryWrapper); //鏈�澶氫负3娆″惊鐜� for (CheckScore checkScore : scoreList) { Short examineCategory = checkScore.getExamineCategory(); - if(CheckConstants.Rule_Category_Video.equals(examineCategory)){ + if (CheckConstants.Rule_Category_Video.equals(examineCategory)) { UpdateWrapper<CheckIndexVideo> updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("publish",code); - updateWrapper.eq("dept_id",checkScore.getDeptId()); - updateWrapper.eq("examine_tag",checkScore.getExamineTag()); - updateWrapper.between("create_time",DateUtils.getDayStart(checkScore.getCreateTime()),DateUtils.getDayEnd(checkScore.getCreateTime())); + updateWrapper.set("publish", code); + updateWrapper.eq("id", checkScore.getIndexId()); indexVideoService.update(updateWrapper); - }else if(CheckConstants.Rule_Category_Car.equals(examineCategory)){ + } else if (CheckConstants.Rule_Category_Car.equals(examineCategory)) { UpdateWrapper<CheckIndexCar> updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("publish",code); - updateWrapper.eq("dept_id",checkScore.getDeptId()); - updateWrapper.eq("examine_tag",checkScore.getExamineTag()); - updateWrapper.between("create_time",DateUtils.getDayStart(checkScore.getCreateTime()),DateUtils.getDayEnd(checkScore.getCreateTime())); + updateWrapper.set("publish", code); + updateWrapper.eq("id", checkScore.getIndexId()); indexCarService.update(updateWrapper); - }else if(CheckConstants.Rule_Category_Face.equals(examineCategory)){ + } else if (CheckConstants.Rule_Category_Face.equals(examineCategory)) { UpdateWrapper<CheckIndexFace> updateWrapper = new UpdateWrapper<>(); - updateWrapper.set("publish",code); - updateWrapper.eq("dept_id",checkScore.getDeptId()); - updateWrapper.eq("examine_tag",checkScore.getExamineTag()); - updateWrapper.between("create_time",DateUtils.getDayStart(checkScore.getCreateTime()),DateUtils.getDayEnd(checkScore.getCreateTime())); + updateWrapper.set("publish", code); + updateWrapper.eq("id", checkScore.getIndexId()); indexFaceService.update(updateWrapper); } } @@ -294,24 +290,47 @@ * @return 鑰冩牳绉垎 */ @Override - public void exportIndex(HttpServletResponse response, CheckScore checkScoreDTO) throws IOException { - String date = checkScoreDTO.getDate(); + public void exportIndex(HttpServletResponse response, CheckResultExportDTO exportDTO) throws IOException { + String date = exportDTO.getDate(); //濡傛灉璇锋眰鍙傛暟鏃堕棿涓虹┖锛屾煡杩欐潯璁板綍鐨勬椂闂� - if (StringUtils.isEmpty(checkScoreDTO.getDate()) && CollectionUtils.isEmpty(checkScoreDTO.getQuarter())) { - CheckScore checkScore = getById(checkScoreDTO.getId()); - Date createTime = checkScore.getCreateTime(); + if (StringUtils.isEmpty(exportDTO.getDate()) && CollectionUtils.isEmpty(exportDTO.getQuarter())) { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); - date = formatter.format(createTime); + if (exportDTO.getId() != null) { + CheckScore checkScore = getById(exportDTO.getId()); + Date createTime = checkScore.getCreateTime(); + date = formatter.format(createTime); + } else { + //闃叉鍗$墖椤甸潰瀵煎嚭涓嶄紶scoreId锛屽鑷存姤閿� + date = formatter.format(new Date()); + } } /** 瀵间笁寮爏heet */ //杞﹁締 CheckIndexCar checkIndexCar = new CheckIndexCar(); checkIndexCar.setDate(date); - checkIndexCar.setQuarter(checkScoreDTO.getQuarter()); + checkIndexCar.setQuarter(exportDTO.getQuarter()); + checkIndexCar.setDeptId(exportDTO.getDeptId()); + checkIndexCar.setDeptIds(exportDTO.getDeptIds()); + checkIndexCar.setExamineTags(exportDTO.getExamineTags()); //鏉冮檺鎺у埗 鍙兘鏌ョ湅宸插彂甯� roleControl(checkIndexCar); List<CheckIndexCar> checkIndexCars = indexCarService.selectCheckIndexCarList(checkIndexCar); + //璁$畻骞冲潎鍊兼斁鍦╡xcel鏈�鍚� + if (exportDTO.getAverage() && !CollectionUtils.isEmpty(checkIndexCars)) { + //鍏堝尯鍒嗗悇涓尯鍘匡紝鍐嶅尯鍒嗚�冩牳鏍囩 + Map<Long, List<CheckIndexCar>> carMap = checkIndexCars.stream().collect(Collectors.groupingBy(CheckIndexCar::getDeptId)); + carMap.forEach((deptId,list)->{ + List<CheckIndexCar> provinceList = list.stream().filter(car -> CheckConstants.Examine_Tag_Province.equals(car.getExamineTag())).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(provinceList)) { + checkIndexCars.add(CheckIndexCar.calculateAverage(provinceList)); + } + List<CheckIndexCar> countyList = list.stream().filter(car -> CheckConstants.Examine_Tag_County.equals(car.getExamineTag())).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(countyList)) { + checkIndexCars.add(CheckIndexCar.calculateAverage(countyList)); + } + }); + } List<CheckIndexCarVO> checkIndexCarVOS = new ArrayList<>(); for (CheckIndexCar indexCar : checkIndexCars) { CheckIndexCarVO excelVo = CheckIndexCar.getExcelVo(indexCar); @@ -321,10 +340,28 @@ //浜鸿劯 CheckIndexFace checkIndexFace = new CheckIndexFace(); checkIndexFace.setDate(date); - checkIndexFace.setQuarter(checkScoreDTO.getQuarter()); + checkIndexFace.setQuarter(exportDTO.getQuarter()); + checkIndexFace.setDeptId(exportDTO.getDeptId()); + checkIndexFace.setDeptIds(exportDTO.getDeptIds()); + checkIndexFace.setExamineTags(exportDTO.getExamineTags()); //鏉冮檺鎺у埗 鍙兘鏌ョ湅宸插彂甯� roleControl(checkIndexFace); List<CheckIndexFace> checkIndexFaces = indexFaceService.selectCheckIndexFaceList(checkIndexFace); + //璁$畻骞冲潎鍊兼斁鍦╡xcel鏈�鍚� + if (exportDTO.getAverage() && !CollectionUtils.isEmpty(checkIndexFaces)) { + //鍏堝尯鍒嗗悇涓尯鍘匡紝鍐嶅尯鍒嗚�冩牳鏍囩 + Map<Long, List<CheckIndexFace>> faceMap = checkIndexFaces.stream().collect(Collectors.groupingBy(CheckIndexFace::getDeptId)); + faceMap.forEach((deptId,list)->{ + List<CheckIndexFace> provinceList = list.stream().filter(face -> CheckConstants.Examine_Tag_Province.equals(face.getExamineTag())).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(provinceList)) { + checkIndexFaces.add(CheckIndexFace.calculateAverage(provinceList)); + } + List<CheckIndexFace> countyList = list.stream().filter(face -> CheckConstants.Examine_Tag_County.equals(face.getExamineTag())).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(countyList)) { + checkIndexFaces.add(CheckIndexFace.calculateAverage(countyList)); + } + }); + } List<CheckIndexFaceVO> checkIndexFaceVOS = new ArrayList<>(); for (CheckIndexFace indexFace : checkIndexFaces) { CheckIndexFaceVO excelVo = CheckIndexFace.getExcelVo(indexFace); @@ -334,10 +371,28 @@ //瑙嗛 CheckIndexVideo checkIndexVideo = new CheckIndexVideo(); checkIndexVideo.setDate(date); - checkIndexVideo.setQuarter(checkScoreDTO.getQuarter()); + checkIndexVideo.setQuarter(exportDTO.getQuarter()); + checkIndexVideo.setDeptId(exportDTO.getDeptId()); + checkIndexVideo.setDeptIds(exportDTO.getDeptIds()); + checkIndexVideo.setExamineTags(exportDTO.getExamineTags()); //鏉冮檺鎺у埗 鍙兘鏌ョ湅宸插彂甯� roleControl(checkIndexVideo); List<CheckIndexVideo> checkIndexVideos = indexVideoService.selectCheckIndexVideoList(checkIndexVideo); + //璁$畻骞冲潎鍊兼斁鍦╡xcel鏈�鍚� + if (exportDTO.getAverage() && !CollectionUtils.isEmpty(checkIndexVideos)) { + //鍏堝尯鍒嗗悇涓尯鍘匡紝鍐嶅尯鍒嗚�冩牳鏍囩 + Map<Long, List<CheckIndexVideo>> videoMap = checkIndexVideos.stream().collect(Collectors.groupingBy(CheckIndexVideo::getDeptId)); + videoMap.forEach((deptId,list)->{ + List<CheckIndexVideo> provinceList = list.stream().filter(video -> CheckConstants.Examine_Tag_Province.equals(video.getExamineTag())).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(provinceList)) { + checkIndexVideos.add(CheckIndexVideo.calculateAverage(provinceList)); + } + List<CheckIndexVideo> countyList = list.stream().filter(video -> CheckConstants.Examine_Tag_County.equals(video.getExamineTag())).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(countyList)) { + checkIndexVideos.add(CheckIndexVideo.calculateAverage(countyList)); + } + }); + } List<CheckIndexVideoVO> checkIndexVideoVOS = new ArrayList<>(); for (CheckIndexVideo indexVideo : checkIndexVideos) { CheckIndexVideoVO excelVo = CheckIndexVideo.getExcelVo(indexVideo); @@ -349,6 +404,23 @@ mysheet.add(e1); mysheet.add(e2); mysheet.add(e3); + //瑙勫垯鏄庣粏 + List<RuleExcelVO> allRuleTemplate = templateRuleMapper.getAllRuleTemplate(); + //鏁村悎鏁版嵁 + List<RuleExcelVO> countyRuleList = allRuleTemplate.stream().filter(vo -> vo.getExamineTag().equals(Integer.parseInt(CheckConstants.Examine_Tag_County + ""))).collect(Collectors.toList()); + List<RuleExcelVO> provinceRuleList = allRuleTemplate.stream().filter(vo -> vo.getExamineTag().equals(Integer.parseInt(CheckConstants.Examine_Tag_Province + ""))).collect(Collectors.toList()); + //鐢ㄥ尯鍘胯鍒欏仛涓讳綋灞曠ず + for (RuleExcelVO countyRule : countyRuleList) { + countyRule.setCountyWeight(countyRule.getWeight()); + //绛涢�夊悓绉嶈鍒欐潈閲� + for (RuleExcelVO provinceRule : provinceRuleList) { + if (provinceRule.getRuleId().equals(countyRule.getRuleId()) && provinceRule.getExamineCategory().equals(countyRule.getExamineCategory())) { + countyRule.setProvinceWeight(provinceRule.getWeight()); + } + } + } + ExcelExp e4 = new ExcelExp("瑙勫垯鏄庣粏", countyRuleList, RuleExcelVO.class); + mysheet.add(e4); ExcelUtilManySheet<List<ExcelExp>> util = new ExcelUtilManySheet<>(mysheet); util.exportExcelManySheet(response, mysheet); @@ -366,6 +438,7 @@ } } } + private void roleControl(BaseEntity checkScore) { List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles(); SysUser user = SecurityUtils.getLoginUser().getUser(); 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..b4c81a4 100644 --- a/ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java +++ b/ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java @@ -97,6 +97,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) { //璁$畻鍒嗘暟 diff --git a/ycl-server/src/main/java/com/ycl/task/MonitorTask.java b/ycl-server/src/main/java/com/ycl/task/MonitorTask.java index 4262d99..53e9bb3 100644 --- a/ycl-server/src/main/java/com/ycl/task/MonitorTask.java +++ b/ycl-server/src/main/java/com/ycl/task/MonitorTask.java @@ -58,6 +58,7 @@ private RedisTemplate redisTemplate; //鍚屾mongodb涓�鏈轰竴妗e埌鏁版嵁搴� + @Transactional(rollbackFor = Exception.class) public void synchronize() { log.info("寮�濮嬪悓姝ongodb涓�鏈轰竴妗e埌鏁版嵁搴�"); Date yesterday = DateUtils.addDays(new Date(), -1); diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml index 7f624f8..533e15c 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml @@ -9,6 +9,7 @@ <result property="deptId" column="dept_id" /> <result property="examineTag" column="examine_tag" /> <result property="createTime" column="create_time" /> + <result property="score" column="score" /> <result property="viewConnectStability" column="view_connect_stability" /> <result property="siteOnline" column="site_online" /> <result property="deviceDirectoryConsistent" column="device_directory_consistent" /> @@ -26,29 +27,25 @@ </sql> <select id="selectCheckIndexCarList" resultMap="CheckIndexCarResult"> - select tcic.*,sd.dept_name + select tcic.*,sd.dept_name,tcs.score from t_check_index_car tcic left join sys_dept sd on tcic.dept_id = sd.dept_id + left join t_check_score tcs on tcic.id = tcs.index_id <where> <if test="deptId != null "> and tcic.dept_id = #{deptId}</if> <if test="examineTag != null "> and examine_tag = #{examineTag}</if> <if test="date != null "> and date_format(tcic.create_time,'%Y-%m') = #{date}</if> <if test="day != null "> and date(tcic.create_time) = #{day}</if> - <if test="viewConnectStability != null "> and view_connect_stability = #{viewConnectStability}</if> - <if test="siteOnline != null "> and site_online = #{siteOnline}</if> - <if test="deviceDirectoryConsistent != null "> and device_directory_consistent = #{deviceDirectoryConsistent}</if> - <if test="vehicleInformationCollectionAccuracy != null "> and vehicle_information_collection_accuracy = #{vehicleInformationCollectionAccuracy}</if> - <if test="vehicleCaptureIntegrity != null "> and vehicle_capture_integrity = #{vehicleCaptureIntegrity}</if> - <if test="vehicleCaptureAccuracy != null "> and vehicle_capture_accuracy = #{vehicleCaptureAccuracy}</if> - <if test="vehicleTimingAccuracy != null "> and vehicle_timing_accuracy = #{vehicleTimingAccuracy}</if> - <if test="vehicleUploadTimeliness != null "> and vehicle_upload_timeliness = #{vehicleUploadTimeliness}</if> - <if test="vehicleUrlAvailability != null "> and vehicle_url_availability = #{vehicleUrlAvailability}</if> - <if test="vehiclePictureAvailability != null "> and vehicle_picture_availability = #{vehiclePictureAvailability}</if> <if test="params.publish != null and params.publish != ''">and publish = #{params.publish}</if> - <if test="deptIds != null ">and tcic.dept_id in + <if test="deptIds != null and deptIds.size()>0">and tcic.dept_id in <foreach collection="deptIds" separator="," open="(" close=")" item="deptId"> #{deptId} </foreach> </if> + <if test="examineTags != null and examineTags.size()>0">and tcic.examine_tag in + <foreach collection="examineTags" separator="," open="(" close=")" item="examineTag"> + #{examineTag} + </foreach> + </if> </where> </select> diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml index 01203f4..abd8b07 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml @@ -24,27 +24,25 @@ </sql> <select id="selectCheckIndexFaceList" resultMap="CheckIndexFaceResult"> - select tcif.*,sd.dept_name + select tcif.*,sd.dept_name,tcs.score from t_check_index_face tcif left join sys_dept sd on tcif.dept_id = sd.dept_id + left join t_check_score tcs on tcif.id = tcs.index_id <where> <if test="deptId != null "> and tcif.dept_id = #{deptId}</if> <if test="examineTag != null "> and examine_tag = #{examineTag}</if> <if test="date != null "> and date_format(tcif.create_time,'%Y-%m') = #{date}</if> <if test="day != null "> and date(tcif.create_time) = #{day}</if> - <if test="viewConnectStability != null "> and view_connect_stability = #{viewConnectStability}</if> - <if test="siteOnline != null "> and site_online = #{siteOnline}</if> - <if test="deviceDirectoryConsistent != null "> and device_directory_consistent = #{deviceDirectoryConsistent}</if> - <if test="faceInformationCollectionAccuracy != null "> and face_information_collection_accuracy = #{faceInformationCollectionAccuracy}</if> - <if test="facePictureQualification != null "> and face_picture_qualification = #{facePictureQualification}</if> - <if test="faceTimingAccuracy != null "> and face_timing_accuracy = #{faceTimingAccuracy}</if> - <if test="faceUploadTimeliness != null "> and face_upload_timeliness = #{faceUploadTimeliness}</if> - <if test="facePictureAvailability != null "> and face_picture_availability = #{facePictureAvailability}</if> <if test="params.publish != null and params.publish != ''">and publish = #{params.publish}</if> <if test="deptIds != null ">and tcif.dept_id in <foreach collection="deptIds" separator="," open="(" close=")" item="deptId"> #{deptId} </foreach> </if> + <if test="examineTags != null and examineTags.size()>0">and tcif.examine_tag in + <foreach collection="examineTags" separator="," open="(" close=")" item="examineTag"> + #{examineTag} + </foreach> + </if> </where> </select> diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml index eb5d13e..380a48e 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml @@ -30,34 +30,26 @@ </sql> <select id="selectCheckIndexVideoList" parameterType="CheckIndexVideo" resultMap="CheckIndexVideoResult"> - select tciv.*,sd.dept_name + select tciv.*,sd.dept_name,tcs.score from t_check_index_video tciv left join sys_dept sd on tciv.dept_id = sd.dept_id + left join t_check_score tcs on tciv.id = tcs.index_id <where> <if test="deptId != null "> and tciv.dept_id = #{deptId}</if> <if test="examineTag != null "> and examine_tag = #{examineTag}</if> <if test="date != null "> and date_format(tciv.create_time,'%Y-%m') = #{date}</if> <if test="day != null "> and date(tciv.create_time) = #{day}</if> <if test="createTime != null "> and date(tciv.create_time) = #{createTime}</if> - <if test="platformOnline != null "> and platform_online = #{platformOnline}</if> - <if test="monitorQualification != null "> and monitor_qualification = #{monitorQualification}</if> - <if test="monitorRegistration != null "> and monitor_registration = #{monitorRegistration}</if> - <if test="archivesRate != null "> and archives_rate = #{archivesRate}</if> - <if test="siteOnline != null "> and site_online = #{siteOnline}</if> - <if test="videoAvailable != null "> and video_available = #{videoAvailable}</if> - <if test="ministrySiteOnline != null "> and ministry_site_online = #{ministrySiteOnline}</if> - <if test="ministryVideoAvailable != null "> and ministry_video_available = #{ministryVideoAvailable}</if> - <if test="keySiteOnline != null "> and key_site_online = #{keySiteOnline}</if> - <if test="keyVideoAvailable != null "> and key_video_available = #{keyVideoAvailable}</if> - <if test="keyAnnotationAccuracy != null "> and key_annotation_accuracy = #{keyAnnotationAccuracy}</if> - <if test="keyTimingAccuracy != null "> and key_timing_accuracy = #{keyTimingAccuracy}</if> - <if test="keyCommandImageOnline != null "> and key_command_image_online = #{keyCommandImageOnline}</if> - <if test="imageResourceSecurity != null "> and image_resource_security = #{imageResourceSecurity}</if> <if test="params.publish != null and params.publish != ''">and publish = #{params.publish}</if> <if test="deptIds != null ">and tciv.dept_id in <foreach collection="deptIds" separator="," open="(" close=")" item="deptId"> #{deptId} </foreach> </if> + <if test="examineTags != null and examineTags.size()>0">and tciv.examine_tag in + <foreach collection="examineTags" separator="," open="(" close=")" item="examineTag"> + #{examineTag} + </foreach> + </if> </where> </select> diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml index bede2bc..b06801c 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml @@ -137,9 +137,9 @@ </select> <insert id="saveBatch"> - insert into t_check_score (score,dept_id,template_id,examine_tag,examine_category,create_time) values + insert into t_check_score (score,dept_id,template_id,index_id,examine_tag,examine_category,create_time) values <foreach collection="scoreList" separator="," item="score"> - (#{score.score},#{score.deptId},#{score.templateId},#{score.examineTag},#{score.examineCategory},#{score.createTime}) + (#{score.score},#{score.deptId},#{score.templateId},#{score.indexId},#{score.examineTag},#{score.examineCategory},#{score.createTime}) </foreach> </insert> diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml index 2893c43..384f4bd 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/CheckTemplateRuleMapper.xml @@ -72,4 +72,13 @@ where tctr.check_template_id = #{checkTemplateId} </select> + <select id="getAllRuleTemplate" resultType="com.ycl.platform.domain.vo.RuleExcelVO"> + select cr.id as ruleId,ct.examine_category as examineCategory,ct.examine_tag as examineTag,ct.template_name as templateName,cr.rule_name as ruleName,ctr.weight as weight,cr.rule_description as ruleDescription + from t_check_template_rule ctr + left join t_check_template ct on ctr.check_template_id = ct.id + left join t_check_rule cr on ctr.check_rule_id = cr.id + where ct.status = 0 and ct.deleted = 0 + + </select> + </mapper> -- Gitblit v1.8.0