增加附近店铺接口
This commit is contained in:
parent
67f55c9df1
commit
9649207ec0
@ -31,4 +31,7 @@ public class SFOrderProductDetailReq implements Serializable {
|
||||
|
||||
@ApiModelProperty("物品数量")
|
||||
private Integer product_num;
|
||||
|
||||
@ApiModelProperty("价格")
|
||||
private Integer product_price;
|
||||
}
|
||||
|
||||
@ -526,7 +526,7 @@ public interface ShopOrderBaseService extends IBaseService<ShopOrderBase> {
|
||||
*
|
||||
* @param devId
|
||||
* @param orderId
|
||||
* @param orderPickupNum
|
||||
* @param orderPickupNum 取单号
|
||||
* @return
|
||||
*/
|
||||
SFCreateOrderReq buildSFOrderData(Integer devId, String orderId, Long orderPickupNum);
|
||||
|
||||
@ -3097,7 +3097,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
||||
tmplArgs.put("order_id", order_id);
|
||||
tmplArgs.put("order_payment_amount", order_payment_amount);
|
||||
// 所有店铺管理员的发送邮件, 提醒商家:您有一笔新的订单 ${order_id},请及时处理。
|
||||
shopMessageTemplateService.aliyunSmsSend(shopKeeperMobiles, "SMS_475836097", tmplArgs);//SMS_475945807
|
||||
shopMessageTemplateService.aliyunSmsSend(shopKeeperMobiles, "SMS_476810378", tmplArgs);//SMS_475836097
|
||||
}
|
||||
|
||||
// 付款成功,对通知推广员进行提醒
|
||||
@ -8346,10 +8346,11 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
||||
}
|
||||
|
||||
ShopOrderBase shopOrderBase = shopOrderBaseService.getById(shopOrderId);
|
||||
ShopOrderData shopOrderData = shopOrderDataService.get(shopOrderId);
|
||||
QueryWrapper<ShopOrderItem> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("order_id", shopOrderId);
|
||||
List<ShopOrderItem> shopOrderItemList = shopOrderItemService.list(queryWrapper);
|
||||
if (shopOrderBase == null || CollUtil.isEmpty(shopOrderItemList)) {
|
||||
if (shopOrderBase == null || shopOrderData==null || CollUtil.isEmpty(shopOrderItemList)) {
|
||||
logger.error("无法获取订单信息!");
|
||||
return null;
|
||||
}
|
||||
@ -8395,7 +8396,9 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
||||
sfCreateOrderReq.setPush_time(DateUtil.currentSeconds());
|
||||
sfCreateOrderReq.setShop_order_id(shopOrderId);
|
||||
sfCreateOrderReq.setOrder_time(shopOrderBase.getOrder_time().getTime() / 1000);
|
||||
sfCreateOrderReq.setOrder_source("小发同城"); //订单来源
|
||||
sfCreateOrderReq.setOrder_source(shopStoreBase.getStore_name()); //订单来源
|
||||
sfCreateOrderReq.setRemark(shopOrderData.getOrder_message()); // 订单留言
|
||||
|
||||
// 7位数取单号,位数不够向左补0
|
||||
String orderPickupNumStr = String.format("%07d", orderPickupNum);
|
||||
sfCreateOrderReq.setOrder_sequence(orderPickupNumStr); //拣货编号
|
||||
@ -8418,16 +8421,19 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
||||
orderProductDetail.setProduct_id(shopOrderItem.getProduct_id());
|
||||
orderProductDetail.setProduct_name(shopOrderItem.getItem_name());
|
||||
orderProductDetail.setProduct_num(shopOrderItem.getOrder_item_quantity());
|
||||
|
||||
// 单个商品金额=数量*单价,单位分
|
||||
Integer itemPrice = shopOrderItem.getOrder_item_unit_price().multiply(BigDecimal.valueOf(shopOrderItem.getOrder_item_quantity())).multiply(BigDecimal.valueOf(100)).intValue();
|
||||
orderProductDetail.setProduct_price(itemPrice);
|
||||
orderProductList.add(orderProductDetail);
|
||||
}
|
||||
|
||||
orderDetail.setProduct_type(businessType); // 店铺主营商品分类,参考:https://commit-openic.sf-express.com/#/apidoc
|
||||
orderDetail.setTotal_price(shopOrderBase.getOrder_payment_amount().multiply(BigDecimal.valueOf(1000)).intValue()); // 单位分
|
||||
orderDetail.setTotal_price(shopOrderBase.getOrder_payment_amount().multiply(BigDecimal.valueOf(100)).intValue()); // 单位分
|
||||
orderDetail.setWeight_gram(0); // 重量一律传 0kg 先,谢总本地运营商协商好的
|
||||
orderDetail.setProduct_num(productNum); //物品个数
|
||||
orderDetail.setProduct_type_num(productTypeNum); //物品种类个数
|
||||
|
||||
|
||||
// 订单里的所有商品列表
|
||||
orderDetail.setProduct_detail(orderProductList);
|
||||
|
||||
|
||||
@ -3,8 +3,10 @@ package com.suisung.mall.shop.store.controller.mobile;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.PhoneUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.domain.UserDto;
|
||||
import com.suisung.mall.common.exception.ApiException;
|
||||
@ -19,10 +21,7 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@ -250,4 +249,20 @@ public class StoreController extends BaseControllerImpl {
|
||||
return CommonResult.success(storeCategoryMap);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取附近店铺列表", notes = "获取附近店铺列表")
|
||||
@RequestMapping(value = "/near/list", method = RequestMethod.GET)
|
||||
public CommonResult nearStoreList(@RequestParam(value = "provinceId",required = false) String provinceId,
|
||||
@RequestParam("cityId") String cityId,
|
||||
@RequestParam("countyId") String countyId,
|
||||
@RequestParam("userLng") String userLng,
|
||||
@RequestParam("userLat") String userLat,
|
||||
@RequestParam(value = "storeCategoryId", required = false) Integer storeCategoryId,
|
||||
@RequestParam(value = "subSiteId",required = false) Integer subSiteId,
|
||||
@RequestParam(value = "storeName",required = false) String storeName,
|
||||
@RequestParam("pageNum") Integer pageNum,
|
||||
@RequestParam("pageSize") Integer pageSize) {
|
||||
IPage<Map> storeList = shopStoreBaseService.getNearShop2(provinceId, cityId, countyId, userLng, userLat, storeCategoryId, subSiteId, storeName, pageNum, pageSize);
|
||||
return CommonResult.success(storeList);
|
||||
}
|
||||
|
||||
}
|
||||
@ -28,4 +28,13 @@ public interface ShopStoreBaseMapper extends BaseMapper<ShopStoreBase> {
|
||||
|
||||
IPage<Map> getNearShop(Page<Map> page, @Param("params") Map params);
|
||||
|
||||
|
||||
/**
|
||||
* 搜索附近店铺,排序:从近到远 2024-12-26
|
||||
* @param page
|
||||
* @param params 省份province_id、城市city_id、县county_id、店铺分类store_category_id、分店subsite_id,店铺名称关键字store_name、
|
||||
* @return
|
||||
*/
|
||||
IPage<Map> getNearShop2(Page<Map> page, @Param("params") Map params);
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.suisung.mall.shop.store.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.account.AccountUserInfo;
|
||||
import com.suisung.mall.common.modules.base.ShopBaseStoreCategory;
|
||||
@ -8,6 +10,7 @@ import com.suisung.mall.common.modules.store.ShopStoreBase;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreCompany;
|
||||
import com.suisung.mall.common.pojo.dto.StandardAddressDTO;
|
||||
import com.suisung.mall.core.web.service.IBaseService;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
import org.springframework.data.util.Pair;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -108,4 +111,20 @@ public interface ShopStoreBaseService extends IBaseService<ShopStoreBase> {
|
||||
* @return
|
||||
*/
|
||||
Pair<Boolean, StandardAddressDTO> checkStoreAddress(ShopStoreBase shopStoreBase);
|
||||
|
||||
/**
|
||||
* 搜索附近店铺,排序:从近到远 2024-12-26
|
||||
* @param provinceId
|
||||
* @param cityId
|
||||
* @param countyId
|
||||
* @param userLng
|
||||
* @param userLat
|
||||
* @param categoryId
|
||||
* @param subsiteId
|
||||
* @param storeName
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
IPage<Map> getNearShop2(String provinceId,String cityId, String countyId, String userLng,String userLat, Integer categoryId,Integer subsiteId, String storeName, Integer pageNum, Integer pageSize);
|
||||
}
|
||||
|
||||
@ -2873,11 +2873,41 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
|
||||
standardAddressDTO.setLongitude(shopStoreBase.getStore_longitude());
|
||||
standardAddressDTO.setLatitude(shopStoreBase.getStore_latitude());
|
||||
standardAddressDTO.setFullAddress(StrUtil.format("%s%s", StrUtil.replace(shopStoreBase.getStore_area(), "/", ""), shopStoreBase.getStore_address()));
|
||||
standardAddressDTO.setFullAddress(StrUtil.format("{}{}", StrUtil.replace(shopStoreBase.getStore_area(), "/", ""), shopStoreBase.getStore_address()));
|
||||
|
||||
return Pair.of(true, standardAddressDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索附近店铺,排序:从近到远 2024-12-26
|
||||
*
|
||||
* @param provinceId
|
||||
* @param cityId
|
||||
* @param countyId
|
||||
* @param userLng
|
||||
* @param userLat
|
||||
* @param storeCategoryId
|
||||
* @param subSiteId
|
||||
* @param storeName
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<Map> getNearShop2(String provinceId, String cityId, String countyId, String userLng, String userLat, Integer storeCategoryId, Integer subSiteId, String storeName, Integer pageNum, Integer pageSize) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("provinceId", provinceId);
|
||||
params.put("cityId", cityId);
|
||||
params.put("countyId", countyId);
|
||||
params.put("userLng", userLng);
|
||||
params.put("userLat", userLat);
|
||||
params.put("storeCategoryId", storeCategoryId);
|
||||
params.put("subSiteId", subSiteId);
|
||||
params.put("storeName", storeName);
|
||||
|
||||
return shopStoreBaseMapper.getNearShop2(new Page<>(pageNum, pageSize), params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理 store_slide 字段
|
||||
*
|
||||
|
||||
@ -139,7 +139,10 @@ feieyun:
|
||||
ukey: vuzPtNVghXSxbZmr
|
||||
sf-express:
|
||||
# 顺丰同城 api 接口配置
|
||||
dev_id: 1711573316
|
||||
appid: 1711573316
|
||||
appkey: cd57608baa9c00fe1cda5f652b14240d
|
||||
dev_id: 1711573316
|
||||
# dev_id: 1715091463
|
||||
# appid: 1715091463
|
||||
# appkey: 47466ae69c530f831395e1bc405639fb
|
||||
enable: 2
|
||||
@ -80,4 +80,56 @@
|
||||
< #{params.distance}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getNearShop2" resultType="java.util.Map">
|
||||
SELECT
|
||||
b.store_logo,
|
||||
b.store_name,
|
||||
b.store_address,
|
||||
b.store_area,
|
||||
a.store_opening_hours,
|
||||
a.store_close_hours,
|
||||
a.store_workingtime,
|
||||
(SELECT count(*) FROM shop_store_same_city_transport_base where store_id=b.store_id) as same_city_setting_count,
|
||||
(SELECT count(*) FROM shop_chain_base where store_id=b.store_id) as chain_count,
|
||||
ST_Distance_Sphere(point(b.store_longitude, b.store_latitude), point(#{params.userLng}, #{params.userLat})) as distance
|
||||
FROM
|
||||
shop_store_base b
|
||||
INNER JOIN
|
||||
shop_store_info a
|
||||
ON b.store_id=a.store_id and b.store_is_open=1 and b.store_state_id=3240 and b.store_type=1
|
||||
<where>
|
||||
<choose>
|
||||
<when test="params.provinceId!=null and params.cityId!=null and params.countyId!=null">
|
||||
and b.store_district_id=concat(#{params.provinceId},'/', #{params.cityId},'/', #{params.countyId})
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="params.provinceId!=null">
|
||||
and b.store_district_id like concat(#{params.provinceId}, '/%')
|
||||
</if>
|
||||
<if test="params.cityId!=null">
|
||||
and b.store_district_id like concat('%/', #{params.cityId}, '/%')
|
||||
</if>
|
||||
<if test="params.countyId!=null">
|
||||
and b.store_district_id like concat('%/',#{params.countyId})
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
<if test="params.storeCategoryId!=null">
|
||||
and b.store_category_id=#{params.storeCategoryId}
|
||||
</if>
|
||||
|
||||
<if test="params.subSiteId!=null">
|
||||
and b.subsite_id=#{params.subSiteId}
|
||||
</if>
|
||||
|
||||
<if test="params.storeName!=null">
|
||||
and b.store_name like concat('%', #{params.storeName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
|
||||
ORDER BY distance asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user