修改品类信息(2)
parent
c2c1270241
commit
6b382157d9
|
@ -50,8 +50,9 @@ public class CategoryInfoSaveReq extends TreeEntity {
|
||||||
@ApiModelProperty(name = "介绍", value = "介绍")
|
@ApiModelProperty(name = "介绍", value = "介绍")
|
||||||
private String introduction;
|
private String introduction;
|
||||||
|
|
||||||
|
private List<Long> attributeIdList;
|
||||||
|
|
||||||
private List<Long> attributeGroupIdList;
|
private List<Long> attributeGroupIdList;
|
||||||
private List<Long> attributeIdList;
|
|
||||||
private List<Long> brandIdList;
|
private List<Long> brandIdList;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,20 +94,19 @@ public class AttributeInfoController extends BaseController {
|
||||||
* 修改商品属性
|
* 修改商品属性
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("product:attribute:edit")
|
@RequiresPermissions("product:attribute:edit")
|
||||||
@Log(title = "商品属性",businessType = BusinessType.UPDATE)
|
@Log(title = "商品属性", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/{id}")
|
@PutMapping("/{id}")
|
||||||
@ApiOperation("修改商品属性")
|
@ApiOperation("修改商品属性")
|
||||||
public Result<String> edit(@PathVariable Long id, @RequestBody AttributeInfoEditReq attributeInfoEditReq) {
|
public Result<String> edit(@PathVariable Long id, @RequestBody AttributeInfoEditReq attributeInfoEditReq) {
|
||||||
return toAjax(attributeInfoService.updateById(AttributeInfo.editBuild(id,attributeInfoEditReq)));
|
return toAjax(attributeInfoService.updateById(AttributeInfo.editBuild(id,attributeInfoEditReq)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除商品属性
|
* 删除商品属性
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("product:attribute:remove")
|
@RequiresPermissions("product:attribute:remove")
|
||||||
@Log(title = "商品属性", businessType = BusinessType.DELETE)
|
@Log(title = "商品属性", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
@ApiOperation("删除商品属性")
|
@ApiOperation("删除商品属性")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
@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) {
|
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||||
|
|
|
@ -46,10 +46,6 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*
|
|
||||||
* @param attributeGroupQuery 分组对象
|
|
||||||
*
|
|
||||||
* @return 返回结果
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<AttributeGroupPageResp> page (AttributeGroup attributeGroupQuery) {
|
public TableDataInfo<AttributeGroupPageResp> page (AttributeGroup attributeGroupQuery) {
|
||||||
|
@ -68,29 +64,25 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 属性组
|
* 查询属性组列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<AttributeGroup> list(AttributeGroup attributeGroup) {
|
public List<AttributeGroup> list (AttributeGroup attributeGroup) {
|
||||||
LambdaQueryWrapper<AttributeGroup> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AttributeGroup> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
if(ObjUtils.notNull(attributeGroup.getName())){
|
if (ObjUtils.notNull(attributeGroup.getName())) {
|
||||||
queryWrapper.like(AttributeGroup::getName,attributeGroup.getName());
|
queryWrapper.like(AttributeGroup::getName, attributeGroup.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ObjUtils.notNull(attributeGroup.getStates())){
|
if (ObjUtils.notNull(attributeGroup.getStates())) {
|
||||||
queryWrapper.eq(AttributeGroup::getStates,attributeGroup.getStates());
|
queryWrapper.eq(AttributeGroup::getStates, attributeGroup.getStates());
|
||||||
}
|
}
|
||||||
|
|
||||||
return list(queryWrapper);
|
return list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 属性组保存模型
|
||||||
*
|
|
||||||
* @param attributeGroupSaveModel 属性组保存模型
|
|
||||||
*
|
|
||||||
* @return 是否成功
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
|
|
|
@ -31,9 +31,6 @@ public class AttributeInfoServiceImpl extends ServiceImpl<AttributeInfoMapper, A
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询商品属性列表
|
* 查询商品属性列表
|
||||||
*
|
|
||||||
* @param attributeInfo 商品属性
|
|
||||||
* @return 商品属性
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<AttributeInfo> list(AttributeInfo attributeInfo) {
|
public List<AttributeInfo> list(AttributeInfo attributeInfo) {
|
||||||
|
@ -53,10 +50,6 @@ public class AttributeInfoServiceImpl extends ServiceImpl<AttributeInfoMapper, A
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过groupId查询属性集合
|
* 通过groupId查询属性集合
|
||||||
*
|
|
||||||
* @param groupId 属性组Id
|
|
||||||
*
|
|
||||||
* @return 属性集合
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<AttributeInfo> attributeListByGroupId (Long groupId) {
|
public List<AttributeInfo> attributeListByGroupId (Long groupId) {
|
||||||
|
|
|
@ -38,18 +38,9 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
||||||
@Autowired
|
@Autowired
|
||||||
private AttributeInfoService attributeInfoService;
|
private AttributeInfoService attributeInfoService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private AsAttributeGroupService asAttributeGroupService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private BrandInfoService brandInfoService;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询品类信息列表
|
* 查询品类信息列表
|
||||||
*
|
|
||||||
* @param categoryInfo 品类信息
|
|
||||||
* @return 品类信息
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<CategoryInfo> list(CategoryInfo categoryInfo) {
|
public List<CategoryInfo> list(CategoryInfo categoryInfo) {
|
||||||
|
@ -75,11 +66,6 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
||||||
if (ObjUtils.notNull(categoryInfo.getIntroduction())){
|
if (ObjUtils.notNull(categoryInfo.getIntroduction())){
|
||||||
queryWrapper.eq(CategoryInfo::getIntroduction, categoryInfo.getIntroduction());
|
queryWrapper.eq(CategoryInfo::getIntroduction, categoryInfo.getIntroduction());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return list(queryWrapper);
|
return list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,8 +80,6 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过品类id获取属性组集合
|
* 通过品类id获取属性组集合
|
||||||
* @param categoryId
|
|
||||||
* @return 属性组集合
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<AttributeGroup> getAttributeGroupList(Long categoryId) {
|
public List<AttributeGroup> getAttributeGroupList(Long categoryId) {
|
||||||
|
@ -104,8 +88,6 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过品类id获取属性集合
|
* 通过品类id获取属性集合
|
||||||
* @param categoryId
|
|
||||||
* @return 属性集合
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<AttributeInfo> getAttributeInfoList(Long categoryId) {
|
public List<AttributeInfo> getAttributeInfoList(Long categoryId) {
|
||||||
|
@ -130,8 +112,6 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过品类id获取品牌集合
|
* 通过品类id获取品牌集合
|
||||||
* @param categoryId
|
|
||||||
* @return 品牌集合
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<BrandInfo> getBrandInfoList(Long categoryId) {
|
public List<BrandInfo> getBrandInfoList(Long categoryId) {
|
||||||
|
|
Loading…
Reference in New Issue