小程序首页接口修改
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.czg.service.account.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.account.entity.PlatformDict;
|
||||
|
||||
/**
|
||||
* 平台配置 映射层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-28
|
||||
*/
|
||||
public interface PlatformDictMapper extends BaseMapper<PlatformDict> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.czg.service.account.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.account.entity.PlatformDictType;
|
||||
|
||||
/**
|
||||
* 平台配置类型 映射层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-28
|
||||
*/
|
||||
public interface PlatformDictTypeMapper extends BaseMapper<PlatformDictType> {
|
||||
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.czg.service.account.mapper;
|
||||
|
||||
import com.czg.account.dto.shopinfo.ShopInfoDetailDTO;
|
||||
import com.czg.account.dto.shopinfo.ShopInfoSubVO;
|
||||
import com.czg.account.entity.ShopInfo;
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺信息 映射层。
|
||||
@@ -11,4 +16,5 @@ import com.mybatisflex.core.BaseMapper;
|
||||
*/
|
||||
public interface ShopInfoMapper extends BaseMapper<ShopInfo> {
|
||||
|
||||
List<ShopInfoSubVO> getSubList(@Param("lng") String lng, @Param("lat") String lat, @Param("distance") float distance);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.czg.service.account.service.impl;
|
||||
|
||||
import com.czg.service.account.mapper.PlatformDictMapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.account.entity.PlatformDict;
|
||||
import com.czg.account.service.PlatformDictService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 平台配置 服务层实现。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-28
|
||||
*/
|
||||
@Service
|
||||
public class PlatformDictServiceImpl extends ServiceImpl<PlatformDictMapper, PlatformDict> implements PlatformDictService{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.czg.service.account.service.impl;
|
||||
|
||||
import com.czg.service.account.mapper.PlatformDictTypeMapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.account.entity.PlatformDictType;
|
||||
import com.czg.account.service.PlatformDictTypeService;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 平台配置类型 服务层实现。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-28
|
||||
*/
|
||||
@DubboService
|
||||
@Service
|
||||
public class PlatformDictTypeServiceImpl extends ServiceImpl<PlatformDictTypeMapper, PlatformDictType> implements PlatformDictTypeService{
|
||||
|
||||
}
|
||||
@@ -17,6 +17,9 @@ import com.czg.service.RedisService;
|
||||
import com.czg.service.account.mapper.ShopInfoMapper;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.czg.utils.GeoUtil;
|
||||
import com.czg.utils.PageUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
@@ -210,4 +213,10 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
||||
Map<String, ShopExtend> shopExtendMap = shopExtends.stream().collect(Collectors.toMap(ShopExtend::getAutoKey, i -> i));
|
||||
return new ShopInfoDetailDTO(shopInfo, shopExtendMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<ShopInfoSubVO> getSubList(String lat, String lng, float distance) {
|
||||
PageHelper.startPage(PageUtil.buildPageHelp());
|
||||
return PageUtil.convert(new PageInfo<>(mapper.getSubList(lng, lat, distance)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,8 +274,11 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
||||
shopUserDetailDTO.setCouponNum(couponNum);
|
||||
|
||||
ShopInfo shopInfo = shopInfoMapper.selectOneById(shopId);
|
||||
shopUserDetailDTO.setShopName(shopInfo.getShopName());
|
||||
shopUserDetailDTO.setShopId(shopInfo.getId());
|
||||
if (shopInfo != null) {
|
||||
shopUserDetailDTO.setShopName(shopInfo.getShopName());
|
||||
shopUserDetailDTO.setShopId(shopInfo.getId());
|
||||
shopUserDetailDTO.setShopInfo(shopInfo);
|
||||
}
|
||||
return shopUserDetailDTO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.czg.service.account.mapper.PlatformDictMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.czg.service.account.mapper.PlatformDictTypeMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -4,4 +4,13 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.czg.service.account.mapper.ShopInfoMapper">
|
||||
|
||||
<select id="getSubList" resultType="com.czg.account.dto.shopinfo.ShopInfoSubVO">
|
||||
select ST_Distance_Sphere(
|
||||
POINT(lng, lat),
|
||||
POINT(#{lng}, #{lat})
|
||||
) / 1000 AS distance, id, shop_name, logo, phone, address
|
||||
from tb_shop_info
|
||||
WHERE ST_Distance_Sphere(POINT(lng, lat), POINT(#{lng}, #{lat})) <= #{distance}
|
||||
order by distance
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user