diff --git a/src/main/java/com/project/information/application/impl/KnowledgePointApplicationServiceImpl.java b/src/main/java/com/project/information/application/impl/KnowledgePointApplicationServiceImpl.java index 80ad13f..ba92427 100644 --- a/src/main/java/com/project/information/application/impl/KnowledgePointApplicationServiceImpl.java +++ b/src/main/java/com/project/information/application/impl/KnowledgePointApplicationServiceImpl.java @@ -89,7 +89,7 @@ public class KnowledgePointApplicationServiceImpl implements KnowledgePointAppli } catch (Exception e) { log.error("解析异常, ID:{}", id, e); // 失败更新状态 - updateStatusInformation(null, InformationParseStatusEnum.Fail.getValue(), id); + updateStatusInformation(null, InformationParseStatusEnum.Success.getValue(), id); } // 聚类 List list = knowledgePointBaseService.lambdaQuery() diff --git a/src/main/java/com/project/interaction/domain/service/impl/SaveClusterDomainServiceImpl.java b/src/main/java/com/project/interaction/domain/service/impl/SaveClusterDomainServiceImpl.java index 3845049..63bed00 100644 --- a/src/main/java/com/project/interaction/domain/service/impl/SaveClusterDomainServiceImpl.java +++ b/src/main/java/com/project/interaction/domain/service/impl/SaveClusterDomainServiceImpl.java @@ -83,6 +83,8 @@ public class SaveClusterDomainServiceImpl implements SaveClusterDomainService { // 批量插入 knowledgePointBaseService.updateBatchById(kpList); } + Thread.sleep(60000); + InformationEntity byId = informationBaseService.getById(informationId); byId.setParseStatus(InformationParseStatusEnum.Success.getValue()); informationBaseService.updateById(byId); @@ -138,7 +140,7 @@ public class SaveClusterDomainServiceImpl implements SaveClusterDomainService { produceDTOList.add(buildDTO(kp.getId() , QuestionSourceTypeEnum.Single_Concept, (int) Math.ceil(targetNum * questionTypeMap.get(QuestionTypeEnum.TRUE_FALSE.name())), (int) Math.ceil(targetNum * questionTypeMap.get(QuestionTypeEnum.SINGLE_CHOICE.name())), - (int) Math.ceil(targetNum * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name())))); + 0)); } if (clusterEntity.getClusterSize() > 1) { // 簇生成目标量 diff --git a/src/main/java/com/project/question/domain/service/impl/QuestionInventoryDomainServiceImpl.java b/src/main/java/com/project/question/domain/service/impl/QuestionInventoryDomainServiceImpl.java index 95b07fe..f67bf9d 100644 --- a/src/main/java/com/project/question/domain/service/impl/QuestionInventoryDomainServiceImpl.java +++ b/src/main/java/com/project/question/domain/service/impl/QuestionInventoryDomainServiceImpl.java @@ -1,5 +1,6 @@ package com.project.question.domain.service.impl; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.project.base.domain.result.Result; import com.project.question.domain.entity.TaskKnowledgeClusterEntity; @@ -57,6 +58,9 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma new LambdaQueryWrapper().eq(TaskKnowledgePointEntity::getTaskId , taskId)); for (TaskKnowledgePointEntity kp : kpList) { for (QuestionTypeEnum questionType : QuestionTypeEnum.values()) { + if (QuestionTypeEnum.MULTIPLE_CHOICE.equals(questionType)) { + continue; + } checkAndProduce(kp.getId() , questionType , watermark , targetLine); } } @@ -65,6 +69,9 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma new LambdaQueryWrapper().eq(TaskKnowledgeClusterEntity::getTaskId, taskId)); for (TaskKnowledgeClusterEntity cluster : clusterList) { + if (cluster.getClusterSize() < 2) { + continue; + } int w = cluster.getClusterSize(); // 簇水位线: 1.0 * U * W int clusterWatermark = watermark * w; @@ -97,6 +104,9 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma new LambdaQueryWrapper().eq(TaskKnowledgePointEntity::getTaskId , taskId)); for (TaskKnowledgePointEntity kp : kpList) { for (QuestionTypeEnum questionType : QuestionTypeEnum.values()) { + if (QuestionTypeEnum.MULTIPLE_CHOICE.equals(questionType)) { + continue; + } int currentStock = questionKpMapper.countAvailableByKp(kp.getId(), questionType.getValue()); if (currentStock < watermark){ flage = false; @@ -109,6 +119,9 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma new LambdaQueryWrapper().eq(TaskKnowledgeClusterEntity::getTaskId, taskId)); for (TaskKnowledgeClusterEntity cluster : clusterList) { + if (cluster.getClusterSize() < 2) { + continue; + } int w = cluster.getClusterSize(); // 簇水位线: 1.0 * U * W int clusterWatermark = watermark * w;