| | |
| | | import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.linghu.config.FinalStatus; |
| | | import com.linghu.mapper.ReferenceMapper; |
| | | import com.linghu.model.common.ResponseResult; |
| | | import com.linghu.model.dto.ExportFeedDTO; |
| | |
| | | import com.linghu.model.dto.ExportGetResultDTO; |
| | | import com.linghu.model.dto.ExportStaticsDTO; |
| | | import com.linghu.model.entity.Keyword; |
| | | import com.linghu.model.entity.KeywordTask; |
| | | import com.linghu.model.entity.Platform; |
| | | import com.linghu.model.entity.Reference; |
| | | import com.linghu.model.excel.FeedExportExcel; |
| | |
| | | import com.linghu.service.KeywordService; |
| | | import com.linghu.mapper.KeywordMapper; |
| | | |
| | | import com.linghu.service.KeywordTaskService; |
| | | import com.linghu.service.PlatformService; |
| | | import com.linghu.service.ReferenceService; |
| | | import org.apache.poi.ss.usermodel.DataValidation; |
| | |
| | | private ReferenceMapper referenceMapper; |
| | | @Autowired |
| | | private PlatformService platformService; |
| | | @Autowired |
| | | private KeywordTaskService keywordTaskService; |
| | | |
| | | @Override |
| | | public ResponseResult<KeywordStaticsListVO> statics(Integer keywordId, Integer questionId) { |
| | |
| | | if (keyword == null) { |
| | | return ResponseResult.error("关键词不存在"); |
| | | } |
| | | if (!"completed".equals(keyword.getStatus())) { |
| | | if (!FinalStatus.COMPLETED.getValue().equals(keyword.getStatus())) { |
| | | return ResponseResult.success(); |
| | | } |
| | | List<KeywordStaticsVO> statics = this.getBaseMapper().statics(keywordId, questionId, keyword.getNum()); |
| | |
| | | if (keyword == null) { |
| | | return ResponseResult.error("关键词不存在"); |
| | | } |
| | | if (!"completed".equals(keyword.getStatus())) { |
| | | if (!FinalStatus.COMPLETED.getValue().equals(keyword.getStatus())) { |
| | | return ResponseResult.error("关键词采集未完成"); |
| | | } |
| | | List<PlatformProportionVO> result = this.getBaseMapper().getResultByTypeId(keywordId, questionId, |
| | |
| | | if (keyword == null) { |
| | | return ResponseResult.error("关键词不存在"); |
| | | } |
| | | if (!"completed".equals(keyword.getStatus())) { |
| | | if (!FinalStatus.COMPLETED.getValue().equals(keyword.getStatus())) { |
| | | return ResponseResult.error("关键词采集未完成"); |
| | | } |
| | | |
| | |
| | | GetTimeVO vo = new GetTimeVO(); |
| | | Keyword keyword = this.getById(keywordId); |
| | | |
| | | LambdaQueryWrapper<Reference> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Reference::getKeyword_id, keywordId); |
| | | if (questionId != null) { |
| | | queryWrapper.eq(Reference::getQuestion_id, questionId); |
| | | } |
| | | queryWrapper.eq(Reference::getNum,keyword.getNum()); |
| | | LambdaQueryWrapper<KeywordTask> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(KeywordTask::getKeyword_id, keywordId); |
| | | queryWrapper.eq(KeywordTask::getNum,keyword.getNum()); |
| | | |
| | | List<Reference> list = referenceService.list(queryWrapper); |
| | | List<KeywordTask> list = keywordTaskService.list(queryWrapper); |
| | | if (null != list && !list.isEmpty()) { |
| | | vo.setNow(list.get(0).getCreate_time()); |
| | | } |
| | | //首次 |
| | | LambdaQueryWrapper<Reference> queryWrapper2 = new LambdaQueryWrapper<>(); |
| | | queryWrapper2.eq(Reference::getKeyword_id, keywordId); |
| | | if (questionId != null) { |
| | | queryWrapper2.eq(Reference::getQuestion_id, questionId); |
| | | } |
| | | queryWrapper2.eq(Reference::getNum,1); |
| | | LambdaQueryWrapper<KeywordTask> queryWrapper2 = new LambdaQueryWrapper<>(); |
| | | queryWrapper2.eq(KeywordTask::getKeyword_id, keywordId); |
| | | queryWrapper2.eq(KeywordTask::getNum,1); |
| | | |
| | | List<Reference> list2 = referenceService.list(queryWrapper2); |
| | | List<KeywordTask> list2 = keywordTaskService.list(queryWrapper2); |
| | | if (null != list2 && !list2.isEmpty()) { |
| | | vo.setFirst(list2.get(0).getCreate_time()); |
| | | } |