Compare commits
4 Commits
6743936872
...
201f44a588
Author | SHA1 | Date |
---|---|---|
小小张 | 201f44a588 | |
小小张 | 80e679a751 | |
小小张 | a4246b55b9 | |
小小张 | 481473c310 |
|
@ -2,11 +2,12 @@ package cn.iocoder.yudao.module.shop.controller.admin.express;
|
|||
|
||||
import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesReqVO;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesSearchReqVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesDO;
|
||||
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
@ -46,8 +47,8 @@ public class ShippingTemplatesController {
|
|||
@PreAuthorize("@ss.hasPermission('admin:shipping:templates:list')")
|
||||
@Operation(summary = "分页列表")
|
||||
@GetMapping(value = "/list")
|
||||
public CommonResult<PageResult<ShippingTemplatesDO>> getList(@Validated ShippingTemplatesSearchReqVO request){
|
||||
PageResult<ShippingTemplatesDO> shippingTemplatesCommonPage = shippingTemplatesService.getList(request);
|
||||
public CommonResult<PageInfo<ShippingTemplatesDO>> getList(@Validated ShippingTemplatesSearchReqVO request, @Validated PageParam pageParamRequest){
|
||||
PageInfo<ShippingTemplatesDO> shippingTemplatesCommonPage = shippingTemplatesService.getList(request, pageParamRequest);
|
||||
return CommonResult.success(shippingTemplatesCommonPage);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.util.List;
|
|||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("admin/express/shipping/no_delivery")
|
||||
@Tag(name = "设置 -- 物流 -- 免费")
|
||||
@Tag(name = "设置 -- 物流 -- 不送达")
|
||||
public class ShippingTemplatesNoDeliveryController {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -39,9 +39,6 @@ public class ShippingTemplatesFreeRespVO implements Serializable {
|
|||
@Schema(description = "省ID, 多个逗号分割。 全国 all", required = true, example = "1,2,3,4")
|
||||
private String provinceId;
|
||||
|
||||
@Schema(description = "城市名称描述")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "包邮件数", required = true, example = "1")
|
||||
// @Min(value = 1, message = "请填写包邮件数")
|
||||
@DecimalMin(value = "0.1", message = "包邮不能低于0.1")
|
||||
|
|
|
@ -38,8 +38,6 @@ public class ShippingTemplatesRegionRespVO implements Serializable {
|
|||
|
||||
@Schema(description = "省ID, 多个逗号分割。 全国 all", required = true, example = "1,2,3,4")
|
||||
private String provinceId;
|
||||
@Schema(description = "城市名称描述")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "首件", required = true, example = "0.1")
|
||||
@DecimalMin(value = "0.1", message = "首件金额不能低于0.1")
|
||||
|
@ -57,6 +55,4 @@ public class ShippingTemplatesRegionRespVO implements Serializable {
|
|||
@DecimalMin(value = "0.1", message = "续件运费金额不能低于0.1")
|
||||
private BigDecimal renewalPrice;
|
||||
|
||||
@Schema(description = "分组唯一值")
|
||||
private String uniqid;
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.shop.controller.app.product;
|
|||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse;
|
||||
import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailResponse;
|
||||
import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO;
|
||||
import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailRespVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct;
|
||||
import cn.iocoder.yudao.module.shop.request.product.ProductListRequest;
|
||||
import cn.iocoder.yudao.module.shop.request.product.ProductRequest;
|
||||
|
@ -49,7 +49,7 @@ public class ProductController {
|
|||
*/
|
||||
@Operation(summary = "热门商品推荐")
|
||||
@RequestMapping(value = "/product/hot", method = RequestMethod.GET)
|
||||
public CommonResult<PageInfo<IndexProductResponse>> getHotProductList(@Validated PageParam pageParamRequest) {
|
||||
public CommonResult<PageInfo<IndexProductRespVO>> getHotProductList(@Validated PageParam pageParamRequest) {
|
||||
return CommonResult.success(productService.getHotProductList(pageParamRequest));
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class ProductController {
|
|||
*/
|
||||
@Operation(summary = "优选商品推荐")
|
||||
@RequestMapping(value = "/product/good", method = RequestMethod.GET)
|
||||
public CommonResult<PageInfo<IndexProductResponse>> getGoodProductList() {
|
||||
public CommonResult<PageInfo<IndexProductRespVO>> getGoodProductList() {
|
||||
return CommonResult.success(productService.getGoodProductList());
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ public class ProductController {
|
|||
*/
|
||||
@Operation(summary = "商品列表")
|
||||
@RequestMapping(value = "/products", method = RequestMethod.GET)
|
||||
public CommonResult<PageInfo<IndexProductResponse>> getList(@Validated ProductRequest request, @Validated PageParam pageParamRequest) {
|
||||
public CommonResult<PageInfo<IndexProductRespVO>> getList(@Validated ProductRequest request, @Validated PageParam pageParamRequest) {
|
||||
return CommonResult.success(productService.getList(request, pageParamRequest));
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ public class ProductController {
|
|||
@Operation(summary = "商品详情")
|
||||
@RequestMapping(value = "/product/detail/{id}", method = RequestMethod.GET)
|
||||
@Parameter(name = "type", description = "normal-正常,video-视频")
|
||||
public CommonResult<ProductDetailResponse> getDetail(@PathVariable Integer id, @RequestParam(value = "type", defaultValue = "normal") String type) {
|
||||
public CommonResult<ProductDetailRespVO> getDetail(@PathVariable Integer id, @RequestParam(value = "type", defaultValue = "normal") String type) {
|
||||
return CommonResult.success(productService.getDetail(id, type));
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ public class ProductController {
|
|||
*/
|
||||
@Operation(summary = "商品列表(个别分类模型使用)")
|
||||
@RequestMapping(value = "/product/list", method = RequestMethod.GET)
|
||||
public CommonResult<PageInfo<IndexProductResponse>> getProductList(@Validated ProductListRequest request, @Validated PageParam pageParamRequest) {
|
||||
public CommonResult<PageInfo<IndexProductRespVO>> getProductList(@Validated ProductListRequest request, @Validated PageParam pageParamRequest) {
|
||||
return CommonResult.success(productService.getCategoryProductList(request, pageParamRequest));
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ public class ProductController {
|
|||
*/
|
||||
@Operation(summary = "商品规格详情")
|
||||
@RequestMapping(value = "/product/sku/detail/{id}", method = RequestMethod.GET)
|
||||
public CommonResult<ProductDetailResponse> getSkuDetail(@PathVariable Integer id) {
|
||||
public CommonResult<ProductDetailRespVO> getSkuDetail(@PathVariable Integer id) {
|
||||
return CommonResult.success(productService.getSkuDetail(id));
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
|
@ -24,7 +25,7 @@ import java.math.BigDecimal;
|
|||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@Schema(description="首页商品对象")
|
||||
public class IndexProductResponse {
|
||||
public class IndexProductRespVO implements Serializable {
|
||||
|
||||
|
||||
@Schema(description = "商品id")
|
|
@ -28,7 +28,7 @@ import java.util.List;
|
|||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@Schema(description="商品详情H5")
|
||||
public class ProductDetailResponse implements Serializable {
|
||||
public class ProductDetailRespVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package cn.iocoder.yudao.module.shop.convert.product;
|
||||
|
||||
import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse;
|
||||
import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct;
|
||||
import cn.iocoder.yudao.module.shop.vo.product.StoreProductVO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
@ -14,5 +14,5 @@ public interface StoreProductConvert {
|
|||
|
||||
StoreProductVO convert(StoreProduct bean);
|
||||
|
||||
List<IndexProductResponse> convert1(List<StoreProduct> bean);
|
||||
List<IndexProductRespVO> convert1(List<StoreProduct> bean);
|
||||
}
|
||||
|
|
|
@ -45,11 +45,6 @@ public class ShippingTemplatesFreeDO implements Serializable {
|
|||
*/
|
||||
private Integer cityId;
|
||||
|
||||
/**
|
||||
*描述
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
*包邮件数
|
||||
*/
|
||||
|
|
|
@ -46,11 +46,6 @@ public class ShippingTemplatesRegionDO implements Serializable {
|
|||
|
||||
private Integer provinceId;
|
||||
|
||||
/**
|
||||
*描述
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
*首件
|
||||
*/
|
||||
|
@ -76,11 +71,6 @@ public class ShippingTemplatesRegionDO implements Serializable {
|
|||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
*分组唯一值
|
||||
*/
|
||||
private String uniqid;
|
||||
|
||||
/**
|
||||
*是否无效
|
||||
*/
|
||||
|
|
|
@ -36,4 +36,6 @@ public interface ShippingTemplatesNoDeliveryService extends IService<ShippingTem
|
|||
* @return 运费模板
|
||||
*/
|
||||
ShippingTemplatesNoDeliveryDO getByTempIdAndCityId(Integer tempId, Integer cityId);
|
||||
|
||||
public Boolean delete(Integer tempId);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package cn.iocoder.yudao.module.shop.service.express;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesReqVO;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesSearchReqVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesDO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
|
@ -25,7 +26,7 @@ import org.springframework.validation.annotation.Validated;
|
|||
@Validated
|
||||
public interface ShippingTemplatesService extends IService<ShippingTemplatesDO> {
|
||||
|
||||
PageResult<ShippingTemplatesDO> getList(ShippingTemplatesSearchReqVO request);
|
||||
PageInfo<ShippingTemplatesDO> getList(ShippingTemplatesSearchReqVO request, PageParam pageParamRequest);
|
||||
|
||||
/**
|
||||
* 新增运费模板
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.springframework.stereotype.Service;
|
|||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* ShippingTemplatesFreeServiceImpl 接口实现
|
||||
|
@ -68,7 +67,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
|
|||
for (Integer cityId: cityIdList) {
|
||||
ShippingTemplatesFreeDO shippingTemplatesFreeDO = new ShippingTemplatesFreeDO();
|
||||
shippingTemplatesFreeDO.setCityId(cityId);
|
||||
shippingTemplatesFreeDO.setTitle(shippingTemplatesFreeRespVO.getTitle());
|
||||
// shippingTemplatesFreeDO.setTitle(shippingTemplatesFreeRespVO.getTitle());
|
||||
shippingTemplatesFreeDO.setUniqid(uniqueKey);
|
||||
shippingTemplatesFreeDO.setTempId(tempId);
|
||||
shippingTemplatesFreeDO.setType(type);
|
||||
|
@ -82,7 +81,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
|
|||
saveBatch(shippingTemplatesFreesListDO);
|
||||
|
||||
//删除模板下的无效数据
|
||||
delete(tempId);
|
||||
deleteStatusFalse(tempId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -116,11 +115,21 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl<ShippingTempla
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除模板下的无效数据
|
||||
* 删除模板下的数据
|
||||
* @param tempId Integer 运费模板id
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Integer tempId) {
|
||||
LambdaQueryWrapper<ShippingTemplatesFreeDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId);
|
||||
return dao.delete(lambdaQueryWrapper) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除模板下的无效数据
|
||||
* @param tempId Integer 运费模板id
|
||||
*/
|
||||
public Boolean deleteStatusFalse(Integer tempId) {
|
||||
LambdaQueryWrapper<ShippingTemplatesFreeDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getTempId, tempId);
|
||||
lambdaQueryWrapper.eq(ShippingTemplatesFreeDO::getStatus, false);
|
||||
|
|
|
@ -11,14 +11,12 @@ import cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesNoDeliver
|
|||
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesNoDeliveryService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
|
@ -41,6 +39,7 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
|
|||
public void saveAll(List<ShippingTemplatesNoDeliveryRespVO> shippingTemplatesNoDeliveryRespVOS, Integer tempId) {
|
||||
ArrayList<ShippingTemplatesNoDeliveryDO> shippingTemplatesNoDeliveryDOS = new ArrayList<>();
|
||||
|
||||
delete(tempId);
|
||||
for (ShippingTemplatesNoDeliveryRespVO shippingTemplatesNoDeliveryRespVO : shippingTemplatesNoDeliveryRespVOS) {
|
||||
if(shippingTemplatesNoDeliveryRespVO.getCityId().equals("all") || shippingTemplatesNoDeliveryRespVO.getCityId().equals("0")){
|
||||
cityIdList = getCityIdList();
|
||||
|
@ -58,6 +57,17 @@ public class ShippingTemplatesNoDeliveryServiceImpl extends ServiceImpl<Shipping
|
|||
saveBatch(shippingTemplatesNoDeliveryDOS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除模板下的无效数据
|
||||
* @param tempId Integer 运费模板id
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Integer tempId) {
|
||||
LambdaQueryWrapper<ShippingTemplatesNoDeliveryDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ShippingTemplatesNoDeliveryDO::getTempId, tempId);
|
||||
return shippingTemplatesNoDeliveryMapper.delete(lambdaQueryWrapper) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有城市cityId
|
||||
* @author Mr.Zhang
|
||||
|
|
|
@ -20,7 +20,6 @@ import java.io.Serializable;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* ShippingTemplatesRegionServiceImpl 接口实现
|
||||
|
@ -79,8 +78,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
|
|||
for (Integer cityId: cityIdList) {
|
||||
ShippingTemplatesRegionDO shippingTemplatesRegionDO = new ShippingTemplatesRegionDO();
|
||||
shippingTemplatesRegionDO.setCityId(cityId);
|
||||
shippingTemplatesRegionDO.setTitle(shippingTemplatesRegionRespVO.getTitle());
|
||||
shippingTemplatesRegionDO.setUniqid(uniqueKey);
|
||||
// shippingTemplatesRegionDO.setTitle(shippingTemplatesRegionRespVO.getTitle());
|
||||
shippingTemplatesRegionDO.setRenewal(shippingTemplatesRegionRespVO.getRenewal());
|
||||
shippingTemplatesRegionDO.setRenewalPrice(shippingTemplatesRegionRespVO.getRenewalPrice());
|
||||
shippingTemplatesRegionDO.setFirst(shippingTemplatesRegionRespVO.getFirst());
|
||||
|
@ -95,7 +93,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
|
|||
saveBatch(shippingTemplatesRegionDOList);
|
||||
|
||||
//删除模板下的无效数据
|
||||
delete(tempId);
|
||||
deleteStatusFalse(tempId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -133,8 +131,7 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
|
|||
* @param tempId Integer 运费模板id
|
||||
* @return Boolean
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Integer tempId) {
|
||||
public Boolean deleteStatusFalse(Integer tempId) {
|
||||
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
|
||||
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getStatus, false);
|
||||
|
@ -152,7 +149,6 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
|
|||
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
|
||||
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getCityId, cityId);
|
||||
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getStatus, true);
|
||||
lambdaQueryWrapper.orderByDesc(ShippingTemplatesRegionDO::getId);
|
||||
lambdaQueryWrapper.last(" limit 1");
|
||||
return dao.selectOne(lambdaQueryWrapper);
|
||||
|
@ -167,5 +163,12 @@ public class ShippingTemplatesRegionServiceImpl extends ServiceImpl<ShippingTemp
|
|||
public List<ShippingTemplatesRegionRespVO> getListGroup(Integer tempId) {
|
||||
return dao.getListGroup(tempId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean delete(Integer tempId) {
|
||||
LambdaQueryWrapper<ShippingTemplatesRegionDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ShippingTemplatesRegionDO::getTempId, tempId);
|
||||
return dao.delete(lambdaQueryWrapper) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.shop.service.express.impl;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.express.vo.*;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ShippingTemplatesDO;
|
||||
import cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesMapper;
|
||||
|
@ -13,6 +13,8 @@ import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesRegionServi
|
|||
import cn.iocoder.yudao.module.shop.service.express.ShippingTemplatesService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -59,15 +61,16 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl<ShippingTemplatesM
|
|||
* @return List<ShippingTemplates>
|
||||
*/
|
||||
@Override
|
||||
public PageResult<ShippingTemplatesDO> getList(ShippingTemplatesSearchReqVO request) {
|
||||
public PageInfo<ShippingTemplatesDO> getList(ShippingTemplatesSearchReqVO request, PageParam pageParamRequest) {
|
||||
PageHelper.startPage(pageParamRequest.getPageNo(), pageParamRequest.getPageSize());
|
||||
|
||||
LambdaQueryWrapper<ShippingTemplatesDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if(!StringUtils.isBlank(request.getKeywords())){
|
||||
lambdaQueryWrapper.like(ShippingTemplatesDO::getName, request.getKeywords());
|
||||
}
|
||||
lambdaQueryWrapper.orderByDesc(ShippingTemplatesDO::getSort).orderByDesc(ShippingTemplatesDO::getId);
|
||||
|
||||
return dao.selectPage(request, lambdaQueryWrapper);
|
||||
lambdaQueryWrapper.orderByDesc(ShippingTemplatesDO::getSort).orderByDesc(ShippingTemplatesDO::getId);
|
||||
return new PageInfo<>(dao.selectList(lambdaQueryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -92,6 +95,7 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl<ShippingTemplatesM
|
|||
shippingTemplatesDO.setName(request.getName());
|
||||
shippingTemplatesDO.setSort(request.getSort());
|
||||
shippingTemplatesDO.setType(request.getType());
|
||||
shippingTemplatesDO.setDeleted(false);
|
||||
shippingTemplatesDO.setAppoint(request.getAppoint());
|
||||
|
||||
save(shippingTemplatesDO);
|
||||
|
@ -183,7 +187,8 @@ public class ShippingTemplatesServiceImpl extends ServiceImpl<ShippingTemplatesM
|
|||
return transactionTemplate.execute(e -> {
|
||||
shippingTemplatesRegionService.delete(id);
|
||||
shippingTemplatesFreeService.delete(id);
|
||||
removeById(id);
|
||||
shippingTemplatesNoDeliveryService.delete(id);
|
||||
dao.deleteById(id);
|
||||
return Boolean.TRUE;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.shop.service.product;
|
|||
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse;
|
||||
import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailResponse;
|
||||
import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO;
|
||||
import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailRespVO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct;
|
||||
import cn.iocoder.yudao.module.shop.request.product.ProductListRequest;
|
||||
import cn.iocoder.yudao.module.shop.request.product.ProductRequest;
|
||||
|
@ -41,7 +41,7 @@ public interface ProductService {
|
|||
* @param pageParamRequest 分页参数
|
||||
* @return CommonPage
|
||||
*/
|
||||
PageInfo<IndexProductResponse> getList(ProductRequest request, PageParam pageParamRequest);
|
||||
PageInfo<IndexProductRespVO> getList(ProductRequest request, PageParam pageParamRequest);
|
||||
|
||||
/**
|
||||
* 获取商品详情
|
||||
|
@ -49,14 +49,14 @@ public interface ProductService {
|
|||
* @param type normal-正常,void-视频
|
||||
* @return 商品详情信息
|
||||
*/
|
||||
ProductDetailResponse getDetail(Integer id, String type);
|
||||
ProductDetailRespVO getDetail(Integer id, String type);
|
||||
|
||||
/**
|
||||
* 获取商品SKU详情
|
||||
* @param id 商品编号
|
||||
* @return 商品详情信息
|
||||
*/
|
||||
ProductDetailResponse getSkuDetail(Integer id);
|
||||
ProductDetailRespVO getSkuDetail(Integer id);
|
||||
|
||||
/**
|
||||
* 商品评论列表
|
||||
|
@ -79,7 +79,7 @@ public interface ProductService {
|
|||
* @param pageRequest 分页参数
|
||||
* @return CommonPage<IndexProductResponse>
|
||||
*/
|
||||
PageInfo<IndexProductResponse> getHotProductList(PageParam pageRequest);
|
||||
PageInfo<IndexProductRespVO> getHotProductList(PageParam pageRequest);
|
||||
|
||||
/**
|
||||
* 商品详情评论
|
||||
|
@ -92,7 +92,7 @@ public interface ProductService {
|
|||
* 优选商品推荐
|
||||
* @return CommonPage<IndexProductResponse>
|
||||
*/
|
||||
PageInfo<IndexProductResponse> getGoodProductList();
|
||||
PageInfo<IndexProductRespVO> getGoodProductList();
|
||||
|
||||
/**
|
||||
* 商品列表(个别分类模型使用)
|
||||
|
@ -100,7 +100,7 @@ public interface ProductService {
|
|||
* @param pageParamRequest 分页参数
|
||||
* @return CommonPage
|
||||
*/
|
||||
PageInfo<IndexProductResponse> getCategoryProductList(ProductListRequest request, PageParam pageParamRequest);
|
||||
PageInfo<IndexProductRespVO> getCategoryProductList(ProductListRequest request, PageParam pageParamRequest);
|
||||
|
||||
/**
|
||||
* 获取商品排行榜
|
||||
|
|
|
@ -9,8 +9,8 @@ import cn.iocoder.yudao.module.infra.api.config.ApiConfigApi;
|
|||
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
||||
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
||||
import cn.iocoder.yudao.module.shop.constants.SysConfigConstants;
|
||||
import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse;
|
||||
import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailResponse;
|
||||
import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO;
|
||||
import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailRespVO;
|
||||
import cn.iocoder.yudao.module.shop.convert.product.StoreProductConvert;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProductAttr;
|
||||
|
@ -107,18 +107,18 @@ public class ProductServiceImpl implements ProductService {
|
|||
* @return CommonPage<IndexProductResponse>
|
||||
*/
|
||||
@Override
|
||||
public PageInfo<IndexProductResponse> getList(ProductRequest request, PageParam pageRequest) {
|
||||
public PageInfo<IndexProductRespVO> getList(ProductRequest request, PageParam pageRequest) {
|
||||
List<StoreProduct> storeProductList = storeProductService.findH5List(request, pageRequest);
|
||||
if (CollUtil.isEmpty(storeProductList)) {
|
||||
return new PageInfo<>(new ArrayList<>());
|
||||
}
|
||||
|
||||
Page<IndexProductResponse> productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize());
|
||||
Page<IndexProductRespVO> productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize());
|
||||
PageInfo<StoreProduct> storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList);
|
||||
|
||||
List<IndexProductResponse> productResponseArrayList = new ArrayList<>();
|
||||
List<IndexProductRespVO> productResponseArrayList = new ArrayList<>();
|
||||
for (StoreProduct storeProduct : storeProductList) {
|
||||
IndexProductResponse productResponse = new IndexProductResponse();
|
||||
IndexProductRespVO productResponse = new IndexProductRespVO();
|
||||
List<Integer> activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity());
|
||||
// 活动类型默认:直接跳过
|
||||
if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) {
|
||||
|
@ -161,7 +161,7 @@ public class ProductServiceImpl implements ProductService {
|
|||
productResponseArrayList.add(productResponse);
|
||||
}
|
||||
|
||||
PageInfo<IndexProductResponse> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList);
|
||||
PageInfo<IndexProductRespVO> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList);
|
||||
BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list");
|
||||
|
||||
return productResponseCommonPage;
|
||||
|
@ -174,22 +174,22 @@ public class ProductServiceImpl implements ProductService {
|
|||
* @return 商品详情信息
|
||||
*/
|
||||
@Override
|
||||
public ProductDetailResponse getDetail(Integer id, String type) {
|
||||
public ProductDetailRespVO getDetail(Integer id, String type) {
|
||||
// 获取用户
|
||||
MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId());
|
||||
|
||||
ProductDetailResponse productDetailResponse = new ProductDetailResponse();
|
||||
ProductDetailRespVO productDetailRespVO = new ProductDetailRespVO();
|
||||
// 查询商品
|
||||
StoreProduct storeProduct = storeProductService.getH5Detail(id);
|
||||
// 设置会员价
|
||||
storeProduct.setVipPrice(storeProduct.getPrice());
|
||||
|
||||
productDetailResponse.setProductInfo(storeProduct);
|
||||
productDetailRespVO.setProductInfo(storeProduct);
|
||||
|
||||
// 获取商品规格
|
||||
List<StoreProductAttr> attrList = attrService.getListByProductIdAndType(storeProduct.getId(), Constants.PRODUCT_TYPE_NORMAL);
|
||||
// 根据制式设置attr属性
|
||||
productDetailResponse.setProductAttr(attrList);
|
||||
productDetailRespVO.setProductAttr(attrList);
|
||||
|
||||
// 根据制式设置sku属性
|
||||
HashMap<String, Object> skuMap = new HashMap<>();
|
||||
|
@ -202,11 +202,11 @@ public class ProductServiceImpl implements ProductService {
|
|||
|
||||
skuMap.put(atr.getSuk(), atr);
|
||||
}
|
||||
productDetailResponse.setProductValue(skuMap);
|
||||
productDetailRespVO.setProductValue(skuMap);
|
||||
|
||||
// 商品活动
|
||||
List<ProductActivityItemResponse> activityAllH5 = productUtils.getProductAllActivity(storeProduct);
|
||||
productDetailResponse.setActivityAllH5(activityAllH5);
|
||||
productDetailRespVO.setActivityAllH5(activityAllH5);
|
||||
|
||||
// 商品浏览量+1
|
||||
StoreProduct updateProduct = new StoreProduct();
|
||||
|
@ -216,7 +216,7 @@ public class ProductServiceImpl implements ProductService {
|
|||
|
||||
// TODO 保存用户访问记录
|
||||
|
||||
return productDetailResponse;
|
||||
return productDetailRespVO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -225,18 +225,18 @@ public class ProductServiceImpl implements ProductService {
|
|||
* @return 商品详情信息
|
||||
*/
|
||||
@Override
|
||||
public ProductDetailResponse getSkuDetail(Integer id) {
|
||||
public ProductDetailRespVO getSkuDetail(Integer id) {
|
||||
// 获取用户
|
||||
MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId());
|
||||
|
||||
ProductDetailResponse productDetailResponse = new ProductDetailResponse();
|
||||
ProductDetailRespVO productDetailRespVO = new ProductDetailRespVO();
|
||||
// 查询商品
|
||||
StoreProduct storeProduct = storeProductService.getH5Detail(id);
|
||||
|
||||
// 获取商品规格
|
||||
List<StoreProductAttr> attrList = attrService.getListByProductIdAndType(storeProduct.getId(), Constants.PRODUCT_TYPE_NORMAL);
|
||||
// 根据制式设置attr属性
|
||||
productDetailResponse.setProductAttr(attrList);
|
||||
productDetailRespVO.setProductAttr(attrList);
|
||||
|
||||
// 根据制式设置sku属性
|
||||
HashMap<String, Object> skuMap = new HashMap<>();
|
||||
|
@ -248,9 +248,9 @@ public class ProductServiceImpl implements ProductService {
|
|||
|
||||
skuMap.put(atr.getSuk(), atr);
|
||||
}
|
||||
productDetailResponse.setProductValue(skuMap);
|
||||
productDetailRespVO.setProductValue(skuMap);
|
||||
|
||||
return productDetailResponse;
|
||||
return productDetailRespVO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -326,18 +326,18 @@ public class ProductServiceImpl implements ProductService {
|
|||
* @return CommonPage<IndexProductResponse>
|
||||
*/
|
||||
@Override
|
||||
public PageInfo<IndexProductResponse> getHotProductList(PageParam pageRequest) {
|
||||
public PageInfo<IndexProductRespVO> getHotProductList(PageParam pageRequest) {
|
||||
List<StoreProduct> storeProductList = storeProductService.getIndexProduct(Constants.INDEX_HOT_BANNER, pageRequest);
|
||||
if (CollUtil.isEmpty(storeProductList)) {
|
||||
return new PageInfo<>(new ArrayList<>());
|
||||
}
|
||||
|
||||
Page<IndexProductResponse> productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize());
|
||||
Page<IndexProductRespVO> productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize());
|
||||
PageInfo<StoreProduct> storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList);
|
||||
|
||||
List<IndexProductResponse> productResponseArrayList = new ArrayList<>();
|
||||
List<IndexProductRespVO> productResponseArrayList = new ArrayList<>();
|
||||
for (StoreProduct storeProduct : storeProductList) {
|
||||
IndexProductResponse productResponse = new IndexProductResponse();
|
||||
IndexProductRespVO productResponse = new IndexProductRespVO();
|
||||
List<Integer> activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity());
|
||||
// 活动类型默认:直接跳过
|
||||
if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) {
|
||||
|
@ -380,7 +380,7 @@ public class ProductServiceImpl implements ProductService {
|
|||
productResponseArrayList.add(productResponse);
|
||||
}
|
||||
|
||||
PageInfo<IndexProductResponse> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList);
|
||||
PageInfo<IndexProductRespVO> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList);
|
||||
BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list");
|
||||
|
||||
return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList));
|
||||
|
@ -404,7 +404,7 @@ public class ProductServiceImpl implements ProductService {
|
|||
* @return CommonPage<IndexProductResponse>
|
||||
*/
|
||||
@Override
|
||||
public PageInfo<IndexProductResponse> getGoodProductList() {
|
||||
public PageInfo<IndexProductRespVO> getGoodProductList() {
|
||||
PageParam pageRequest = new PageParam();
|
||||
pageRequest.setPageSize(9);
|
||||
List<StoreProduct> storeProductList = storeProductService.getIndexProduct(Constants.INDEX_RECOMMEND_BANNER, pageRequest);
|
||||
|
@ -412,12 +412,12 @@ public class ProductServiceImpl implements ProductService {
|
|||
return new PageInfo<>(new ArrayList<>());
|
||||
}
|
||||
|
||||
Page<IndexProductResponse> productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize());
|
||||
Page<IndexProductRespVO> productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize());
|
||||
PageInfo<StoreProduct> storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList);
|
||||
|
||||
List<IndexProductResponse> productResponseArrayList = new ArrayList<>();
|
||||
List<IndexProductRespVO> productResponseArrayList = new ArrayList<>();
|
||||
for (StoreProduct storeProduct : storeProductList) {
|
||||
IndexProductResponse productResponse = new IndexProductResponse();
|
||||
IndexProductRespVO productResponse = new IndexProductRespVO();
|
||||
List<Integer> activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity());
|
||||
// 活动类型默认:直接跳过
|
||||
if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) {
|
||||
|
@ -460,7 +460,7 @@ public class ProductServiceImpl implements ProductService {
|
|||
productResponseArrayList.add(productResponse);
|
||||
}
|
||||
|
||||
PageInfo<IndexProductResponse> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList);
|
||||
PageInfo<IndexProductRespVO> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList);
|
||||
BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list");
|
||||
|
||||
return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList));
|
||||
|
@ -473,7 +473,7 @@ public class ProductServiceImpl implements ProductService {
|
|||
* @return CommonPage
|
||||
*/
|
||||
@Override
|
||||
public PageInfo<IndexProductResponse> getCategoryProductList(ProductListRequest request, PageParam pageParamRequest) {
|
||||
public PageInfo<IndexProductRespVO> getCategoryProductList(ProductListRequest request, PageParam pageParamRequest) {
|
||||
ProductRequest searchRequest = new ProductRequest();
|
||||
BeanUtils.copyProperties(searchRequest, request);
|
||||
List<StoreProduct> storeProductList = storeProductService.findH5List(searchRequest, pageParamRequest);
|
||||
|
@ -481,13 +481,13 @@ public class ProductServiceImpl implements ProductService {
|
|||
return new PageInfo<>(new ArrayList<>());
|
||||
}
|
||||
|
||||
Page<IndexProductResponse> productPage = PageHelper.startPage(pageParamRequest.getPageNo(), pageParamRequest.getPageSize());
|
||||
Page<IndexProductRespVO> productPage = PageHelper.startPage(pageParamRequest.getPageNo(), pageParamRequest.getPageSize());
|
||||
PageInfo<StoreProduct> storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList);
|
||||
|
||||
MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId());
|
||||
List<IndexProductResponse> productResponseArrayList = new ArrayList<>();
|
||||
List<IndexProductRespVO> productResponseArrayList = new ArrayList<>();
|
||||
for (StoreProduct storeProduct : storeProductList) {
|
||||
IndexProductResponse productResponse = new IndexProductResponse();
|
||||
IndexProductRespVO productResponse = new IndexProductRespVO();
|
||||
// 获取商品购物车数量
|
||||
if (ObjectUtil.isNotNull(user)) {
|
||||
productResponse.setCartNum(cartService.getProductNumByUidAndProductId(user.getId(), storeProduct.getId()));
|
||||
|
@ -496,7 +496,7 @@ public class ProductServiceImpl implements ProductService {
|
|||
productResponseArrayList.add(productResponse);
|
||||
}
|
||||
|
||||
PageInfo<IndexProductResponse> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList);
|
||||
PageInfo<IndexProductRespVO> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList);
|
||||
BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list");
|
||||
|
||||
return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList));
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
<mapper namespace="cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesFreeMapper">
|
||||
|
||||
<select id="getListGroup" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesFreeRespVO" parameterType="integer">
|
||||
SELECT group_concat(`city_id`) AS city_id, title, `number`, price, uniqid FROM eb_shipping_templates_free where temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `uniqid` ORDER BY id ASC
|
||||
SELECT group_concat(`city_id`) AS city_id, province_id, `number`, price FROM eb_shipping_templates_free where temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `id` ORDER BY id ASC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
<mapper namespace="cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesNoDeliveryMapper">
|
||||
|
||||
<select id="getList" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesNoDeliveryRespVO" parameterType="integer">
|
||||
SELECT group_concat(`city_id`) AS city_id, temp_id FROM eb_shipping_templates_no_delivery where temp_id = #{tempId, jdbcType=INTEGER} ORDER BY id ASC
|
||||
SELECT group_concat(`city_id`) AS city_id, province_id FROM eb_shipping_templates_no_delivery WHERE temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `id` ORDER BY id ASC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
<mapper namespace="cn.iocoder.yudao.module.shop.dal.mysql.express.ShippingTemplatesRegionMapper">
|
||||
|
||||
<select id="getListGroup" resultType="cn.iocoder.yudao.module.shop.controller.admin.express.vo.ShippingTemplatesRegionRespVO" parameterType="integer">
|
||||
SELECT group_concat(`city_id`) AS city_id, title, `first`, first_price, `renewal`, renewal_price, uniqid FROM eb_shipping_templates_region where temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `uniqid` ORDER BY id ASC
|
||||
SELECT group_concat(`city_id`) AS city_id, `first`, first_price, `renewal`, renewal_price FROM eb_shipping_templates_region where temp_id = #{tempId, jdbcType=INTEGER} GROUP BY `id` ORDER BY id ASC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue