From 29fbb07e30eab4b8092a7600a0ef0e39db1de1f2 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期三, 25 九月 2024 14:35:00 +0800
Subject: [PATCH] 工单号生成修改
---
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexVideo.java | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
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 6408f46..bed934e 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
@@ -121,13 +121,14 @@
//杞崲鎴愬瓧绗︿覆鐢ㄤ簬excel瀵煎嚭
public static CheckIndexVideoVO getExcelVo(@NonNull CheckIndexVideo checkIndexVideo) {
CheckIndexVideoVO checkIndexVideoVO = new CheckIndexVideoVO();
- checkIndexVideoVO.setScore(checkIndexVideo.getScore());
+ checkIndexVideoVO.setNum(checkIndexVideo.getNum());
+ checkIndexVideoVO.setScore(checkIndexVideo.getScore().setScale(2, RoundingMode.HALF_UP));
checkIndexVideoVO.setDeptName(checkIndexVideo.getDeptName());
//閬垮厤鍚堣琛屾姤閿�(鍚堣鏁版嵁 缂哄皯createTimeStr瀛楁 鐩存帴灏哻reateTimeStr璁剧疆涓�"鍚堣")
if (StringUtils.isEmpty(checkIndexVideo.getCreateTimeStr())) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
checkIndexVideoVO.setCreateTimeStr(format.format(checkIndexVideo.getCreateTime()));
- }else {
+ } else {
checkIndexVideoVO.setCreateTimeStr(checkIndexVideo.getCreateTimeStr());
}
checkIndexVideoVO.setExamineTagStr(CheckConstants.Examine_Tag_Province.equals(checkIndexVideo.getExamineTag()) ? "鐪佸巺鑰冩牳" : "鍖哄幙鑰冩牳");
@@ -153,6 +154,7 @@
* 鐢ㄤ簬瀵煎嚭璁$畻骞冲潎鍊�
*/
public static CheckIndexVideo calculateAverage(List<CheckIndexVideo> videos) {
+ Integer numSum = 0;
BigDecimal scoreSum = BigDecimal.ZERO;
BigDecimal totalPlatformOnline = BigDecimal.ZERO;
BigDecimal totalMonitorQualification = BigDecimal.ZERO;
@@ -171,6 +173,7 @@
int count = videos.size();
for (CheckIndexVideo video : videos) {
+ numSum = numSum + (video.getNum() == null? 0:video.getNum());
scoreSum = scoreSum.add(video.getScore() == null ? BigDecimal.ZERO : video.getScore());
totalPlatformOnline = totalPlatformOnline.add(video.getPlatformOnline());
totalMonitorQualification = totalMonitorQualification.add(video.getMonitorQualification());
@@ -193,7 +196,8 @@
averageVideo.setCreateTimeStr("鍚堣");
averageVideo.setDeptName(videos.get(0).getDeptName());
averageVideo.setExamineTag(videos.get(0).getExamineTag());
- averageVideo.setScore(scoreSum);
+ averageVideo.setNum(numSum/count);
+ averageVideo.setScore(scoreSum.divide(BigDecimal.valueOf(count), 2, RoundingMode.HALF_UP));
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));
--
Gitblit v1.8.0