Browse Source

bug修改

V1.0
luogw 1 week ago
parent
commit
ebdf665b36
  1. 6
      src/main/java/com/project/interaction/domain/service/impl/SaveClusterDomainServiceImpl.java
  2. 12
      src/main/java/com/project/question/domain/service/impl/QuestionInventoryDomainServiceImpl.java

6
src/main/java/com/project/interaction/domain/service/impl/SaveClusterDomainServiceImpl.java

@ -142,13 +142,13 @@ public class SaveClusterDomainServiceImpl implements SaveClusterDomainService {
for (TaskKnowledgePointEntity kp : taskKpList) {
// 调用题目生成方法
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())),
targetNum * (int) Math.ceil(questionTypeMap.get(QuestionTypeEnum.TRUE_FALSE.name())),
targetNum * (int) Math.ceil(questionTypeMap.get(QuestionTypeEnum.SINGLE_CHOICE.name())),
0));
}
if (clusterEntity.getClusterSize() > 1) {
// 簇生成目标量
int clusterTargetNum = (int) Math.ceil(targetNum * clusterEntity.getClusterSize() * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name()));
int clusterTargetNum = targetNum * (int) Math.ceil(clusterEntity.getClusterSize() * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name()));
produceDTOList.add(buildDTO(clusterEntity.getId(), QuestionSourceTypeEnum.Multi_Concept ,0,0, clusterTargetNum));
}
}

12
src/main/java/com/project/question/domain/service/impl/QuestionInventoryDomainServiceImpl.java

@ -59,8 +59,8 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma
continue;
}
checkAndProduce(kp.getId() , questionType ,
(int) Math.ceil(watermark * questionTypeMap.get(questionType.name())),
(int) Math.ceil(targetLine * questionTypeMap.get(questionType.name())));
watermark * (int) Math.ceil(questionTypeMap.get(questionType.name())),
targetLine * (int) Math.ceil(questionTypeMap.get(questionType.name())));
}
}
// 针对每一个簇
@ -73,9 +73,9 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma
}
int w = cluster.getClusterSize();
// 簇水位线: 1.0 * U * W
int clusterWatermark = (int) Math.ceil(watermark * w * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name()));
int clusterWatermark = watermark * (int) Math.ceil(w * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name()));
// 簇目标线: 2 * U * W
int clusterTargetLine = (int) Math.ceil(targetLine * w * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name()));
int clusterTargetLine = targetLine * (int) Math.ceil(w * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name()));
checkClusterProduce(cluster.getId(), clusterWatermark, clusterTargetLine);
}
@ -104,7 +104,7 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma
}
Map<String, Double> questionTypeMap = questionTypeProportion(task);
int targetLine = getTargetLine(task);
int targetNum = (int) Math.ceil(targetLine * questionTypeMap.get(questionType.name()));
int targetNum = targetLine * (int) Math.ceil(questionTypeMap.get(questionType.name()));
total = total + targetNum;
if (!checkKpInventory(kp.getId(), questionType, targetNum)) {
flage = true;
@ -123,7 +123,7 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma
int targetLine = getTargetLine(task);
// 簇目标线: 2 * U * W
int w = cluster.getClusterSize();
int targetNum = (int) Math.ceil(targetLine * w * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name()));
int targetNum = targetLine * (int) Math.ceil(w * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name()));
total = total + targetNum;
if (!checkClusterInventory(cluster.getId(), targetNum)) {
flage = true;

Loading…
Cancel
Save