master
hbr 2024-03-03 10:54:42 +08:00
parent c04448a42d
commit 99485ae5a4
7 changed files with 73 additions and 9 deletions

View File

@ -44,6 +44,7 @@ public class SysJobController extends BaseController {
return getDataTable(list);
}
/**
*
*/

View File

@ -57,7 +57,7 @@ public class AttributeGroupController extends BaseController {
<<<<<<< HEAD
=======
@ApiOperation("获取属性组列表")
@RequiresPermissions("product:attributeGroup:list")
@RequiresPermissions("product:attributeGroup:list1")
@GetMapping("listAll")
public Result<TableDataInfo<AttributeGroupPageResp>> listAttributeGroupPageResp(AttributeGroupQueryReq attributeGroupQueryReq){
startPage();;
@ -91,8 +91,8 @@ public class AttributeGroupController extends BaseController {
}
@ApiOperation("获取属性组详细信息")
@RequiresPermissions("product:attributeGroup:query")
@GetMapping("/{id}")
@RequiresPermissions("product:attributeGroup:query1")
@GetMapping("/query/{id}")
@ApiImplicitParam(name = "id",value ="id",required = true,dataType = "Long",paramType = "path",dataTypeClass = Long.class)
public Result<AttributeGroup> getInfo1(@PathVariable Long id){
return Result.success(attributeGroupService.getById(id));
@ -110,12 +110,12 @@ public class AttributeGroupController extends BaseController {
attributeGroupService.save(AttributeGroupSaveModel.saveReqBuild(attributeGroupSaveReq))
);
}
/**
*
*/
@RequiresPermissions("product:attributeGroup:add")
// /**
// * 新增属性组
// */
@RequiresPermissions("product:attributeGroup:add1")
@Log(title = "属性组",businessType = BusinessType.INSERT)
@PostMapping
@PostMapping("/add1")
@ApiOperation("新增属性组")
public Result<String> addAttributeGroup(@RequestBody AttributeGroupSaveReq attributeGroupSaveReq){
return toAjax(attributeGroupService.save(AttributeGroupSaveModel.saveReqBuild(attributeGroupSaveReq)));
@ -133,12 +133,20 @@ public class AttributeGroupController extends BaseController {
return toAjax(attributeGroupService.updateById(AttributeGroup.editBuild(id,attributeGroupEditReq)));
}
@RequiresPermissions("product:attributeGroup:edit")
@Log(title = "属性组", businessType = BusinessType.UPDATE)
@PutMapping("/edit1/{id}")
@ApiOperation("修改属性组")
public Result<String> editAttributeGroup(@PathVariable Long id, @RequestBody AttributeGroupEditReq attributeGroupEditReq){
return toAjax(attributeGroupService.updateById(AttributeGroup.editBuild(id,attributeGroupEditReq)));
}
/**
*
*/
@RequiresPermissions("product:attributeGroup:edit")
@Log(title = "属性组",businessType = BusinessType.UPDATE)
@PutMapping("/{id}")
@PutMapping("/edit/{id}")
@ApiOperation("修改属性组")
public Result<String> editUpdate(@PathVariable Long id,@RequestBody AttributeGroupEditReq attributeGroupEditReq){
return toAjax(attributeGroupService.updateById(AttributeGroup.editBuild(id,attributeGroupEditReq)));

View File

@ -50,6 +50,14 @@ public class BrandInfoController extends BaseController {
List<BrandInfo> list = brandInfoService.list(BrandInfo.queryBuild(brandInfoQueryReq));
return getDataTable(list);
}
@ApiOperation("获取品牌信息列表")
@RequiresPermissions("product:brand:list")
@GetMapping("/listBrand")
public Result<TableDataInfo<BrandInfo>> listBrand(BrandInfoQueryReq brandInfoQueryReq){
startPage();
List<BrandInfo> list=brandInfoService.listBrand(BrandInfo.queryBuild(brandInfoQueryReq));
return getDataTable(list);
}
/**
*

View File

@ -108,4 +108,13 @@ public class ProjectInfoController extends BaseController {
public Result<String> remove(@PathVariable List<Long> ids) {
return toAjax(projectInfoService.removeBatchByIds(ids));
}
@RequiresPermissions("product:info:remove1")
@Log(title = "商品信息",businessType = BusinessType.DELETE)
@DeleteMapping("/type/{ids}")
@ApiOperation("删除商品信息")
@ApiImplicitParam(name ="id",value = "id",required = true,dataType = "long", paramType = "path",dataTypeClass = String.class, example = "1,2,3,4")
public Result<String> removeInfo(@PathVariable List<Long> ids){
return toAjax(projectInfoService.removeBatchByIds(ids));
}
}

View File

@ -3,6 +3,7 @@ package com.muyu.product.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.mysql.cj.protocol.ResultStreamer;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -86,6 +87,14 @@ public class ProjectSkuInfoController extends BaseController {
return toAjax(projectSkuInfoService.save(ProjectSkuInfo.saveBuild(projectSkuInfoSaveReq)));
}
@RequiresPermissions("product:sku:add1")
@Log(title ="商品SKU",businessType = BusinessType.INSERT)
@PostMapping("/sku/add")
@ApiOperation("新增商品SKU")
public Result<String> addSKU(@RequestBody ProjectSkuInfoSaveReq projectSkuInfoSaveReq){
return toAjax(projectSkuInfoService.save(ProjectSkuInfo.saveBuild(projectSkuInfoSaveReq)));
}
/**
* SKU
*/
@ -108,4 +117,13 @@ public class ProjectSkuInfoController extends BaseController {
public Result<String> remove(@PathVariable List<Long> ids) {
return toAjax(projectSkuInfoService.removeBatchByIds(ids));
}
@RequiresPermissions("product:sku:remove2")
@Log(title = "商品SKU",businessType = BusinessType.DELETE)
@DeleteMapping("/sku/{ids}")
@ApiOperation("删除商品SKU")
@ApiImplicitParam(name = "id",value = "id",required = true,dataType = "Long",paramType = "path",dataTypeClass = String.class, example = "1,2,3,4")
public Result<String> removeSku(@PathVariable List<Long> ids){
return toAjax(projectSkuInfoService.removeBatchByIds(ids));
}
}

View File

@ -19,4 +19,5 @@ public interface BrandInfoService extends IService<BrandInfo> {
*/
public List<BrandInfo> list(BrandInfo brandInfo);
List<BrandInfo> listBrand(BrandInfo brandInfo);
}

View File

@ -53,6 +53,25 @@ public class BrandInfoServiceImpl extends ServiceImpl<BrandInfoMapper, BrandInfo
return list(queryWrapper);
}
@Override
public List<BrandInfo> listBrand(BrandInfo brandInfo) {
LambdaQueryWrapper<BrandInfo> queryWrapper = new LambdaQueryWrapper<>();
if (ObjUtils.notNull(brandInfo.getNam())){
queryWrapper.eq(BrandInfo::getNam,brandInfo.getNam());
}
if (ObjUtils.notNull(brandInfo.getLogo())){
queryWrapper.eq(BrandInfo::getLogo,brandInfo.getLogo());
}
if (ObjUtils.notNull(brandInfo.getStart())){
queryWrapper.eq(BrandInfo::getStart, brandInfo.getStart());
}
if (ObjUtils.notNull(brandInfo.getIntroduction())){
queryWrapper.eq(BrandInfo::getIntroduction, brandInfo.getIntroduction());
}
return list(queryWrapper);
}
@Override
public boolean save(BrandInfo entity) {
entity.setCreateBy(SecurityUtils.getUsername());