Commit 3ecf2c20 by huluobin

update

parent ae108bac
......@@ -1007,7 +1007,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
@Override
public IPage<LeisureScheduleServe> queryPageLeisureScheduleServe(LeisureScheduleServeQuery query) {
IPage<LeisureScheduleServe> page = new Page<>(query.getPageNum(), query.getPageSize());
page = scheduleManageMapper.queryPageLeisureScheduleServe(page);
page = scheduleManageMapper.queryPageLeisureScheduleServe(page, query.getLatitude(), query.getLongitude());
page.getRecords().forEach(leisureScheduleServe -> {
leisureScheduleServe.setDistance(MapDistance.getDistance(query.getLatitude().toString(),
......
......@@ -37,7 +37,9 @@ public interface ScheduleManageMapper extends BaseMapper<ScheduleManage> {
* @param page
* @return
*/
IPage<LeisureScheduleServe> queryPageLeisureScheduleServe(IPage<LeisureScheduleServe> page);
IPage<LeisureScheduleServe> queryPageLeisureScheduleServe(IPage<LeisureScheduleServe> page,
@Param("latitude") Double latitude,
@Param("longitude") Double longitude);
/**
* 查询某天美甲师已用时间节点列表
......
......@@ -46,7 +46,7 @@ public class PhoneLoginController {
@RequestParam(required = false) String realName,
@RequestParam(required = false)
@DateTimeFormat(pattern = "yyyy-MM-dd") Date birthday,
@RequestParam(required = false) String sex) {
@RequestParam(required = false) String sex) throws Exception {
Customer customer = gogirlTokenService.bindPhoneAndCode(phone, code, realName, birthday, sex);
return JsonResult.success(customer);
......
......@@ -216,7 +216,28 @@
t6.`name` as serve_name,
t8.`name` as department_name,
t8.latitude,
t8.longitude
t8.longitude,
ROUND(
6378.138 * 2 * ASIN(
SQRT(
POW(
SIN(
(
#{latitude} * PI() / 180 - t8.latitude * PI() / 180
) / 2
),
2
) + COS(#{latitude} * PI() / 180) * COS(t8.latitude * PI() / 180) * POW(
SIN(
(
#{longitude} * PI() / 180 - t8.longitude * PI() / 180
) / 2
),
2
)
)
) * 1000
) AS distance
from leisure_discount_config t1
LEFT JOIN leisure_discount_config_week t2 on t1.id =t2.leisure_discount_config_id
LEFT JOIN leisure_discount_config_service t3 on t1.id =t3.leisure_discount_config_id
......@@ -228,6 +249,7 @@
where t1.is_enabled =1
and t2.id is not null
and t3.id is not null
order by distance
</select>
<select id="queryTechnicianTimeNode" resultType="com.gogirl.dto.TechnicianTimeNode">
......
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