修改品类信息(2)

master
Jiang Peng 2024-03-03 21:03:34 +08:00
parent c2c1270241
commit 6b382157d9
5 changed files with 12 additions and 47 deletions

View File

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

View File

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

View File

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

View File

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

View File

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