From e498e084b2ccc08afc7a7bf3a83e6eb462c1629b Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 30 九月 2024 11:29:26 +0800
Subject: [PATCH] 工单取图片优化
---
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexFace.java | 8 ++++++--
1 files changed, 6 insertions(+), 2 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..13e87b4 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())) {
@@ -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