|
|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.system.vo.DictModel;
|
|
|
@@ -144,8 +145,10 @@ public class DetailServiceImpl implements IDetailService {
|
|
|
@Override
|
|
|
public CourseInfoVO getCourseInfo(String id, double latitude, double longitude) {
|
|
|
CourseInfoVO courseInfoVO = appCoursesMapper.getCourseInfo(id);
|
|
|
- AppSite appSite = appSiteMapper.selectById(courseInfoVO.getSiteId());
|
|
|
- courseInfoVO.setKm(PositionUtil.calculateDistance(latitude, longitude, appSite.getLatitude().doubleValue(), appSite.getLongitude().doubleValue()));
|
|
|
+ AppSite appSite = appSiteMapper.selectById(courseInfoVO.getAddressSiteId());
|
|
|
+ if (appSite!=null&& ObjectUtils.isNotEmpty(appSite.getLatitude())&& ObjectUtils.isNotEmpty(appSite.getLongitude())){
|
|
|
+ courseInfoVO.setKm(PositionUtil.calculateDistance(latitude, longitude, appSite.getLatitude().doubleValue(), appSite.getLongitude().doubleValue()));
|
|
|
+ }
|
|
|
courseInfoVO.setSales(getCourseSales(id));
|
|
|
List<CourseInfoVO.CourseDetailVO> courseDetailVOList = new ArrayList<>();
|
|
|
appCoursesPriceRulesMapper.selectList(Wrappers.<AppCoursesPriceRules>lambdaQuery()
|
|
|
@@ -175,7 +178,7 @@ public class DetailServiceImpl implements IDetailService {
|
|
|
courseInfoVO.setSalesYear(getCourseSales(appCourses.getId()));
|
|
|
courseInfoVO.setPriceType(isFirstPurchase(user.getId()));
|
|
|
courseInfoVO.setCover(list.get(0));
|
|
|
- AppSite appSite = appSiteMapper.selectById(appCourses.getSiteId());
|
|
|
+ AppSite appSite = appSiteMapper.selectById(appCourses.getAddressSiteId());
|
|
|
if (appSite!=null){
|
|
|
courseInfoVO.setAddress(appSite.getAddress());
|
|
|
double km = PositionUtil.calculateDistance(latitude, longitude, appSite.getLatitude().doubleValue(), appSite.getLongitude().doubleValue());
|