From c83101eb62f5d4906b9c01ceea6b21a37f9e84d8 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 18 十一月 2025 09:24:53 +0800
Subject: [PATCH] bug修复
---
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexFace.java | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
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 0c80fc1..f41950e 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
@@ -83,7 +83,8 @@
//杞崲鎴愬瓧绗︿覆鐢ㄤ簬excel瀵煎嚭
public static CheckIndexFaceVO getExcelVo(@NonNull CheckIndexFace checkIndexFace) {
CheckIndexFaceVO checkIndexFaceVo = new CheckIndexFaceVO();
- checkIndexFaceVo.setScore(checkIndexFace.getScore());
+ checkIndexFaceVo.setNum(checkIndexFace.getNum());
+ checkIndexFaceVo.setScore(checkIndexFace.getScore().setScale(2,RoundingMode.HALF_UP));
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
//閬垮厤鍚堣琛屾姤閿�(鍚堣鏁版嵁 缂哄皯createTimeStr瀛楁 鐩存帴灏哻reateTimeStr璁剧疆涓�"鍚堣")
if (StringUtils.isEmpty(checkIndexFace.getCreateTimeStr())) {
@@ -92,7 +93,7 @@
checkIndexFaceVo.setCreateTimeStr(checkIndexFace.getCreateTimeStr());
}
checkIndexFaceVo.setDeptName(checkIndexFace.getDeptName());
- checkIndexFaceVo.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexFace.getExamineTag()) ? "鐪佸巺鑰冩牳" : "鍖哄幙鑰冩牳");
+ checkIndexFaceVo.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexFace.getExamineTag()) ? "鐪佸巺鑰冩牳" : CheckConstants.Examine_Tag_County.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) + "%");
checkIndexFaceVo.setFacePictureAvailabilityText(checkIndexFace.getFacePictureAvailability().multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP) + "%");
@@ -106,6 +107,7 @@
}
/** 鐢ㄤ簬瀵煎嚭璁$畻骞冲潎鍊� */
public static CheckIndexFace calculateAverage(List<CheckIndexFace> checkIndexFaces) {
+ Integer numSum = 0;
BigDecimal scoreSum = BigDecimal.ZERO;
BigDecimal totalViewConnectStability = BigDecimal.ZERO;
BigDecimal totalSiteOnline = BigDecimal.ZERO;
@@ -119,6 +121,7 @@
int count = checkIndexFaces.size();
for (CheckIndexFace indexFace : checkIndexFaces) {
+ numSum = numSum + (indexFace.getNum() == null? 0:indexFace.getNum());
scoreSum = scoreSum.add(indexFace.getScore() == null ? BigDecimal.ZERO : indexFace.getScore());
totalViewConnectStability = totalViewConnectStability.add(indexFace.getViewConnectStability());
totalSiteOnline = totalSiteOnline.add(indexFace.getSiteOnline());
@@ -133,7 +136,8 @@
result.setCreateTimeStr("鍚堣");
result.setDeptName(checkIndexFaces.get(0).getDeptName());
result.setExamineTag(checkIndexFaces.get(0).getExamineTag());
- result.setScore(scoreSum);
+ result.setNum(numSum/count);
+ result.setScore(scoreSum.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP));
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));
--
Gitblit v1.8.0