fix: 1. 任务数量上限从100提高到10000 2. 流水线任务正确设置主任务的总数量

This commit is contained in:
Your Name 2026-01-15 17:02:20 +08:00
parent 6f522a9b95
commit 6001679eac
2 changed files with 9 additions and 3 deletions

View File

@ -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());

View File

@ -98,7 +98,7 @@
<a-input-number
v-model:value="item.quantity"
:min="1"
:max="100"
:max="10000"
placeholder="数量"
size="large"
style="width: 100%"