移动端多门店完成及其导出新sql
This commit is contained in:
3209
sql/yshop2.0.sql
3209
sql/yshop2.0.sql
File diff suppressed because it is too large
Load Diff
4559
sql/yxshop2.1.sql
Normal file
4559
sql/yxshop2.1.sql
Normal file
File diff suppressed because one or more lines are too long
@ -1,4 +1,3 @@
|
|||||||
新项目 直接导入yshop2.0.sql即可
|
新项目 直接导入yshop2.1.sql即可
|
||||||
1.9升级到2.0表变化的只有yx_user_recharge_sql、yx_system_store.sql
|
2.0升级到2.1,直接把yshop2.1升级sql.txt里面sql语句运行即可
|
||||||
|
|
||||||
升级说明:这次2.0代码改动地方多,升级需谨慎!!!
|
|
||||||
@ -1313,7 +1313,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<YxStoreOrderMapper,
|
|||||||
storeOrder.setShippingType(param.getShippingType());
|
storeOrder.setShippingType(param.getShippingType());
|
||||||
//处理门店
|
//处理门店
|
||||||
if(OrderInfoEnum.SHIPPIING_TYPE_2.getValue().equals(param.getShippingType())){
|
if(OrderInfoEnum.SHIPPIING_TYPE_2.getValue().equals(param.getShippingType())){
|
||||||
YxSystemStoreQueryVo systemStoreQueryVo = systemStoreService.getStoreInfo();
|
YxSystemStoreQueryVo systemStoreQueryVo = systemStoreService.getYxSystemStoreById(param.getStoreId());
|
||||||
if(systemStoreQueryVo == null ) throw new ErrorRequestException("暂无门店无法选择门店自提");
|
if(systemStoreQueryVo == null ) throw new ErrorRequestException("暂无门店无法选择门店自提");
|
||||||
storeOrder.setVerifyCode(StrUtil.sub(orderSn,orderSn.length(),-12));
|
storeOrder.setVerifyCode(StrUtil.sub(orderSn,orderSn.length(),-12));
|
||||||
storeOrder.setStoreId(systemStoreQueryVo.getId());
|
storeOrder.setStoreId(systemStoreQueryVo.getId());
|
||||||
|
|||||||
@ -91,6 +91,7 @@ public class StoreOrderController extends BaseController {
|
|||||||
private final YxStoreBargainUserService storeBargainUserService;
|
private final YxStoreBargainUserService storeBargainUserService;
|
||||||
private final YxSystemStoreService systemStoreService;
|
private final YxSystemStoreService systemStoreService;
|
||||||
private final YxSystemAttachmentService systemAttachmentService;
|
private final YxSystemAttachmentService systemAttachmentService;
|
||||||
|
private final YxSystemStoreStaffService systemStoreStaffService;
|
||||||
|
|
||||||
private static Lock lock = new ReentrantLock(false);
|
private static Lock lock = new ReentrantLock(false);
|
||||||
|
|
||||||
@ -163,7 +164,7 @@ public class StoreOrderController extends BaseController {
|
|||||||
confirmOrderDTO.setUserInfo(userService.getYxUserById(uid));
|
confirmOrderDTO.setUserInfo(userService.getYxUserById(uid));
|
||||||
|
|
||||||
//门店
|
//门店
|
||||||
confirmOrderDTO.setSystemStore(systemStoreService.getStoreInfo());
|
confirmOrderDTO.setSystemStore(systemStoreService.getStoreInfo("",""));
|
||||||
|
|
||||||
return ApiResult.ok(confirmOrderDTO);
|
return ApiResult.ok(confirmOrderDTO);
|
||||||
}
|
}
|
||||||
@ -446,7 +447,7 @@ public class StoreOrderController extends BaseController {
|
|||||||
}
|
}
|
||||||
storeOrder.setCode(qrcodeUrl);
|
storeOrder.setCode(qrcodeUrl);
|
||||||
storeOrder.setMapKey(mapKey);
|
storeOrder.setMapKey(mapKey);
|
||||||
storeOrder.setSystemStore(systemStoreService.getStoreInfo());
|
storeOrder.setSystemStore(systemStoreService.getYxSystemStoreById(storeOrder.getStoreId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return ApiResult.ok(storeOrderService.handleOrder(storeOrder));
|
return ApiResult.ok(storeOrderService.handleOrder(storeOrder));
|
||||||
@ -478,14 +479,14 @@ public class StoreOrderController extends BaseController {
|
|||||||
String couponId = jsonObject.getString("couponId");
|
String couponId = jsonObject.getString("couponId");
|
||||||
String shippingType = jsonObject.getString("shipping_type");
|
String shippingType = jsonObject.getString("shipping_type");
|
||||||
String useIntegral = jsonObject.getString("useIntegral");
|
String useIntegral = jsonObject.getString("useIntegral");
|
||||||
//todo 砍价
|
// 砍价
|
||||||
if(ObjectUtil.isNotNull(jsonObject.getInteger("bargainId"))){
|
if(ObjectUtil.isNotNull(jsonObject.getInteger("bargainId"))){
|
||||||
YxStoreBargainUser storeBargainUser = storeBargainUserService.getBargainUserInfo(jsonObject.getInteger("bargainId")
|
YxStoreBargainUser storeBargainUser = storeBargainUserService.getBargainUserInfo(jsonObject.getInteger("bargainId")
|
||||||
,uid);
|
,uid);
|
||||||
if(ObjectUtil.isNull(storeBargainUser)) return ApiResult.fail("砍价失败");
|
if(ObjectUtil.isNull(storeBargainUser)) return ApiResult.fail("砍价失败");
|
||||||
if(storeBargainUser.getStatus() == 3) return ApiResult.fail("砍价已支付");
|
if(storeBargainUser.getStatus() == 3) return ApiResult.fail("砍价已支付");
|
||||||
}
|
}
|
||||||
//todo 拼团
|
// 拼团
|
||||||
if(ObjectUtil.isNotNull(jsonObject.getInteger("pinkId"))){
|
if(ObjectUtil.isNotNull(jsonObject.getInteger("pinkId"))){
|
||||||
int pinkId = jsonObject.getInteger("pinkId");
|
int pinkId = jsonObject.getInteger("pinkId");
|
||||||
YxStoreOrder yxStoreOrder = storeOrderService.getOrderPink(pinkId,uid,1);
|
YxStoreOrder yxStoreOrder = storeOrderService.getOrderPink(pinkId,uid,1);
|
||||||
@ -707,6 +708,11 @@ public class StoreOrderController extends BaseController {
|
|||||||
|
|
||||||
YxStoreOrder order = storeOrderService.getOne(Wrappers.query(storeOrder));
|
YxStoreOrder order = storeOrderService.getOne(Wrappers.query(storeOrder));
|
||||||
if(order == null) return ApiResult.fail("核销的订单不存在或未支付或已退款");
|
if(order == null) return ApiResult.fail("核销的订单不存在或未支付或已退款");
|
||||||
|
|
||||||
|
int uid = SecurityUtils.getUserId().intValue();
|
||||||
|
boolean checkStatus = systemStoreStaffService.checkStatus(uid,order.getStoreId());
|
||||||
|
if(!checkStatus) return ApiResult.fail("您没有当前店铺核销权限!");
|
||||||
|
|
||||||
if(order.getStatus() > 0) return ApiResult.fail("订单已经核销");
|
if(order.getStatus() > 0) return ApiResult.fail("订单已经核销");
|
||||||
|
|
||||||
if(order.getCombinationId() > 0 && order.getPinkId() > 0){
|
if(order.getCombinationId() > 0 && order.getPinkId() > 0){
|
||||||
|
|||||||
@ -27,5 +27,6 @@ public class OrderParam implements Serializable {
|
|||||||
private Integer shippingType;
|
private Integer shippingType;
|
||||||
private Double useIntegral;
|
private Double useIntegral;
|
||||||
private Integer isChannel = 1;
|
private Integer isChannel = 1;
|
||||||
|
private Integer storeId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,15 +1,20 @@
|
|||||||
package co.yixiang.modules.shop.mapper;
|
package co.yixiang.modules.shop.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import co.yixiang.modules.shop.entity.YxSystemStore;
|
import co.yixiang.modules.shop.entity.YxSystemStore;
|
||||||
import co.yixiang.modules.shop.web.param.YxSystemStoreQueryParam;
|
import co.yixiang.modules.shop.web.param.YxSystemStoreQueryParam;
|
||||||
import co.yixiang.modules.shop.web.vo.YxSystemStoreQueryVo;
|
import co.yixiang.modules.shop.web.vo.YxSystemStoreQueryVo;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -21,6 +26,12 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
@Repository
|
@Repository
|
||||||
public interface YxSystemStoreMapper extends BaseMapper<YxSystemStore> {
|
public interface YxSystemStoreMapper extends BaseMapper<YxSystemStore> {
|
||||||
|
@Select("SELECT*,ROUND(6378.138 * 2 * ASIN(SQRT(POW(SIN((#{lat} * PI() / 180 - latitude * PI() / 180" +
|
||||||
|
" ) / 2),2) + COS(40.0497810000 * PI() / 180) * COS(latitude * PI() / 180) * POW(" +
|
||||||
|
" SIN((#{lon} * PI() / 180 - longitude * PI() / 180) / 2),2))) * 1000) AS distance" +
|
||||||
|
" FROM yx_system_store WHERE is_del=0 AND is_show = 1 ORDER BY distance ASC"
|
||||||
|
)
|
||||||
|
List<YxSystemStoreQueryVo> getStoreList(Page page,@Param("lon") double lon,@Param("lat") double lat);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID获取查询对象
|
* 根据ID获取查询对象
|
||||||
|
|||||||
@ -36,7 +36,7 @@ public interface YxStoreProductService extends BaseService<YxStoreProduct> {
|
|||||||
int getProductStock(int productId,String unique);
|
int getProductStock(int productId,String unique);
|
||||||
|
|
||||||
|
|
||||||
ProductDTO goodsDetail(int id,int type,int uid);
|
ProductDTO goodsDetail(int id,int type,int uid,String latitude,String longitude);
|
||||||
|
|
||||||
List<YxStoreProductQueryVo> getGoodsList(YxStoreProductQueryParam productQueryParam);
|
List<YxStoreProductQueryVo> getGoodsList(YxStoreProductQueryParam productQueryParam);
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import co.yixiang.modules.shop.web.vo.YxSystemStoreQueryVo;
|
|||||||
import co.yixiang.common.web.vo.Paging;
|
import co.yixiang.common.web.vo.Paging;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -18,20 +19,23 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public interface YxSystemStoreService extends BaseService<YxSystemStore> {
|
public interface YxSystemStoreService extends BaseService<YxSystemStore> {
|
||||||
|
|
||||||
YxSystemStoreQueryVo getStoreInfo();
|
List<YxSystemStoreQueryVo> getStoreList(String latitude,String longitude,int page, int limit);
|
||||||
|
|
||||||
|
|
||||||
|
YxSystemStoreQueryVo getStoreInfo(String latitude,String longitude);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID获取查询对象
|
* 根据ID获取查询对象
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
YxSystemStoreQueryVo getYxSystemStoreById(Serializable id) throws Exception;
|
YxSystemStoreQueryVo getYxSystemStoreById(Serializable id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取分页对象
|
* 获取分页对象
|
||||||
* @param yxSystemStoreQueryParam
|
* @param yxSystemStoreQueryParam
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Paging<YxSystemStoreQueryVo> getYxSystemStorePageList(YxSystemStoreQueryParam yxSystemStoreQueryParam) throws Exception;
|
Paging<YxSystemStoreQueryVo> getYxSystemStorePageList(YxSystemStoreQueryParam yxSystemStoreQueryParam);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public interface YxSystemStoreStaffService extends BaseService<YxSystemStoreStaff> {
|
public interface YxSystemStoreStaffService extends BaseService<YxSystemStoreStaff> {
|
||||||
|
|
||||||
boolean checkStatus(int uid);
|
boolean checkStatus(int uid,int storeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID获取查询对象
|
* 根据ID获取查询对象
|
||||||
|
|||||||
@ -125,7 +125,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<YxStoreProductMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProductDTO goodsDetail(int id, int type,int uid) {
|
public ProductDTO goodsDetail(int id, int type,int uid,String latitude,String longitude) {
|
||||||
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
|
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
|
||||||
wrapper.eq("is_del",0).eq("is_show",1).eq("id",id);
|
wrapper.eq("is_del",0).eq("is_show",1).eq("id",id);
|
||||||
YxStoreProduct storeProduct = yxStoreProductMapper.selectOne(wrapper);
|
YxStoreProduct storeProduct = yxStoreProductMapper.selectOne(wrapper);
|
||||||
@ -156,7 +156,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<YxStoreProductMap
|
|||||||
productDTO.setReplyChance(replyService.doReply(id,replyCount));//百分比
|
productDTO.setReplyChance(replyService.doReply(id,replyCount));//百分比
|
||||||
|
|
||||||
//门店
|
//门店
|
||||||
productDTO.setSystemStore(systemStoreService.getStoreInfo());
|
productDTO.setSystemStore(systemStoreService.getStoreInfo(latitude,longitude));
|
||||||
productDTO.setMapKey(RedisUtil.get("tengxun_map_key"));
|
productDTO.setMapKey(RedisUtil.get("tengxun_map_key"));
|
||||||
|
|
||||||
return productDTO;
|
return productDTO;
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package co.yixiang.modules.shop.service.impl;
|
package co.yixiang.modules.shop.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import co.yixiang.enums.CommonEnum;
|
import co.yixiang.enums.CommonEnum;
|
||||||
import co.yixiang.modules.shop.entity.YxSystemStore;
|
import co.yixiang.modules.shop.entity.YxSystemStore;
|
||||||
import co.yixiang.modules.shop.mapper.YxSystemStoreMapper;
|
import co.yixiang.modules.shop.mapper.YxSystemStoreMapper;
|
||||||
@ -9,6 +11,7 @@ import co.yixiang.modules.shop.web.param.YxSystemStoreQueryParam;
|
|||||||
import co.yixiang.modules.shop.web.vo.YxSystemStoreQueryVo;
|
import co.yixiang.modules.shop.web.vo.YxSystemStoreQueryVo;
|
||||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||||
import co.yixiang.common.web.vo.Paging;
|
import co.yixiang.common.web.vo.Paging;
|
||||||
|
import co.yixiang.utils.LocationUtils;
|
||||||
import co.yixiang.utils.RedisUtil;
|
import co.yixiang.utils.RedisUtil;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -20,6 +23,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,7 +46,19 @@ public class YxSystemStoreServiceImpl extends BaseServiceImpl<YxSystemStoreMappe
|
|||||||
private SystemStoreMap storeMap;
|
private SystemStoreMap storeMap;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public YxSystemStoreQueryVo getStoreInfo() {
|
public List<YxSystemStoreQueryVo> getStoreList(String latitude, String longitude, int page, int limit) {
|
||||||
|
|
||||||
|
Page<YxSystemStore> pageModel = new Page<>(page, limit);
|
||||||
|
List<YxSystemStoreQueryVo> list = yxSystemStoreMapper.getStoreList(pageModel,Double.valueOf(longitude),Double.valueOf(latitude));
|
||||||
|
list.forEach(item->{
|
||||||
|
String newDis = NumberUtil.round(Double.valueOf(item.getDistance()) / 1000,2).toString();
|
||||||
|
item.setDistance(newDis);
|
||||||
|
});
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public YxSystemStoreQueryVo getStoreInfo(String latitude,String longitude) {
|
||||||
YxSystemStore systemStore = new YxSystemStore();
|
YxSystemStore systemStore = new YxSystemStore();
|
||||||
systemStore.setIsDel(CommonEnum.DEL_STATUS_0.getValue());
|
systemStore.setIsDel(CommonEnum.DEL_STATUS_0.getValue());
|
||||||
systemStore.setIsShow(CommonEnum.SHOW_STATUS_1.getValue());
|
systemStore.setIsShow(CommonEnum.SHOW_STATUS_1.getValue());
|
||||||
@ -54,17 +70,23 @@ public class YxSystemStoreServiceImpl extends BaseServiceImpl<YxSystemStoreMappe
|
|||||||
if(yxSystemStore == null) return null;
|
if(yxSystemStore == null) return null;
|
||||||
String mention = RedisUtil.get("store_self_mention");
|
String mention = RedisUtil.get("store_self_mention");
|
||||||
if(mention == null || Integer.valueOf(mention) == 2) return null;
|
if(mention == null || Integer.valueOf(mention) == 2) return null;
|
||||||
return storeMap.toDto(yxSystemStore);
|
YxSystemStoreQueryVo systemStoreQueryVo = storeMap.toDto(yxSystemStore);
|
||||||
|
if(StrUtil.isNotEmpty(latitude) && StrUtil.isNotEmpty(longitude)){
|
||||||
|
double distance = LocationUtils.getDistance(Double.valueOf(latitude),Double.valueOf(longitude),
|
||||||
|
Double.valueOf(yxSystemStore.getLatitude()),Double.valueOf(yxSystemStore.getLongitude()));
|
||||||
|
systemStoreQueryVo.setDistance(String.valueOf(distance));
|
||||||
|
}
|
||||||
|
return systemStoreQueryVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public YxSystemStoreQueryVo getYxSystemStoreById(Serializable id) throws Exception{
|
public YxSystemStoreQueryVo getYxSystemStoreById(Serializable id){
|
||||||
return yxSystemStoreMapper.getYxSystemStoreById(id);
|
return yxSystemStoreMapper.getYxSystemStoreById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Paging<YxSystemStoreQueryVo> getYxSystemStorePageList(YxSystemStoreQueryParam yxSystemStoreQueryParam) throws Exception{
|
public Paging<YxSystemStoreQueryVo> getYxSystemStorePageList(YxSystemStoreQueryParam yxSystemStoreQueryParam){
|
||||||
Page page = setPageParam(yxSystemStoreQueryParam,OrderItem.desc("create_time"));
|
Page page = setPageParam(yxSystemStoreQueryParam,OrderItem.desc("add_time"));
|
||||||
IPage<YxSystemStoreQueryVo> iPage = yxSystemStoreMapper.getYxSystemStorePageList(page,yxSystemStoreQueryParam);
|
IPage<YxSystemStoreQueryVo> iPage = yxSystemStoreMapper.getYxSystemStorePageList(page,yxSystemStoreQueryParam);
|
||||||
return new Paging(iPage);
|
return new Paging(iPage);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,9 +37,10 @@ public class YxSystemStoreStaffServiceImpl extends BaseServiceImpl<YxSystemStore
|
|||||||
private YxSystemStoreStaffMapper yxSystemStoreStaffMapper;
|
private YxSystemStoreStaffMapper yxSystemStoreStaffMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkStatus(int uid) {
|
public boolean checkStatus(int uid,int storeId) {
|
||||||
YxSystemStoreStaff storeStaff = new YxSystemStoreStaff();
|
YxSystemStoreStaff storeStaff = new YxSystemStoreStaff();
|
||||||
storeStaff.setUid(uid);
|
storeStaff.setUid(uid);
|
||||||
|
if(storeId > 0) storeStaff.setStoreId(storeId);
|
||||||
return yxSystemStoreStaffMapper.selectCount(Wrappers.query(storeStaff)) > 0;
|
return yxSystemStoreStaffMapper.selectCount(Wrappers.query(storeStaff)) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,12 +10,17 @@ package co.yixiang.modules.shop.web.controller;
|
|||||||
|
|
||||||
import cn.hutool.core.io.file.FileReader;
|
import cn.hutool.core.io.file.FileReader;
|
||||||
import cn.hutool.core.io.resource.ClassPathResource;
|
import cn.hutool.core.io.resource.ClassPathResource;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import co.yixiang.annotation.AnonymousAccess;
|
import co.yixiang.annotation.AnonymousAccess;
|
||||||
import co.yixiang.common.api.ApiResult;
|
import co.yixiang.common.api.ApiResult;
|
||||||
import co.yixiang.constant.ShopConstants;
|
import co.yixiang.constant.ShopConstants;
|
||||||
import co.yixiang.modules.shop.service.YxStoreProductService;
|
import co.yixiang.modules.shop.service.YxStoreProductService;
|
||||||
import co.yixiang.modules.shop.service.YxSystemGroupDataService;
|
import co.yixiang.modules.shop.service.YxSystemGroupDataService;
|
||||||
|
import co.yixiang.modules.shop.service.YxSystemStoreService;
|
||||||
|
import co.yixiang.modules.shop.web.param.YxSystemStoreQueryParam;
|
||||||
|
import co.yixiang.modules.shop.web.vo.YxSystemStoreQueryVo;
|
||||||
import co.yixiang.utils.FileUtil;
|
import co.yixiang.utils.FileUtil;
|
||||||
|
import co.yixiang.utils.RedisUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@ -23,6 +28,7 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -46,6 +52,7 @@ public class IndexController {
|
|||||||
|
|
||||||
private final YxSystemGroupDataService systemGroupDataService;
|
private final YxSystemGroupDataService systemGroupDataService;
|
||||||
private final YxStoreProductService storeProductService;
|
private final YxStoreProductService storeProductService;
|
||||||
|
private final YxSystemStoreService systemStoreService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -122,6 +129,28 @@ public class IndexController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@AnonymousAccess
|
||||||
|
@GetMapping("/store_list")
|
||||||
|
@ApiOperation(value = "获取门店列表",notes = "获取门店列表")
|
||||||
|
public ApiResult<Object> storeList( YxSystemStoreQueryParam param){
|
||||||
|
Map<String,Object> map = new LinkedHashMap<>();
|
||||||
|
List<YxSystemStoreQueryVo> lists;
|
||||||
|
if(StrUtil.isBlank(param.getLatitude()) || StrUtil.isBlank(param.getLongitude())){
|
||||||
|
lists = systemStoreService.getYxSystemStorePageList(param).getRecords();
|
||||||
|
}else{
|
||||||
|
lists = systemStoreService.getStoreList(
|
||||||
|
param.getLatitude(),
|
||||||
|
param.getLongitude(),
|
||||||
|
param.getPage(),param.getLimit());
|
||||||
|
}
|
||||||
|
|
||||||
|
map.put("list",lists);
|
||||||
|
// map.put("mapKey",RedisUtil.get("tengxun_map_key"));
|
||||||
|
return ApiResult.ok(map);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -119,10 +119,12 @@ public class StoreProductController extends BaseController {
|
|||||||
@Log(value = "查看商品详情",type = 1)
|
@Log(value = "查看商品详情",type = 1)
|
||||||
@GetMapping("/product/detail/{id}")
|
@GetMapping("/product/detail/{id}")
|
||||||
@ApiOperation(value = "普通商品详情",notes = "普通商品详情")
|
@ApiOperation(value = "普通商品详情",notes = "普通商品详情")
|
||||||
public ApiResult<ProductDTO> detail(@PathVariable Integer id){
|
public ApiResult<ProductDTO> detail(@PathVariable Integer id,
|
||||||
|
@RequestParam(value = "") String latitude,
|
||||||
|
@RequestParam(value = "") String longitude){
|
||||||
int uid = SecurityUtils.getUserId().intValue();
|
int uid = SecurityUtils.getUserId().intValue();
|
||||||
|
|
||||||
ProductDTO productDTO = storeProductService.goodsDetail(id,0,uid);
|
ProductDTO productDTO = storeProductService.goodsDetail(id,0,uid,latitude,longitude);
|
||||||
|
|
||||||
// 海报
|
// 海报
|
||||||
String siteUrl = systemConfigService.getData("site_url");
|
String siteUrl = systemConfigService.getData("site_url");
|
||||||
|
|||||||
@ -6,6 +6,9 @@ import lombok.EqualsAndHashCode;
|
|||||||
|
|
||||||
import co.yixiang.common.web.param.QueryParam;
|
import co.yixiang.common.web.param.QueryParam;
|
||||||
|
|
||||||
|
import javax.persistence.criteria.CriteriaBuilder;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 门店自提 查询参数对象
|
* 门店自提 查询参数对象
|
||||||
@ -16,7 +19,12 @@ import co.yixiang.common.web.param.QueryParam;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ApiModel(value="YxSystemStoreQueryParam对象", description="门店自提查询参数")
|
@ApiModel(value="门店自提", description="门店自提查询参数")
|
||||||
public class YxSystemStoreQueryParam extends QueryParam {
|
public class YxSystemStoreQueryParam extends QueryParam {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,4 +70,6 @@ public class YxSystemStoreQueryVo implements Serializable {
|
|||||||
|
|
||||||
private Date validTimeStart;
|
private Date validTimeStart;
|
||||||
|
|
||||||
|
private String distance;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -447,7 +447,7 @@ public class YxUserServiceImpl extends BaseServiceImpl<YxUserMapper, YxUser> imp
|
|||||||
}
|
}
|
||||||
|
|
||||||
//获取核销权限
|
//获取核销权限
|
||||||
userQueryVo.setCheckStatus(systemStoreStaffService.checkStatus((int)id));
|
userQueryVo.setCheckStatus(systemStoreStaffService.checkStatus((int)id,0));
|
||||||
|
|
||||||
return userQueryVo;
|
return userQueryVo;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getYxSystemStorePageList" resultType="co.yixiang.modules.shop.web.vo.YxSystemStoreQueryVo">
|
<select id="getYxSystemStorePageList" resultType="co.yixiang.modules.shop.web.vo.YxSystemStoreQueryVo">
|
||||||
select <include refid="Base_Column_List"/> from yx_system_store
|
select <include refid="Base_Column_List"/> from yx_system_store where is_show = 1 and is_del = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package co.yixiang.utils;
|
package co.yixiang.utils;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName LocationUtils
|
* @ClassName LocationUtils
|
||||||
* @Author hupeng <610796224@qq.com>
|
* @Author hupeng <610796224@qq.com>
|
||||||
@ -13,7 +15,7 @@ public class LocationUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过经纬度获取距离(单位:米)
|
* 通过经纬度获取距离(单位:千米)
|
||||||
* @param lat1
|
* @param lat1
|
||||||
* @param lng1
|
* @param lng1
|
||||||
* @param lat2
|
* @param lat2
|
||||||
@ -31,7 +33,8 @@ public class LocationUtils {
|
|||||||
* Math.pow(Math.sin(b / 2), 2)));
|
* Math.pow(Math.sin(b / 2), 2)));
|
||||||
s = s * EARTH_RADIUS;
|
s = s * EARTH_RADIUS;
|
||||||
s = Math.round(s * 10000d) / 10000d;
|
s = Math.round(s * 10000d) / 10000d;
|
||||||
s = s*1000;
|
//s = s*1000;
|
||||||
return s;
|
return NumberUtil.round(s,2).doubleValue();
|
||||||
|
//return s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user