fix: 使用taskSubType显示一级分类(新品/优化/改图等)

This commit is contained in:
Your Name 2026-01-07 20:13:42 +08:00
parent 5c1579fa3f
commit a56f504871

View File

@ -1099,9 +1099,23 @@ public class TaskItemService {
}
}
// 主任务的任务类型信息(显示一级分类如"新品"、"优化")
// 主任务的任务类型信息
groupInfo.put("taskTypeId", mainTask.getTaskTypeId());
if (mainTask.getTaskTypeId() != null) {
// 使用taskSubType显示一级分类(新品/优化/改图等)
String taskSubType = mainTask.getTaskSubType();
if (taskSubType != null && !taskSubType.isEmpty()) {
// 转换为中文显示
String taskTypeName = switch (taskSubType) {
case "new" -> "新品";
case "optimize" -> "优化";
case "redesign" -> "改图";
case "other" -> "其他";
default -> taskSubType;
};
groupInfo.put("taskTypeName", taskTypeName);
groupInfo.put("taskSubType", taskSubType);
} else if (mainTask.getTaskTypeId() != null) {
// 兼容:如果没有taskSubType,使用taskTypeId查询
com.designhub.entity.DemandType taskType = demandTypeMapper.selectById(mainTask.getTaskTypeId());
if (taskType != null) {
groupInfo.put("taskTypeName", taskType.getName());