代码优化 public MapString BigDecimal getLevelSubtotalfinal ListScoreItemTableSourceVO scoreItems final int size = CollectionUtilssizescoreItems; return CollectionUtilsemptyIfNullscoreItems
public Map<String, BigDecimal> getLevelSubtotal(final List
private static LevelSubtotalVO convert(final ScoreItemValueVO scoreItemValue, final int size) { BigDecimal examineWeight = scoreItemValue.getExamineWeight(); BigDecimal assessScore = NumberUtils.createBigDecimal(String.valueOf(scoreItemValue.getAssessScore())); final BigDecimal levelSubtotalAssessScore = examineWeight.multiply(assessScore) .divide(BigDecimal.valueOf(size), 4, RoundingMode.HALF_UP); LevelSubtotalVO levelSubtotalVO = new LevelSubtotalVO(scoreItemValue.getId(), levelSubtotalAssessScore); return levelSubtotalVO;
原文地址: http://www.cveoy.top/t/topic/iVa3 著作权归作者所有。请勿转载和采集!