Parcourir la source

查询流程分类全部列表

hubin il y a 1 an
Parent
commit
6030538510

+ 8 - 0
src/main/java/com/aizuda/boot/modules/flw/controller/FlwCategoryController.java

@@ -1,6 +1,7 @@
 package com.aizuda.boot.modules.flw.controller;
 
 import com.aizuda.boot.modules.flw.entity.FlwCategory;
+import com.aizuda.boot.modules.flw.entity.dto.FlwCategoryDTO;
 import com.aizuda.boot.modules.flw.service.IFlwCategoryService;
 import com.aizuda.core.api.ApiController;
 import com.aizuda.core.api.PageParam;
@@ -37,6 +38,13 @@ public class FlwCategoryController extends ApiController {
         return flwCategoryService.page(dto.page(), dto.getData());
     }
 
+    @Operation(summary = "查询全部列表")
+    @Permission("flw:category:listAll")
+    @PostMapping("/list-all")
+    public List<FlwCategory> listAll(@RequestBody FlwCategoryDTO dto) {
+        return flwCategoryService.listAllByDto(dto);
+    }
+
     @Operation(summary = "查询 id 信息")
     @Permission("flw:category:get")
     @GetMapping("/get")

+ 17 - 0
src/main/java/com/aizuda/boot/modules/flw/entity/dto/FlwCategoryDTO.java

@@ -0,0 +1,17 @@
+package com.aizuda.boot.modules.flw.entity.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class FlwCategoryDTO {
+
+    @Schema(description = "名称")
+    private String name;
+
+    @Schema(description = "备注")
+    private String remark;
+
+}

+ 4 - 0
src/main/java/com/aizuda/boot/modules/flw/service/IFlwCategoryService.java

@@ -1,9 +1,12 @@
 package com.aizuda.boot.modules.flw.service;
 
 import com.aizuda.boot.modules.flw.entity.FlwCategory;
+import com.aizuda.boot.modules.flw.entity.dto.FlwCategoryDTO;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.aizuda.service.service.IBaseService;
 
+import java.util.List;
+
 /**
  * 流程分类 服务类
  *
@@ -14,4 +17,5 @@ public interface IFlwCategoryService extends IBaseService<FlwCategory> {
 
     Page<FlwCategory> page(Page<FlwCategory> page, FlwCategory flwCategory);
 
+    List<FlwCategory> listAllByDto(FlwCategoryDTO dto);
 }

+ 14 - 0
src/main/java/com/aizuda/boot/modules/flw/service/impl/FlwCategoryServiceImpl.java

@@ -1,5 +1,6 @@
 package com.aizuda.boot.modules.flw.service.impl;
 
+import com.aizuda.boot.modules.flw.entity.dto.FlwCategoryDTO;
 import com.aizuda.core.api.ApiAssert;
 import com.aizuda.boot.modules.flw.entity.FlwCategory;
 import com.aizuda.boot.modules.flw.mapper.FlwCategoryMapper;
@@ -8,8 +9,11 @@ import com.aizuda.service.service.BaseServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * 流程分类 服务实现类
  *
@@ -25,6 +29,16 @@ public class FlwCategoryServiceImpl extends BaseServiceImpl<FlwCategoryMapper, F
         return super.page(page, lqw);
     }
 
+    @Override
+    public List<FlwCategory> listAllByDto(FlwCategoryDTO dto) {
+        LambdaQueryWrapper<FlwCategory> lqw = Wrappers.lambdaQuery();
+        if (null != dto) {
+            lqw.like(StringUtils.isNoneBlank(dto.getName()), FlwCategory::getName, dto.getName());
+            lqw.like(StringUtils.isNoneBlank(dto.getRemark()), FlwCategory::getRemark, dto.getRemark());
+        }
+        return super.list(lqw);
+    }
+
     @Override
     public boolean updateById(FlwCategory flwCategory) {
         ApiAssert.fail(null == flwCategory.getId(), "主键不存在无法更新");