From 756b51767378bc86aa03ba09555d959cfb665bd9 Mon Sep 17 00:00:00 2001 From: luoweijian <1329394916@qq.com> Date: Sat, 21 Mar 2026 10:07:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=87=E6=A1=A3=E8=81=9A?= =?UTF-8?q?=E7=B1=BB=E5=AE=9E=E4=BD=93=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/KnowledgePointApplicationServiceImpl.java | 2 +- .../service/impl/SaveClusterDomainServiceImpl.java | 4 +++- .../impl/QuestionInventoryDomainServiceImpl.java | 13 +++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) 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;