记得上下班打卡 | git大法好,push需谨慎

Commit 471ba942 authored by 张国柄's avatar 张国柄

+API:店铺管理:商品分类:筛选;

parent d06b5b8c
package com.liquidnet.client.admin.web.controller.zhengzai.goblin; package com.liquidnet.client.admin.web.controller.zhengzai.goblin;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.liquidnet.client.admin.common.annotation.Log; import com.liquidnet.client.admin.common.annotation.Log;
import com.liquidnet.client.admin.common.core.controller.BaseController; import com.liquidnet.client.admin.common.core.controller.BaseController;
...@@ -44,6 +46,37 @@ public class GoblinSelfCategoryAdminController extends BaseController { ...@@ -44,6 +46,37 @@ public class GoblinSelfCategoryAdminController extends BaseController {
return getDataTable(goblinSelfGoodsCategoryService.listForForMultiGrade()); return getDataTable(goblinSelfGoodsCategoryService.listForForMultiGrade());
} }
@ApiOperation(value = "筛选")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "grade", value = "分类层级[1-一级|2-二级|3-三级]", allowableValues = "1,2,3"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "cateId", value = "分类父ID[30]"),
})
@Log(title = "店铺管理:商品分类:筛选", businessType = BusinessType.DELETE)
@RequiresPermissions("goblin:category:select")
@PostMapping("select")
@ResponseBody
public AjaxResult select(@RequestParam String grade, @RequestParam String cateId) {
LambdaQueryWrapper<GoblinSelfGoodsCategory> queryWrapper = Wrappers.lambdaQuery(GoblinSelfGoodsCategory.class);
switch (grade) {
case "1":
break;
case "2":
case "3":
if (StringUtils.isBlank(cateId)) {
return AjaxResult.warn("请指定商品分类");
}
queryWrapper.eq(GoblinSelfGoodsCategory::getCatePid, cateId);
default:
logger.warn("店铺管理:商品分类:筛选:无效参数[grade={},cateId={}]", grade, cateId);
return AjaxResult.warn("无效参数");
}
queryWrapper.eq(GoblinSelfGoodsCategory::getGrade, grade);
queryWrapper.select(GoblinSelfGoodsCategory::getCateId, GoblinSelfGoodsCategory::getName, GoblinSelfGoodsCategory::getIcon, GoblinSelfGoodsCategory::getNeIsbn);
queryWrapper.orderByAsc(GoblinSelfGoodsCategory::getCateId);
return AjaxResult.success(goblinSelfGoodsCategoryService.list(queryWrapper));
}
@ApiOperation(value = "新建") @ApiOperation(value = "新建")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "grade", value = "分类层级[1-一级|2-二级|3-三级]", allowableValues = "1,2,3"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "grade", value = "分类层级[1-一级|2-二级|3-三级]", allowableValues = "1,2,3"),
...@@ -86,5 +119,4 @@ public class GoblinSelfCategoryAdminController extends BaseController { ...@@ -86,5 +119,4 @@ public class GoblinSelfCategoryAdminController extends BaseController {
} }
return toAjax(goblinSelfGoodsCategoryService.remove(Convert.toStrArray(cateId))); return toAjax(goblinSelfGoodsCategoryService.remove(Convert.toStrArray(cateId)));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment