| | |
| | | package cc.mrbird.febs.mall.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.mall.dto.CountryDeliveryDto; |
| | | import cc.mrbird.febs.mall.entity.MallCountryDelivery; |
| | | import cc.mrbird.febs.mall.mapper.MallCountryDeliveryMapper; |
| | | import cc.mrbird.febs.mall.service.IMallCountryDeliveryService; |
| | | import cc.mrbird.febs.mall.vo.AdminMallNewsInfoVo; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | .orderByAsc(MallCountryDelivery::getCountryCode) |
| | | ); |
| | | return new FebsResponse().success().data(list); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<MallCountryDelivery> countryDeliveryList(MallCountryDelivery dto, QueryRequest request) { |
| | | Page<MallCountryDelivery> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<MallCountryDelivery> pages = mallCountryDeliveryMapper.getCountryDeliveryListInPage(page, dto); |
| | | return pages; |
| | | } |
| | | |
| | | @Override |
| | |
| | | ); |
| | | |
| | | if (delivery == null) { |
| | | |
| | | MallCountryDelivery defaultDelivery = mallCountryDeliveryMapper.selectOne( |
| | | Wrappers.lambdaQuery(MallCountryDelivery.class) |
| | | .eq(MallCountryDelivery::getCountryCode, "DEFAULT") |
| | | .eq(MallCountryDelivery::getStatus, 1) |
| | | ); |
| | | // 没有配置则返回默认运费 0(可根据业务调整) |
| | | return new FebsResponse().success().data(BigDecimal.ZERO); |
| | | return new FebsResponse().success().data(defaultDelivery.getShippingFee()); |
| | | } |
| | | |
| | | return new FebsResponse().success().data(delivery.getShippingFee()); |