From 0125a6598c24a4adb7b37c1f1e8fa8581d1043d8 Mon Sep 17 00:00:00 2001 From: sj <1304317391@qq.com> Date: Sat, 17 Sep 2022 18:44:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=93=81=E7=89=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/domain/YxStoreProduct.java | 5 +++++ .../service/dto/YxStoreProductDto.java | 3 +++ .../impl/YxStoreProductServiceImpl.java | 8 +++++++ .../modules/store/domain/YxStoreBrand.java | 2 ++ .../store/service/dto/YxStoreBrandDto.java | 3 +++ .../service/dto/YxStoreBrandSamllDto.java | 21 +++++++++++++++++++ 6 files changed, 42 insertions(+) create mode 100644 zsw-bxg/src/main/java/co/yixiang/modules/store/service/dto/YxStoreBrandSamllDto.java diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProduct.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProduct.java index 7c7d278c..0c423860 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProduct.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProduct.java @@ -9,6 +9,7 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDomain; import co.yixiang.modules.category.domain.YxStoreCategory; +import co.yixiang.modules.store.domain.YxStoreBrand; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -244,9 +245,13 @@ public class YxStoreProduct extends BaseDomain { @ApiModelProperty(value = "是否开启积分兑换") private Integer isIntegral; + //商品对应的分类 @TableField(exist = false) private YxStoreCategory storeCategory; + //商品所选的品牌 + @TableField(exist = false) + private YxStoreBrand storeBrand; public void copy(YxStoreProduct source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/YxStoreProductDto.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/YxStoreProductDto.java index 4475652f..4541caf9 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/YxStoreProductDto.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/YxStoreProductDto.java @@ -6,6 +6,7 @@ package co.yixiang.modules.product.service.dto; import co.yixiang.modules.category.service.dto.YxStoreCategorySmallDto; +import co.yixiang.modules.store.service.dto.YxStoreBrandSamllDto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -134,4 +135,6 @@ public class YxStoreProductDto implements Serializable { private Integer isIntegral; private YxStoreCategorySmallDto storeCategory; + + private YxStoreBrandSamllDto storeBrand; } diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java index 05d51c8c..b7202b17 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java @@ -28,6 +28,7 @@ import co.yixiang.enums.SpecTypeEnum; import co.yixiang.exception.BadRequestException; import co.yixiang.exception.ErrorRequestException; import co.yixiang.modules.category.service.YxStoreCategoryService; +import co.yixiang.modules.store.service.YxStoreBrandService; import co.yixiang.modules.product.domain.YxStoreProduct; import co.yixiang.modules.product.domain.YxStoreProductAttrValue; import co.yixiang.modules.product.domain.YxStoreProductRelation; @@ -51,6 +52,7 @@ import co.yixiang.modules.product.vo.YxStoreProductQueryVo; import co.yixiang.modules.product.vo.YxStoreProductReplyQueryVo; import co.yixiang.modules.shop.service.YxSystemConfigService; import co.yixiang.modules.shop.service.YxSystemStoreService; +import co.yixiang.modules.store.service.YxStoreBrandService; import co.yixiang.modules.template.domain.YxShippingTemplates; import co.yixiang.modules.template.service.YxShippingTemplatesService; import co.yixiang.modules.user.service.YxUserService; @@ -90,6 +92,9 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl queryAll(YxStoreProductQueryCriteria criteria) { List yxStoreProductList = baseMapper.selectList(QueryHelpPlus.getPredicate(YxStoreProduct.class, criteria)); yxStoreProductList.forEach(yxStoreProduct -> { + //商品分类id yxStoreProduct.setStoreCategory(yxStoreCategoryService.getById(yxStoreProduct.getCateId())); + //商品品牌id + yxStoreProduct.setStoreBrand(yxStoreBrandService.getById(yxStoreProduct.getBrandId())); }); return yxStoreProductList; } diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/store/domain/YxStoreBrand.java b/zsw-bxg/src/main/java/co/yixiang/modules/store/domain/YxStoreBrand.java index 924b7961..b7d25bc7 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/store/domain/YxStoreBrand.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/store/domain/YxStoreBrand.java @@ -35,6 +35,8 @@ public class YxStoreBrand implements Serializable { @NotBlank private String brandName; + /** 品牌描述*/ + private String brandDescription; /** 排序 */ private Integer sort; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/store/service/dto/YxStoreBrandDto.java b/zsw-bxg/src/main/java/co/yixiang/modules/store/service/dto/YxStoreBrandDto.java index 733f6b53..d4821d5e 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/store/service/dto/YxStoreBrandDto.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/store/service/dto/YxStoreBrandDto.java @@ -25,6 +25,9 @@ public class YxStoreBrandDto implements Serializable { /** 品牌名称 */ private String brandName; + /** 品牌描述 */ + private String brandDescription; + /** 排序 */ private Integer sort; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/store/service/dto/YxStoreBrandSamllDto.java b/zsw-bxg/src/main/java/co/yixiang/modules/store/service/dto/YxStoreBrandSamllDto.java new file mode 100644 index 00000000..b354c058 --- /dev/null +++ b/zsw-bxg/src/main/java/co/yixiang/modules/store/service/dto/YxStoreBrandSamllDto.java @@ -0,0 +1,21 @@ +package co.yixiang.modules.store.service.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author ssj + * @date 2019-9-17 + */ +@Data +public class YxStoreBrandSamllDto implements Serializable { + + // 商品品牌表ID + private Integer id; + + + // 分类名称 + private String brandName; + +}