| | |
| | | import com.linghu.model.dto.KeywordDto; |
| | | import com.linghu.model.dto.OrderDto; |
| | | import com.linghu.model.entity.Keyword; |
| | | import com.linghu.model.entity.KeywordTask; |
| | | import com.linghu.model.entity.Orders; |
| | | import com.linghu.model.entity.Question; |
| | | import com.linghu.service.KeywordService; |
| | | import com.linghu.service.KeywordTaskService; |
| | | import com.linghu.service.OrderService; |
| | | import com.linghu.mapper.OrderMapper; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.linghu.service.QuestionService; |
| | |
| | | private QuestionService questionService; |
| | | @Autowired |
| | | private OrderMapper orderMapper; |
| | | @Autowired |
| | | private KeywordTaskService keywordTaskService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | for (Keyword keyword : keywords) { |
| | | KeywordDto dto = new KeywordDto(); |
| | | BeanUtils.copyProperties(keyword, dto); |
| | | LambdaQueryWrapper<KeywordTask> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(KeywordTask::getKeyword_id, keyword.getKeyword_id()); |
| | | List<KeywordTask> keywordTasks = keywordTaskService.list(queryWrapper); |
| | | |
| | | // 提取 task_id 列表 |
| | | List<String> taskIdList = keywordTasks.stream() |
| | | .map(KeywordTask::getTask_id) |
| | | .filter(Objects::nonNull) |
| | | .collect(Collectors.toList()); |
| | | |
| | | dto.setTaskIdList(taskIdList); // 设置 task_id 列表 |
| | | // 查询该关键词下的所有提问词 |
| | | List<Question> questions = questionService.lambdaQuery() |
| | | .eq(Question::getKeyword_id, keyword.getKeyword_id()) |
| | |
| | | } |
| | | return keywordDtos; |
| | | } |
| | | |
| | | @Override |
| | | public Page<String> getClientList(String clientName, Integer pageNum, Integer pageSize) { |
| | | Page<Orders> page = new Page<>(pageNum, pageSize); |