From 6001679eacb6a49d3fcd9c0dce952f1e21a926b7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 15 Jan 2026 17:02:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=201.=20=E4=BB=BB=E5=8A=A1=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E4=B8=8A=E9=99=90=E4=BB=8E100=E6=8F=90=E9=AB=98?= =?UTF-8?q?=E5=88=B010000=202.=20=E6=B5=81=E6=B0=B4=E7=BA=BF=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=AD=A3=E7=A1=AE=E8=AE=BE=E7=BD=AE=E4=B8=BB=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=9A=84=E6=80=BB=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/designhub/service/TaskService.java | 10 ++++++++-- frontend/src/views/CreateTask.vue | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/com/designhub/service/TaskService.java b/backend/src/main/java/com/designhub/service/TaskService.java index 81b05ea..e4ba5af 100644 --- a/backend/src/main/java/com/designhub/service/TaskService.java +++ b/backend/src/main/java/com/designhub/service/TaskService.java @@ -251,9 +251,10 @@ public class TaskService { throw new BusinessException(ResultCode.PARAM_ERROR, "流水线任务至少需要一个子任务"); } - // 计算总积分和工时(使用BigDecimal保留小数精度) + // 计算总积分、工时和数量(使用BigDecimal保留小数精度) BigDecimal totalScoreDecimal = BigDecimal.ZERO; double totalHours = 0; + int totalQuantity = 0; for (com.designhub.dto.PipelineTaskDTO.TaskItemDTO itemDto : dto.getItems()) { var demandType = configService.getDemandTypeById(itemDto.getTaskTypeId()); if (demandType == null) { @@ -265,6 +266,7 @@ public class TaskService { totalScoreDecimal = totalScoreDecimal.add(itemScore); totalHours += itemHours; + totalQuantity += itemDto.getQuantity(); } // 保留2位小数 @@ -297,6 +299,7 @@ public class TaskService { task.setPipelineMode(dto.getPipelineMode()); task.setScore(totalScoreDecimal); task.setEstimatedHours(BigDecimal.valueOf(totalHours)); + task.setQuantity(totalQuantity); task.setBrandId(dto.getBrandId()); task.setCategoryId(dto.getCategoryId()); task.setPlatformId(dto.getPlatformId()); @@ -1337,9 +1340,10 @@ public class TaskService { throw new BusinessException(ResultCode.PARAM_ERROR, "流水线任务至少需要一个子任务"); } - // 计算总积分和工时(使用BigDecimal保留小数精度) + // 计算总积分、工时和数量(使用BigDecimal保留小数精度) BigDecimal totalScoreDecimal = BigDecimal.ZERO; double totalHours = 0; + int totalQuantity = 0; for (com.designhub.dto.PipelineTaskDTO.TaskItemDTO itemDto : dto.getItems()) { var demandType = configService.getDemandTypeById(itemDto.getTaskTypeId()); if (demandType == null) { @@ -1352,6 +1356,7 @@ public class TaskService { totalScoreDecimal = totalScoreDecimal.add(itemScore); totalHours += itemHours; + totalQuantity += itemDto.getQuantity(); } // 保留2位小数 @@ -1375,6 +1380,7 @@ public class TaskService { existTask.setPipelineMode(dto.getPipelineMode()); existTask.setScore(totalScoreDecimal); existTask.setEstimatedHours(BigDecimal.valueOf(totalHours)); + existTask.setQuantity(totalQuantity); existTask.setBrandId(dto.getBrandId()); existTask.setCategoryId(dto.getCategoryId()); existTask.setPlatformId(dto.getPlatformId()); diff --git a/frontend/src/views/CreateTask.vue b/frontend/src/views/CreateTask.vue index 390dfac..02ace8f 100644 --- a/frontend/src/views/CreateTask.vue +++ b/frontend/src/views/CreateTask.vue @@ -98,7 +98,7 @@