From 8fc0241701fbc1e942064576d02458921bde9388 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期三, 19 二月 2025 09:48:19 +0800
Subject: [PATCH] 运维监控报表接口统计sql重新编写
---
ycl-server/src/main/java/com/ycl/task/ContractResultTask.java | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/task/ContractResultTask.java b/ycl-server/src/main/java/com/ycl/task/ContractResultTask.java
index a20c5bd..ce627db 100644
--- a/ycl-server/src/main/java/com/ycl/task/ContractResultTask.java
+++ b/ycl-server/src/main/java/com/ycl/task/ContractResultTask.java
@@ -9,6 +9,7 @@
import com.ycl.utils.DateUtils;
import com.ycl.utils.bean.BeanUtils;
import enumeration.general.CalculateReportStatusEnum;
+import enumeration.general.PublishType;
import lombok.Data;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -48,23 +49,28 @@
// 涓婁釜鏈堟墸鍒嗚褰�
List<ContractScore> contractScore = contractScoreService.getDateRangeScoreByContractId(tContract.getId(), startTime, endTime);
// 鏂板鑰冩牳缁撴灉
+ //鑾峰彇涓婁釜鏈堟椂闂�
+ Calendar calendar = Calendar.getInstance();
+ calendar.add(Calendar.MONTH, -1);
ContractResult contractResult = getCheckResult(tContract, contractScore);
+ contractResult.setWhichMonth(calendar.get(Calendar.MONTH)+1);
+ contractResult.setWhichYear(calendar.get(Calendar.YEAR));
checkResultService.save(contractResult);
- // 鏂板鑰冩牳缁撴灉璁板綍
- List<ContractResultRecord> contractResultRecord = getContractResultRecord(contractScore, contractResult);
- checkResultService.saveBatchRecord(contractResultRecord);
+// // 鏂板鑰冩牳缁撴灉璁板綍
+// List<ContractResultRecord> contractResultRecord = getContractResultRecord(contractScore, contractResult);
+// checkResultService.saveBatchRecord(contractResultRecord);
// 鏂板鏍哥畻鏄庣粏璁板綍
CalculateRecord calculateRecord = new CalculateRecord();
- calculateRecord.setScore(contractResult.getScore());
+ //鏀逛负鐩存帴鍘绘煡
+// calculateRecord.setScore(contractResult.getScore());
calculateRecord.setContractId(Integer.parseInt(tContract.getId()+""));
calculateRecord.setCreateTime(new Date());
calculateRecord.setUpdateTime(new Date());
- calculateRecord.setStatus(CalculateReportStatusEnum.NOT_PUBLISH.getValue());
- Calendar calendar = Calendar.getInstance();
+ calculateRecord.setStatus(PublishType.UNPUBLISHED.getCode());
+
calculateRecord.setWhichYear(calendar.get(Calendar.YEAR));
calculateRecord.setWhichMonth(calendar.get(Calendar.MONTH)+1);
calculateRecordMapper.insert(calculateRecord);
-
}
}
@@ -100,7 +106,8 @@
contractResult.setContractId(tContract.getId());
contractResult.setPublish(0);
contractResult.setCheckTime(DateUtils.getNowDate());
- contractResult.setScore(contractScore.isEmpty() ? new BigDecimal("100") : new BigDecimal("100").subtract(contractScore.stream().map(ContractScore::getScore).reduce(BigDecimal::add).get()));
+ //鏀逛负鐩存帴鍘绘煡
+// contractResult.setScore(contractScore.isEmpty() ? new BigDecimal("100") : new BigDecimal("100").subtract(contractScore.stream().map(ContractScore::getScore).reduce(BigDecimal::add).get()));
return contractResult;
}
--
Gitblit v1.8.0