From da7a4d799034ca244467665827bae91ca3c0252c Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期五, 16 八月 2024 10:31:55 +0800
Subject: [PATCH] feat:数据中心展示
---
ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateReportServiceImpl.java | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateReportServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateReportServiceImpl.java
index e603c06..8020953 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateReportServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateReportServiceImpl.java
@@ -29,6 +29,7 @@
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
+import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -54,6 +55,9 @@
@Override
public Result add(CalculateReportForm form) {
CalculateReport entity = CalculateReportForm.getEntityByForm(form, null);
+ Date now = new Date();
+ entity.setCreateTime(now);
+ entity.setUpdateTime(now);
if(baseMapper.insert(entity) > 0) {
return Result.ok("娣诲姞鎴愬姛");
}
@@ -69,10 +73,11 @@
public Result update(CalculateReportForm form) {
CalculateReport entity = baseMapper.selectById(form.getId());
-
// 涓虹┖鎶汭llegalArgumentException锛屽仛鍏ㄥ眬寮傚父澶勭悊
Assert.notNull(entity, "璁板綍涓嶅瓨鍦�");
BeanUtils.copyProperties(form, entity);
+ Date now = new Date();
+ entity.setUpdateTime(now);
if (baseMapper.updateById(entity) > 0) {
return Result.ok("淇敼鎴愬姛");
}
@@ -204,7 +209,7 @@
CalculateExport calculateExport = new CalculateExport();
calculateExport.setRuleName("鍚堣");
calculateExport.setNum(list.stream().mapToInt(CalculateExport::getNum).sum());
- calculateExport.setScore(list.stream().mapToInt(CalculateExport::getScore).sum());
+ calculateExport.setScore(100 + list.stream().mapToInt(CalculateExport::getScore).sum());
list.add(calculateExport);
// 杈撳嚭鏂囦欢
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
--
Gitblit v1.8.0