Browse Source

商品品牌修改

zyj
sj 2 years ago
parent
commit
0125a6598c
  1. 5
      zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProduct.java
  2. 3
      zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/YxStoreProductDto.java
  3. 8
      zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java
  4. 2
      zsw-bxg/src/main/java/co/yixiang/modules/store/domain/YxStoreBrand.java
  5. 3
      zsw-bxg/src/main/java/co/yixiang/modules/store/service/dto/YxStoreBrandDto.java
  6. 21
      zsw-bxg/src/main/java/co/yixiang/modules/store/service/dto/YxStoreBrandSamllDto.java

5
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));

3
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;
}

8
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<StoreProductMappe
private StoreProductMapper storeProductMapper;
@Autowired
private YxStoreCategoryService yxStoreCategoryService;
@Autowired
private YxStoreBrandService yxStoreBrandService;
@Autowired
private YxStoreProductAttrService yxStoreProductAttrService;
@Autowired
@ -463,7 +468,10 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
public List<YxStoreProduct> queryAll(YxStoreProductQueryCriteria criteria) {
List<YxStoreProduct> 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;
}

2
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;

3
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;

21
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;
}
Loading…
Cancel
Save