小程序首页接口修改

This commit is contained in:
张松
2025-03-07 13:33:41 +08:00
parent 870a4de2fd
commit f8f46d8f3c
18 changed files with 122 additions and 22 deletions

View File

@@ -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> {
}

View File

@@ -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> {
}

View File

@@ -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);
}

View File

@@ -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{
}

View File

@@ -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{
}

View File

@@ -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)));
}
}

View File

@@ -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;
}
}

View File

@@ -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>

View File

@@ -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>

View File

@@ -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})) &lt;= #{distance}
order by distance
</select>
</mapper>