|
@@ -6,15 +6,13 @@ import org.jeecg.modules.app.dto.GetPlaceListDTO;
|
|
|
import org.jeecg.modules.app.dto.SearchDTO;
|
|
|
import org.jeecg.modules.app.service.IAppHomeService;
|
|
|
import org.jeecg.modules.app.vo.*;
|
|
|
-import org.jeecg.modules.system.app.entity.AppBanner;
|
|
|
-import org.jeecg.modules.system.app.entity.AppCourses;
|
|
|
-import org.jeecg.modules.system.app.entity.AppInstructor;
|
|
|
-import org.jeecg.modules.system.app.entity.AppSearchHot;
|
|
|
+import org.jeecg.modules.system.app.entity.*;
|
|
|
import org.jeecg.modules.system.app.mapper.*;
|
|
|
import org.jeecg.modules.system.entity.SysDepart;
|
|
|
import org.jeecg.modules.system.entity.SysUser;
|
|
|
import org.jeecg.modules.system.mapper.SysDepartMapper;
|
|
|
import org.jeecg.modules.system.mapper.SysUserMapper;
|
|
|
+import org.jeecg.modules.system.util.PositionUtil;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -147,8 +145,7 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
Page<PlaceVO> page = new Page<>(getPlaceListDTO.getCurrent(), getPlaceListDTO.getSize());
|
|
|
Page<PlaceVO> placeList = appSiteMapper.getPlaceList(page, getPlaceListDTO.getVenueType());
|
|
|
placeList.getRecords().forEach(placeVO -> {
|
|
|
- //todo 待申请第三方地图接口
|
|
|
- placeVO.setKm(0.0)
|
|
|
+ placeVO.setKm(PositionUtil.calculateDistance(getPlaceListDTO.getLatitude(), getPlaceListDTO.getLongitude(), placeVO.getLatitude().doubleValue(), placeVO.getLongitude().doubleValue()))
|
|
|
.setCategory(getCategoryName(placeVO.getCategoryId()));
|
|
|
});
|
|
|
if(getPlaceListDTO.getVenueType().equals("0-2")
|
|
@@ -208,8 +205,8 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
Page<SearchVO.SearchPlaceVO> page = new Page<>(searchDTO.getCurrent(), searchDTO.getSize());
|
|
|
Page<SearchVO.SearchPlaceVO> searchPlaceVOPage = appSiteMapper.convertSearchPlaceVOPage(page, searchDTO);
|
|
|
searchPlaceVOPage.getRecords().forEach(placeVO -> {
|
|
|
- //todo 待申请第三方地图接口
|
|
|
- placeVO.setKm(0.0)
|
|
|
+ AppSite appSite = appSiteMapper.selectById(placeVO.getId());
|
|
|
+ placeVO.setKm(PositionUtil.calculateDistance(searchDTO.getLatitude(), searchDTO.getLongitude(), appSite.getLatitude().doubleValue(), appSite.getLongitude().doubleValue()))
|
|
|
.setCategory(getCategoryName(placeVO.getCategoryId()));
|
|
|
});
|
|
|
if(searchDTO.getVenueType().equals("0-2")
|
|
@@ -253,8 +250,8 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
Page<SearchVO.SearchTrainVO> page = new Page<>(searchDTO.getCurrent(), searchDTO.getSize());
|
|
|
Page<SearchVO.SearchTrainVO> searchTrainVOPage = appCoursesMapper.convertSearchTrainVOPage(page, searchDTO);
|
|
|
searchTrainVOPage.getRecords().forEach(trainVO -> {
|
|
|
- //todo 待申请第三方地图接口
|
|
|
- trainVO.setKm(0.0);
|
|
|
+ AppSite appSite = appSiteMapper.selectById(trainVO.getSiteId());
|
|
|
+ trainVO.setKm(PositionUtil.calculateDistance(searchDTO.getLatitude(), searchDTO.getLongitude(), appSite.getLatitude().doubleValue(), appSite.getLongitude().doubleValue()));
|
|
|
});
|
|
|
return searchTrainVOPage;
|
|
|
}
|
|
@@ -270,15 +267,16 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
Page<SearchVO.SearchRaceVO> page = new Page<>(searchDTO.getCurrent(), searchDTO.getSize());
|
|
|
Page<SearchVO.SearchRaceVO> searchCompetitionVOPage = appGameMapper.convertSearchCompetitionVOPage(page, searchDTO);
|
|
|
searchCompetitionVOPage.getRecords().forEach(competitionVO -> {
|
|
|
- //todo 待申请第三方地图接口
|
|
|
- competitionVO.setKm(0.0);
|
|
|
+ AppSite appSite = appSiteMapper.selectOne(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getOrgCode,competitionVO.getOrgCode()));
|
|
|
+ competitionVO.setKm(PositionUtil.calculateDistance(searchDTO.getLatitude(), searchDTO.getLongitude(), appSite.getLatitude().doubleValue(), appSite.getLongitude().doubleValue()));
|
|
|
+
|
|
|
});
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @Author SheepHy
|
|
|
- * @Description //TODO
|
|
|
+ * @Description
|
|
|
* @Date 14:43 2025/7/7
|
|
|
* @Param searchDTO {@link SearchDTO}
|
|
|
* @return Page<SearchVO.SearchInstructorVO>
|
|
@@ -297,7 +295,8 @@ public class AppHomeServiceImpl implements IAppHomeService {
|
|
|
return vo;
|
|
|
})
|
|
|
.collect(Collectors.toList());
|
|
|
- instructorVO.setKm(0.0)
|
|
|
+ AppSite appSite = appSiteMapper.selectOne(Wrappers.<AppSite>lambdaQuery().eq(AppSite::getOrgCode, instructorVO.getOrgCode()));
|
|
|
+ instructorVO.setKm(PositionUtil.calculateDistance(searchDTO.getLatitude(), searchDTO.getLongitude(), appSite.getLatitude().doubleValue(), appSite.getLongitude().doubleValue()))
|
|
|
.setCourseList(courseInfoVOS);
|
|
|
});
|
|
|
return searchInstructorVOPage;
|