修改状态
parent
0566acaf4d
commit
a23c56457e
|
@ -80,5 +80,14 @@ public class AttributeGroup extends BaseEntity {
|
|||
.states(attributeGroupEditReq.getStates())
|
||||
.build();
|
||||
}
|
||||
/**
|
||||
* 修改构造器
|
||||
*/
|
||||
public static AttributeGroup editUpdBuild(Long id, String states){
|
||||
return AttributeGroup.builder()
|
||||
.id(id)
|
||||
.states(states)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -81,7 +81,15 @@ public class RuleInfo extends BaseEntity {
|
|||
.status(ruleInfoEditReq.getStatus())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改构造器
|
||||
*/
|
||||
public static RuleInfo editUpdBuild(Long id, String status){
|
||||
return RuleInfo.builder()
|
||||
.id(id)
|
||||
.status(status)
|
||||
.build();
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param ruleInfoAddModel 添加模型
|
||||
|
|
|
@ -27,7 +27,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
|||
public class AttributeGroupEditReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
/** 组名称 */
|
||||
@ApiModelProperty(name = "组名称", value = "组名称", required = true)
|
||||
private String name;
|
||||
|
|
|
@ -44,16 +44,17 @@ public class CategoryInfoEditReq extends TreeEntity {
|
|||
@ApiModelProperty(name = "介绍", value = "介绍")
|
||||
private String introduction;
|
||||
/**
|
||||
* 商品属性组关联ID
|
||||
* 属性集合
|
||||
*/
|
||||
private List<AttributeGroup> attributeGroupIdList;
|
||||
/**
|
||||
* 商品属性关联ID
|
||||
*/
|
||||
private List<AttributeInfo> attributeIdList;
|
||||
private List<AttributeInfo> attributeInfoList;
|
||||
|
||||
/**
|
||||
* 商品品牌组关联ID
|
||||
* 属性组集合
|
||||
*/
|
||||
private List<BrandInfo> brandIdList;
|
||||
private List<AttributeGroup> attributeGroupList;
|
||||
|
||||
/**
|
||||
* 品牌集合
|
||||
*/
|
||||
private List<BrandInfo> brandInfoList;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,16 @@ public class AttributeGroupController extends BaseController {
|
|||
attributeGroupService.save(AttributeGroupSaveModel.saveReqBuild(attributeGroupSaveReq))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改属性状态
|
||||
*/
|
||||
@RequiresPermissions("product:attributeGroup:edit")
|
||||
@Log(title = "属性组", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}/{states}")
|
||||
@ApiOperation("修改属性状态")
|
||||
public Result<String> updStates(@PathVariable Long id,@PathVariable String states) {
|
||||
return toAjax(attributeGroupService.updateById(AttributeGroup.editUpdBuild(id,states)));
|
||||
}
|
||||
/**
|
||||
* 修改属性组
|
||||
*/
|
||||
|
|
|
@ -103,6 +103,16 @@ public class RuleInfoController extends BaseController {
|
|||
ruleInfoService.updateRuleById(id,req);
|
||||
return Result.success();
|
||||
}
|
||||
/**
|
||||
* 修改商品规格
|
||||
*/
|
||||
@RequiresPermissions("product:rule:edit")
|
||||
@Log(title = "商品规格", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}/{status}")
|
||||
@ApiOperation("修改商品规格状态")
|
||||
public Result<String> updateRuleStatus(@PathVariable Long id, @PathVariable String status) {
|
||||
return toAjax(ruleInfoService.updateById(RuleInfo.editUpdBuild(id,status)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品规格
|
||||
|
|
|
@ -363,7 +363,7 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
LambdaQueryWrapper<AsCategoryBrand> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(AsCategoryBrand::getCategoryId,id);
|
||||
asCategoryBrandService.remove(lambdaQueryWrapper);
|
||||
List<Long> brandIdList = categoryInfoEditReq.getBrandIdList().stream().map(BrandInfo::getId).toList();
|
||||
List<Long> brandIdList = categoryInfoEditReq.getBrandInfoList().stream().map(BrandInfo::getId).toList();
|
||||
asCategoryBrandService.saveBatch(
|
||||
brandIdList.stream().map(brandId ->AsCategoryBrand.categoryBuild(id,brandId)).toList()
|
||||
);
|
||||
|
@ -374,7 +374,7 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
LambdaQueryWrapper<AsCategoryAttributeGroup> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(AsCategoryAttributeGroup::getCategoryId,id);
|
||||
asCategoryAttributeGroupService.remove(wrapper);
|
||||
List<Long> attributeGroupIdList = categoryInfoEditReq.getAttributeGroupIdList().stream().map(AttributeGroup::getId).toList();
|
||||
List<Long> attributeGroupIdList = categoryInfoEditReq.getAttributeGroupList().stream().map(AttributeGroup::getId).toList();
|
||||
asCategoryAttributeGroupService.saveBatch(
|
||||
attributeGroupIdList.stream().map(aLong -> AsCategoryAttributeGroup.categoryBuild(id,aLong)).toList()
|
||||
);
|
||||
|
@ -385,7 +385,7 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
LambdaQueryWrapper<AsCategoryAttribute> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AsCategoryAttribute::getCategoryId,id);
|
||||
asCategoryAttributeService.remove(queryWrapper);
|
||||
List<Long> longList = categoryInfoEditReq.getAttributeIdList().stream().map(AttributeInfo::getId).toList();
|
||||
List<Long> longList = categoryInfoEditReq.getAttributeInfoList().stream().map(AttributeInfo::getId).toList();
|
||||
asCategoryAttributeService.saveBatch(
|
||||
longList.stream().map(aLong -> AsCategoryAttribute.categoryBuild(id,aLong)).toList()
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue