From 2a64ac1b7032341aea5d3eb91a78daf6e5491991 Mon Sep 17 00:00:00 2001 From: wjt Date: Thu, 21 Sep 2023 18:06:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=A8=E5=BA=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribute/service/impl/StoreServiceImpl.java | 12 ++++++++++-- .../com/baiye/modules/distribute/vo/StoreVO.java | 3 +++ admin/src/main/resources/mapper/StoreMapper.xml | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/admin/src/main/java/com/baiye/modules/distribute/service/impl/StoreServiceImpl.java b/admin/src/main/java/com/baiye/modules/distribute/service/impl/StoreServiceImpl.java index e8894a6..e5f6125 100644 --- a/admin/src/main/java/com/baiye/modules/distribute/service/impl/StoreServiceImpl.java +++ b/admin/src/main/java/com/baiye/modules/distribute/service/impl/StoreServiceImpl.java @@ -64,10 +64,17 @@ public class StoreServiceImpl extends ExtendServiceImpl sysUserNameRoleS = sysUserService.listUserNameByUserIds(userIds); userInfo = sysUserNameRoleS.stream().collect(Collectors.toMap(SysUserNameRoleDTO::getUserId, SysUserNameRoleDTO::getUserName)); } - + String city = ""; + String province = ""; + String county = ""; + String detail = ""; for (StoreVO vo : records) { vo.setReservationNum(map.get(vo.getId())); - vo.setAddress(vo.getCity() + vo.getCounty()); + city = vo.getCity(); + province = vo.getProvince(); + county = vo.getCounty(); + detail = vo.getDetail(); + vo.setAddress(province + city + county + detail); vo.setTradeTime(vo.getTradeStartTime() + "-" + vo.getTradeEndTime()); if (vo.getUserId() != null) { vo.setUserName(userInfo.get(vo.getUserId())); @@ -140,6 +147,7 @@ public class StoreServiceImpl extends ExtendServiceImpl list = new ArrayList<>(); //todo Long userId = SecurityUtils.getWhichUserId(); + List stores = baseMapper.queryRangeStore(longitude, latitude, distance, userId); if (CollUtil.isNotEmpty(stores)) { int index = 0; diff --git a/admin/src/main/java/com/baiye/modules/distribute/vo/StoreVO.java b/admin/src/main/java/com/baiye/modules/distribute/vo/StoreVO.java index cb6e747..3f30827 100644 --- a/admin/src/main/java/com/baiye/modules/distribute/vo/StoreVO.java +++ b/admin/src/main/java/com/baiye/modules/distribute/vo/StoreVO.java @@ -34,6 +34,9 @@ public class StoreVO { @Schema(description = "区县") private String county; + @Schema(description = "详情") + private String detail; + @Schema(description = "营业开始时间") private String tradeStartTime; diff --git a/admin/src/main/resources/mapper/StoreMapper.xml b/admin/src/main/resources/mapper/StoreMapper.xml index 4e87c69..b468a43 100644 --- a/admin/src/main/resources/mapper/StoreMapper.xml +++ b/admin/src/main/resources/mapper/StoreMapper.xml @@ -53,7 +53,7 @@ PI() / 180) / 2), 2))) * 1000) AS distance FROM tb_store - where create_by = 1 + where create_by = #{userId} and deleted = 0 HAVING distance <= #{distance} ORDER BY distance ASC