修改状态

master
meng 2024-11-15 16:29:18 +08:00
parent 0566acaf4d
commit a23c56457e
7 changed files with 51 additions and 14 deletions

View File

@ -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();
}
}

View File

@ -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

View File

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

View File

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

View File

@ -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)));
}
/**
*
*/

View File

@ -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)));
}
/**
*

View File

@ -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()
);