设置分数

main
yz 1 year ago
parent f5e4340348
commit b167feb400

@ -109,20 +109,21 @@ public class ScoreController {
} }
} }
//设置各模块总成绩到DTO
dto.setOneScore(oneScore);
dto.setTwoScore(twoScore);
dto.setThreeScore(threeScore);
dto.setFourScore(fourScore);
dto.setFiveScore(fiveScore);
BigDecimal oneScoreWeight = oneScore.multiply(weight.getMarketResearchWeight()).divide(BigDecimal.valueOf(6),2,BigDecimal.ROUND_HALF_UP);
BigDecimal oneScoreWeight = oneScore.multiply(weight.getMarketResearchWeight()); BigDecimal twoScoreWeight = twoScore.multiply(weight.getProductPlanningWeight()).divide(BigDecimal.valueOf(4),2,BigDecimal.ROUND_HALF_UP);
BigDecimal twoScoreWeight = twoScore.multiply(weight.getProductPlanningWeight()); BigDecimal threeScoreWeight = threeScore.multiply(weight.getProductLaunchTestWeight()).divide(BigDecimal.valueOf(4),2,BigDecimal.ROUND_HALF_UP);
BigDecimal threeScoreWeight = twoScore.multiply(weight.getProductLaunchTestWeight()); BigDecimal fourScoreWeight = fourScore.multiply(weight.getSupplyChannelWeight()).divide(BigDecimal.valueOf(3),2,BigDecimal.ROUND_HALF_UP);
BigDecimal fourScoreWeight = twoScore.multiply(weight.getSupplyChannelWeight()); BigDecimal fiveScoreWeight = fiveScore.multiply(weight.getProductEvaluationWeight()).divide(BigDecimal.valueOf(8),2,BigDecimal.ROUND_HALF_UP);
BigDecimal fiveScoreWeight = twoScore.multiply(weight.getProductEvaluationWeight()); //设置总分
dto.setTotalScore(oneScoreWeight.add(twoScoreWeight).add(threeScoreWeight).add(fourScoreWeight).add(fiveScoreWeight)); dto.setTotalScore(oneScoreWeight.add(twoScoreWeight).add(threeScoreWeight).add(fourScoreWeight).add(fiveScoreWeight));
//设置每个项目分数
//设置各模块总成绩到DTO
dto.setOneScore(oneScoreWeight);
dto.setTwoScore(twoScoreWeight);
dto.setThreeScore(threeScoreWeight);
dto.setFourScore(fourScoreWeight);
dto.setFiveScore(fiveScoreWeight);
StuRankExample stuRankExample = new StuRankExample(); StuRankExample stuRankExample = new StuRankExample();
stuRankExample.createCriteria().andUpdateTimeEqualTo(scoreRankService.getNowDate()).andUserIdEqualTo(userId); stuRankExample.createCriteria().andUpdateTimeEqualTo(scoreRankService.getNowDate()).andUserIdEqualTo(userId);
List<StuRank> stuRanks = stuRankMapper.selectByExample(stuRankExample); List<StuRank> stuRanks = stuRankMapper.selectByExample(stuRankExample);

@ -100,11 +100,11 @@ public class ScoreRankServiceImpl implements ScoreRankService {
fiveScore = fiveScore.add(score); fiveScore = fiveScore.add(score);
} }
} }
BigDecimal oneScoreWeight = oneScore.multiply(weight.getMarketResearchWeight()); BigDecimal oneScoreWeight = oneScore.multiply(weight.getMarketResearchWeight()).divide(BigDecimal.valueOf(6),2,BigDecimal.ROUND_HALF_UP);
BigDecimal twoScoreWeight = twoScore.multiply(weight.getProductPlanningWeight()); BigDecimal twoScoreWeight = twoScore.multiply(weight.getProductPlanningWeight()).divide(BigDecimal.valueOf(4),2,BigDecimal.ROUND_HALF_UP);
BigDecimal threeScoreWeight = twoScore.multiply(weight.getProductLaunchTestWeight()); BigDecimal threeScoreWeight = threeScore.multiply(weight.getProductLaunchTestWeight()).divide(BigDecimal.valueOf(4),2,BigDecimal.ROUND_HALF_UP);
BigDecimal fourScoreWeight = twoScore.multiply(weight.getSupplyChannelWeight()); BigDecimal fourScoreWeight = fourScore.multiply(weight.getSupplyChannelWeight()).divide(BigDecimal.valueOf(3),2,BigDecimal.ROUND_HALF_UP);
BigDecimal fiveScoreWeight = twoScore.multiply(weight.getProductEvaluationWeight()); BigDecimal fiveScoreWeight = fiveScore.multiply(weight.getProductEvaluationWeight()).divide(BigDecimal.valueOf(8),2,BigDecimal.ROUND_HALF_UP);
dto.setTotalScore(oneScoreWeight.add(twoScoreWeight).add(threeScoreWeight).add(fourScoreWeight).add(fiveScoreWeight)); dto.setTotalScore(oneScoreWeight.add(twoScoreWeight).add(threeScoreWeight).add(fourScoreWeight).add(fiveScoreWeight));
scoreRank.setScore(dto.getTotalScore()); scoreRank.setScore(dto.getTotalScore());
@ -209,11 +209,11 @@ public class ScoreRankServiceImpl implements ScoreRankService {
fiveScore = fiveScore.add(score); fiveScore = fiveScore.add(score);
} }
} }
BigDecimal oneScoreWeight = oneScore.multiply(weight.getMarketResearchWeight()); BigDecimal oneScoreWeight = oneScore.multiply(weight.getMarketResearchWeight()).divide(BigDecimal.valueOf(6),2,BigDecimal.ROUND_HALF_UP);
BigDecimal twoScoreWeight = twoScore.multiply(weight.getProductPlanningWeight()); BigDecimal twoScoreWeight = twoScore.multiply(weight.getProductPlanningWeight()).divide(BigDecimal.valueOf(4),2,BigDecimal.ROUND_HALF_UP);
BigDecimal threeScoreWeight = twoScore.multiply(weight.getProductLaunchTestWeight()); BigDecimal threeScoreWeight = threeScore.multiply(weight.getProductLaunchTestWeight()).divide(BigDecimal.valueOf(4),2,BigDecimal.ROUND_HALF_UP);
BigDecimal fourScoreWeight = twoScore.multiply(weight.getSupplyChannelWeight()); BigDecimal fourScoreWeight = fourScore.multiply(weight.getSupplyChannelWeight()).divide(BigDecimal.valueOf(3),2,BigDecimal.ROUND_HALF_UP);
BigDecimal fiveScoreWeight = twoScore.multiply(weight.getProductEvaluationWeight()); BigDecimal fiveScoreWeight = fiveScore.multiply(weight.getProductEvaluationWeight()).divide(BigDecimal.valueOf(8),2,BigDecimal.ROUND_HALF_UP);
dto.setTotalScore(oneScoreWeight.add(twoScoreWeight).add(threeScoreWeight).add(fourScoreWeight).add(fiveScoreWeight)); dto.setTotalScore(oneScoreWeight.add(twoScoreWeight).add(threeScoreWeight).add(fourScoreWeight).add(fiveScoreWeight));
scoreRank.setScore(dto.getTotalScore()); scoreRank.setScore(dto.getTotalScore());
scoreRank.setScqxwjWeight(weight.getMarketResearchWeight()); scoreRank.setScqxwjWeight(weight.getMarketResearchWeight());

Loading…
Cancel
Save