fix: 修复数据分析页面核心指标统计,分离待处理和进行中任务计数
This commit is contained in:
parent
66c6507385
commit
8f00871b6d
@ -379,8 +379,14 @@ public class AnalyticsService {
|
||||
.filter(t -> "completed".equals(t.getStatus()))
|
||||
.count();
|
||||
|
||||
// 待处理:只包含 pending 状态(不包含 in_progress)
|
||||
int pendingDemands = (int) tasks.stream()
|
||||
.filter(t -> Arrays.asList("pending", "in_progress", "submitted").contains(t.getStatus()))
|
||||
.filter(t -> "pending".equals(t.getStatus()))
|
||||
.count();
|
||||
|
||||
// 进行中:只包含 in_progress 状态
|
||||
int inProgressDemands = (int) tasks.stream()
|
||||
.filter(t -> "in_progress".equals(t.getStatus()))
|
||||
.count();
|
||||
|
||||
int canceledDemands = (int) tasks.stream()
|
||||
@ -423,6 +429,7 @@ public class AnalyticsService {
|
||||
.monthDemands(monthDemands)
|
||||
.completedDemands(completedDemands)
|
||||
.pendingDemands(pendingDemands)
|
||||
.inProgressDemands(inProgressDemands)
|
||||
.canceledDemands(canceledDemands)
|
||||
.totalScoreUsed(totalScoreUsed)
|
||||
.todayScoreUsed(todayScoreUsed)
|
||||
|
||||
@ -129,7 +129,8 @@ public class DemandStatisticsVO {
|
||||
private Integer weekDemands; // 本周需求数
|
||||
private Integer monthDemands; // 本月需求数
|
||||
private Integer completedDemands; // 已完成数
|
||||
private Integer pendingDemands; // 进行中数
|
||||
private Integer pendingDemands; // 待处理数(pending状态)
|
||||
private Integer inProgressDemands; // 进行中数(in_progress状态)
|
||||
private Integer canceledDemands; // 已取消数
|
||||
private BigDecimal totalScoreUsed; // 总积分消耗
|
||||
private BigDecimal todayScoreUsed; // 今日积分消耗
|
||||
|
||||
@ -707,6 +707,7 @@ const statistics = reactive<DemandStatistics>({
|
||||
monthDemands: 0,
|
||||
completedDemands: 0,
|
||||
pendingDemands: 0,
|
||||
inProgressDemands: 0,
|
||||
canceledDemands: 0,
|
||||
totalScoreUsed: 0,
|
||||
todayScoreUsed: 0,
|
||||
@ -812,8 +813,9 @@ const stageChartRef = ref<HTMLElement>()
|
||||
// 计算属性
|
||||
const overview = computed(() => statistics.overview)
|
||||
|
||||
// 进行中任务数:直接使用后端返回的 inProgressDemands
|
||||
const inProgressCount = computed(() => {
|
||||
return overview.value.totalDemands - overview.value.completedDemands - overview.value.pendingDemands - overview.value.canceledDemands
|
||||
return overview.value.inProgressDemands || 0
|
||||
})
|
||||
|
||||
const completionRate = computed(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user