diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsProductAttributeInfo.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsProductAttributeInfo.java index 853c477..af811b5 100644 --- a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsProductAttributeInfo.java +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/AsProductAttributeInfo.java @@ -1,9 +1,8 @@ package com.muyu.product.domain; -import java.util.Date; + import java.util.function.Supplier; -import com.fasterxml.jackson.annotation.JsonFormat; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/CategoryParentCommonElementResp.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/CategoryParentCommonElementResp.java index ba5576a..3b850d9 100644 --- a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/CategoryParentCommonElementResp.java +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/CategoryParentCommonElementResp.java @@ -21,6 +21,8 @@ import java.util.List; @AllArgsConstructor public class CategoryParentCommonElementResp { + private Long categoryId; + /** * 属性集合 */ diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/CategoryInfoController.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/CategoryInfoController.java index eaaaf32..5e3555b 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/CategoryInfoController.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/CategoryInfoController.java @@ -12,6 +12,9 @@ import com.muyu.product.domain.model.CategoryInfoSaveModel; import com.muyu.product.domain.resp.CategoryCommonElementResp; import com.muyu.product.domain.resp.CategoryInfoUpdReq; 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 io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -47,6 +50,8 @@ public class CategoryInfoController extends BaseController { @Autowired private CategoryInfoService categoryInfoService; + + /** * 查询品类信息列表 */ @@ -138,9 +143,7 @@ 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 parentCommonElement( - @PathVariable(value = "categoryId") Long categoryId - ) { + public Result parentCommonElement(@PathVariable(value = "categoryId") Long categoryId) { return Result.success(categoryInfoService.parentCommonElement(categoryId)); } } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/ProjectInfoController.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/ProjectInfoController.java index f1e3d62..09ba50e 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/ProjectInfoController.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/ProjectInfoController.java @@ -91,6 +91,7 @@ public class ProjectInfoController extends BaseController { return Result.success(projectInfoService.getById(id)); } + /** * 获取商品信息详细信息 */ diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/RuleInfoController.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/RuleInfoController.java index 64575e3..1851a28 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/RuleInfoController.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/RuleInfoController.java @@ -40,6 +40,7 @@ import com.muyu.common.core.web.page.TableDataInfo; @RestController @RequestMapping("/rule") public class RuleInfoController extends BaseController { + @Autowired private RuleInfoService ruleInfoService; diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryAttributeGroupMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryAttributeGroupMapper.java index 109e0f5..8970dec 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryAttributeGroupMapper.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryAttributeGroupMapper.java @@ -3,6 +3,7 @@ package com.muyu.product.mapper; import java.util.List; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.muyu.product.domain.AsCategoryAttributeGroup; +import org.apache.ibatis.annotations.Param; /** * 品类属性组中间Mapper接口 @@ -13,4 +14,5 @@ import com.muyu.product.domain.AsCategoryAttributeGroup; public interface AsCategoryAttributeGroupMapper extends BaseMapper { + void addByCategory(@Param("id") Long id, @Param("attributeGroupId") Long attributeGroupId); } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AsCategoryAttributeGroupService.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AsCategoryAttributeGroupService.java index d08a7cf..7ccadd3 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AsCategoryAttributeGroupService.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AsCategoryAttributeGroupService.java @@ -19,6 +19,5 @@ public interface AsCategoryAttributeGroupService extends IService list(AsCategoryAttributeGroup asCategoryAttributeGroup); - void addByCategory(Long id, Long attributeGroupId); } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AsCategoryAttributeService.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AsCategoryAttributeService.java index a6b1c3b..d7c2e20 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AsCategoryAttributeService.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AsCategoryAttributeService.java @@ -19,5 +19,5 @@ public interface AsCategoryAttributeService extends IService list(AsCategoryAttribute asCategoryAttribute); - void addByCategory(Long id, Long attributeId); + } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AsCategoryBrandService.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AsCategoryBrandService.java index 059e1aa..058dd31 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AsCategoryBrandService.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/AsCategoryBrandService.java @@ -18,6 +18,4 @@ public interface AsCategoryBrandService extends IService { * @return 品类品牌中间集合 */ public List list(AsCategoryBrand asCategoryBrand); - - void addByCategory(Long id, Long brandId); } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/AsCategoryAttributeGroupServiceImpl.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/AsCategoryAttributeGroupServiceImpl.java index 7c6cd1f..7aacadd 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/AsCategoryAttributeGroupServiceImpl.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/AsCategoryAttributeGroupServiceImpl.java @@ -23,10 +23,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @Service public class AsCategoryAttributeGroupServiceImpl extends ServiceImpl implements AsCategoryAttributeGroupService { - - @Autowired - private AsAttributeGroupMapper asAttributeGroupMapper; - /** * 查询品类属性组中间列表 * @@ -46,15 +42,8 @@ public class AsCategoryAttributeGroupServiceImpl extends ServiceImpl attributeLists = attributeGroupEditReq.getAttributeList(); - for (AttributeInfoSaveReq attributeList : attributeLists) { - asAttributeGroupInfoMapper.addAttributeInfo(id,attributeList.getId()); +// asAttributeGroupInfoMapper.delAttributeInfo(id); +// List attributeLists = attributeGroupEditReq.getAttributeList(); +// for (AttributeInfoSaveReq attributeList : attributeLists) { +// asAttributeGroupInfoMapper.addAttributeInfo(id,attributeList.getId()); +// } + + asAttributeGroupService.remove(new LambdaQueryWrapper().eq(AsAttributeGroup::getAttributeId,id)); + + if(null!=attributeGroupEditReq.getAttributeList()){ + attributeGroupEditReq.getAttributeList().stream().forEach(attributeInfoSaveReq -> { + asAttributeGroupInfoMapper.addAttributeInfo(id,attributeInfoSaveReq.getId()); + }); } } - - - } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/CategoryInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/CategoryInfoServiceImpl.java index b76cde2..e6c7d81 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/CategoryInfoServiceImpl.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/CategoryInfoServiceImpl.java @@ -13,6 +13,9 @@ import com.muyu.product.domain.model.TemplateAttributeModel; import com.muyu.product.domain.resp.CategoryCommonElementResp; import com.muyu.product.domain.resp.CategoryInfoUpdReq; 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; @@ -62,6 +65,15 @@ public class CategoryInfoServiceImpl extends ServiceImpl{ - asCategoryAttributeService.addByCategory(id,attributeId); + asCategoryAttributeMapper.addByCategory(id,attributeId); }); } if(null!=categoryInfoUpdReq.getBrandInfoList()){ categoryInfoUpdReq.getBrandInfoList().stream().forEach(brandId->{ - asCategoryBrandService.addByCategory(id,brandId); + asCategoryBrandMapper.addByCategory(id,brandId); }); } if(null!=categoryInfoUpdReq.getAttributeGroupList()){ categoryInfoUpdReq.getAttributeGroupList().stream().forEach(attributeGroupId->{ - asCategoryAttributeGroupService.addByCategory(id,attributeGroupId); + asCategoryAttributeGroupMapper.addByCategory(id,attributeGroupId); }); } return b; @@ -342,7 +354,7 @@ public class CategoryInfoServiceImpl extends ServiceImpl asCategoryAttributeGroupLambdaQueryWrapper = new LambdaQueryWrapper<>(){{ - in(AsCategoryAttributeGroup::getCategoryId, cateGoryIdList); + in(AsCategoryAttributeGroup::getCategoryId, cateGoryId); }}; List categoryAttributeGroupList = asCategoryAttributeGroupService.list(asCategoryAttributeGroupLambdaQueryWrapper); List attributeGroupModelList = categoryAttributeGroupList.stream() diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java index 400a456..f17509f 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java @@ -116,8 +116,8 @@ public class RuleInfoServiceImpl extends ServiceImpl ruleInfoRespList.forEach(ruleInfoResp -> { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(ProjectInfo::getRuleId,ruleInfoResp.getId()); - List list1 = projectInfoService.list(lambdaQueryWrapper); - if(!Collections.isEmpty(list1)){ + List projectInfoList = projectInfoService.list(lambdaQueryWrapper); + if(!Collections.isEmpty(projectInfoList)){ ruleInfoResp.setFlan(true); } }); diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/AsCategoryAttributeGroupMapper.xml b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/AsCategoryAttributeGroupMapper.xml index 7196d03..9b150fd 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/AsCategoryAttributeGroupMapper.xml +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/AsCategoryAttributeGroupMapper.xml @@ -18,4 +18,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select id, category_id, attribute_group_id, remark, create_by, create_time, update_by, update_time from as_category_attribute_group + + + insert into as_category_attribute_group (category_id, ) values (#{id},#{attributeId}) + + diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/AsCategoryAttributeMapper.xml b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/AsCategoryAttributeMapper.xml index 3c9e5af..7f33d10 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/AsCategoryAttributeMapper.xml +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/AsCategoryAttributeMapper.xml @@ -19,6 +19,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select id, category_id, attribute_id, remark, create_by, create_time, update_by, update_time from as_category_attribute - insert into as_category_attribute_group (category_id,attribute_id) values (#{id},#{attributeId}) + insert into as_category_attribute (category_id,attribute_id) values (#{id},#{attributeId}) diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/AsCategoryBrandMapper.xml b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/AsCategoryBrandMapper.xml index 4a7f521..37f25dd 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/AsCategoryBrandMapper.xml +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/AsCategoryBrandMapper.xml @@ -19,6 +19,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select id, category_id, brand_id, remark, create_by, create_time, update_by, update_time from as_category_brand - insert into as_category_attribute_group (category_id,brand_id) values (#{id},#{brandId}) + insert into brand_info (category_id,brand_id) values (#{id},#{brandId})