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