品类的增删改查
parent
90bcce03e0
commit
265583c5ac
|
@ -15,7 +15,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 属性与组中间对象 as_attribute_group
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -15,7 +15,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 品牌商品中间对象 as_brand_project
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -16,7 +16,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 品类属性中间对象 as_category_attribute
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author 杨乐
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
@ -45,10 +45,10 @@ public class AsCategoryAttribute extends BaseEntity implements CategoryBase {
|
|||
@ApiModelProperty(name = "属性id", value = "属性id", required = true)
|
||||
private Long attributeId;
|
||||
|
||||
public static AsCategoryAttribute categoryBuild(Long groupId, Long categoryInfoId) {
|
||||
public static AsCategoryAttribute categoryBuild(Long categoryInfoId, Long attributeId) {
|
||||
return AsCategoryAttribute.builder()
|
||||
.categoryId(categoryInfoId)
|
||||
.attributeId(groupId)
|
||||
.attributeId(attributeId)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -57,6 +57,15 @@ public class AsCategoryAttribute extends BaseEntity implements CategoryBase {
|
|||
.categoryId(attributeId) // 修改此处为 categoryId
|
||||
.build();
|
||||
}
|
||||
|
||||
public static AsCategoryAttribute categoryBuildtwo(Long categoryInfoId, Long attributeId) {
|
||||
return AsCategoryAttribute.builder()
|
||||
.categoryId(categoryInfoId)
|
||||
.attributeId(attributeId)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Long getBaseId() {
|
||||
return this.attributeId;
|
||||
|
|
|
@ -16,7 +16,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 品类属性组中间对象 as_category_attribute_group
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
@ -52,6 +52,12 @@ public class AsCategoryAttributeGroup extends BaseEntity implements CategoryBase
|
|||
.build();
|
||||
}
|
||||
|
||||
public static AsCategoryAttributeGroup cateBuild(Long categoryId){
|
||||
return AsCategoryAttributeGroup.builder()
|
||||
.attributeGroupId(categoryId)
|
||||
.categoryId(categoryId)
|
||||
.build();
|
||||
}
|
||||
@Override
|
||||
public Long getBaseId() {
|
||||
return this.attributeGroupId;
|
||||
|
|
|
@ -16,7 +16,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 品类品牌中间对象 as_category_brand
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
@ -44,6 +44,7 @@ public class AsCategoryBrand extends BaseEntity implements CategoryBase {
|
|||
@Excel(name = "品牌id")
|
||||
@ApiModelProperty(name = "品牌id", value = "品牌id", required = true)
|
||||
private Long brandId;
|
||||
|
||||
public static AsCategoryBrand categoryBuild(Long categoryInfoId, Long brandId) {
|
||||
return AsCategoryBrand.builder()
|
||||
.brandId(brandId)
|
||||
|
@ -51,6 +52,11 @@ public class AsCategoryBrand extends BaseEntity implements CategoryBase {
|
|||
.build();
|
||||
}
|
||||
|
||||
public static AsCategoryBrand categoryBrand(Long brandId){
|
||||
return AsCategoryBrand.builder()
|
||||
.brandId(brandId)
|
||||
.build();
|
||||
}
|
||||
@Override
|
||||
public Long getBaseId() {
|
||||
return this.brandId;
|
||||
|
|
|
@ -18,7 +18,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品属性对象 as_product_attribute_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 属性组对象 attribute_group
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品属性对象 attribute_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -18,7 +18,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 品牌信息对象 brand_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -17,11 +17,12 @@ import com.muyu.product.domain.req.CategoryInfoEditReq;
|
|||
import com.muyu.common.core.web.domain.TreeEntity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 品类信息对象 category_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
@ -59,20 +60,6 @@ public class CategoryInfo extends TreeEntity {
|
|||
@Excel(name = "介绍")
|
||||
@ApiModelProperty(name = "介绍", value = "介绍")
|
||||
private String introduction;
|
||||
//
|
||||
// /**
|
||||
// * 商品属性组关联ID
|
||||
// */
|
||||
// private List<Long> attributeGroupIdList;
|
||||
// /**
|
||||
// * 商品属性关联ID
|
||||
// */
|
||||
// private List<Long> attributeIdList;
|
||||
//
|
||||
// /**
|
||||
// * 商品品牌组关联ID
|
||||
// */
|
||||
// private List<Long> brandIdList;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,7 +18,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品评论对象 comment_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -18,7 +18,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 评论点赞对象 comment_like_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -18,7 +18,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品信息对象 project_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -19,7 +19,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品SKU对象 project_sku_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.function.Supplier;
|
|||
/**
|
||||
* 规格详情对象 rule_attr_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.function.Supplier;
|
|||
/**
|
||||
* 商品规格对象 rule_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
package com.muyu.product.domain.model;
|
||||
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.product.domain.AttributeGroup;
|
||||
import com.muyu.product.domain.req.AttributeGroupSaveReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 属性组添加模型
|
||||
* @Date 2024-2-28 下午 03:16
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AttributeGroupSaveModel extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 组名称 */
|
||||
private String name;
|
||||
|
||||
/** 状态 */
|
||||
private String states;
|
||||
|
||||
/**
|
||||
* 属性ID集合
|
||||
*/
|
||||
private List<Long> attributeIdList;
|
||||
|
||||
public static AttributeGroupSaveModel saveReqBuild (AttributeGroupSaveReq req){
|
||||
return AttributeGroupSaveModel.builder()
|
||||
.name(req.getName())
|
||||
.states(req.getStates())
|
||||
.attributeIdList(req.getAttributeIdList())
|
||||
.build();
|
||||
}
|
||||
|
||||
public AttributeGroup buildAttributeGroup () {
|
||||
return AttributeGroup.builder()
|
||||
.name(this.getName())
|
||||
.states(this.getStates())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -15,7 +15,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 属性组对象 attribute_group
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 属性组对象 attribute_group
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -15,7 +15,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 属性组对象 attribute_group
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品属性对象 attribute_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品属性对象 attribute_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品属性对象 attribute_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -12,7 +12,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 品牌信息对象 brand_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 品牌信息对象 brand_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 品牌信息对象 brand_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||
/**
|
||||
* 品类信息对象 category_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
@ -42,4 +42,19 @@ public class CategoryInfoEditReq extends TreeEntity {
|
|||
private String introduction;
|
||||
|
||||
private List<Long> cateGoryIdList;
|
||||
|
||||
/**
|
||||
* 品类属性组关联ID
|
||||
*/
|
||||
private List<Long> attributeGroupIdList;
|
||||
/**
|
||||
* 商品属性组关联ID
|
||||
*/
|
||||
private List<Long> attributeIdList;
|
||||
|
||||
/**
|
||||
* 商品属性组关联的ID
|
||||
*/
|
||||
private List<Long> brandIdList;
|
||||
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.TreeEntity;
|
|||
/**
|
||||
* 品类信息对象 category_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||
/**
|
||||
* 品类信息对象 category_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品评论对象 comment_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品评论对象 comment_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品评论对象 comment_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 评论点赞对象 comment_like_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 评论点赞对象 comment_like_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 评论点赞对象 comment_like_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品信息对象 project_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品信息对象 project_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品信息对象 project_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -12,7 +12,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品SKU对象 project_sku_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -12,7 +12,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品SKU对象 project_sku_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -12,7 +12,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品SKU对象 project_sku_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 规格详情对象 rule_attr_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 规格详情对象 rule_attr_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 规格详情对象 rule_attr_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品规格对象 rule_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
/**
|
||||
* 商品规格对象 rule_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
/**
|
||||
* 商品规格对象 rule_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.product.controller;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
||||
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
||||
import io.swagger.annotations.*;
|
||||
|
@ -31,7 +32,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
/**
|
||||
* 属性组Controller
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Api(tags = "属性组")
|
||||
|
@ -112,6 +113,7 @@ public class AttributeGroupController extends BaseController {
|
|||
@ApiOperation("删除属性组")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(attributeGroupService.removeBatchByIds(ids));
|
||||
attributeGroupService.removeBatchById(ids);
|
||||
return toAjax(attributeGroupService.removeBatchById(ids));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
/**
|
||||
* 商品属性Controller
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Api(tags = "商品属性")
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
/**
|
||||
* 品牌信息Controller
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Api(tags = "品牌信息")
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
|
@ -36,7 +35,7 @@ import com.muyu.product.service.CategoryInfoService;
|
|||
/**
|
||||
* 品类信息Controller
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Api(tags = "品类信息")
|
||||
|
@ -113,6 +112,7 @@ public class CategoryInfoController extends BaseController {
|
|||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改品类信息")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody CategoryInfoEditReq categoryInfoEditReq) {
|
||||
categoryInfoService.utilCateGoryInfo(id,categoryInfoEditReq);
|
||||
return toAjax(categoryInfoService.updateById(CategoryInfo.editBuild(id,categoryInfoEditReq)));
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,8 @@ public class CategoryInfoController extends BaseController {
|
|||
@ApiOperation("删除品类信息")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(categoryInfoService.removeBatchByIds(ids));
|
||||
categoryInfoService.removeBatchById(ids);
|
||||
return toAjax(categoryInfoService.removeBatchById(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -136,9 +137,10 @@ public class CategoryInfoController extends BaseController {
|
|||
@GetMapping("/parentCommonElement/{categoryId}")
|
||||
@ApiOperation("通过品类ID获取父级以上的属性集合")
|
||||
@ApiImplicitParam(name = "categoryId",value = "categoryId",required = true,dataType = "Long",paramType = "path",dataTypeClass = Long.class,example = "1")
|
||||
public Result<CategoryParentCommonElementResp> parentCommonElement(
|
||||
public Result<CategoryParentCommonElementResp> parentCommonElementRespResult(
|
||||
@PathVariable(value = "categoryId") Long categoryId
|
||||
){
|
||||
|
||||
return Result.success(categoryInfoService.parentCommonElement(categoryId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
/**
|
||||
* 商品评论Controller
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Api(tags = "商品评论")
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
/**
|
||||
* 评论点赞Controller
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Api(tags = "评论点赞")
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
/**
|
||||
* 商品信息Controller
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Api(tags = "商品信息")
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
/**
|
||||
* 商品SKUController
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Api(tags = "商品SKU")
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
/**
|
||||
* 规格详情Controller
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Api(tags = "规格详情")
|
||||
|
|
|
@ -31,7 +31,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
/**
|
||||
* 商品规格Controller
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Api(tags = "商品规格")
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.AsAttributeGroup;
|
|||
/**
|
||||
* 属性与组中间Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AsAttributeGroupMapper extends BaseMapper<AsAttributeGroup> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.AsBrandProject;
|
|||
/**
|
||||
* 品牌商品中间Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AsBrandProjectMapper extends BaseMapper<AsBrandProject> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.AsCategoryAttributeGroup;
|
|||
/**
|
||||
* 品类属性组中间Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AsCategoryAttributeGroupMapper extends BaseMapper<AsCategoryAttributeGroup> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.AsCategoryAttribute;
|
|||
/**
|
||||
* 品类属性中间Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AsCategoryAttributeMapper extends BaseMapper<AsCategoryAttribute> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.AsCategoryBrand;
|
|||
/**
|
||||
* 品类品牌中间Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AsCategoryBrandMapper extends BaseMapper<AsCategoryBrand> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.AsProductAttributeInfo;
|
|||
/**
|
||||
* 商品属性Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AsProductAttributeInfoMapper extends BaseMapper<AsProductAttributeInfo> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.AttributeGroup;
|
|||
/**
|
||||
* 属性组Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AttributeGroupMapper extends BaseMapper<AttributeGroup> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.AttributeInfo;
|
|||
/**
|
||||
* 商品属性Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AttributeInfoMapper extends BaseMapper<AttributeInfo> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.BrandInfo;
|
|||
/**
|
||||
* 品牌信息Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface BrandInfoMapper extends BaseMapper<BrandInfo> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.CategoryInfo;
|
|||
/**
|
||||
* 品类信息Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface CategoryInfoMapper extends BaseMapper<CategoryInfo> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.CommentInfo;
|
|||
/**
|
||||
* 商品评论Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface CommentInfoMapper extends BaseMapper<CommentInfo> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.CommentLikeInfo;
|
|||
/**
|
||||
* 评论点赞Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface CommentLikeInfoMapper extends BaseMapper<CommentLikeInfo> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.ProjectInfo;
|
|||
/**
|
||||
* 商品信息Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface ProjectInfoMapper extends BaseMapper<ProjectInfo> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.ProjectSkuInfo;
|
|||
/**
|
||||
* 商品SKUMapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface ProjectSkuInfoMapper extends BaseMapper<ProjectSkuInfo> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.RuleAttrInfo;
|
|||
/**
|
||||
* 规格详情Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface RuleAttrInfoMapper extends BaseMapper<RuleAttrInfo> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.muyu.product.domain.RuleInfo;
|
|||
/**
|
||||
* 商品规格Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface RuleInfoMapper extends BaseMapper<RuleInfo> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
/**
|
||||
* 属性与组中间Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AsAttributeGroupService extends IService<AsAttributeGroup> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
/**
|
||||
* 品牌商品中间Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AsBrandProjectService extends IService<AsBrandProject> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
/**
|
||||
* 品类属性组中间Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AsCategoryAttributeGroupService extends IService<AsCategoryAttributeGroup> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
/**
|
||||
* 品类属性中间Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AsCategoryAttributeService extends IService<AsCategoryAttribute> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
/**
|
||||
* 品类品牌中间Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AsCategoryBrandService extends IService<AsCategoryBrand> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
/**
|
||||
* 商品属性Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AsProductAttributeInfoService extends IService<AsProductAttributeInfo> {
|
||||
|
|
|
@ -5,15 +5,15 @@ import java.util.List;
|
|||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.product.domain.AttributeGroup;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
||||
import com.muyu.product.domain.req.AttributeGroupEditReq;
|
||||
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 属性组Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AttributeGroupService extends IService<AttributeGroup> {
|
||||
|
@ -41,4 +41,6 @@ public interface AttributeGroupService extends IService<AttributeGroup> {
|
|||
public Boolean save(AttributeGroupSaveModel attributeGroupSaveModel);
|
||||
|
||||
void updateAsAttributGrop(AttributeGroupEditReq attributeGroupEditReq, Long groupId);
|
||||
|
||||
Boolean removeBatchById(List<Long> ids);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
/**
|
||||
* 商品属性Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AttributeInfoService extends IService<AttributeInfo> {
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.muyu.product.domain.req.BrandInfoEditReq;
|
|||
/**
|
||||
* 品牌信息Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface BrandInfoService extends IService<BrandInfo> {
|
||||
|
|
|
@ -15,7 +15,7 @@ import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
|||
/**
|
||||
* 品类信息Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface CategoryInfoService extends IService<CategoryInfo> {
|
||||
|
@ -30,17 +30,16 @@ public interface CategoryInfoService extends IService<CategoryInfo> {
|
|||
CategoryParentCommonElementResp parentCommonElement(Long categoryId);
|
||||
|
||||
|
||||
void util(CategoryInfoEditReq categoryInfoEditReq, Long id);
|
||||
|
||||
public boolean save(CategoryInfoSaveModel categoryInfoSaveModel);
|
||||
|
||||
List<AttributeGroup> getAttributeGroup(Long categoryId);
|
||||
|
||||
List<BrandInfo> getBrand(Long categoryId);
|
||||
|
||||
List<AttributeInfo> getAttribute(Long categoryId);
|
||||
|
||||
CategoryParentCommonElementResp paretCoommonElement(Long categoryId);
|
||||
// List<AttributeGroup> getAttributeGroup(Long categoryId);
|
||||
//
|
||||
// List<BrandInfo> getBrand(Long categoryId);
|
||||
//
|
||||
// List<AttributeInfo> getAttribute(Long categoryId);
|
||||
//
|
||||
// CategoryParentCommonElementResp paretCoommonElement(Long categoryId);
|
||||
|
||||
/**
|
||||
* 品类共有属性
|
||||
|
@ -48,4 +47,8 @@ public interface CategoryInfoService extends IService<CategoryInfo> {
|
|||
* @return
|
||||
*/
|
||||
CategoryCommonElementResp getTemplateAttributeByCateGoryId(Long cateGoryId);
|
||||
|
||||
void utilCateGoryInfo(Long id, CategoryInfoEditReq categoryInfoEditReq);
|
||||
|
||||
Boolean removeBatchById(List<Long> ids);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
/**
|
||||
* 商品评论Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface CommentInfoService extends IService<CommentInfo> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
/**
|
||||
* 评论点赞Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface CommentLikeInfoService extends IService<CommentLikeInfo> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
/**
|
||||
* 商品信息Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface ProjectInfoService extends IService<ProjectInfo> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
/**
|
||||
* 商品SKUService接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface ProjectSkuInfoService extends IService<ProjectSkuInfo> {
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
/**
|
||||
* 规格详情Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface RuleAttrInfoService extends IService<RuleAttrInfo> {
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.muyu.product.domain.resp.RuleInfoResp;
|
|||
/**
|
||||
* 商品规格Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface RuleInfoService extends IService<RuleInfo> {
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
/**
|
||||
* 属性与组中间Service业务层处理
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Slf4j
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
/**
|
||||
* 品牌商品中间Service业务层处理
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Slf4j
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
/**
|
||||
* 品类属性组中间Service业务层处理
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Slf4j
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
/**
|
||||
* 品类属性中间Service业务层处理
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Slf4j
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
/**
|
||||
* 品类品牌中间Service业务层处理
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Slf4j
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
/**
|
||||
* 商品属性Service业务层处理
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Slf4j
|
||||
|
|
|
@ -7,10 +7,10 @@ import com.muyu.common.core.utils.ObjUtils;
|
|||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.product.domain.AsAttributeGroup;
|
||||
import com.muyu.product.domain.AttributeGroup;
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
||||
import com.muyu.product.domain.req.AttributeGroupEditReq;
|
||||
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
||||
import com.muyu.product.mapper.AsAttributeGroupMapper;
|
||||
import com.muyu.product.mapper.AttributeGroupMapper;
|
||||
import com.muyu.product.service.AsAttributeGroupService;
|
||||
import com.muyu.product.service.AttributeGroupService;
|
||||
|
@ -22,13 +22,12 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.Spliterator;
|
||||
|
||||
/**
|
||||
* 属性组Service业务层处理
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Slf4j
|
||||
|
@ -128,4 +127,16 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
|||
.toList()
|
||||
);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private AsAttributeGroupMapper asAttributeGroupMapper;
|
||||
@Override
|
||||
public Boolean removeBatchById(List<Long> ids) {
|
||||
LambdaQueryWrapper<AsAttributeGroup> asAttributeGroupLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
asAttributeGroupLambdaQueryWrapper.in(AsAttributeGroup::getGroupId, ids);
|
||||
asAttributeGroupMapper.delete(asAttributeGroupLambdaQueryWrapper);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
/**
|
||||
* 商品属性Service业务层处理
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Slf4j
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
/**
|
||||
* 品牌信息Service业务层处理
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Slf4j
|
||||
|
|
|
@ -13,6 +13,9 @@ import com.muyu.product.domain.model.TemplateAttributeModel;
|
|||
import com.muyu.product.domain.req.CategoryInfoEditReq;
|
||||
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
||||
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||
import com.muyu.product.mapper.AsCategoryAttributeGroupMapper;
|
||||
import com.muyu.product.mapper.AsCategoryAttributeMapper;
|
||||
import com.muyu.product.mapper.AsCategoryBrandMapper;
|
||||
import com.muyu.product.mapper.CategoryInfoMapper;
|
||||
import com.muyu.product.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -30,7 +33,7 @@ import java.util.stream.Stream;
|
|||
/**
|
||||
* 品类信息Service业务层处理
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Slf4j
|
||||
|
@ -69,8 +72,6 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
@Override
|
||||
public List<CategoryInfo> list (CategoryInfo categoryInfo) {
|
||||
LambdaQueryWrapper<CategoryInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
|
||||
if (ObjUtils.notNull(categoryInfo.getName())){
|
||||
queryWrapper.like(CategoryInfo::getName,categoryInfo.getName());
|
||||
}
|
||||
|
@ -94,9 +95,24 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param categoryId 品类ID
|
||||
* @return 父级以上的属性.属性组.品牌集合
|
||||
*/
|
||||
@Override //通过品类ID获取父级以上的属性,属性组,品牌集
|
||||
public CategoryParentCommonElementResp parentCommonElement(Long categoryId) {
|
||||
return CategoryParentCommonElementResp.builder()
|
||||
.attributeInfoList(getCommon(categoryId,asCategoryAttributeService,attributeInfoService))
|
||||
.attributeGroupList(getCommon(categoryId,asCategoryAttributeGroupService,attributeGroupService))
|
||||
.brandInfoList(getCommon(categoryId,asCategoryBrandService,brandInfoService))
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean save (CategoryInfoSaveModel categoryInfoSaveModel) {
|
||||
|
||||
CategoryInfo categoryInfo = CategoryInfo.saveModelBuild(categoryInfoSaveModel);
|
||||
boolean save = this.save(categoryInfo);
|
||||
Long categoryInfoId = categoryInfo.getId();
|
||||
|
@ -104,7 +120,7 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
if (attributeIdList != null && !attributeIdList.isEmpty()) {
|
||||
asCategoryAttributeService.saveBatch(
|
||||
attributeIdList.stream()
|
||||
.map(attributeId -> AsCategoryAttribute.categoryBuild(categoryInfoId, attributeId))
|
||||
.map(attributeId -> AsCategoryAttribute.categoryBuildtwo(categoryInfoId,attributeId))
|
||||
.toList()
|
||||
);
|
||||
}
|
||||
|
@ -127,116 +143,111 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
return save;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过品类ID获取父级以上的属性组集合
|
||||
*
|
||||
* @param categoryId 品类ID
|
||||
*
|
||||
* @return 父级以上的属性组集合
|
||||
*/
|
||||
@Override
|
||||
public List<AttributeGroup> getAttributeGroup (Long categoryId) {
|
||||
List<AttributeGroup> attributeGroupList = new ArrayList<>();
|
||||
LambdaQueryWrapper<AsCategoryAttributeGroup> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AsCategoryAttributeGroup::getCategoryId, categoryId);
|
||||
List<AsCategoryAttributeGroup> asCategoryAttributeGroupList = asCategoryAttributeGroupService.list(queryWrapper);
|
||||
if (asCategoryAttributeGroupList != null && !asCategoryAttributeGroupList.isEmpty()) {
|
||||
List<Long> attributeGroupIdList = asCategoryAttributeGroupList.stream()
|
||||
.map(AsCategoryAttributeGroup::getAttributeGroupId)
|
||||
.toList();
|
||||
attributeGroupList.addAll(attributeGroupService.listByIds(attributeGroupIdList));
|
||||
}
|
||||
CategoryInfo categoryInfo = this.getById(categoryId);
|
||||
if (categoryInfo.getParentId() != 0) {
|
||||
if (attributeGroupList.isEmpty()) {
|
||||
attributeGroupList.addAll(getAttributeGroup(categoryInfo.getParentId()));
|
||||
} else {
|
||||
List<AttributeGroup> attributeGroups = getAttributeGroup(categoryInfo.getParentId());
|
||||
attributeGroups.forEach(attributeGroup -> {
|
||||
if (!attributeGroupList.contains(attributeGroup)) {
|
||||
attributeGroupList.add(attributeGroup);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return attributeGroupList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过品类ID获取父级以上的品牌集合
|
||||
*
|
||||
* @param categoryId 品类ID
|
||||
*
|
||||
* @return 父级以上的品牌集合
|
||||
*/
|
||||
@Override
|
||||
public List<BrandInfo> getBrand (Long categoryId) {
|
||||
List<BrandInfo> brandInfoList = new ArrayList<>();
|
||||
LambdaQueryWrapper<AsCategoryBrand> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AsCategoryBrand::getCategoryId, categoryId);
|
||||
List<AsCategoryBrand> asCategoryBrandList = asCategoryBrandService.list(queryWrapper);
|
||||
if (asCategoryBrandList != null && !asCategoryBrandList.isEmpty()) {
|
||||
List<Long> brandIdList = asCategoryBrandList.stream()
|
||||
.map(AsCategoryBrand::getBrandId)
|
||||
.toList();
|
||||
brandInfoList.addAll(brandInfoService.listByIds(brandIdList));
|
||||
}
|
||||
CategoryInfo categoryInfo = this.getById(categoryId);
|
||||
if (categoryInfo.getParentId() != 0) {
|
||||
if (brandInfoList.isEmpty()) {
|
||||
brandInfoList.addAll(getBrand(categoryInfo.getParentId()));
|
||||
} else {
|
||||
List<BrandInfo> brandInfos = getBrand(categoryInfo.getParentId());
|
||||
brandInfos.forEach(brandInfo -> {
|
||||
if (!brandInfoList.contains(brandInfo)) {
|
||||
brandInfoList.add(brandInfo);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
return brandInfoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过品类ID获取父级以上的属性集合
|
||||
*
|
||||
* @param categoryId 品类ID
|
||||
*
|
||||
* @return 父级以上的属性集合
|
||||
*/
|
||||
@Override
|
||||
public List<AttributeInfo> getAttribute (Long categoryId) {
|
||||
List<AttributeInfo> attributeInfoList = new ArrayList<>();
|
||||
LambdaQueryWrapper<AsCategoryAttribute> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AsCategoryAttribute::getCategoryId, categoryId);
|
||||
List<AsCategoryAttribute> asCategoryAttributeList = asCategoryAttributeService.list(queryWrapper);
|
||||
if (asCategoryAttributeList != null && !asCategoryAttributeList.isEmpty()) {
|
||||
List<Long> attributeIdList = asCategoryAttributeList.stream()
|
||||
.map(AsCategoryAttribute::getAttributeId)
|
||||
.toList();
|
||||
attributeInfoList.addAll(attributeInfoService.listByIds(attributeIdList));
|
||||
}
|
||||
CategoryInfo categoryInfo = this.getById(categoryId);
|
||||
if (categoryInfo.getParentId() != 0) {
|
||||
if (attributeInfoList.isEmpty()) {
|
||||
attributeInfoList.addAll(getAttribute(categoryInfo.getParentId()));
|
||||
} else {
|
||||
List<AttributeInfo> attributeInfos = getAttribute(categoryInfo.getParentId());
|
||||
attributeInfos.forEach(attributeInfoQuery -> {
|
||||
if (!attributeInfoList.contains(attributeInfoQuery)) {
|
||||
attributeInfoList.add(attributeInfoQuery);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return attributeInfoList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoryParentCommonElementResp paretCoommonElement(Long categoryId) {
|
||||
return null;
|
||||
}
|
||||
// /**
|
||||
// * 通过品类ID获取父级以上的属性组集合
|
||||
// *
|
||||
// * @param categoryId 品类ID
|
||||
// *
|
||||
// * @return 父级以上的属性组集合
|
||||
// */
|
||||
// @Override
|
||||
// public List<AttributeGroup> getAttributeGroup (Long categoryId) {
|
||||
// List<AttributeGroup> attributeGroupList = new ArrayList<>();
|
||||
// LambdaQueryWrapper<AsCategoryAttributeGroup> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// queryWrapper.eq(AsCategoryAttributeGroup::getCategoryId, categoryId);
|
||||
// List<AsCategoryAttributeGroup> asCategoryAttributeGroupList = asCategoryAttributeGroupService.list(queryWrapper);
|
||||
// if (asCategoryAttributeGroupList != null && !asCategoryAttributeGroupList.isEmpty()) {
|
||||
// List<Long> attributeGroupIdList = asCategoryAttributeGroupList.stream()
|
||||
// .map(AsCategoryAttributeGroup::getAttributeGroupId)
|
||||
// .toList();
|
||||
// attributeGroupList.addAll(attributeGroupService.listByIds(attributeGroupIdList));
|
||||
// }
|
||||
// CategoryInfo categoryInfo = this.getById(categoryId);
|
||||
// if (categoryInfo.getParentId() != 0) {
|
||||
// if (attributeGroupList.isEmpty()) {
|
||||
// attributeGroupList.addAll(getAttributeGroup(categoryInfo.getParentId()));
|
||||
// } else {
|
||||
// List<AttributeGroup> attributeGroups = getAttributeGroup(categoryInfo.getParentId());
|
||||
// attributeGroups.forEach(attributeGroup -> {
|
||||
// if (!attributeGroupList.contains(attributeGroup)) {
|
||||
// attributeGroupList.add(attributeGroup);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// return attributeGroupList;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过品类ID获取父级以上的品牌集合
|
||||
// *
|
||||
// * @param categoryId 品类ID
|
||||
// *
|
||||
// * @return 父级以上的品牌集合
|
||||
// */
|
||||
// @Override
|
||||
// public List<BrandInfo> getBrand (Long categoryId) {
|
||||
// List<BrandInfo> brandInfoList = new ArrayList<>();
|
||||
// LambdaQueryWrapper<AsCategoryBrand> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// queryWrapper.eq(AsCategoryBrand::getCategoryId, categoryId);
|
||||
// List<AsCategoryBrand> asCategoryBrandList = asCategoryBrandService.list(queryWrapper);
|
||||
// if (asCategoryBrandList != null && !asCategoryBrandList.isEmpty()) {
|
||||
// List<Long> brandIdList = asCategoryBrandList.stream()
|
||||
// .map(AsCategoryBrand::getBrandId)
|
||||
// .toList();
|
||||
// brandInfoList.addAll(brandInfoService.listByIds(brandIdList));
|
||||
// }
|
||||
// CategoryInfo categoryInfo = this.getById(categoryId);
|
||||
// if (categoryInfo.getParentId() != 0) {
|
||||
// if (brandInfoList.isEmpty()) {
|
||||
// brandInfoList.addAll(getBrand(categoryInfo.getParentId()));
|
||||
// } else {
|
||||
// List<BrandInfo> brandInfos = getBrand(categoryInfo.getParentId());
|
||||
// brandInfos.forEach(brandInfo -> {
|
||||
// if (!brandInfoList.contains(brandInfo)) {
|
||||
// brandInfoList.add(brandInfo);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// return brandInfoList;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过品类ID获取父级以上的属性集合
|
||||
// *
|
||||
// * @param categoryId 品类ID
|
||||
// *
|
||||
// * @return 父级以上的属性集合
|
||||
// */
|
||||
// @Override
|
||||
// public List<AttributeInfo> getAttribute (Long categoryId) {
|
||||
// List<AttributeInfo> attributeInfoList = new ArrayList<>();
|
||||
// LambdaQueryWrapper<AsCategoryAttribute> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// queryWrapper.eq(AsCategoryAttribute::getCategoryId, categoryId);
|
||||
// List<AsCategoryAttribute> asCategoryAttributeList = asCategoryAttributeService.list(queryWrapper);
|
||||
// if (asCategoryAttributeList != null && !asCategoryAttributeList.isEmpty()) {
|
||||
// List<Long> attributeIdList = asCategoryAttributeList.stream()
|
||||
// .map(AsCategoryAttribute::getAttributeId)
|
||||
// .toList();
|
||||
// attributeInfoList.addAll(attributeInfoService.listByIds(attributeIdList));
|
||||
// }
|
||||
// CategoryInfo categoryInfo = this.getById(categoryId);
|
||||
// if (categoryInfo.getParentId() != 0) {
|
||||
// if (attributeInfoList.isEmpty()) {
|
||||
// attributeInfoList.addAll(getAttribute(categoryInfo.getParentId()));
|
||||
// } else {
|
||||
// List<AttributeInfo> attributeInfos = getAttribute(categoryInfo.getParentId());
|
||||
// attributeInfos.forEach(attributeInfoQuery -> {
|
||||
// if (!attributeInfoList.contains(attributeInfoQuery)) {
|
||||
// attributeInfoList.add(attributeInfoQuery);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// return attributeInfoList;
|
||||
// }
|
||||
|
||||
|
||||
public <T, AS> List<T> getCommon (Long categoryId, IService<AS> iService, IService<T> bsiService) {
|
||||
|
@ -271,26 +282,7 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过品类ID获取父级以上的属性、属性组、品牌集合
|
||||
*
|
||||
* @param categoryId 品类ID
|
||||
*
|
||||
* @return 父级以上的属性、属性组、品牌集合
|
||||
*/
|
||||
@Override
|
||||
public CategoryParentCommonElementResp parentCommonElement (Long categoryId) {
|
||||
return CategoryParentCommonElementResp.builder()
|
||||
.attributeInfoList(getCommon(categoryId, asCategoryAttributeService, attributeInfoService))
|
||||
.attributeGroupList(getCommon(categoryId, asCategoryAttributeGroupService, attributeGroupService))
|
||||
.brandInfoList(getCommon(categoryId, asCategoryBrandService, brandInfoService))
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void util(CategoryInfoEditReq categoryInfoEditReq, Long id) {
|
||||
|
||||
}
|
||||
|
||||
private void getParentIdListByCateGoryId(List<Long> parentIdList, Long cateGoryId){
|
||||
if (cateGoryId.equals(0L)){
|
||||
|
@ -381,4 +373,82 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
.attributeList(attributeModelList)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void utilCateGoryInfo(Long id, CategoryInfoEditReq categoryInfoEditReq) {
|
||||
//品类 属性组
|
||||
//品牌
|
||||
// 属性
|
||||
AsCategoryAttribute asCategoryAttributeGroup = AsCategoryAttribute.categoryAttribute(id);
|
||||
List<AsCategoryAttribute> list = asCategoryAttributeService.list(asCategoryAttributeGroup);
|
||||
ArrayList<Long> longs = new ArrayList<>();
|
||||
for (AsCategoryAttribute asCategoryAttribute : list) {
|
||||
longs.add(asCategoryAttribute.getId());
|
||||
}
|
||||
asCategoryAttributeService.removeBatchByIds(longs);
|
||||
List<Long> attributeGroupIdList = categoryInfoEditReq.getAttributeGroupIdList();
|
||||
asCategoryAttributeService.saveBatch(
|
||||
attributeGroupIdList.stream()
|
||||
.map(aLong -> AsCategoryAttribute.categoryBuild(id,aLong))
|
||||
.toList()
|
||||
);
|
||||
|
||||
AsCategoryAttributeGroup asCategoryAttribute = AsCategoryAttributeGroup.cateBuild(id);
|
||||
List<AsCategoryAttributeGroup> categoryAttributeGroupList = asCategoryAttributeGroupService.list(asCategoryAttribute);
|
||||
ArrayList<Long> arrayList = new ArrayList<>();
|
||||
for (AsCategoryAttributeGroup categoryAttributeGroup : categoryAttributeGroupList) {
|
||||
arrayList.add(categoryAttributeGroup.getId());
|
||||
}
|
||||
asCategoryAttributeGroupService.removeBatchByIds(arrayList);
|
||||
List<Long> reqAttributeGroupIdList = categoryInfoEditReq.getAttributeGroupIdList();
|
||||
asCategoryAttributeGroupService.saveBatch(
|
||||
reqAttributeGroupIdList.stream()
|
||||
.map(aLong ->
|
||||
AsCategoryAttributeGroup.categoryBuild(id,aLong)
|
||||
).toList()
|
||||
);
|
||||
AsCategoryBrand asCategoryBrand = AsCategoryBrand.categoryBrand(id);
|
||||
List<AsCategoryBrand> asCategoryBrands = asCategoryBrandService.list(asCategoryBrand);
|
||||
ArrayList<Long> longArrayList = new ArrayList<>();
|
||||
for (AsCategoryBrand categoryBrand : asCategoryBrands) {
|
||||
longArrayList.add(categoryBrand.getId());
|
||||
}
|
||||
asCategoryBrandService.removeBatchByIds(longArrayList);
|
||||
List<Long> brandIdList = categoryInfoEditReq.getBrandIdList();
|
||||
asCategoryBrandService.saveBatch(
|
||||
brandIdList.stream()
|
||||
.map(aLong ->
|
||||
AsCategoryBrand.categoryBuild(id,aLong))
|
||||
.toList()
|
||||
);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@Autowired
|
||||
private AsCategoryAttributeGroupMapper asCategoryAttributeGroupMapper;
|
||||
@Autowired
|
||||
private AsCategoryAttributeMapper asCategoryAttributeMapper;
|
||||
|
||||
@Autowired
|
||||
private AsCategoryBrandMapper asCategoryBrandMapper;
|
||||
@Override
|
||||
public Boolean removeBatchById(List<Long> ids) {
|
||||
//删除品类属性组中间表
|
||||
LambdaQueryWrapper<AsCategoryAttributeGroup> asCategoryAttributeGroupLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
asCategoryAttributeGroupLambdaQueryWrapper.in(AsCategoryAttributeGroup::getAttributeGroupId, ids);
|
||||
asCategoryAttributeGroupMapper.delete(asCategoryAttributeGroupLambdaQueryWrapper);
|
||||
//删除品类属性中间表
|
||||
LambdaQueryWrapper<AsCategoryAttribute> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(AsCategoryAttribute::getAttributeId, ids);
|
||||
asCategoryAttributeMapper.delete(queryWrapper);
|
||||
|
||||
//删除品类品牌中间
|
||||
LambdaQueryWrapper<AsCategoryBrand> brandLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
brandLambdaQueryWrapper.in(AsCategoryBrand::getBrandId, ids);
|
||||
asCategoryBrandMapper.delete(brandLambdaQueryWrapper);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
/**
|
||||
* 商品评论Service业务层处理
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @author YangLe
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Slf4j
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue