debug: 添加延误扣分查询的调试日志

This commit is contained in:
Your Name 2026-01-13 17:55:21 +08:00
parent d15f8113a8
commit 7e2845efed

View File

@ -1333,14 +1333,22 @@ public class AnalyticsService {
.le(Task::getActualEndTime, endTime)
);
log.info("获取设计师扣分明细 - 用户: {}, 月份: {}, 已完成任务数: {}",
designer.getRealName() != null ? designer.getRealName() : designer.getUsername(),
currentMonth, completedTasks.size());
// 获取扣分比例配置
BigDecimal deductionRate = getDeductionRate(designer.getDeptId(), currentMonth);
log.info("扣分比例: {}%", deductionRate);
// 计算延误扣分明细
List<DeductionDetailVO.DelayDeductionItem> delayDeductions = new ArrayList<>();
BigDecimal totalDelayDeduction = BigDecimal.ZERO;
for (Task task : completedTasks) {
log.debug("检查任务: taskNo={}, deadline={}, actualEndTime={}",
task.getTaskNo(), task.getDeadline(), task.getActualEndTime());
if (task.getDeadline() != null && task.getActualEndTime() != null
&& task.getActualEndTime().isAfter(task.getDeadline())) {
@ -1370,6 +1378,9 @@ public class AnalyticsService {
totalDelayDeduction = totalDelayDeduction.add(taskDeduction);
log.info("发现延误任务: taskNo={}, 任务积分={}, 延误小时={}, 扣分={}",
task.getTaskNo(), taskScore, overdueHours, taskDeduction);
delayDeductions.add(DeductionDetailVO.DelayDeductionItem.builder()
.taskId(task.getId())
.taskNo(task.getTaskNo())
@ -1386,6 +1397,8 @@ public class AnalyticsService {
}
}
log.info("延误扣分总数: {}, 延误扣分记录数: {}", totalDelayDeduction, delayDeductions.size());
// 获取进度未更新扣分明细
List<DeductionDetailVO.ProgressDeductionItem> progressDeductions = new ArrayList<>();
BigDecimal totalProgressDeduction = BigDecimal.ZERO;