|
|
|
@ -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<TaskKnowledgePointEntity>().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<TaskKnowledgeClusterEntity>().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<TaskKnowledgePointEntity>().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<TaskKnowledgeClusterEntity>().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; |
|
|
|
|