1018653686@qq.com 1 year ago
parent
commit
0419b86254

+ 1 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/product/dto/ProductCategorySelectDto.java

@@ -14,4 +14,5 @@ import lombok.Setter;
 @Setter
 public class ProductCategorySelectDto extends BaseSelectDto {
     private String status;
+    private Long categoryId;
 }

+ 2 - 1
hx-xmhjc/src/main/java/com/fjhx/xmhjc/entity/product/dto/ProductSubCategorySelectDto.java

@@ -13,5 +13,6 @@ import lombok.Setter;
 @Getter
 @Setter
 public class ProductSubCategorySelectDto extends BaseSelectDto {
-
+    private String status;
+    private Long categoryId;
 }

+ 1 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/service/product/impl/ProductCategoryServiceImpl.java

@@ -1,5 +1,6 @@
 package com.fjhx.xmhjc.service.product.impl;
 
+import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.fjhx.xmhjc.entity.product.po.ProductCategory;

+ 3 - 0
hx-xmhjc/src/main/java/com/fjhx/xmhjc/service/product/impl/ProductSubCategoryServiceImpl.java

@@ -1,5 +1,6 @@
 package com.fjhx.xmhjc.service.product.impl;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.fjhx.xmhjc.entity.product.po.ProductCategory;
 import com.fjhx.xmhjc.entity.product.po.ProductSubCategory;
 import com.fjhx.xmhjc.entity.product.vo.ProductCategoryVo;
@@ -31,6 +32,8 @@ public class ProductSubCategoryServiceImpl extends ServiceImpl<ProductSubCategor
     @Override
     public Page<ProductSubCategoryVo> getPage(ProductSubCategorySelectDto dto) {
         IWrapper<ProductSubCategory> wrapper = getWrapper();
+        wrapper.eq(ObjectUtil.isNotNull(dto.getCategoryId()), "parent_id", dto.getCategoryId());
+        wrapper.eq(ObjectUtil.isNotNull(dto.getStatus()), "status", dto.getStatus());
         wrapper.orderByDesc("psc", ProductSubCategory::getId);
         Page<ProductSubCategoryVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         return page;