修改IPO得分逻辑

master
xiaoCJ 1 year ago
parent f5e615979a
commit a56066efde

@ -154,6 +154,8 @@ public class TopicServiceImpl implements TopicService {
return new ResultEntity<List<String>>(HttpStatus.BAD_REQUEST, "请勿重复提交!");
}
int score = 0;
int ipoListedSectorScore = 0; //上市版块得分
int ipoListedConditionScore = 0; // 上市条件得分
String module = "";
for (TopicsWithBLOBs topic : topics) {
String userAnswer = topic.getUserAnswer();
@ -181,15 +183,28 @@ public class TopicServiceImpl implements TopicService {
// break;
}
}
if (isCorrect && topicId.equals("999")) {
score = 4;
} else if (isCorrect) {
// if (isCorrect && topicId.equals("999")) {
// score = 4;
/* } else*/
if (isCorrect) {
// 答案正确
score = score + 1; // 设置得分为1或其他适当的值
if (module.equals(Constant.IPOTJ)) {
ipoListedConditionScore = ipoListedConditionScore + 1;
}
if (module.equals(Constant.IPOBK)) {
ipoListedSectorScore = ipoListedConditionScore + 1;
}
}
} else {
if (userAnswer.equals(rightAnswer)) {
score = score + 1;
if (module.equals(Constant.IPOTJ)) {
ipoListedConditionScore = ipoListedConditionScore + 1;
}
if (module.equals(Constant.IPOBK)) {
ipoListedSectorScore = ipoListedSectorScore + 1;
}
}
}
//添加到答题记录表
@ -212,8 +227,7 @@ public class TopicServiceImpl implements TopicService {
topicRecordMapper.insert(topicRecord);
}
//IPO模块总分十分其余5分 板块3分条件3分流程4分固定的题目单独接口
if (/*!(module.equals(Constant.IPOBK) || module.equals(Constant.IPOTJ)) &&*/ score >= 5) {
if (score >= 5) {
score = 5;
}
// 调用计分方法
@ -231,18 +245,18 @@ public class TopicServiceImpl implements TopicService {
performanceScoreService.calculateScoreByModule("projectValuationScore", score, flowId);
}
if (module.equals(Constant.IPOBK)) {
performanceScoreService.calculateScoreByModule("ipoListedSectorScore", score, flowId);
performanceScoreService.calculateScoreByModule("ipoListedSectorScore", ipoListedSectorScore, flowId);
PerformanceScore byFlowId = performanceScoreService.getByFlowId(flowId);
byFlowId.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(byFlowId);
}
if (module.equals(Constant.IPOTJ)) {
performanceScoreService.calculateScoreByModule("ipoListedConditionScore", score, flowId);
performanceScoreService.calculateScoreByModule("ipoListedConditionScore", ipoListedConditionScore, flowId);
PerformanceScore byFlowId = performanceScoreService.getByFlowId(flowId);
byFlowId.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(byFlowId);
}
return new ResultEntity<>(HttpStatus.OK,"提交成功!");
return new ResultEntity<>(HttpStatus.OK, "提交成功!");
}

Loading…
Cancel
Save