|
@@ -97,8 +97,14 @@ public class DetailServiceImpl implements IDetailService {
|
|
public PlaceInfoVO getPlaceInfo(String id) {
|
|
public PlaceInfoVO getPlaceInfo(String id) {
|
|
AppSite appSite = appSiteMapper.selectById(id);
|
|
AppSite appSite = appSiteMapper.selectById(id);
|
|
PlaceInfoVO placeInfo = appSiteMapper.getPlaceInfo(id);
|
|
PlaceInfoVO placeInfo = appSiteMapper.getPlaceInfo(id);
|
|
- long scoreNum = evaluateMapper.findByScoreNum(id);
|
|
|
|
- long scoreSum = evaluateMapper.findByAverageScore(id);//评论总评分
|
|
|
|
|
|
+ Long scoreNum = evaluateMapper.findByScoreNum(id);
|
|
|
|
+ if(null == scoreNum){
|
|
|
|
+ scoreNum = 0L;
|
|
|
|
+ }
|
|
|
|
+ Long scoreSum = evaluateMapper.findByAverageScore(id);//评论总评分
|
|
|
|
+ if(null == scoreSum){
|
|
|
|
+ scoreSum = 0L;
|
|
|
|
+ }
|
|
placeInfo.setGoodRate(calculateAverage(scoreSum, scoreNum));
|
|
placeInfo.setGoodRate(calculateAverage(scoreSum, scoreNum));
|
|
List<DictModel> dictModels = sysDictMapper.queryDictItemsByCode(FACILITY_INFO);
|
|
List<DictModel> dictModels = sysDictMapper.queryDictItemsByCode(FACILITY_INFO);
|
|
List<String> facilityInfo = new ArrayList<>();
|
|
List<String> facilityInfo = new ArrayList<>();
|