|
|
@@ -575,9 +575,9 @@ public class StoreCommentServiceImpl extends ServiceImpl<StoreCommentMapper, Sto
|
|
|
storeComment.setCreatedUserId(storeComment.getUserId());
|
|
|
|
|
|
int i = this.save(storeComment) ? 0 : 1;
|
|
|
-
|
|
|
Map<String, String> commentCountAndScore = storeCommentMapper.getCommentCountAndScoreInfo(storeId);
|
|
|
- double total = StringUtils.isNotEmpty(commentCountAndScore.get("total")) ? Double.parseDouble(commentCountAndScore.get("total")) : 0;
|
|
|
+ String totalStr = String.valueOf(commentCountAndScore.get("total"));
|
|
|
+ double total = StringUtils.isNotEmpty(totalStr) ? Double.parseDouble(totalStr) : 0;
|
|
|
double scoreAvg = StringUtils.isNotEmpty(commentCountAndScore.get("score")) ? Double.parseDouble(commentCountAndScore.get("score")) / total : 0;
|
|
|
double tasteScore = StringUtils.isNotEmpty(commentCountAndScore.get("tasteScore")) ? Double.parseDouble(commentCountAndScore.get("tasteScore")) / total : 0;
|
|
|
double enScore = StringUtils.isNotEmpty(commentCountAndScore.get("enScore")) ? Double.parseDouble(commentCountAndScore.get("enScore")) / total : 0;
|