商品分类

pull/1/head
feijinping 3 years ago
parent 22c98f8e04
commit 58766aa147

@ -82,6 +82,22 @@ public class SysDictDataController extends BaseController
return AjaxResult.success(data); return AjaxResult.success(data);
} }
/**
*
*/
@PostMapping(value = "/all-by-types")
public AjaxResult allByTypes(@RequestBody List<String> dictTypes)
{
SysDictData query = new SysDictData();
query.getParams().put("dictTypes", dictTypes);
List<SysDictData> data = dictDataService.selectDictDataList(query);
if (StringUtils.isNull(data))
{
data = new ArrayList<>();
}
return AjaxResult.success(data);
}
/** /**
* *
*/ */

@ -45,9 +45,9 @@ public class ProductCategoryController extends BaseController {
@ApiOperation("查询商品分类列表") @ApiOperation("查询商品分类列表")
@PreAuthorize("@ss.hasPermi('pms:productCategory:list')") @PreAuthorize("@ss.hasPermi('pms:productCategory:list')")
@PostMapping("/list") @PostMapping("/list")
public ResponseEntity<Page<ProductCategory>> list(@RequestBody ProductCategoryQuery query, Pageable page) { public ResponseEntity<List<ProductCategory>> list(@RequestBody ProductCategoryQuery query) {
List<ProductCategory> list = service.selectList(query, page); List<ProductCategory> list = service.selectList(query, null);
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal())); return ResponseEntity.ok(list);
} }
@ApiOperation("导出商品分类列表") @ApiOperation("导出商品分类列表")

@ -20,8 +20,8 @@ public class ProductCategory extends BaseAudit {
@ApiModelProperty("ID") @ApiModelProperty("ID")
private Long id; private Long id;
@ApiModelProperty("上分类的编号0表示一级分类") @ApiModelProperty("上分类的编号0表示一级分类")
@Excel(name = "上分类的编号0表示一级分类") @Excel(name = "上分类的编号0表示一级分类")
private Long parentId; private Long parentId;
@ApiModelProperty("NAME") @ApiModelProperty("NAME")

@ -12,7 +12,7 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel(description="商品分类 查询 对象") @ApiModel(description="商品分类 查询 对象")
@Data @Data
public class ProductCategoryQuery { public class ProductCategoryQuery {
@ApiModelProperty("上分类的编号0表示一级分类 精确匹配") @ApiModelProperty("上分类的编号0表示一级分类 精确匹配")
private Long parentId; private Long parentId;
@ApiModelProperty("NAME 精确匹配") @ApiModelProperty("NAME 精确匹配")

@ -13,8 +13,8 @@ import lombok.Data;
public class ProductCategoryVO extends BaseAudit { public class ProductCategoryVO extends BaseAudit {
/** ID */ /** ID */
private Long id; private Long id;
/** 上分类的编号0表示一级分类 */ /** 上分类的编号0表示一级分类 */
@Excel(name = "上分类的编号0表示一级分类") @Excel(name = "上分类的编号0表示一级分类")
private Long parentId; private Long parentId;
/** NAME */ /** NAME */
@Excel(name = "NAME") @Excel(name = "NAME")

@ -37,6 +37,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''"> <if test="status != null and status != ''">
AND status = #{status} AND status = #{status}
</if> </if>
<if test="params != null and params.dictTypes != null and params.dictTypes.size() > 0">
AND dict_type in
<foreach collection="params.dictTypes" open="(" separator="," close=")" item="it">
#{it}
</foreach>
</if>
</where> </where>
order by dict_sort asc order by dict_sort asc
</select> </select>

@ -53,7 +53,7 @@ DROP TABLE IF EXISTS `pms_product_category`;
CREATE TABLE `pms_product_category` CREATE TABLE `pms_product_category`
( (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`parent_id` bigint(20) NULL DEFAULT NULL COMMENT '分类的编号0表示一级分类', `parent_id` bigint(20) NULL DEFAULT NULL COMMENT '分类的编号0表示一级分类',
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`level` int(1) NULL DEFAULT NULL COMMENT '分类级别0->1级1->2级', `level` int(1) NULL DEFAULT NULL COMMENT '分类级别0->1级1->2级',
`show_status` int(1) NULL DEFAULT NULL COMMENT '显示状态0->不显示1->显示', `show_status` int(1) NULL DEFAULT NULL COMMENT '显示状态0->不显示1->显示',

Loading…
Cancel
Save