运费设置业务类 添加
This commit is contained in:
parent
77cb223ac9
commit
ac98be5c09
@ -42,7 +42,7 @@ public class ShopStoreSameCityTransportBase implements Serializable {
|
||||
private Long transport_base_id;
|
||||
|
||||
@ApiModelProperty(value = "店铺ID")
|
||||
private Integer store_id;
|
||||
private Long store_id;
|
||||
|
||||
@ApiModelProperty(value = "店铺详细地址")
|
||||
private String store_address;
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2024. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.common.pojo.dto;
|
||||
|
||||
import com.suisung.mall.common.modules.store.ShopStoreSameCityTransport;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreSameCityTransportBase;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "同城配送基础设置DTO", description = "同城配送基础设置DTO")
|
||||
public class ShopStoreSameCityTransportBaseDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "店铺同城快递基础运费设置")
|
||||
ShopStoreSameCityTransportBase shopStoreSameCityTransportBase;
|
||||
|
||||
@ApiModelProperty(value = "店铺同城快递运费设置(起送条件+优惠条件)")
|
||||
public List<ShopStoreSameCityTransport> shopStoreSameCityTransportList;
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (c) 2024. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.shop.store.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreSameCityTransportBase;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface ShopStoreSameCityTransportBaseMapper extends BaseMapper<ShopStoreSameCityTransportBase> {
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2024. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.shop.store.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreSameCityTransport;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreSameCityTransportBase;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface ShopStoreSameCityTransportMapper extends BaseMapper<ShopStoreSameCityTransport> {
|
||||
}
|
||||
@ -90,4 +90,11 @@ public interface ShopStoreBaseService extends IBaseService<ShopStoreBase> {
|
||||
Integer getStoreId(Integer user_id);
|
||||
|
||||
Boolean removeStore(Integer storeId);
|
||||
|
||||
/**
|
||||
* 根据店铺Id获取一条基本店铺信息
|
||||
* @param store_id
|
||||
* @return
|
||||
*/
|
||||
ShopStoreBase storeBase(Integer store_id);
|
||||
}
|
||||
|
||||
@ -8,5 +8,28 @@
|
||||
|
||||
package com.suisung.mall.shop.store.service;
|
||||
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.pojo.dto.ShopStoreSameCityTransportBaseDTO;
|
||||
|
||||
public interface ShopStoreSameCityTransportBaseService {
|
||||
|
||||
/**
|
||||
* 获取同城配送设置详情信息
|
||||
* @return
|
||||
*/
|
||||
CommonResult ShopStoreSameCityTransportBaseDetail();
|
||||
|
||||
/**
|
||||
* 保存或更新同城配送各项设置
|
||||
* @param shopStoreSameCityTransportBaseDTO
|
||||
* @return
|
||||
*/
|
||||
CommonResult saveOrUpdateSameCityTransport(ShopStoreSameCityTransportBaseDTO shopStoreSameCityTransportBaseDTO);
|
||||
|
||||
/**
|
||||
* 根据店铺 Id 获取同城配送设置详情信息
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
ShopStoreSameCityTransportBaseDTO getDetailById(Long storeId);
|
||||
}
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2024. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.shop.store.service;
|
||||
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreSameCityTransport;
|
||||
import com.suisung.mall.common.pojo.dto.ShopStoreSameCityTransportBaseDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ShopStoreSameCityTransportService {
|
||||
|
||||
|
||||
/**
|
||||
* 根据同城配送基础配置自增 Id 获取同城配送扩展设置列表
|
||||
* @param transportBaseId
|
||||
* @return
|
||||
*/
|
||||
List<ShopStoreSameCityTransport> selectShopStoreSameCityTransportList(Long transportBaseId);
|
||||
}
|
||||
@ -2839,6 +2839,23 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据店铺Id获取一条基本店铺信息
|
||||
*
|
||||
* @param store_id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ShopStoreBase storeBase(Integer store_id) {
|
||||
if(store_id==null ||store_id<=0){
|
||||
return null;
|
||||
}
|
||||
|
||||
QueryWrapper<ShopStoreBase> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("store_id", store_id);
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理 store_slide 字段
|
||||
*
|
||||
|
||||
@ -8,9 +8,92 @@
|
||||
|
||||
package com.suisung.mall.shop.store.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreBase;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreSameCityTransport;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreSameCityTransportBase;
|
||||
import com.suisung.mall.common.pojo.dto.ShopStoreSameCityTransportBaseDTO;
|
||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||
import com.suisung.mall.shop.store.mapper.ShopStoreSameCityTransportBaseMapper;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreSameCityTransportBaseService;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreSameCityTransportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ShopStoreSameCityTransportBaseServiceImpl implements ShopStoreSameCityTransportBaseService {
|
||||
public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<ShopStoreSameCityTransportBaseMapper, ShopStoreSameCityTransportBase> implements ShopStoreSameCityTransportBaseService {
|
||||
|
||||
@Autowired
|
||||
private ShopStoreSameCityTransportService shopStoreSameCityTransportService;
|
||||
|
||||
@Autowired
|
||||
private ShopStoreBaseService shopStoreBaseService;
|
||||
|
||||
/**
|
||||
* 获取同城配送设置详情信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CommonResult ShopStoreSameCityTransportBaseDetail() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或更新同城配送各项设置
|
||||
*
|
||||
* @param shopStoreSameCityTransportBaseDTO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CommonResult saveOrUpdateSameCityTransport(ShopStoreSameCityTransportBaseDTO shopStoreSameCityTransportBaseDTO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据店铺 Id 获取同城配送设置详情信息
|
||||
*
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ShopStoreSameCityTransportBaseDTO getDetailById(Long storeId) {
|
||||
if (storeId == null || storeId <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ShopStoreBase shopStoreBase = shopStoreBaseService.storeBase(storeId.intValue());
|
||||
if (shopStoreBase == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
QueryWrapper<ShopStoreSameCityTransportBase> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id", storeId);
|
||||
queryWrapper.orderByAsc("transport_base_id");
|
||||
ShopStoreSameCityTransportBase shopStoreSameCityTransportBase = getOne(queryWrapper);
|
||||
if (shopStoreSameCityTransportBase == null) {
|
||||
shopStoreSameCityTransportBase = new ShopStoreSameCityTransportBase();
|
||||
shopStoreSameCityTransportBase.setStore_id(storeId);
|
||||
|
||||
// 获取店铺的地址和经纬度
|
||||
shopStoreSameCityTransportBase.setStore_address(StrUtil.removeAll(shopStoreBase.getStore_area(),"/") + shopStoreBase.getStore_address());
|
||||
shopStoreSameCityTransportBase.setStore_longitude(Convert.toBigDecimal(shopStoreBase.getStore_longitude()));
|
||||
shopStoreSameCityTransportBase.setStore_latitude(Convert.toBigDecimal(shopStoreBase.getStore_latitude()));
|
||||
}
|
||||
|
||||
ShopStoreSameCityTransportBaseDTO shopStoreSameCityTransportBaseDTO = new ShopStoreSameCityTransportBaseDTO();
|
||||
shopStoreSameCityTransportBaseDTO.setShopStoreSameCityTransportBase(shopStoreSameCityTransportBase);
|
||||
|
||||
// 多个店铺同城快递运费设置(起送条件+优惠条件)
|
||||
List<ShopStoreSameCityTransport> shopStoreSameCityTransportList = shopStoreSameCityTransportService.selectShopStoreSameCityTransportList(shopStoreSameCityTransportBase.getTransport_base_id());
|
||||
shopStoreSameCityTransportBaseDTO.setShopStoreSameCityTransportList(shopStoreSameCityTransportList);
|
||||
|
||||
return shopStoreSameCityTransportBaseDTO;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 2024. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.shop.store.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.suisung.mall.common.constant.ConstantError;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreSameCityTransport;
|
||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||
import com.suisung.mall.shop.store.mapper.ShopStoreSameCityTransportMapper;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreSameCityTransportService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ShopStoreSameCityTransportServiceImpl extends BaseServiceImpl<ShopStoreSameCityTransportMapper, ShopStoreSameCityTransport> implements ShopStoreSameCityTransportService {
|
||||
|
||||
|
||||
/**
|
||||
* 根据同城配送基础配置自增 Id 获取同城配送扩展设置列表
|
||||
*
|
||||
* @param transportBaseId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ShopStoreSameCityTransport> selectShopStoreSameCityTransportList(Long transportBaseId) {
|
||||
if (transportBaseId == null||transportBaseId <= 0) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
QueryWrapper<ShopStoreSameCityTransport> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("transport_base_id", transportBaseId);
|
||||
queryWrapper.eq("status", ConstantError.Enable);
|
||||
queryWrapper.orderByAsc("transport_id");
|
||||
|
||||
List<ShopStoreSameCityTransport> shopStoreSameCityTransportList = list(queryWrapper);
|
||||
if(CollectionUtil.isEmpty(shopStoreSameCityTransportList)){
|
||||
shopStoreSameCityTransportList = Collections.emptyList();
|
||||
}
|
||||
|
||||
return shopStoreSameCityTransportList;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user