|
@@ -158,6 +158,25 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
for (StoreUser storeUser : storeUsers) {
|
|
|
storeMainInfoVo.setLogoutFlagUser(storeUser.getLogoutFlag());
|
|
|
}
|
|
|
+
|
|
|
+ // 计算店铺到最近地铁站的距离
|
|
|
+ JSONObject nearbySubway = gaoDeMapUtil.getNearbySubway(storeMainInfoVo.getStorePosition().split(",")[0], storeMainInfoVo.getStorePosition().split(",")[1]);
|
|
|
+ // 地铁名
|
|
|
+ String subWayName = nearbySubway.getString("name");
|
|
|
+ storeMainInfoVo.setSubwayName(subWayName);
|
|
|
+ // 地铁站经纬度
|
|
|
+ String subWayJing = nearbySubway.getString("location") == null ? null : nearbySubway.getString("location").split(",")[0];
|
|
|
+ String subWayWei = nearbySubway.getString("location") == null ? null : nearbySubway.getString("location").split(",")[1];
|
|
|
+
|
|
|
+ if ((subWayJing != null && !subWayJing.isEmpty()) && (subWayWei != null && !subWayWei.isEmpty())) {
|
|
|
+ double storeJing = Double.parseDouble(storeMainInfoVo.getStorePosition().split(",")[0]);
|
|
|
+ double storeWei = Double.parseDouble(storeMainInfoVo.getStorePosition().split(",")[1]);
|
|
|
+ double storeDistance2 = DistanceUtil.haversineCalculateDistance(Double.parseDouble(subWayJing), Double.parseDouble(subWayWei), storeJing, storeWei);
|
|
|
+ storeMainInfoVo.setDistance2(storeDistance2);
|
|
|
+ } else {
|
|
|
+ storeMainInfoVo.setDistance2(0);
|
|
|
+ }
|
|
|
+
|
|
|
return storeMainInfoVo;
|
|
|
}
|
|
|
|
|
@@ -876,7 +895,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
if (!storeImgs1.isEmpty()) {
|
|
|
result.setImgUrl(storeImgs1.get(0).getImgUrl());
|
|
|
} else {
|
|
|
- result.setEntranceImage("null");
|
|
|
+ result.setImgUrl("null");
|
|
|
}
|
|
|
// 设置经纬度
|
|
|
result.setStorePositionLongitude(result.getStorePosition().split(",")[0]);
|
|
@@ -1018,6 +1037,23 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
// 获取店铺动态总数
|
|
|
result.setTotalDynamicsNum(storeDynamicslist.size());
|
|
|
|
|
|
+ //营业时间
|
|
|
+ List<StoreBusinessInfo> storeBusinessInfos = storeBusinessInfoMapper.selectList(new LambdaQueryWrapper<StoreBusinessInfo>().eq(StoreBusinessInfo::getStoreId, storeId).eq(StoreBusinessInfo::getDeleteFlag, 0));
|
|
|
+ if (ObjectUtils.isNotEmpty(storeBusinessInfos)) {
|
|
|
+ result.setStoreBusinessInfo(storeBusinessInfos.get(0));
|
|
|
+
|
|
|
+ LocalTime now = LocalTime.now();
|
|
|
+ List<String> startList = Arrays.asList(result.getStoreBusinessInfo().getStartTime().split(":"));
|
|
|
+ List<String> endList = Arrays.asList(result.getStoreBusinessInfo().getEndTime().split(":"));
|
|
|
+ LocalTime start = LocalTime.of(Integer.parseInt(startList.get(0)), Integer.parseInt(startList.get(1)));
|
|
|
+ LocalTime end = LocalTime.of(Integer.parseInt(endList.get(0)), Integer.parseInt(startList.get(1)));
|
|
|
+ if (now.isAfter(start) && now.isBefore(end)) {
|
|
|
+ result.setYyFlag(1);
|
|
|
+ }else {
|
|
|
+ result.setYyFlag(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|