修改IPO得分逻辑和收益分配得分逻辑

master
xiaoCJ
parent e11987e278
commit 4ec9286a22

@ -11,4 +11,5 @@ public interface PerformanceScoreService {
void calculateScoreByModule2(String methodName, Integer score, String flowId);
PerformanceScore getByFlowId(String flowId);
void updateScore(String methodName, Integer score, String flowId);
void ipoUpdateScore(String methodName, Integer score, String flowId);
}

@ -57,6 +57,19 @@ public class PerformanceScoreServiceImpl implements PerformanceScoreService {
performanceScoreMapper.updateByPrimaryKey(performanceScore);
}
@Override //ipo接口算分
public void ipoUpdateScore(String methodName, Integer score, String flowId) {
PerformanceScore performanceScore = getByFlowId(flowId);
BigDecimal oldScore = (BigDecimal) performanceScore.get(methodName);
if (oldScore==null){
oldScore = BigDecimal.ZERO;
}
performanceScore.set(methodName, BigDecimal.valueOf(score).add(oldScore));
BigDecimal add = performanceScore.getTotalScore().add(BigDecimal.valueOf(score));
performanceScore.setTotalScore(add);
performanceScoreMapper.updateByPrimaryKey(performanceScore);
}
@Override // 实体类字段名 分数 流程ID
public void calculateScoreByModule2(String methodName, Integer score, String flowId) {
PerformanceScore performanceScore = getByFlowId(flowId);

@ -278,7 +278,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
profitDistribution.setRoundSubordinatedLp(subtract);
profitDistributionMapper.insert(profitDistribution);
//判断算分
if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
if (BigDecimal.ZERO.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0 &&
subtract.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) {
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);

@ -154,8 +154,6 @@ 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();
@ -190,20 +188,32 @@ public class TopicServiceImpl implements TopicService {
// 答案正确
score = score + 1; // 设置得分为1或其他适当的值
if (module.equals(Constant.IPOTJ)) {
ipoListedConditionScore = ipoListedConditionScore + 1;
performanceScoreService.ipoUpdateScore("ipoListedConditionScore", 1, flowId);
PerformanceScore byFlowId = performanceScoreService.getByFlowId(flowId);
byFlowId.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(byFlowId);
}
if (module.equals(Constant.IPOBK)) {
ipoListedSectorScore = ipoListedConditionScore + 1;
performanceScoreService.ipoUpdateScore("ipoListedSectorScore", 1, flowId);
PerformanceScore byFlowId = performanceScoreService.getByFlowId(flowId);
byFlowId.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(byFlowId);
}
}
} else {
if (userAnswer.equals(rightAnswer)) {
score = score + 1;
if (module.equals(Constant.IPOTJ)) {
ipoListedConditionScore = ipoListedConditionScore + 1;
performanceScoreService.ipoUpdateScore("ipoListedConditionScore", 1, flowId);
PerformanceScore byFlowId = performanceScoreService.getByFlowId(flowId);
byFlowId.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(byFlowId);
}
if (module.equals(Constant.IPOBK)) {
ipoListedSectorScore = ipoListedSectorScore + 1;
performanceScoreService.ipoUpdateScore("ipoListedSectorScore", 1, flowId);
PerformanceScore byFlowId = performanceScoreService.getByFlowId(flowId);
byFlowId.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(byFlowId);
}
}
}
@ -225,6 +235,7 @@ public class TopicServiceImpl implements TopicService {
topicRecord.setModule(module);
topicRecord.setTopicType(topicType);
topicRecordMapper.insert(topicRecord);
}
if (score >= 5) {
@ -244,18 +255,7 @@ public class TopicServiceImpl implements TopicService {
if (module.equals(Constant.XMGZTK)) {
performanceScoreService.calculateScoreByModule("projectValuationScore", score, flowId);
}
if (module.equals(Constant.IPOBK)) {
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", ipoListedConditionScore, flowId);
PerformanceScore byFlowId = performanceScoreService.getByFlowId(flowId);
byFlowId.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(byFlowId);
}
return new ResultEntity<>(HttpStatus.OK, "提交成功!");
}

Loading…
Cancel
Save