Commit 540b853a by zhiwj

修改bug

parent 1574845e
......@@ -480,8 +480,9 @@ public class EvaluateOutApiServiceImpl implements EvaluateOutApiService {
}
private double getAvgScore(TabEvaluateOrderConfig evaluateOrderConfig, Integer goodsScore, Integer storeScore, Integer serviceScore) {
logger.debug("计算平均分:{},{},{}", goodsScore, storeScore, serviceScore);
// 开启的评价项
int count = 0;
double count = 0;
// 评价总分
double sumScore = 0;
if (Constants.OPEN.equals(evaluateOrderConfig.getGoods()) && goodsScore != null) {
......@@ -497,8 +498,11 @@ public class EvaluateOutApiServiceImpl implements EvaluateOutApiService {
sumScore += serviceScore;
}
if (count > 0) {
return sumScore / count;
double avg = sumScore / count;
logger.debug("平均分计算结果:{}", avg);
return avg;
} else {
logger.debug("平均分计算结果为0");
return 0;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment