小程序首页接口修改
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package com.czg.service.product.mapper;
|
||||
package com.czg.service.account.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.account.entity.PlatformDict;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.czg.service.product.mapper;
|
||||
package com.czg.service.account.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.account.entity.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);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.czg.service.product.service.impl;
|
||||
package com.czg.service.account.service.impl;
|
||||
|
||||
import com.czg.service.product.mapper.PlatformDictMapper;
|
||||
import com.czg.service.account.mapper.PlatformDictMapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.account.entity.PlatformDict;
|
||||
import com.czg.product.service.PlatformDictService;
|
||||
import com.czg.account.service.PlatformDictService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.czg.service.product.service.impl;
|
||||
package com.czg.service.account.service.impl;
|
||||
|
||||
import com.czg.service.product.mapper.PlatformDictTypeMapper;
|
||||
import com.czg.service.account.mapper.PlatformDictTypeMapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.account.entity.PlatformDictType;
|
||||
import com.czg.product.service.PlatformDictTypeService;
|
||||
import com.czg.account.service.PlatformDictTypeService;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -12,6 +13,7 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.czg.service.product.mapper.PlatformDictMapper">
|
||||
<mapper namespace="com.czg.service.account.mapper.PlatformDictMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -2,6 +2,6 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.czg.service.product.mapper.PlatformDictTypeMapper">
|
||||
<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>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.czg.service.product.service.impl;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.account.entity.PlatformDict;
|
||||
import com.czg.account.entity.ShopInfo;
|
||||
import com.czg.account.entity.SysDict;
|
||||
import com.czg.product.service.HomePageService;
|
||||
import com.czg.product.service.PlatformDictService;
|
||||
import com.czg.account.service.PlatformDictService;
|
||||
import com.czg.product.service.SysDictService;
|
||||
import com.czg.account.vo.home.BannerInfoVo;
|
||||
import com.czg.account.vo.home.HomePageVO;
|
||||
@@ -17,18 +15,15 @@ import com.czg.product.service.ProdSkuService;
|
||||
import com.czg.product.service.ProductService;
|
||||
import com.czg.product.vo.RecommendProVO;
|
||||
import com.czg.service.product.mapper.ProductMapper;
|
||||
import com.czg.utils.JoinQueryWrapper;
|
||||
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 jakarta.annotation.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -45,8 +40,9 @@ public class HomePageServiceImpl implements HomePageService {
|
||||
};
|
||||
|
||||
|
||||
@Resource
|
||||
@DubboReference
|
||||
private PlatformDictService platformDictService;
|
||||
|
||||
@Resource
|
||||
private SysDictService sysDictService;
|
||||
@Resource
|
||||
|
||||
Reference in New Issue
Block a user