Compare commits

...

2 Commits

Author SHA1 Message Date
luogw e6201660f8 bug修复 3 weeks ago
luogw 2b83c4e511 Revert "bug修复" 3 weeks ago
  1. 2
      src/main/java/com/project/interaction/domain/service/impl/SaveClusterDomainServiceImpl.java
  2. 18
      src/main/java/com/project/question/domain/service/impl/QuestionInventoryDomainServiceImpl.java
  3. 2
      src/main/java/com/project/task/application/impl/TaskApplicationServiceImpl.java

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

@ -148,7 +148,7 @@ public class SaveClusterDomainServiceImpl implements SaveClusterDomainService {
} }
if (clusterEntity.getClusterSize() > 1) { if (clusterEntity.getClusterSize() > 1) {
// 簇生成目标量 // 簇生成目标量
int clusterTargetNum = (int) Math.ceil(targetNum * clusterEntity.getClusterSize()); int clusterTargetNum = (int) Math.ceil(targetNum * clusterEntity.getClusterSize() * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name()));
produceDTOList.add(buildDTO(clusterEntity.getId(), QuestionSourceTypeEnum.Multi_Concept ,0,0, clusterTargetNum)); produceDTOList.add(buildDTO(clusterEntity.getId(), QuestionSourceTypeEnum.Multi_Concept ,0,0, clusterTargetNum));
} }
} }

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

@ -73,9 +73,9 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma
} }
int w = cluster.getClusterSize(); int w = cluster.getClusterSize();
// 簇水位线: 1.0 * U * W // 簇水位线: 1.0 * U * W
int clusterWatermark = (int) Math.ceil(watermark * w); int clusterWatermark = (int) Math.ceil(watermark * w * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name()));
// 簇目标线: 1.2 * U * W // 簇目标线: 1.2 * U * W
int clusterTargetLine = (int) Math.ceil(targetLine * w); int clusterTargetLine = (int) Math.ceil(targetLine * w * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name()));
checkClusterProduce(cluster.getId(), clusterWatermark, clusterTargetLine); checkClusterProduce(cluster.getId(), clusterWatermark, clusterTargetLine);
} }
@ -119,10 +119,12 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma
continue; continue;
} }
Map<String, Double> questionTypeMap = questionTypeProportion(task);
int targetLine = getTargetLine(task); int targetLine = getTargetLine(task);
int clusterWatermark = (int) Math.ceil(targetLine * cluster.getClusterSize()); int clusterWatermark = targetLine * cluster.getClusterSize();
total = total + clusterWatermark; int targetNum = (int) Math.ceil(clusterWatermark * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name()));
if (!checkClusterInventory(cluster.getId(), clusterWatermark)) { total = total + targetNum;
if (!checkClusterInventory(cluster.getId(), targetNum)) {
flage = true; flage = true;
} }
} }
@ -224,9 +226,11 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma
@Override @Override
public Boolean checkCluster(TaskEntity task, TaskKnowledgeClusterEntity cluster) { public Boolean checkCluster(TaskEntity task, TaskKnowledgeClusterEntity cluster) {
Map<String, Double> questionTypeMap = questionTypeProportion(task);
int targetLine = getTargetLine(task); int targetLine = getTargetLine(task);
int clusterWatermark = (int) Math.ceil(targetLine * cluster.getClusterSize()); int clusterWatermark = targetLine * cluster.getClusterSize();
return checkClusterInventory(cluster.getId(), clusterWatermark); return checkClusterInventory(cluster.getId(), (int) Math.ceil(clusterWatermark * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name())));
} }
} }

2
src/main/java/com/project/task/application/impl/TaskApplicationServiceImpl.java

@ -75,7 +75,7 @@ public class TaskApplicationServiceImpl implements TaskApplicationService {
@Override @Override
public Result<Boolean> isDeletedTask(Long taskId, List<Long> taskKpIds,Integer type) { public Result<Boolean> isDeletedTask(Long taskId, List<Long> taskKpIds,Integer type) {
if (taskKpIds == null || CollectionUtils.isEmpty(taskKpIds) || type != null) { if (taskKpIds == null || CollectionUtils.isEmpty(taskKpIds) || type == null) {
throw new MissingParameterException("参数不完整"); throw new MissingParameterException("参数不完整");
} }

Loading…
Cancel
Save